iclient-leaflet.js 5.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073
  1. /*!
  2. *
  3. * iclient-leaflet
  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. /***/ 6525:
  12. /***/ (function(module) {
  13. "use strict";
  14. module.exports = Point;
  15. /**
  16. * A standalone point geometry with useful accessor, comparison, and
  17. * modification methods.
  18. *
  19. * @class Point
  20. * @param {Number} x the x-coordinate. this could be longitude or screen
  21. * pixels, or any other sort of unit.
  22. * @param {Number} y the y-coordinate. this could be latitude or screen
  23. * pixels, or any other sort of unit.
  24. * @example
  25. * var point = new Point(-77, 38);
  26. */
  27. function Point(x, y) {
  28. this.x = x;
  29. this.y = y;
  30. }
  31. Point.prototype = {
  32. /**
  33. * Clone this point, returning a new point that can be modified
  34. * without affecting the old one.
  35. * @return {Point} the clone
  36. */
  37. clone: function clone() {
  38. return new Point(this.x, this.y);
  39. },
  40. /**
  41. * Add this point's x & y coordinates to another point,
  42. * yielding a new point.
  43. * @param {Point} p the other point
  44. * @return {Point} output point
  45. */
  46. add: function add(p) {
  47. return this.clone()._add(p);
  48. },
  49. /**
  50. * Subtract this point's x & y coordinates to from point,
  51. * yielding a new point.
  52. * @param {Point} p the other point
  53. * @return {Point} output point
  54. */
  55. sub: function sub(p) {
  56. return this.clone()._sub(p);
  57. },
  58. /**
  59. * Multiply this point's x & y coordinates by point,
  60. * yielding a new point.
  61. * @param {Point} p the other point
  62. * @return {Point} output point
  63. */
  64. multByPoint: function multByPoint(p) {
  65. return this.clone()._multByPoint(p);
  66. },
  67. /**
  68. * Divide this point's x & y coordinates by point,
  69. * yielding a new point.
  70. * @param {Point} p the other point
  71. * @return {Point} output point
  72. */
  73. divByPoint: function divByPoint(p) {
  74. return this.clone()._divByPoint(p);
  75. },
  76. /**
  77. * Multiply this point's x & y coordinates by a factor,
  78. * yielding a new point.
  79. * @param {Point} k factor
  80. * @return {Point} output point
  81. */
  82. mult: function mult(k) {
  83. return this.clone()._mult(k);
  84. },
  85. /**
  86. * Divide this point's x & y coordinates by a factor,
  87. * yielding a new point.
  88. * @param {Point} k factor
  89. * @return {Point} output point
  90. */
  91. div: function div(k) {
  92. return this.clone()._div(k);
  93. },
  94. /**
  95. * Rotate this point around the 0, 0 origin by an angle a,
  96. * given in radians
  97. * @param {Number} a angle to rotate around, in radians
  98. * @return {Point} output point
  99. */
  100. rotate: function rotate(a) {
  101. return this.clone()._rotate(a);
  102. },
  103. /**
  104. * Rotate this point around p point by an angle a,
  105. * given in radians
  106. * @param {Number} a angle to rotate around, in radians
  107. * @param {Point} p Point to rotate around
  108. * @return {Point} output point
  109. */
  110. rotateAround: function rotateAround(a, p) {
  111. return this.clone()._rotateAround(a, p);
  112. },
  113. /**
  114. * Multiply this point by a 4x1 transformation matrix
  115. * @param {Array<Number>} m transformation matrix
  116. * @return {Point} output point
  117. */
  118. matMult: function matMult(m) {
  119. return this.clone()._matMult(m);
  120. },
  121. /**
  122. * Calculate this point but as a unit vector from 0, 0, meaning
  123. * that the distance from the resulting point to the 0, 0
  124. * coordinate will be equal to 1 and the angle from the resulting
  125. * point to the 0, 0 coordinate will be the same as before.
  126. * @return {Point} unit vector point
  127. */
  128. unit: function unit() {
  129. return this.clone()._unit();
  130. },
  131. /**
  132. * Compute a perpendicular point, where the new y coordinate
  133. * is the old x coordinate and the new x coordinate is the old y
  134. * coordinate multiplied by -1
  135. * @return {Point} perpendicular point
  136. */
  137. perp: function perp() {
  138. return this.clone()._perp();
  139. },
  140. /**
  141. * Return a version of this point with the x & y coordinates
  142. * rounded to integers.
  143. * @return {Point} rounded point
  144. */
  145. round: function round() {
  146. return this.clone()._round();
  147. },
  148. /**
  149. * Return the magitude of this point: this is the Euclidean
  150. * distance from the 0, 0 coordinate to this point's x and y
  151. * coordinates.
  152. * @return {Number} magnitude
  153. */
  154. mag: function mag() {
  155. return Math.sqrt(this.x * this.x + this.y * this.y);
  156. },
  157. /**
  158. * Judge whether this point is equal to another point, returning
  159. * true or false.
  160. * @param {Point} other the other point
  161. * @return {boolean} whether the points are equal
  162. */
  163. equals: function equals(other) {
  164. return this.x === other.x && this.y === other.y;
  165. },
  166. /**
  167. * Calculate the distance from this point to another point
  168. * @param {Point} p the other point
  169. * @return {Number} distance
  170. */
  171. dist: function dist(p) {
  172. return Math.sqrt(this.distSqr(p));
  173. },
  174. /**
  175. * Calculate the distance from this point to another point,
  176. * without the square root step. Useful if you're comparing
  177. * relative distances.
  178. * @param {Point} p the other point
  179. * @return {Number} distance
  180. */
  181. distSqr: function distSqr(p) {
  182. var dx = p.x - this.x,
  183. dy = p.y - this.y;
  184. return dx * dx + dy * dy;
  185. },
  186. /**
  187. * Get the angle from the 0, 0 coordinate to this point, in radians
  188. * coordinates.
  189. * @return {Number} angle
  190. */
  191. angle: function angle() {
  192. return Math.atan2(this.y, this.x);
  193. },
  194. /**
  195. * Get the angle from this point to another point, in radians
  196. * @param {Point} b the other point
  197. * @return {Number} angle
  198. */
  199. angleTo: function angleTo(b) {
  200. return Math.atan2(this.y - b.y, this.x - b.x);
  201. },
  202. /**
  203. * Get the angle between this point and another point, in radians
  204. * @param {Point} b the other point
  205. * @return {Number} angle
  206. */
  207. angleWith: function angleWith(b) {
  208. return this.angleWithSep(b.x, b.y);
  209. },
  210. /*
  211. * Find the angle of the two vectors, solving the formula for
  212. * the cross product a x b = |a||b|sin(θ) for θ.
  213. * @param {Number} x the x-coordinate
  214. * @param {Number} y the y-coordinate
  215. * @return {Number} the angle in radians
  216. */
  217. angleWithSep: function angleWithSep(x, y) {
  218. return Math.atan2(this.x * y - this.y * x, this.x * x + this.y * y);
  219. },
  220. _matMult: function _matMult(m) {
  221. var x = m[0] * this.x + m[1] * this.y,
  222. y = m[2] * this.x + m[3] * this.y;
  223. this.x = x;
  224. this.y = y;
  225. return this;
  226. },
  227. _add: function _add(p) {
  228. this.x += p.x;
  229. this.y += p.y;
  230. return this;
  231. },
  232. _sub: function _sub(p) {
  233. this.x -= p.x;
  234. this.y -= p.y;
  235. return this;
  236. },
  237. _mult: function _mult(k) {
  238. this.x *= k;
  239. this.y *= k;
  240. return this;
  241. },
  242. _div: function _div(k) {
  243. this.x /= k;
  244. this.y /= k;
  245. return this;
  246. },
  247. _multByPoint: function _multByPoint(p) {
  248. this.x *= p.x;
  249. this.y *= p.y;
  250. return this;
  251. },
  252. _divByPoint: function _divByPoint(p) {
  253. this.x /= p.x;
  254. this.y /= p.y;
  255. return this;
  256. },
  257. _unit: function _unit() {
  258. this._div(this.mag());
  259. return this;
  260. },
  261. _perp: function _perp() {
  262. var y = this.y;
  263. this.y = this.x;
  264. this.x = -y;
  265. return this;
  266. },
  267. _rotate: function _rotate(angle) {
  268. var cos = Math.cos(angle),
  269. sin = Math.sin(angle),
  270. x = cos * this.x - sin * this.y,
  271. y = sin * this.x + cos * this.y;
  272. this.x = x;
  273. this.y = y;
  274. return this;
  275. },
  276. _rotateAround: function _rotateAround(angle, p) {
  277. var cos = Math.cos(angle),
  278. sin = Math.sin(angle),
  279. x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),
  280. y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);
  281. this.x = x;
  282. this.y = y;
  283. return this;
  284. },
  285. _round: function _round() {
  286. this.x = Math.round(this.x);
  287. this.y = Math.round(this.y);
  288. return this;
  289. }
  290. };
  291. /**
  292. * Construct a point from an array if necessary, otherwise if the input
  293. * is already a Point, or an unknown type, return it unchanged
  294. * @param {Array<Number>|Point|*} a any kind of input value
  295. * @return {Point} constructed point, or passed-through value.
  296. * @example
  297. * // this
  298. * var point = Point.convert([0, 1]);
  299. * // is equivalent to
  300. * var point = new Point(0, 1);
  301. */
  302. Point.convert = function (a) {
  303. if (a instanceof Point) {
  304. return a;
  305. }
  306. if (Array.isArray(a)) {
  307. return new Point(a[0], a[1]);
  308. }
  309. return a;
  310. };
  311. /***/ }),
  312. /***/ 4721:
  313. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  314. module.exports.VectorTile = __webpack_require__(2473);
  315. /* unused reexport */ __webpack_require__(9233);
  316. /* unused reexport */ __webpack_require__(5557);
  317. /***/ }),
  318. /***/ 2473:
  319. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  320. "use strict";
  321. var VectorTileLayer = __webpack_require__(5557);
  322. module.exports = VectorTile;
  323. function VectorTile(pbf, end) {
  324. this.layers = pbf.readFields(readTile, {}, end);
  325. }
  326. function readTile(tag, layers, pbf) {
  327. if (tag === 3) {
  328. var layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
  329. if (layer.length) layers[layer.name] = layer;
  330. }
  331. }
  332. /***/ }),
  333. /***/ 9233:
  334. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  335. "use strict";
  336. var Point = __webpack_require__(6525);
  337. module.exports = VectorTileFeature;
  338. function VectorTileFeature(pbf, end, extent, keys, values) {
  339. // Public
  340. this.properties = {};
  341. this.extent = extent;
  342. this.type = 0;
  343. // Private
  344. this._pbf = pbf;
  345. this._geometry = -1;
  346. this._keys = keys;
  347. this._values = values;
  348. pbf.readFields(readFeature, this, end);
  349. }
  350. function readFeature(tag, feature, pbf) {
  351. if (tag == 1) feature.id = pbf.readVarint();else if (tag == 2) readTag(pbf, feature);else if (tag == 3) feature.type = pbf.readVarint();else if (tag == 4) feature._geometry = pbf.pos;
  352. }
  353. function readTag(pbf, feature) {
  354. var end = pbf.readVarint() + pbf.pos;
  355. while (pbf.pos < end) {
  356. var key = feature._keys[pbf.readVarint()],
  357. value = feature._values[pbf.readVarint()];
  358. feature.properties[key] = value;
  359. }
  360. }
  361. VectorTileFeature.types = ['Unknown', 'Point', 'LineString', 'Polygon'];
  362. VectorTileFeature.prototype.loadGeometry = function () {
  363. var pbf = this._pbf;
  364. pbf.pos = this._geometry;
  365. var end = pbf.readVarint() + pbf.pos,
  366. cmd = 1,
  367. length = 0,
  368. x = 0,
  369. y = 0,
  370. lines = [],
  371. line;
  372. while (pbf.pos < end) {
  373. if (length <= 0) {
  374. var cmdLen = pbf.readVarint();
  375. cmd = cmdLen & 0x7;
  376. length = cmdLen >> 3;
  377. }
  378. length--;
  379. if (cmd === 1 || cmd === 2) {
  380. x += pbf.readSVarint();
  381. y += pbf.readSVarint();
  382. if (cmd === 1) {
  383. // moveTo
  384. if (line) lines.push(line);
  385. line = [];
  386. }
  387. line.push(new Point(x, y));
  388. } else if (cmd === 7) {
  389. // Workaround for https://github.com/mapbox/mapnik-vector-tile/issues/90
  390. if (line) {
  391. line.push(line[0].clone()); // closePolygon
  392. }
  393. } else {
  394. throw new Error('unknown command ' + cmd);
  395. }
  396. }
  397. if (line) lines.push(line);
  398. return lines;
  399. };
  400. VectorTileFeature.prototype.bbox = function () {
  401. var pbf = this._pbf;
  402. pbf.pos = this._geometry;
  403. var end = pbf.readVarint() + pbf.pos,
  404. cmd = 1,
  405. length = 0,
  406. x = 0,
  407. y = 0,
  408. x1 = Infinity,
  409. x2 = -Infinity,
  410. y1 = Infinity,
  411. y2 = -Infinity;
  412. while (pbf.pos < end) {
  413. if (length <= 0) {
  414. var cmdLen = pbf.readVarint();
  415. cmd = cmdLen & 0x7;
  416. length = cmdLen >> 3;
  417. }
  418. length--;
  419. if (cmd === 1 || cmd === 2) {
  420. x += pbf.readSVarint();
  421. y += pbf.readSVarint();
  422. if (x < x1) x1 = x;
  423. if (x > x2) x2 = x;
  424. if (y < y1) y1 = y;
  425. if (y > y2) y2 = y;
  426. } else if (cmd !== 7) {
  427. throw new Error('unknown command ' + cmd);
  428. }
  429. }
  430. return [x1, y1, x2, y2];
  431. };
  432. VectorTileFeature.prototype.toGeoJSON = function (x, y, z) {
  433. var size = this.extent * Math.pow(2, z),
  434. x0 = this.extent * x,
  435. y0 = this.extent * y,
  436. coords = this.loadGeometry(),
  437. type = VectorTileFeature.types[this.type],
  438. i,
  439. j;
  440. function project(line) {
  441. for (var j = 0; j < line.length; j++) {
  442. var p = line[j],
  443. y2 = 180 - (p.y + y0) * 360 / size;
  444. line[j] = [(p.x + x0) * 360 / size - 180, 360 / Math.PI * Math.atan(Math.exp(y2 * Math.PI / 180)) - 90];
  445. }
  446. }
  447. switch (this.type) {
  448. case 1:
  449. var points = [];
  450. for (i = 0; i < coords.length; i++) {
  451. points[i] = coords[i][0];
  452. }
  453. coords = points;
  454. project(coords);
  455. break;
  456. case 2:
  457. for (i = 0; i < coords.length; i++) {
  458. project(coords[i]);
  459. }
  460. break;
  461. case 3:
  462. coords = classifyRings(coords);
  463. for (i = 0; i < coords.length; i++) {
  464. for (j = 0; j < coords[i].length; j++) {
  465. project(coords[i][j]);
  466. }
  467. }
  468. break;
  469. }
  470. if (coords.length === 1) {
  471. coords = coords[0];
  472. } else {
  473. type = 'Multi' + type;
  474. }
  475. var result = {
  476. type: "Feature",
  477. geometry: {
  478. type: type,
  479. coordinates: coords
  480. },
  481. properties: this.properties
  482. };
  483. if ('id' in this) {
  484. result.id = this.id;
  485. }
  486. return result;
  487. };
  488. // classifies an array of rings into polygons with outer rings and holes
  489. function classifyRings(rings) {
  490. var len = rings.length;
  491. if (len <= 1) return [rings];
  492. var polygons = [],
  493. polygon,
  494. ccw;
  495. for (var i = 0; i < len; i++) {
  496. var area = signedArea(rings[i]);
  497. if (area === 0) continue;
  498. if (ccw === undefined) ccw = area < 0;
  499. if (ccw === area < 0) {
  500. if (polygon) polygons.push(polygon);
  501. polygon = [rings[i]];
  502. } else {
  503. polygon.push(rings[i]);
  504. }
  505. }
  506. if (polygon) polygons.push(polygon);
  507. return polygons;
  508. }
  509. function signedArea(ring) {
  510. var sum = 0;
  511. for (var i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {
  512. p1 = ring[i];
  513. p2 = ring[j];
  514. sum += (p2.x - p1.x) * (p1.y + p2.y);
  515. }
  516. return sum;
  517. }
  518. /***/ }),
  519. /***/ 5557:
  520. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  521. "use strict";
  522. var VectorTileFeature = __webpack_require__(9233);
  523. module.exports = VectorTileLayer;
  524. function VectorTileLayer(pbf, end) {
  525. // Public
  526. this.version = 1;
  527. this.name = null;
  528. this.extent = 4096;
  529. this.length = 0;
  530. // Private
  531. this._pbf = pbf;
  532. this._keys = [];
  533. this._values = [];
  534. this._features = [];
  535. pbf.readFields(readLayer, this, end);
  536. this.length = this._features.length;
  537. }
  538. function readLayer(tag, layer, pbf) {
  539. if (tag === 15) layer.version = pbf.readVarint();else if (tag === 1) layer.name = pbf.readString();else if (tag === 5) layer.extent = pbf.readVarint();else if (tag === 2) layer._features.push(pbf.pos);else if (tag === 3) layer._keys.push(pbf.readString());else if (tag === 4) layer._values.push(readValueMessage(pbf));
  540. }
  541. function readValueMessage(pbf) {
  542. var value = null,
  543. end = pbf.readVarint() + pbf.pos;
  544. while (pbf.pos < end) {
  545. var tag = pbf.readVarint() >> 3;
  546. value = tag === 1 ? pbf.readString() : tag === 2 ? pbf.readFloat() : tag === 3 ? pbf.readDouble() : tag === 4 ? pbf.readVarint64() : tag === 5 ? pbf.readVarint() : tag === 6 ? pbf.readSVarint() : tag === 7 ? pbf.readBoolean() : null;
  547. }
  548. return value;
  549. }
  550. // return feature `i` from this layer as a `VectorTileFeature`
  551. VectorTileLayer.prototype.feature = function (i) {
  552. if (i < 0 || i >= this._features.length) throw new Error('feature index out of bounds');
  553. this._pbf.pos = this._features[i];
  554. var end = this._pbf.readVarint() + this._pbf.pos;
  555. return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);
  556. };
  557. /***/ }),
  558. /***/ 5023:
  559. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  560. "use strict";
  561. var parent = __webpack_require__(6727);
  562. module.exports = parent;
  563. /***/ }),
  564. /***/ 3123:
  565. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  566. "use strict";
  567. var parent = __webpack_require__(8690);
  568. module.exports = parent;
  569. /***/ }),
  570. /***/ 879:
  571. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  572. "use strict";
  573. __webpack_require__(7422);
  574. var path = __webpack_require__(97);
  575. module.exports = path.Object.assign;
  576. /***/ }),
  577. /***/ 3723:
  578. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  579. "use strict";
  580. __webpack_require__(4835);
  581. var WrappedWellKnownSymbolModule = __webpack_require__(8384);
  582. module.exports = WrappedWellKnownSymbolModule.f('asyncIterator');
  583. /***/ }),
  584. /***/ 5980:
  585. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  586. "use strict";
  587. var isCallable = __webpack_require__(729);
  588. var tryToString = __webpack_require__(8434);
  589. var $TypeError = TypeError;
  590. // `Assert: IsCallable(argument) is true`
  591. module.exports = function (argument) {
  592. if (isCallable(argument)) return argument;
  593. throw $TypeError(tryToString(argument) + ' is not a function');
  594. };
  595. /***/ }),
  596. /***/ 7563:
  597. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  598. "use strict";
  599. var isObject = __webpack_require__(691);
  600. var $String = String;
  601. var $TypeError = TypeError;
  602. // `Assert: Type(argument) is Object`
  603. module.exports = function (argument) {
  604. if (isObject(argument)) return argument;
  605. throw $TypeError($String(argument) + ' is not an object');
  606. };
  607. /***/ }),
  608. /***/ 8632:
  609. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  610. "use strict";
  611. var toIndexedObject = __webpack_require__(6462);
  612. var toAbsoluteIndex = __webpack_require__(5333);
  613. var lengthOfArrayLike = __webpack_require__(6803);
  614. // `Array.prototype.{ indexOf, includes }` methods implementation
  615. var createMethod = function createMethod(IS_INCLUDES) {
  616. return function ($this, el, fromIndex) {
  617. var O = toIndexedObject($this);
  618. var length = lengthOfArrayLike(O);
  619. var index = toAbsoluteIndex(fromIndex, length);
  620. var value;
  621. // Array#includes uses SameValueZero equality algorithm
  622. // eslint-disable-next-line no-self-compare -- NaN check
  623. if (IS_INCLUDES && el != el) while (length > index) {
  624. value = O[index++];
  625. // eslint-disable-next-line no-self-compare -- NaN check
  626. if (value != value) return true;
  627. // Array#indexOf ignores holes, Array#includes - not
  628. } else for (; length > index; index++) {
  629. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  630. }
  631. return !IS_INCLUDES && -1;
  632. };
  633. };
  634. module.exports = {
  635. // `Array.prototype.includes` method
  636. // https://tc39.es/ecma262/#sec-array.prototype.includes
  637. includes: createMethod(true),
  638. // `Array.prototype.indexOf` method
  639. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  640. indexOf: createMethod(false)
  641. };
  642. /***/ }),
  643. /***/ 2177:
  644. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  645. "use strict";
  646. var uncurryThis = __webpack_require__(9738);
  647. var toString = uncurryThis({}.toString);
  648. var stringSlice = uncurryThis(''.slice);
  649. module.exports = function (it) {
  650. return stringSlice(toString(it), 8, -1);
  651. };
  652. /***/ }),
  653. /***/ 9029:
  654. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  655. "use strict";
  656. var hasOwn = __webpack_require__(1675);
  657. var ownKeys = __webpack_require__(9402);
  658. var getOwnPropertyDescriptorModule = __webpack_require__(7238);
  659. var definePropertyModule = __webpack_require__(704);
  660. module.exports = function (target, source, exceptions) {
  661. var keys = ownKeys(source);
  662. var defineProperty = definePropertyModule.f;
  663. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  664. for (var i = 0; i < keys.length; i++) {
  665. var key = keys[i];
  666. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  667. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  668. }
  669. }
  670. };
  671. /***/ }),
  672. /***/ 8268:
  673. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  674. "use strict";
  675. var DESCRIPTORS = __webpack_require__(6539);
  676. var definePropertyModule = __webpack_require__(704);
  677. var createPropertyDescriptor = __webpack_require__(4925);
  678. module.exports = DESCRIPTORS ? function (object, key, value) {
  679. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  680. } : function (object, key, value) {
  681. object[key] = value;
  682. return object;
  683. };
  684. /***/ }),
  685. /***/ 4925:
  686. /***/ (function(module) {
  687. "use strict";
  688. module.exports = function (bitmap, value) {
  689. return {
  690. enumerable: !(bitmap & 1),
  691. configurable: !(bitmap & 2),
  692. writable: !(bitmap & 4),
  693. value: value
  694. };
  695. };
  696. /***/ }),
  697. /***/ 7454:
  698. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  699. "use strict";
  700. var isCallable = __webpack_require__(729);
  701. var definePropertyModule = __webpack_require__(704);
  702. var makeBuiltIn = __webpack_require__(7948);
  703. var defineGlobalProperty = __webpack_require__(161);
  704. module.exports = function (O, key, value, options) {
  705. if (!options) options = {};
  706. var simple = options.enumerable;
  707. var name = options.name !== undefined ? options.name : key;
  708. if (isCallable(value)) makeBuiltIn(value, name, options);
  709. if (options.global) {
  710. if (simple) O[key] = value;else defineGlobalProperty(key, value);
  711. } else {
  712. try {
  713. if (!options.unsafe) delete O[key];else if (O[key]) simple = true;
  714. } catch (error) {/* empty */}
  715. if (simple) O[key] = value;else definePropertyModule.f(O, key, {
  716. value: value,
  717. enumerable: false,
  718. configurable: !options.nonConfigurable,
  719. writable: !options.nonWritable
  720. });
  721. }
  722. return O;
  723. };
  724. /***/ }),
  725. /***/ 161:
  726. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  727. "use strict";
  728. var global = __webpack_require__(5835);
  729. // eslint-disable-next-line es/no-object-defineproperty -- safe
  730. var defineProperty = Object.defineProperty;
  731. module.exports = function (key, value) {
  732. try {
  733. defineProperty(global, key, {
  734. value: value,
  735. configurable: true,
  736. writable: true
  737. });
  738. } catch (error) {
  739. global[key] = value;
  740. }
  741. return value;
  742. };
  743. /***/ }),
  744. /***/ 6539:
  745. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  746. "use strict";
  747. var fails = __webpack_require__(6583);
  748. // Detect IE8's incomplete defineProperty implementation
  749. module.exports = !fails(function () {
  750. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  751. return Object.defineProperty({}, 1, {
  752. get: function get() {
  753. return 7;
  754. }
  755. })[1] != 7;
  756. });
  757. /***/ }),
  758. /***/ 9967:
  759. /***/ (function(module) {
  760. "use strict";
  761. 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); }
  762. var documentAll = (typeof document === "undefined" ? "undefined" : _typeof(document)) == 'object' && document.all;
  763. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
  764. // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
  765. var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
  766. module.exports = {
  767. all: documentAll,
  768. IS_HTMLDDA: IS_HTMLDDA
  769. };
  770. /***/ }),
  771. /***/ 3343:
  772. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  773. "use strict";
  774. var global = __webpack_require__(5835);
  775. var isObject = __webpack_require__(691);
  776. var document = global.document;
  777. // typeof document.createElement is 'object' in old IE
  778. var EXISTS = isObject(document) && isObject(document.createElement);
  779. module.exports = function (it) {
  780. return EXISTS ? document.createElement(it) : {};
  781. };
  782. /***/ }),
  783. /***/ 1785:
  784. /***/ (function(module) {
  785. "use strict";
  786. module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
  787. /***/ }),
  788. /***/ 9282:
  789. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  790. "use strict";
  791. var global = __webpack_require__(5835);
  792. var userAgent = __webpack_require__(1785);
  793. var process = global.process;
  794. var Deno = global.Deno;
  795. var versions = process && process.versions || Deno && Deno.version;
  796. var v8 = versions && versions.v8;
  797. var match, version;
  798. if (v8) {
  799. match = v8.split('.');
  800. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  801. // but their correct versions are not interesting for us
  802. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  803. }
  804. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  805. // so check `userAgent` even if `.v8` exists, but 0
  806. if (!version && userAgent) {
  807. match = userAgent.match(/Edge\/(\d+)/);
  808. if (!match || match[1] >= 74) {
  809. match = userAgent.match(/Chrome\/(\d+)/);
  810. if (match) version = +match[1];
  811. }
  812. }
  813. module.exports = version;
  814. /***/ }),
  815. /***/ 8525:
  816. /***/ (function(module) {
  817. "use strict";
  818. // IE8- don't enum bug keys
  819. module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
  820. /***/ }),
  821. /***/ 7926:
  822. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  823. "use strict";
  824. 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); }
  825. var global = __webpack_require__(5835);
  826. var getOwnPropertyDescriptor = (__webpack_require__(7238).f);
  827. var createNonEnumerableProperty = __webpack_require__(8268);
  828. var defineBuiltIn = __webpack_require__(7454);
  829. var defineGlobalProperty = __webpack_require__(161);
  830. var copyConstructorProperties = __webpack_require__(9029);
  831. var isForced = __webpack_require__(3175);
  832. /*
  833. options.target - name of the target object
  834. options.global - target is the global object
  835. options.stat - export as static methods of target
  836. options.proto - export as prototype methods of target
  837. options.real - real prototype method for the `pure` version
  838. options.forced - export even if the native feature is available
  839. options.bind - bind methods to the target, required for the `pure` version
  840. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  841. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  842. options.sham - add a flag to not completely full polyfills
  843. options.enumerable - export as enumerable property
  844. options.dontCallGetSet - prevent calling a getter on target
  845. options.name - the .name of the function if it does not match the key
  846. */
  847. module.exports = function (options, source) {
  848. var TARGET = options.target;
  849. var GLOBAL = options.global;
  850. var STATIC = options.stat;
  851. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  852. if (GLOBAL) {
  853. target = global;
  854. } else if (STATIC) {
  855. target = global[TARGET] || defineGlobalProperty(TARGET, {});
  856. } else {
  857. target = (global[TARGET] || {}).prototype;
  858. }
  859. if (target) for (key in source) {
  860. sourceProperty = source[key];
  861. if (options.dontCallGetSet) {
  862. descriptor = getOwnPropertyDescriptor(target, key);
  863. targetProperty = descriptor && descriptor.value;
  864. } else targetProperty = target[key];
  865. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  866. // contained in target
  867. if (!FORCED && targetProperty !== undefined) {
  868. if (_typeof(sourceProperty) == _typeof(targetProperty)) continue;
  869. copyConstructorProperties(sourceProperty, targetProperty);
  870. }
  871. // add a flag to not completely full polyfills
  872. if (options.sham || targetProperty && targetProperty.sham) {
  873. createNonEnumerableProperty(sourceProperty, 'sham', true);
  874. }
  875. defineBuiltIn(target, key, sourceProperty, options);
  876. }
  877. };
  878. /***/ }),
  879. /***/ 6583:
  880. /***/ (function(module) {
  881. "use strict";
  882. module.exports = function (exec) {
  883. try {
  884. return !!exec();
  885. } catch (error) {
  886. return true;
  887. }
  888. };
  889. /***/ }),
  890. /***/ 9096:
  891. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  892. "use strict";
  893. var fails = __webpack_require__(6583);
  894. module.exports = !fails(function () {
  895. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  896. var test = function () {/* empty */}.bind();
  897. // eslint-disable-next-line no-prototype-builtins -- safe
  898. return typeof test != 'function' || test.hasOwnProperty('prototype');
  899. });
  900. /***/ }),
  901. /***/ 5057:
  902. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  903. "use strict";
  904. var NATIVE_BIND = __webpack_require__(9096);
  905. var call = Function.prototype.call;
  906. module.exports = NATIVE_BIND ? call.bind(call) : function () {
  907. return call.apply(call, arguments);
  908. };
  909. /***/ }),
  910. /***/ 1864:
  911. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  912. "use strict";
  913. var DESCRIPTORS = __webpack_require__(6539);
  914. var hasOwn = __webpack_require__(1675);
  915. var FunctionPrototype = Function.prototype;
  916. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  917. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  918. var EXISTS = hasOwn(FunctionPrototype, 'name');
  919. // additional protection from minified / mangled / dropped function names
  920. var PROPER = EXISTS && function something() {/* empty */}.name === 'something';
  921. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable);
  922. module.exports = {
  923. EXISTS: EXISTS,
  924. PROPER: PROPER,
  925. CONFIGURABLE: CONFIGURABLE
  926. };
  927. /***/ }),
  928. /***/ 9738:
  929. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  930. "use strict";
  931. var NATIVE_BIND = __webpack_require__(9096);
  932. var FunctionPrototype = Function.prototype;
  933. var call = FunctionPrototype.call;
  934. var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
  935. module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
  936. return function () {
  937. return call.apply(fn, arguments);
  938. };
  939. };
  940. /***/ }),
  941. /***/ 8078:
  942. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  943. "use strict";
  944. var global = __webpack_require__(5835);
  945. var isCallable = __webpack_require__(729);
  946. var aFunction = function aFunction(argument) {
  947. return isCallable(argument) ? argument : undefined;
  948. };
  949. module.exports = function (namespace, method) {
  950. return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
  951. };
  952. /***/ }),
  953. /***/ 2337:
  954. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  955. "use strict";
  956. var aCallable = __webpack_require__(5980);
  957. var isNullOrUndefined = __webpack_require__(6254);
  958. // `GetMethod` abstract operation
  959. // https://tc39.es/ecma262/#sec-getmethod
  960. module.exports = function (V, P) {
  961. var func = V[P];
  962. return isNullOrUndefined(func) ? undefined : aCallable(func);
  963. };
  964. /***/ }),
  965. /***/ 5835:
  966. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  967. "use strict";
  968. 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); }
  969. var check = function check(it) {
  970. return it && it.Math == Math && it;
  971. };
  972. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  973. module.exports =
  974. // eslint-disable-next-line es/no-global-this -- safe
  975. check((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === "undefined" ? "undefined" : _typeof(window)) == 'object' && window) ||
  976. // eslint-disable-next-line no-restricted-globals -- safe
  977. check((typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self) || check((typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g) ||
  978. // eslint-disable-next-line no-new-func -- fallback
  979. function () {
  980. return this;
  981. }() || this || Function('return this')();
  982. /***/ }),
  983. /***/ 1675:
  984. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  985. "use strict";
  986. var uncurryThis = __webpack_require__(9738);
  987. var toObject = __webpack_require__(5825);
  988. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  989. // `HasOwnProperty` abstract operation
  990. // https://tc39.es/ecma262/#sec-hasownproperty
  991. // eslint-disable-next-line es/no-object-hasown -- safe
  992. module.exports = Object.hasOwn || function hasOwn(it, key) {
  993. return hasOwnProperty(toObject(it), key);
  994. };
  995. /***/ }),
  996. /***/ 940:
  997. /***/ (function(module) {
  998. "use strict";
  999. module.exports = {};
  1000. /***/ }),
  1001. /***/ 2175:
  1002. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1003. "use strict";
  1004. var DESCRIPTORS = __webpack_require__(6539);
  1005. var fails = __webpack_require__(6583);
  1006. var createElement = __webpack_require__(3343);
  1007. // Thanks to IE8 for its funny defineProperty
  1008. module.exports = !DESCRIPTORS && !fails(function () {
  1009. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1010. return Object.defineProperty(createElement('div'), 'a', {
  1011. get: function get() {
  1012. return 7;
  1013. }
  1014. }).a != 7;
  1015. });
  1016. /***/ }),
  1017. /***/ 5407:
  1018. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1019. "use strict";
  1020. var uncurryThis = __webpack_require__(9738);
  1021. var fails = __webpack_require__(6583);
  1022. var classof = __webpack_require__(2177);
  1023. var $Object = Object;
  1024. var split = uncurryThis(''.split);
  1025. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1026. module.exports = fails(function () {
  1027. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  1028. // eslint-disable-next-line no-prototype-builtins -- safe
  1029. return !$Object('z').propertyIsEnumerable(0);
  1030. }) ? function (it) {
  1031. return classof(it) == 'String' ? split(it, '') : $Object(it);
  1032. } : $Object;
  1033. /***/ }),
  1034. /***/ 6111:
  1035. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1036. "use strict";
  1037. var uncurryThis = __webpack_require__(9738);
  1038. var isCallable = __webpack_require__(729);
  1039. var store = __webpack_require__(9700);
  1040. var functionToString = uncurryThis(Function.toString);
  1041. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  1042. if (!isCallable(store.inspectSource)) {
  1043. store.inspectSource = function (it) {
  1044. return functionToString(it);
  1045. };
  1046. }
  1047. module.exports = store.inspectSource;
  1048. /***/ }),
  1049. /***/ 4751:
  1050. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1051. "use strict";
  1052. var NATIVE_WEAK_MAP = __webpack_require__(9801);
  1053. var global = __webpack_require__(5835);
  1054. var isObject = __webpack_require__(691);
  1055. var createNonEnumerableProperty = __webpack_require__(8268);
  1056. var hasOwn = __webpack_require__(1675);
  1057. var shared = __webpack_require__(9700);
  1058. var sharedKey = __webpack_require__(7307);
  1059. var hiddenKeys = __webpack_require__(940);
  1060. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  1061. var TypeError = global.TypeError;
  1062. var WeakMap = global.WeakMap;
  1063. var set, get, has;
  1064. var enforce = function enforce(it) {
  1065. return has(it) ? get(it) : set(it, {});
  1066. };
  1067. var getterFor = function getterFor(TYPE) {
  1068. return function (it) {
  1069. var state;
  1070. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  1071. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  1072. }
  1073. return state;
  1074. };
  1075. };
  1076. if (NATIVE_WEAK_MAP || shared.state) {
  1077. var store = shared.state || (shared.state = new WeakMap());
  1078. /* eslint-disable no-self-assign -- prototype methods protection */
  1079. store.get = store.get;
  1080. store.has = store.has;
  1081. store.set = store.set;
  1082. /* eslint-enable no-self-assign -- prototype methods protection */
  1083. set = function set(it, metadata) {
  1084. if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
  1085. metadata.facade = it;
  1086. store.set(it, metadata);
  1087. return metadata;
  1088. };
  1089. get = function get(it) {
  1090. return store.get(it) || {};
  1091. };
  1092. has = function has(it) {
  1093. return store.has(it);
  1094. };
  1095. } else {
  1096. var STATE = sharedKey('state');
  1097. hiddenKeys[STATE] = true;
  1098. set = function set(it, metadata) {
  1099. if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
  1100. metadata.facade = it;
  1101. createNonEnumerableProperty(it, STATE, metadata);
  1102. return metadata;
  1103. };
  1104. get = function get(it) {
  1105. return hasOwn(it, STATE) ? it[STATE] : {};
  1106. };
  1107. has = function has(it) {
  1108. return hasOwn(it, STATE);
  1109. };
  1110. }
  1111. module.exports = {
  1112. set: set,
  1113. get: get,
  1114. has: has,
  1115. enforce: enforce,
  1116. getterFor: getterFor
  1117. };
  1118. /***/ }),
  1119. /***/ 729:
  1120. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1121. "use strict";
  1122. var $documentAll = __webpack_require__(9967);
  1123. var documentAll = $documentAll.all;
  1124. // `IsCallable` abstract operation
  1125. // https://tc39.es/ecma262/#sec-iscallable
  1126. module.exports = $documentAll.IS_HTMLDDA ? function (argument) {
  1127. return typeof argument == 'function' || argument === documentAll;
  1128. } : function (argument) {
  1129. return typeof argument == 'function';
  1130. };
  1131. /***/ }),
  1132. /***/ 3175:
  1133. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1134. "use strict";
  1135. var fails = __webpack_require__(6583);
  1136. var isCallable = __webpack_require__(729);
  1137. var replacement = /#|\.prototype\./;
  1138. var isForced = function isForced(feature, detection) {
  1139. var value = data[normalize(feature)];
  1140. return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
  1141. };
  1142. var normalize = isForced.normalize = function (string) {
  1143. return String(string).replace(replacement, '.').toLowerCase();
  1144. };
  1145. var data = isForced.data = {};
  1146. var NATIVE = isForced.NATIVE = 'N';
  1147. var POLYFILL = isForced.POLYFILL = 'P';
  1148. module.exports = isForced;
  1149. /***/ }),
  1150. /***/ 6254:
  1151. /***/ (function(module) {
  1152. "use strict";
  1153. // we can't use just `it == null` since of `document.all` special case
  1154. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
  1155. module.exports = function (it) {
  1156. return it === null || it === undefined;
  1157. };
  1158. /***/ }),
  1159. /***/ 691:
  1160. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1161. "use strict";
  1162. 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); }
  1163. var isCallable = __webpack_require__(729);
  1164. var $documentAll = __webpack_require__(9967);
  1165. var documentAll = $documentAll.all;
  1166. module.exports = $documentAll.IS_HTMLDDA ? function (it) {
  1167. return _typeof(it) == 'object' ? it !== null : isCallable(it) || it === documentAll;
  1168. } : function (it) {
  1169. return _typeof(it) == 'object' ? it !== null : isCallable(it);
  1170. };
  1171. /***/ }),
  1172. /***/ 1437:
  1173. /***/ (function(module) {
  1174. "use strict";
  1175. module.exports = false;
  1176. /***/ }),
  1177. /***/ 4192:
  1178. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1179. "use strict";
  1180. 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); }
  1181. var getBuiltIn = __webpack_require__(8078);
  1182. var isCallable = __webpack_require__(729);
  1183. var isPrototypeOf = __webpack_require__(5522);
  1184. var USE_SYMBOL_AS_UID = __webpack_require__(7860);
  1185. var $Object = Object;
  1186. module.exports = USE_SYMBOL_AS_UID ? function (it) {
  1187. return _typeof(it) == 'symbol';
  1188. } : function (it) {
  1189. var $Symbol = getBuiltIn('Symbol');
  1190. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  1191. };
  1192. /***/ }),
  1193. /***/ 6803:
  1194. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1195. "use strict";
  1196. var toLength = __webpack_require__(5108);
  1197. // `LengthOfArrayLike` abstract operation
  1198. // https://tc39.es/ecma262/#sec-lengthofarraylike
  1199. module.exports = function (obj) {
  1200. return toLength(obj.length);
  1201. };
  1202. /***/ }),
  1203. /***/ 7948:
  1204. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1205. "use strict";
  1206. var uncurryThis = __webpack_require__(9738);
  1207. var fails = __webpack_require__(6583);
  1208. var isCallable = __webpack_require__(729);
  1209. var hasOwn = __webpack_require__(1675);
  1210. var DESCRIPTORS = __webpack_require__(6539);
  1211. var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(1864).CONFIGURABLE);
  1212. var inspectSource = __webpack_require__(6111);
  1213. var InternalStateModule = __webpack_require__(4751);
  1214. var enforceInternalState = InternalStateModule.enforce;
  1215. var getInternalState = InternalStateModule.get;
  1216. var $String = String;
  1217. // eslint-disable-next-line es/no-object-defineproperty -- safe
  1218. var defineProperty = Object.defineProperty;
  1219. var stringSlice = uncurryThis(''.slice);
  1220. var replace = uncurryThis(''.replace);
  1221. var join = uncurryThis([].join);
  1222. var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
  1223. return defineProperty(function () {/* empty */}, 'length', {
  1224. value: 8
  1225. }).length !== 8;
  1226. });
  1227. var TEMPLATE = String(String).split('String');
  1228. var makeBuiltIn = module.exports = function (value, name, options) {
  1229. if (stringSlice($String(name), 0, 7) === 'Symbol(') {
  1230. name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
  1231. }
  1232. if (options && options.getter) name = 'get ' + name;
  1233. if (options && options.setter) name = 'set ' + name;
  1234. if (!hasOwn(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
  1235. if (DESCRIPTORS) defineProperty(value, 'name', {
  1236. value: name,
  1237. configurable: true
  1238. });else value.name = name;
  1239. }
  1240. if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
  1241. defineProperty(value, 'length', {
  1242. value: options.arity
  1243. });
  1244. }
  1245. try {
  1246. if (options && hasOwn(options, 'constructor') && options.constructor) {
  1247. if (DESCRIPTORS) defineProperty(value, 'prototype', {
  1248. writable: false
  1249. });
  1250. // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
  1251. } else if (value.prototype) value.prototype = undefined;
  1252. } catch (error) {/* empty */}
  1253. var state = enforceInternalState(value);
  1254. if (!hasOwn(state, 'source')) {
  1255. state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
  1256. }
  1257. return value;
  1258. };
  1259. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  1260. // eslint-disable-next-line no-extend-native -- required
  1261. Function.prototype.toString = makeBuiltIn(function toString() {
  1262. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  1263. }, 'toString');
  1264. /***/ }),
  1265. /***/ 4920:
  1266. /***/ (function(module) {
  1267. "use strict";
  1268. var ceil = Math.ceil;
  1269. var floor = Math.floor;
  1270. // `Math.trunc` method
  1271. // https://tc39.es/ecma262/#sec-math.trunc
  1272. // eslint-disable-next-line es/no-math-trunc -- safe
  1273. module.exports = Math.trunc || function trunc(x) {
  1274. var n = +x;
  1275. return (n > 0 ? floor : ceil)(n);
  1276. };
  1277. /***/ }),
  1278. /***/ 7328:
  1279. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1280. "use strict";
  1281. var DESCRIPTORS = __webpack_require__(6539);
  1282. var uncurryThis = __webpack_require__(9738);
  1283. var call = __webpack_require__(5057);
  1284. var fails = __webpack_require__(6583);
  1285. var objectKeys = __webpack_require__(5403);
  1286. var getOwnPropertySymbolsModule = __webpack_require__(7485);
  1287. var propertyIsEnumerableModule = __webpack_require__(5339);
  1288. var toObject = __webpack_require__(5825);
  1289. var IndexedObject = __webpack_require__(5407);
  1290. // eslint-disable-next-line es/no-object-assign -- safe
  1291. var $assign = Object.assign;
  1292. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1293. var defineProperty = Object.defineProperty;
  1294. var concat = uncurryThis([].concat);
  1295. // `Object.assign` method
  1296. // https://tc39.es/ecma262/#sec-object.assign
  1297. module.exports = !$assign || fails(function () {
  1298. // should have correct order of operations (Edge bug)
  1299. if (DESCRIPTORS && $assign({
  1300. b: 1
  1301. }, $assign(defineProperty({}, 'a', {
  1302. enumerable: true,
  1303. get: function get() {
  1304. defineProperty(this, 'b', {
  1305. value: 3,
  1306. enumerable: false
  1307. });
  1308. }
  1309. }), {
  1310. b: 2
  1311. })).b !== 1) return true;
  1312. // should work with symbols and should have deterministic property order (V8 bug)
  1313. var A = {};
  1314. var B = {};
  1315. // eslint-disable-next-line es/no-symbol -- safe
  1316. var symbol = Symbol();
  1317. var alphabet = 'abcdefghijklmnopqrst';
  1318. A[symbol] = 7;
  1319. alphabet.split('').forEach(function (chr) {
  1320. B[chr] = chr;
  1321. });
  1322. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  1323. }) ? function assign(target, source) {
  1324. // eslint-disable-line no-unused-vars -- required for `.length`
  1325. var T = toObject(target);
  1326. var argumentsLength = arguments.length;
  1327. var index = 1;
  1328. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  1329. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  1330. while (argumentsLength > index) {
  1331. var S = IndexedObject(arguments[index++]);
  1332. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  1333. var length = keys.length;
  1334. var j = 0;
  1335. var key;
  1336. while (length > j) {
  1337. key = keys[j++];
  1338. if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
  1339. }
  1340. }
  1341. return T;
  1342. } : $assign;
  1343. /***/ }),
  1344. /***/ 704:
  1345. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1346. "use strict";
  1347. var DESCRIPTORS = __webpack_require__(6539);
  1348. var IE8_DOM_DEFINE = __webpack_require__(2175);
  1349. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(4821);
  1350. var anObject = __webpack_require__(7563);
  1351. var toPropertyKey = __webpack_require__(9737);
  1352. var $TypeError = TypeError;
  1353. // eslint-disable-next-line es/no-object-defineproperty -- safe
  1354. var $defineProperty = Object.defineProperty;
  1355. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1356. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1357. var ENUMERABLE = 'enumerable';
  1358. var CONFIGURABLE = 'configurable';
  1359. var WRITABLE = 'writable';
  1360. // `Object.defineProperty` method
  1361. // https://tc39.es/ecma262/#sec-object.defineproperty
  1362. exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  1363. anObject(O);
  1364. P = toPropertyKey(P);
  1365. anObject(Attributes);
  1366. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  1367. var current = $getOwnPropertyDescriptor(O, P);
  1368. if (current && current[WRITABLE]) {
  1369. O[P] = Attributes.value;
  1370. Attributes = {
  1371. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  1372. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  1373. writable: false
  1374. };
  1375. }
  1376. }
  1377. return $defineProperty(O, P, Attributes);
  1378. } : $defineProperty : function defineProperty(O, P, Attributes) {
  1379. anObject(O);
  1380. P = toPropertyKey(P);
  1381. anObject(Attributes);
  1382. if (IE8_DOM_DEFINE) try {
  1383. return $defineProperty(O, P, Attributes);
  1384. } catch (error) {/* empty */}
  1385. if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
  1386. if ('value' in Attributes) O[P] = Attributes.value;
  1387. return O;
  1388. };
  1389. /***/ }),
  1390. /***/ 7238:
  1391. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1392. "use strict";
  1393. var DESCRIPTORS = __webpack_require__(6539);
  1394. var call = __webpack_require__(5057);
  1395. var propertyIsEnumerableModule = __webpack_require__(5339);
  1396. var createPropertyDescriptor = __webpack_require__(4925);
  1397. var toIndexedObject = __webpack_require__(6462);
  1398. var toPropertyKey = __webpack_require__(9737);
  1399. var hasOwn = __webpack_require__(1675);
  1400. var IE8_DOM_DEFINE = __webpack_require__(2175);
  1401. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1402. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1403. // `Object.getOwnPropertyDescriptor` method
  1404. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  1405. exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  1406. O = toIndexedObject(O);
  1407. P = toPropertyKey(P);
  1408. if (IE8_DOM_DEFINE) try {
  1409. return $getOwnPropertyDescriptor(O, P);
  1410. } catch (error) {/* empty */}
  1411. if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  1412. };
  1413. /***/ }),
  1414. /***/ 5454:
  1415. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1416. "use strict";
  1417. var internalObjectKeys = __webpack_require__(497);
  1418. var enumBugKeys = __webpack_require__(8525);
  1419. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  1420. // `Object.getOwnPropertyNames` method
  1421. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  1422. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  1423. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1424. return internalObjectKeys(O, hiddenKeys);
  1425. };
  1426. /***/ }),
  1427. /***/ 7485:
  1428. /***/ (function(__unused_webpack_module, exports) {
  1429. "use strict";
  1430. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  1431. exports.f = Object.getOwnPropertySymbols;
  1432. /***/ }),
  1433. /***/ 5522:
  1434. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1435. "use strict";
  1436. var uncurryThis = __webpack_require__(9738);
  1437. module.exports = uncurryThis({}.isPrototypeOf);
  1438. /***/ }),
  1439. /***/ 497:
  1440. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1441. "use strict";
  1442. var uncurryThis = __webpack_require__(9738);
  1443. var hasOwn = __webpack_require__(1675);
  1444. var toIndexedObject = __webpack_require__(6462);
  1445. var indexOf = (__webpack_require__(8632).indexOf);
  1446. var hiddenKeys = __webpack_require__(940);
  1447. var push = uncurryThis([].push);
  1448. module.exports = function (object, names) {
  1449. var O = toIndexedObject(object);
  1450. var i = 0;
  1451. var result = [];
  1452. var key;
  1453. for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  1454. // Don't enum bug & hidden keys
  1455. while (names.length > i) if (hasOwn(O, key = names[i++])) {
  1456. ~indexOf(result, key) || push(result, key);
  1457. }
  1458. return result;
  1459. };
  1460. /***/ }),
  1461. /***/ 5403:
  1462. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1463. "use strict";
  1464. var internalObjectKeys = __webpack_require__(497);
  1465. var enumBugKeys = __webpack_require__(8525);
  1466. // `Object.keys` method
  1467. // https://tc39.es/ecma262/#sec-object.keys
  1468. // eslint-disable-next-line es/no-object-keys -- safe
  1469. module.exports = Object.keys || function keys(O) {
  1470. return internalObjectKeys(O, enumBugKeys);
  1471. };
  1472. /***/ }),
  1473. /***/ 5339:
  1474. /***/ (function(__unused_webpack_module, exports) {
  1475. "use strict";
  1476. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  1477. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1478. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1479. // Nashorn ~ JDK8 bug
  1480. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
  1481. 1: 2
  1482. }, 1);
  1483. // `Object.prototype.propertyIsEnumerable` method implementation
  1484. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  1485. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  1486. var descriptor = getOwnPropertyDescriptor(this, V);
  1487. return !!descriptor && descriptor.enumerable;
  1488. } : $propertyIsEnumerable;
  1489. /***/ }),
  1490. /***/ 2821:
  1491. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1492. "use strict";
  1493. var call = __webpack_require__(5057);
  1494. var isCallable = __webpack_require__(729);
  1495. var isObject = __webpack_require__(691);
  1496. var $TypeError = TypeError;
  1497. // `OrdinaryToPrimitive` abstract operation
  1498. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  1499. module.exports = function (input, pref) {
  1500. var fn, val;
  1501. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  1502. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
  1503. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  1504. throw $TypeError("Can't convert object to primitive value");
  1505. };
  1506. /***/ }),
  1507. /***/ 9402:
  1508. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1509. "use strict";
  1510. var getBuiltIn = __webpack_require__(8078);
  1511. var uncurryThis = __webpack_require__(9738);
  1512. var getOwnPropertyNamesModule = __webpack_require__(5454);
  1513. var getOwnPropertySymbolsModule = __webpack_require__(7485);
  1514. var anObject = __webpack_require__(7563);
  1515. var concat = uncurryThis([].concat);
  1516. // all object keys, includes non-enumerable and symbols
  1517. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  1518. var keys = getOwnPropertyNamesModule.f(anObject(it));
  1519. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  1520. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  1521. };
  1522. /***/ }),
  1523. /***/ 97:
  1524. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1525. "use strict";
  1526. var global = __webpack_require__(5835);
  1527. module.exports = global;
  1528. /***/ }),
  1529. /***/ 1894:
  1530. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1531. "use strict";
  1532. var isNullOrUndefined = __webpack_require__(6254);
  1533. var $TypeError = TypeError;
  1534. // `RequireObjectCoercible` abstract operation
  1535. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  1536. module.exports = function (it) {
  1537. if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
  1538. return it;
  1539. };
  1540. /***/ }),
  1541. /***/ 7307:
  1542. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1543. "use strict";
  1544. var shared = __webpack_require__(5464);
  1545. var uid = __webpack_require__(6065);
  1546. var keys = shared('keys');
  1547. module.exports = function (key) {
  1548. return keys[key] || (keys[key] = uid(key));
  1549. };
  1550. /***/ }),
  1551. /***/ 9700:
  1552. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1553. "use strict";
  1554. var global = __webpack_require__(5835);
  1555. var defineGlobalProperty = __webpack_require__(161);
  1556. var SHARED = '__core-js_shared__';
  1557. var store = global[SHARED] || defineGlobalProperty(SHARED, {});
  1558. module.exports = store;
  1559. /***/ }),
  1560. /***/ 5464:
  1561. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1562. "use strict";
  1563. var IS_PURE = __webpack_require__(1437);
  1564. var store = __webpack_require__(9700);
  1565. (module.exports = function (key, value) {
  1566. return store[key] || (store[key] = value !== undefined ? value : {});
  1567. })('versions', []).push({
  1568. version: '3.32.0',
  1569. mode: IS_PURE ? 'pure' : 'global',
  1570. copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
  1571. license: 'https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE',
  1572. source: 'https://github.com/zloirock/core-js'
  1573. });
  1574. /***/ }),
  1575. /***/ 4993:
  1576. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1577. "use strict";
  1578. /* eslint-disable es/no-symbol -- required for testing */
  1579. var V8_VERSION = __webpack_require__(9282);
  1580. var fails = __webpack_require__(6583);
  1581. var global = __webpack_require__(5835);
  1582. var $String = global.String;
  1583. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  1584. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  1585. var symbol = Symbol();
  1586. // Chrome 38 Symbol has incorrect toString conversion
  1587. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  1588. // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
  1589. // of course, fail.
  1590. return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
  1591. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  1592. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  1593. });
  1594. /***/ }),
  1595. /***/ 5333:
  1596. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1597. "use strict";
  1598. var toIntegerOrInfinity = __webpack_require__(1087);
  1599. var max = Math.max;
  1600. var min = Math.min;
  1601. // Helper for a popular repeating case of the spec:
  1602. // Let integer be ? ToInteger(index).
  1603. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  1604. module.exports = function (index, length) {
  1605. var integer = toIntegerOrInfinity(index);
  1606. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  1607. };
  1608. /***/ }),
  1609. /***/ 6462:
  1610. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1611. "use strict";
  1612. // toObject with fallback for non-array-like ES3 strings
  1613. var IndexedObject = __webpack_require__(5407);
  1614. var requireObjectCoercible = __webpack_require__(1894);
  1615. module.exports = function (it) {
  1616. return IndexedObject(requireObjectCoercible(it));
  1617. };
  1618. /***/ }),
  1619. /***/ 1087:
  1620. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1621. "use strict";
  1622. var trunc = __webpack_require__(4920);
  1623. // `ToIntegerOrInfinity` abstract operation
  1624. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  1625. module.exports = function (argument) {
  1626. var number = +argument;
  1627. // eslint-disable-next-line no-self-compare -- NaN check
  1628. return number !== number || number === 0 ? 0 : trunc(number);
  1629. };
  1630. /***/ }),
  1631. /***/ 5108:
  1632. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1633. "use strict";
  1634. var toIntegerOrInfinity = __webpack_require__(1087);
  1635. var min = Math.min;
  1636. // `ToLength` abstract operation
  1637. // https://tc39.es/ecma262/#sec-tolength
  1638. module.exports = function (argument) {
  1639. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  1640. };
  1641. /***/ }),
  1642. /***/ 5825:
  1643. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1644. "use strict";
  1645. var requireObjectCoercible = __webpack_require__(1894);
  1646. var $Object = Object;
  1647. // `ToObject` abstract operation
  1648. // https://tc39.es/ecma262/#sec-toobject
  1649. module.exports = function (argument) {
  1650. return $Object(requireObjectCoercible(argument));
  1651. };
  1652. /***/ }),
  1653. /***/ 1044:
  1654. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1655. "use strict";
  1656. var call = __webpack_require__(5057);
  1657. var isObject = __webpack_require__(691);
  1658. var isSymbol = __webpack_require__(4192);
  1659. var getMethod = __webpack_require__(2337);
  1660. var ordinaryToPrimitive = __webpack_require__(2821);
  1661. var wellKnownSymbol = __webpack_require__(3121);
  1662. var $TypeError = TypeError;
  1663. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  1664. // `ToPrimitive` abstract operation
  1665. // https://tc39.es/ecma262/#sec-toprimitive
  1666. module.exports = function (input, pref) {
  1667. if (!isObject(input) || isSymbol(input)) return input;
  1668. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  1669. var result;
  1670. if (exoticToPrim) {
  1671. if (pref === undefined) pref = 'default';
  1672. result = call(exoticToPrim, input, pref);
  1673. if (!isObject(result) || isSymbol(result)) return result;
  1674. throw $TypeError("Can't convert object to primitive value");
  1675. }
  1676. if (pref === undefined) pref = 'number';
  1677. return ordinaryToPrimitive(input, pref);
  1678. };
  1679. /***/ }),
  1680. /***/ 9737:
  1681. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1682. "use strict";
  1683. var toPrimitive = __webpack_require__(1044);
  1684. var isSymbol = __webpack_require__(4192);
  1685. // `ToPropertyKey` abstract operation
  1686. // https://tc39.es/ecma262/#sec-topropertykey
  1687. module.exports = function (argument) {
  1688. var key = toPrimitive(argument, 'string');
  1689. return isSymbol(key) ? key : key + '';
  1690. };
  1691. /***/ }),
  1692. /***/ 8434:
  1693. /***/ (function(module) {
  1694. "use strict";
  1695. var $String = String;
  1696. module.exports = function (argument) {
  1697. try {
  1698. return $String(argument);
  1699. } catch (error) {
  1700. return 'Object';
  1701. }
  1702. };
  1703. /***/ }),
  1704. /***/ 6065:
  1705. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1706. "use strict";
  1707. var uncurryThis = __webpack_require__(9738);
  1708. var id = 0;
  1709. var postfix = Math.random();
  1710. var toString = uncurryThis(1.0.toString);
  1711. module.exports = function (key) {
  1712. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  1713. };
  1714. /***/ }),
  1715. /***/ 7860:
  1716. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1717. "use strict";
  1718. /* eslint-disable es/no-symbol -- required for testing */
  1719. 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); }
  1720. var NATIVE_SYMBOL = __webpack_require__(4993);
  1721. module.exports = NATIVE_SYMBOL && !Symbol.sham && _typeof(Symbol.iterator) == 'symbol';
  1722. /***/ }),
  1723. /***/ 4821:
  1724. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1725. "use strict";
  1726. var DESCRIPTORS = __webpack_require__(6539);
  1727. var fails = __webpack_require__(6583);
  1728. // V8 ~ Chrome 36-
  1729. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  1730. module.exports = DESCRIPTORS && fails(function () {
  1731. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1732. return Object.defineProperty(function () {/* empty */}, 'prototype', {
  1733. value: 42,
  1734. writable: false
  1735. }).prototype != 42;
  1736. });
  1737. /***/ }),
  1738. /***/ 9801:
  1739. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1740. "use strict";
  1741. var global = __webpack_require__(5835);
  1742. var isCallable = __webpack_require__(729);
  1743. var WeakMap = global.WeakMap;
  1744. module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
  1745. /***/ }),
  1746. /***/ 5336:
  1747. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1748. "use strict";
  1749. var path = __webpack_require__(97);
  1750. var hasOwn = __webpack_require__(1675);
  1751. var wrappedWellKnownSymbolModule = __webpack_require__(8384);
  1752. var defineProperty = (__webpack_require__(704).f);
  1753. module.exports = function (NAME) {
  1754. var _Symbol = path.Symbol || (path.Symbol = {});
  1755. if (!hasOwn(_Symbol, NAME)) defineProperty(_Symbol, NAME, {
  1756. value: wrappedWellKnownSymbolModule.f(NAME)
  1757. });
  1758. };
  1759. /***/ }),
  1760. /***/ 8384:
  1761. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  1762. "use strict";
  1763. var wellKnownSymbol = __webpack_require__(3121);
  1764. exports.f = wellKnownSymbol;
  1765. /***/ }),
  1766. /***/ 3121:
  1767. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1768. "use strict";
  1769. var global = __webpack_require__(5835);
  1770. var shared = __webpack_require__(5464);
  1771. var hasOwn = __webpack_require__(1675);
  1772. var uid = __webpack_require__(6065);
  1773. var NATIVE_SYMBOL = __webpack_require__(4993);
  1774. var USE_SYMBOL_AS_UID = __webpack_require__(7860);
  1775. var _Symbol = global.Symbol;
  1776. var WellKnownSymbolsStore = shared('wks');
  1777. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? _Symbol['for'] || _Symbol : _Symbol && _Symbol.withoutSetter || uid;
  1778. module.exports = function (name) {
  1779. if (!hasOwn(WellKnownSymbolsStore, name)) {
  1780. WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(_Symbol, name) ? _Symbol[name] : createWellKnownSymbol('Symbol.' + name);
  1781. }
  1782. return WellKnownSymbolsStore[name];
  1783. };
  1784. /***/ }),
  1785. /***/ 7422:
  1786. /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
  1787. "use strict";
  1788. var $ = __webpack_require__(7926);
  1789. var assign = __webpack_require__(7328);
  1790. // `Object.assign` method
  1791. // https://tc39.es/ecma262/#sec-object.assign
  1792. // eslint-disable-next-line es/no-object-assign -- required for testing
  1793. $({
  1794. target: 'Object',
  1795. stat: true,
  1796. arity: 2,
  1797. forced: Object.assign !== assign
  1798. }, {
  1799. assign: assign
  1800. });
  1801. /***/ }),
  1802. /***/ 4835:
  1803. /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
  1804. "use strict";
  1805. var defineWellKnownSymbol = __webpack_require__(5336);
  1806. // `Symbol.asyncIterator` well-known symbol
  1807. // https://tc39.es/ecma262/#sec-symbol.asynciterator
  1808. defineWellKnownSymbol('asyncIterator');
  1809. /***/ }),
  1810. /***/ 6727:
  1811. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1812. "use strict";
  1813. var parent = __webpack_require__(879);
  1814. module.exports = parent;
  1815. /***/ }),
  1816. /***/ 8690:
  1817. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  1818. "use strict";
  1819. var parent = __webpack_require__(3723);
  1820. module.exports = parent;
  1821. /***/ }),
  1822. /***/ 5937:
  1823. /***/ (function(module) {
  1824. (function (self) {
  1825. 'use strict';
  1826. // if __disableNativeFetch is set to true, the it will always polyfill fetch
  1827. // with Ajax.
  1828. if (!self.__disableNativeFetch && self.fetch) {
  1829. return;
  1830. }
  1831. function normalizeName(name) {
  1832. if (typeof name !== 'string') {
  1833. name = String(name);
  1834. }
  1835. if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  1836. throw new TypeError('Invalid character in header field name');
  1837. }
  1838. return name.toLowerCase();
  1839. }
  1840. function normalizeValue(value) {
  1841. if (typeof value !== 'string') {
  1842. value = String(value);
  1843. }
  1844. return value;
  1845. }
  1846. function Headers(headers) {
  1847. this.map = {};
  1848. if (headers instanceof Headers) {
  1849. headers.forEach(function (value, name) {
  1850. this.append(name, value);
  1851. }, this);
  1852. } else if (headers) {
  1853. Object.getOwnPropertyNames(headers).forEach(function (name) {
  1854. this.append(name, headers[name]);
  1855. }, this);
  1856. }
  1857. }
  1858. Headers.prototype.append = function (name, value) {
  1859. name = normalizeName(name);
  1860. value = normalizeValue(value);
  1861. var list = this.map[name];
  1862. if (!list) {
  1863. list = [];
  1864. this.map[name] = list;
  1865. }
  1866. list.push(value);
  1867. };
  1868. Headers.prototype['delete'] = function (name) {
  1869. delete this.map[normalizeName(name)];
  1870. };
  1871. Headers.prototype.get = function (name) {
  1872. var values = this.map[normalizeName(name)];
  1873. return values ? values[0] : null;
  1874. };
  1875. Headers.prototype.getAll = function (name) {
  1876. return this.map[normalizeName(name)] || [];
  1877. };
  1878. Headers.prototype.has = function (name) {
  1879. return this.map.hasOwnProperty(normalizeName(name));
  1880. };
  1881. Headers.prototype.set = function (name, value) {
  1882. this.map[normalizeName(name)] = [normalizeValue(value)];
  1883. };
  1884. Headers.prototype.forEach = function (callback, thisArg) {
  1885. Object.getOwnPropertyNames(this.map).forEach(function (name) {
  1886. this.map[name].forEach(function (value) {
  1887. callback.call(thisArg, value, name, this);
  1888. }, this);
  1889. }, this);
  1890. };
  1891. function consumed(body) {
  1892. if (body.bodyUsed) {
  1893. return Promise.reject(new TypeError('Already read'));
  1894. }
  1895. body.bodyUsed = true;
  1896. }
  1897. function fileReaderReady(reader) {
  1898. return new Promise(function (resolve, reject) {
  1899. reader.onload = function () {
  1900. resolve(reader.result);
  1901. };
  1902. reader.onerror = function () {
  1903. reject(reader.error);
  1904. };
  1905. });
  1906. }
  1907. function readBlobAsArrayBuffer(blob) {
  1908. var reader = new FileReader();
  1909. reader.readAsArrayBuffer(blob);
  1910. return fileReaderReady(reader);
  1911. }
  1912. function readBlobAsText(blob, options) {
  1913. var reader = new FileReader();
  1914. var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
  1915. var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
  1916. var _charset = blob.type.match(regex) || contentType.match(regex);
  1917. var args = [blob];
  1918. if (_charset) {
  1919. args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
  1920. }
  1921. reader.readAsText.apply(reader, args);
  1922. return fileReaderReady(reader);
  1923. }
  1924. var support = {
  1925. blob: 'FileReader' in self && 'Blob' in self && function () {
  1926. try {
  1927. new Blob();
  1928. return true;
  1929. } catch (e) {
  1930. return false;
  1931. }
  1932. }(),
  1933. formData: 'FormData' in self,
  1934. arrayBuffer: 'ArrayBuffer' in self
  1935. };
  1936. function Body() {
  1937. this.bodyUsed = false;
  1938. this._initBody = function (body, options) {
  1939. this._bodyInit = body;
  1940. if (typeof body === 'string') {
  1941. this._bodyText = body;
  1942. } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  1943. this._bodyBlob = body;
  1944. this._options = options;
  1945. } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  1946. this._bodyFormData = body;
  1947. } else if (!body) {
  1948. this._bodyText = '';
  1949. } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {
  1950. // Only support ArrayBuffers for POST method.
  1951. // Receiving ArrayBuffers happens via Blobs, instead.
  1952. } else {
  1953. throw new Error('unsupported BodyInit type');
  1954. }
  1955. };
  1956. if (support.blob) {
  1957. this.blob = function () {
  1958. var rejected = consumed(this);
  1959. if (rejected) {
  1960. return rejected;
  1961. }
  1962. if (this._bodyBlob) {
  1963. return Promise.resolve(this._bodyBlob);
  1964. } else if (this._bodyFormData) {
  1965. throw new Error('could not read FormData body as blob');
  1966. } else {
  1967. return Promise.resolve(new Blob([this._bodyText]));
  1968. }
  1969. };
  1970. this.arrayBuffer = function () {
  1971. return this.blob().then(readBlobAsArrayBuffer);
  1972. };
  1973. this.text = function () {
  1974. var rejected = consumed(this);
  1975. if (rejected) {
  1976. return rejected;
  1977. }
  1978. if (this._bodyBlob) {
  1979. return readBlobAsText(this._bodyBlob, this._options);
  1980. } else if (this._bodyFormData) {
  1981. throw new Error('could not read FormData body as text');
  1982. } else {
  1983. return Promise.resolve(this._bodyText);
  1984. }
  1985. };
  1986. } else {
  1987. this.text = function () {
  1988. var rejected = consumed(this);
  1989. return rejected ? rejected : Promise.resolve(this._bodyText);
  1990. };
  1991. }
  1992. if (support.formData) {
  1993. this.formData = function () {
  1994. return this.text().then(decode);
  1995. };
  1996. }
  1997. this.json = function () {
  1998. return this.text().then(JSON.parse);
  1999. };
  2000. return this;
  2001. }
  2002. // HTTP methods whose capitalization should be normalized
  2003. var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
  2004. function normalizeMethod(method) {
  2005. var upcased = method.toUpperCase();
  2006. return methods.indexOf(upcased) > -1 ? upcased : method;
  2007. }
  2008. function Request(input, options) {
  2009. options = options || {};
  2010. var body = options.body;
  2011. if (Request.prototype.isPrototypeOf(input)) {
  2012. if (input.bodyUsed) {
  2013. throw new TypeError('Already read');
  2014. }
  2015. this.url = input.url;
  2016. this.credentials = input.credentials;
  2017. if (!options.headers) {
  2018. this.headers = new Headers(input.headers);
  2019. }
  2020. this.method = input.method;
  2021. this.mode = input.mode;
  2022. if (!body) {
  2023. body = input._bodyInit;
  2024. input.bodyUsed = true;
  2025. }
  2026. } else {
  2027. this.url = input;
  2028. }
  2029. this.credentials = options.credentials || this.credentials || 'omit';
  2030. if (options.headers || !this.headers) {
  2031. this.headers = new Headers(options.headers);
  2032. }
  2033. this.method = normalizeMethod(options.method || this.method || 'GET');
  2034. this.mode = options.mode || this.mode || null;
  2035. this.referrer = null;
  2036. if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  2037. throw new TypeError('Body not allowed for GET or HEAD requests');
  2038. }
  2039. this._initBody(body, options);
  2040. }
  2041. Request.prototype.clone = function () {
  2042. return new Request(this);
  2043. };
  2044. function decode(body) {
  2045. var form = new FormData();
  2046. body.trim().split('&').forEach(function (bytes) {
  2047. if (bytes) {
  2048. var split = bytes.split('=');
  2049. var name = split.shift().replace(/\+/g, ' ');
  2050. var value = split.join('=').replace(/\+/g, ' ');
  2051. form.append(decodeURIComponent(name), decodeURIComponent(value));
  2052. }
  2053. });
  2054. return form;
  2055. }
  2056. function headers(xhr) {
  2057. var head = new Headers();
  2058. var pairs = xhr.getAllResponseHeaders().trim().split('\n');
  2059. pairs.forEach(function (header) {
  2060. var split = header.trim().split(':');
  2061. var key = split.shift().trim();
  2062. var value = split.join(':').trim();
  2063. head.append(key, value);
  2064. });
  2065. return head;
  2066. }
  2067. Body.call(Request.prototype);
  2068. function Response(bodyInit, options) {
  2069. if (!options) {
  2070. options = {};
  2071. }
  2072. this._initBody(bodyInit, options);
  2073. this.type = 'default';
  2074. this.status = options.status;
  2075. this.ok = this.status >= 200 && this.status < 300;
  2076. this.statusText = options.statusText;
  2077. this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
  2078. this.url = options.url || '';
  2079. }
  2080. Body.call(Response.prototype);
  2081. Response.prototype.clone = function () {
  2082. return new Response(this._bodyInit, {
  2083. status: this.status,
  2084. statusText: this.statusText,
  2085. headers: new Headers(this.headers),
  2086. url: this.url
  2087. });
  2088. };
  2089. Response.error = function () {
  2090. var response = new Response(null, {
  2091. status: 0,
  2092. statusText: ''
  2093. });
  2094. response.type = 'error';
  2095. return response;
  2096. };
  2097. var redirectStatuses = [301, 302, 303, 307, 308];
  2098. Response.redirect = function (url, status) {
  2099. if (redirectStatuses.indexOf(status) === -1) {
  2100. throw new RangeError('Invalid status code');
  2101. }
  2102. return new Response(null, {
  2103. status: status,
  2104. headers: {
  2105. location: url
  2106. }
  2107. });
  2108. };
  2109. self.Headers = Headers;
  2110. self.Request = Request;
  2111. self.Response = Response;
  2112. self.fetch = function (input, init) {
  2113. return new Promise(function (resolve, reject) {
  2114. var request;
  2115. if (Request.prototype.isPrototypeOf(input) && !init) {
  2116. request = input;
  2117. } else {
  2118. request = new Request(input, init);
  2119. }
  2120. var xhr = new XMLHttpRequest();
  2121. function responseURL() {
  2122. if ('responseURL' in xhr) {
  2123. return xhr.responseURL;
  2124. }
  2125. // Avoid security warnings on getResponseHeader when not allowed by CORS
  2126. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  2127. return xhr.getResponseHeader('X-Request-URL');
  2128. }
  2129. return;
  2130. }
  2131. var __onLoadHandled = false;
  2132. function onload() {
  2133. if (xhr.readyState !== 4) {
  2134. return;
  2135. }
  2136. var status = xhr.status === 1223 ? 204 : xhr.status;
  2137. if (status < 100 || status > 599) {
  2138. if (__onLoadHandled) {
  2139. return;
  2140. } else {
  2141. __onLoadHandled = true;
  2142. }
  2143. reject(new TypeError('Network request failed'));
  2144. return;
  2145. }
  2146. var options = {
  2147. status: status,
  2148. statusText: xhr.statusText,
  2149. headers: headers(xhr),
  2150. url: responseURL()
  2151. };
  2152. var body = 'response' in xhr ? xhr.response : xhr.responseText;
  2153. if (__onLoadHandled) {
  2154. return;
  2155. } else {
  2156. __onLoadHandled = true;
  2157. }
  2158. resolve(new Response(body, options));
  2159. }
  2160. xhr.onreadystatechange = onload;
  2161. xhr.onload = onload;
  2162. xhr.onerror = function () {
  2163. if (__onLoadHandled) {
  2164. return;
  2165. } else {
  2166. __onLoadHandled = true;
  2167. }
  2168. reject(new TypeError('Network request failed'));
  2169. };
  2170. xhr.open(request.method, request.url, true);
  2171. // `withCredentials` should be setted after calling `.open` in IE10
  2172. // http://stackoverflow.com/a/19667959/1219343
  2173. try {
  2174. if (request.credentials === 'include') {
  2175. if ('withCredentials' in xhr) {
  2176. xhr.withCredentials = true;
  2177. } else {
  2178. console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
  2179. }
  2180. }
  2181. } catch (e) {
  2182. console && console.warn && console.warn('set withCredentials error:' + e);
  2183. }
  2184. if ('responseType' in xhr && support.blob) {
  2185. xhr.responseType = 'blob';
  2186. }
  2187. request.headers.forEach(function (value, name) {
  2188. xhr.setRequestHeader(name, value);
  2189. });
  2190. xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
  2191. });
  2192. };
  2193. self.fetch.polyfill = true;
  2194. // Support CommonJS
  2195. if ( true && module.exports) {
  2196. module.exports = self.fetch;
  2197. }
  2198. })(typeof self !== 'undefined' ? self : this);
  2199. /***/ }),
  2200. /***/ 4238:
  2201. /***/ (function(module, exports) {
  2202. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  2203. if (true) {
  2204. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  2205. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  2206. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  2207. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  2208. } else { var mod; }
  2209. })(this, function (exports, module) {
  2210. 'use strict';
  2211. var defaultOptions = {
  2212. timeout: 5000,
  2213. jsonpCallback: 'callback',
  2214. jsonpCallbackFunction: null
  2215. };
  2216. function generateCallbackFunction() {
  2217. return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
  2218. }
  2219. function clearFunction(functionName) {
  2220. // IE8 throws an exception when you try to delete a property on window
  2221. // http://stackoverflow.com/a/1824228/751089
  2222. try {
  2223. delete window[functionName];
  2224. } catch (e) {
  2225. window[functionName] = undefined;
  2226. }
  2227. }
  2228. function removeScript(scriptId) {
  2229. var script = document.getElementById(scriptId);
  2230. if (script) {
  2231. document.getElementsByTagName('head')[0].removeChild(script);
  2232. }
  2233. }
  2234. function fetchJsonp(_url) {
  2235. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  2236. // to avoid param reassign
  2237. var url = _url;
  2238. var timeout = options.timeout || defaultOptions.timeout;
  2239. var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
  2240. var timeoutId = undefined;
  2241. return new Promise(function (resolve, reject) {
  2242. var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
  2243. var scriptId = jsonpCallback + '_' + callbackFunction;
  2244. window[callbackFunction] = function (response) {
  2245. resolve({
  2246. ok: true,
  2247. // keep consistent with fetch API
  2248. json: function json() {
  2249. return Promise.resolve(response);
  2250. }
  2251. });
  2252. if (timeoutId) clearTimeout(timeoutId);
  2253. removeScript(scriptId);
  2254. clearFunction(callbackFunction);
  2255. };
  2256. // Check if the user set their own params, and if not add a ? to start a list of params
  2257. url += url.indexOf('?') === -1 ? '?' : '&';
  2258. var jsonpScript = document.createElement('script');
  2259. jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
  2260. if (options.charset) {
  2261. jsonpScript.setAttribute('charset', options.charset);
  2262. }
  2263. jsonpScript.id = scriptId;
  2264. document.getElementsByTagName('head')[0].appendChild(jsonpScript);
  2265. timeoutId = setTimeout(function () {
  2266. reject(new Error('JSONP request to ' + _url + ' timed out'));
  2267. clearFunction(callbackFunction);
  2268. removeScript(scriptId);
  2269. window[callbackFunction] = function () {
  2270. clearFunction(callbackFunction);
  2271. };
  2272. }, timeout);
  2273. // Caught if got 404/500
  2274. jsonpScript.onerror = function () {
  2275. reject(new Error('JSONP request to ' + _url + ' failed'));
  2276. clearFunction(callbackFunction);
  2277. removeScript(scriptId);
  2278. if (timeoutId) clearTimeout(timeoutId);
  2279. };
  2280. });
  2281. }
  2282. // export as global function
  2283. /*
  2284. let local;
  2285. if (typeof global !== 'undefined') {
  2286. local = global;
  2287. } else if (typeof self !== 'undefined') {
  2288. local = self;
  2289. } else {
  2290. try {
  2291. local = Function('return this')();
  2292. } catch (e) {
  2293. throw new Error('polyfill failed because global object is unavailable in this environment');
  2294. }
  2295. }
  2296. local.fetchJsonp = fetchJsonp;
  2297. */
  2298. module.exports = fetchJsonp;
  2299. });
  2300. /***/ }),
  2301. /***/ 4634:
  2302. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  2303. "use strict";
  2304. Object.defineProperty(exports, "__esModule", ({
  2305. value: true
  2306. }));
  2307. exports.Builder = void 0;
  2308. var byte_buffer_js_1 = __webpack_require__(1603);
  2309. var constants_js_1 = __webpack_require__(1083);
  2310. var Builder = /** @class */function () {
  2311. /**
  2312. * Create a FlatBufferBuilder.
  2313. */
  2314. function Builder(opt_initial_size) {
  2315. /** Minimum alignment encountered so far. */
  2316. this.minalign = 1;
  2317. /** The vtable for the current table. */
  2318. this.vtable = null;
  2319. /** The amount of fields we're actually using. */
  2320. this.vtable_in_use = 0;
  2321. /** Whether we are currently serializing a table. */
  2322. this.isNested = false;
  2323. /** Starting offset of the current struct/table. */
  2324. this.object_start = 0;
  2325. /** List of offsets of all vtables. */
  2326. this.vtables = [];
  2327. /** For the current vector being built. */
  2328. this.vector_num_elems = 0;
  2329. /** False omits default values from the serialized data */
  2330. this.force_defaults = false;
  2331. this.string_maps = null;
  2332. var initial_size;
  2333. if (!opt_initial_size) {
  2334. initial_size = 1024;
  2335. } else {
  2336. initial_size = opt_initial_size;
  2337. }
  2338. /**
  2339. * @type {ByteBuffer}
  2340. * @private
  2341. */
  2342. this.bb = byte_buffer_js_1.ByteBuffer.allocate(initial_size);
  2343. this.space = initial_size;
  2344. }
  2345. Builder.prototype.clear = function () {
  2346. this.bb.clear();
  2347. this.space = this.bb.capacity();
  2348. this.minalign = 1;
  2349. this.vtable = null;
  2350. this.vtable_in_use = 0;
  2351. this.isNested = false;
  2352. this.object_start = 0;
  2353. this.vtables = [];
  2354. this.vector_num_elems = 0;
  2355. this.force_defaults = false;
  2356. this.string_maps = null;
  2357. };
  2358. /**
  2359. * In order to save space, fields that are set to their default value
  2360. * don't get serialized into the buffer. Forcing defaults provides a
  2361. * way to manually disable this optimization.
  2362. *
  2363. * @param forceDefaults true always serializes default values
  2364. */
  2365. Builder.prototype.forceDefaults = function (forceDefaults) {
  2366. this.force_defaults = forceDefaults;
  2367. };
  2368. /**
  2369. * Get the ByteBuffer representing the FlatBuffer. Only call this after you've
  2370. * called finish(). The actual data starts at the ByteBuffer's current position,
  2371. * not necessarily at 0.
  2372. */
  2373. Builder.prototype.dataBuffer = function () {
  2374. return this.bb;
  2375. };
  2376. /**
  2377. * Get the bytes representing the FlatBuffer. Only call this after you've
  2378. * called finish().
  2379. */
  2380. Builder.prototype.asUint8Array = function () {
  2381. return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());
  2382. };
  2383. /**
  2384. * Prepare to write an element of `size` after `additional_bytes` have been
  2385. * written, e.g. if you write a string, you need to align such the int length
  2386. * field is aligned to 4 bytes, and the string data follows it directly. If all
  2387. * you need to do is alignment, `additional_bytes` will be 0.
  2388. *
  2389. * @param size This is the of the new element to write
  2390. * @param additional_bytes The padding size
  2391. */
  2392. Builder.prototype.prep = function (size, additional_bytes) {
  2393. // Track the biggest thing we've ever aligned to.
  2394. if (size > this.minalign) {
  2395. this.minalign = size;
  2396. }
  2397. // Find the amount of alignment needed such that `size` is properly
  2398. // aligned after `additional_bytes`
  2399. var align_size = ~(this.bb.capacity() - this.space + additional_bytes) + 1 & size - 1;
  2400. // Reallocate the buffer if needed.
  2401. while (this.space < align_size + size + additional_bytes) {
  2402. var old_buf_size = this.bb.capacity();
  2403. this.bb = Builder.growByteBuffer(this.bb);
  2404. this.space += this.bb.capacity() - old_buf_size;
  2405. }
  2406. this.pad(align_size);
  2407. };
  2408. Builder.prototype.pad = function (byte_size) {
  2409. for (var i = 0; i < byte_size; i++) {
  2410. this.bb.writeInt8(--this.space, 0);
  2411. }
  2412. };
  2413. Builder.prototype.writeInt8 = function (value) {
  2414. this.bb.writeInt8(this.space -= 1, value);
  2415. };
  2416. Builder.prototype.writeInt16 = function (value) {
  2417. this.bb.writeInt16(this.space -= 2, value);
  2418. };
  2419. Builder.prototype.writeInt32 = function (value) {
  2420. this.bb.writeInt32(this.space -= 4, value);
  2421. };
  2422. Builder.prototype.writeInt64 = function (value) {
  2423. this.bb.writeInt64(this.space -= 8, value);
  2424. };
  2425. Builder.prototype.writeFloat32 = function (value) {
  2426. this.bb.writeFloat32(this.space -= 4, value);
  2427. };
  2428. Builder.prototype.writeFloat64 = function (value) {
  2429. this.bb.writeFloat64(this.space -= 8, value);
  2430. };
  2431. /**
  2432. * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).
  2433. * @param value The `int8` to add the the buffer.
  2434. */
  2435. Builder.prototype.addInt8 = function (value) {
  2436. this.prep(1, 0);
  2437. this.writeInt8(value);
  2438. };
  2439. /**
  2440. * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).
  2441. * @param value The `int16` to add the the buffer.
  2442. */
  2443. Builder.prototype.addInt16 = function (value) {
  2444. this.prep(2, 0);
  2445. this.writeInt16(value);
  2446. };
  2447. /**
  2448. * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).
  2449. * @param value The `int32` to add the the buffer.
  2450. */
  2451. Builder.prototype.addInt32 = function (value) {
  2452. this.prep(4, 0);
  2453. this.writeInt32(value);
  2454. };
  2455. /**
  2456. * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).
  2457. * @param value The `int64` to add the the buffer.
  2458. */
  2459. Builder.prototype.addInt64 = function (value) {
  2460. this.prep(8, 0);
  2461. this.writeInt64(value);
  2462. };
  2463. /**
  2464. * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).
  2465. * @param value The `float32` to add the the buffer.
  2466. */
  2467. Builder.prototype.addFloat32 = function (value) {
  2468. this.prep(4, 0);
  2469. this.writeFloat32(value);
  2470. };
  2471. /**
  2472. * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).
  2473. * @param value The `float64` to add the the buffer.
  2474. */
  2475. Builder.prototype.addFloat64 = function (value) {
  2476. this.prep(8, 0);
  2477. this.writeFloat64(value);
  2478. };
  2479. Builder.prototype.addFieldInt8 = function (voffset, value, defaultValue) {
  2480. if (this.force_defaults || value != defaultValue) {
  2481. this.addInt8(value);
  2482. this.slot(voffset);
  2483. }
  2484. };
  2485. Builder.prototype.addFieldInt16 = function (voffset, value, defaultValue) {
  2486. if (this.force_defaults || value != defaultValue) {
  2487. this.addInt16(value);
  2488. this.slot(voffset);
  2489. }
  2490. };
  2491. Builder.prototype.addFieldInt32 = function (voffset, value, defaultValue) {
  2492. if (this.force_defaults || value != defaultValue) {
  2493. this.addInt32(value);
  2494. this.slot(voffset);
  2495. }
  2496. };
  2497. Builder.prototype.addFieldInt64 = function (voffset, value, defaultValue) {
  2498. if (this.force_defaults || value !== defaultValue) {
  2499. this.addInt64(value);
  2500. this.slot(voffset);
  2501. }
  2502. };
  2503. Builder.prototype.addFieldFloat32 = function (voffset, value, defaultValue) {
  2504. if (this.force_defaults || value != defaultValue) {
  2505. this.addFloat32(value);
  2506. this.slot(voffset);
  2507. }
  2508. };
  2509. Builder.prototype.addFieldFloat64 = function (voffset, value, defaultValue) {
  2510. if (this.force_defaults || value != defaultValue) {
  2511. this.addFloat64(value);
  2512. this.slot(voffset);
  2513. }
  2514. };
  2515. Builder.prototype.addFieldOffset = function (voffset, value, defaultValue) {
  2516. if (this.force_defaults || value != defaultValue) {
  2517. this.addOffset(value);
  2518. this.slot(voffset);
  2519. }
  2520. };
  2521. /**
  2522. * Structs are stored inline, so nothing additional is being added. `d` is always 0.
  2523. */
  2524. Builder.prototype.addFieldStruct = function (voffset, value, defaultValue) {
  2525. if (value != defaultValue) {
  2526. this.nested(value);
  2527. this.slot(voffset);
  2528. }
  2529. };
  2530. /**
  2531. * Structures are always stored inline, they need to be created right
  2532. * where they're used. You'll get this assertion failure if you
  2533. * created it elsewhere.
  2534. */
  2535. Builder.prototype.nested = function (obj) {
  2536. if (obj != this.offset()) {
  2537. throw new Error('FlatBuffers: struct must be serialized inline.');
  2538. }
  2539. };
  2540. /**
  2541. * Should not be creating any other object, string or vector
  2542. * while an object is being constructed
  2543. */
  2544. Builder.prototype.notNested = function () {
  2545. if (this.isNested) {
  2546. throw new Error('FlatBuffers: object serialization must not be nested.');
  2547. }
  2548. };
  2549. /**
  2550. * Set the current vtable at `voffset` to the current location in the buffer.
  2551. */
  2552. Builder.prototype.slot = function (voffset) {
  2553. if (this.vtable !== null) this.vtable[voffset] = this.offset();
  2554. };
  2555. /**
  2556. * @returns Offset relative to the end of the buffer.
  2557. */
  2558. Builder.prototype.offset = function () {
  2559. return this.bb.capacity() - this.space;
  2560. };
  2561. /**
  2562. * Doubles the size of the backing ByteBuffer and copies the old data towards
  2563. * the end of the new buffer (since we build the buffer backwards).
  2564. *
  2565. * @param bb The current buffer with the existing data
  2566. * @returns A new byte buffer with the old data copied
  2567. * to it. The data is located at the end of the buffer.
  2568. *
  2569. * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass
  2570. * it a uint8Array we need to suppress the type check:
  2571. * @suppress {checkTypes}
  2572. */
  2573. Builder.growByteBuffer = function (bb) {
  2574. var old_buf_size = bb.capacity();
  2575. // Ensure we don't grow beyond what fits in an int.
  2576. if (old_buf_size & 0xC0000000) {
  2577. throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');
  2578. }
  2579. var new_buf_size = old_buf_size << 1;
  2580. var nbb = byte_buffer_js_1.ByteBuffer.allocate(new_buf_size);
  2581. nbb.setPosition(new_buf_size - old_buf_size);
  2582. nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);
  2583. return nbb;
  2584. };
  2585. /**
  2586. * Adds on offset, relative to where it will be written.
  2587. *
  2588. * @param offset The offset to add.
  2589. */
  2590. Builder.prototype.addOffset = function (offset) {
  2591. this.prep(constants_js_1.SIZEOF_INT, 0); // Ensure alignment is already done.
  2592. this.writeInt32(this.offset() - offset + constants_js_1.SIZEOF_INT);
  2593. };
  2594. /**
  2595. * Start encoding a new object in the buffer. Users will not usually need to
  2596. * call this directly. The FlatBuffers compiler will generate helper methods
  2597. * that call this method internally.
  2598. */
  2599. Builder.prototype.startObject = function (numfields) {
  2600. this.notNested();
  2601. if (this.vtable == null) {
  2602. this.vtable = [];
  2603. }
  2604. this.vtable_in_use = numfields;
  2605. for (var i = 0; i < numfields; i++) {
  2606. this.vtable[i] = 0; // This will push additional elements as needed
  2607. }
  2608. this.isNested = true;
  2609. this.object_start = this.offset();
  2610. };
  2611. /**
  2612. * Finish off writing the object that is under construction.
  2613. *
  2614. * @returns The offset to the object inside `dataBuffer`
  2615. */
  2616. Builder.prototype.endObject = function () {
  2617. if (this.vtable == null || !this.isNested) {
  2618. throw new Error('FlatBuffers: endObject called without startObject');
  2619. }
  2620. this.addInt32(0);
  2621. var vtableloc = this.offset();
  2622. // Trim trailing zeroes.
  2623. var i = this.vtable_in_use - 1;
  2624. // eslint-disable-next-line no-empty
  2625. for (; i >= 0 && this.vtable[i] == 0; i--) {}
  2626. var trimmed_size = i + 1;
  2627. // Write out the current vtable.
  2628. for (; i >= 0; i--) {
  2629. // Offset relative to the start of the table.
  2630. this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);
  2631. }
  2632. var standard_fields = 2; // The fields below:
  2633. this.addInt16(vtableloc - this.object_start);
  2634. var len = (trimmed_size + standard_fields) * constants_js_1.SIZEOF_SHORT;
  2635. this.addInt16(len);
  2636. // Search for an existing vtable that matches the current one.
  2637. var existing_vtable = 0;
  2638. var vt1 = this.space;
  2639. outer_loop: for (i = 0; i < this.vtables.length; i++) {
  2640. var vt2 = this.bb.capacity() - this.vtables[i];
  2641. if (len == this.bb.readInt16(vt2)) {
  2642. for (var j = constants_js_1.SIZEOF_SHORT; j < len; j += constants_js_1.SIZEOF_SHORT) {
  2643. if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {
  2644. continue outer_loop;
  2645. }
  2646. }
  2647. existing_vtable = this.vtables[i];
  2648. break;
  2649. }
  2650. }
  2651. if (existing_vtable) {
  2652. // Found a match:
  2653. // Remove the current vtable.
  2654. this.space = this.bb.capacity() - vtableloc;
  2655. // Point table to existing vtable.
  2656. this.bb.writeInt32(this.space, existing_vtable - vtableloc);
  2657. } else {
  2658. // No match:
  2659. // Add the location of the current vtable to the list of vtables.
  2660. this.vtables.push(this.offset());
  2661. // Point table to current vtable.
  2662. this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);
  2663. }
  2664. this.isNested = false;
  2665. return vtableloc;
  2666. };
  2667. /**
  2668. * Finalize a buffer, poiting to the given `root_table`.
  2669. */
  2670. Builder.prototype.finish = function (root_table, opt_file_identifier, opt_size_prefix) {
  2671. var size_prefix = opt_size_prefix ? constants_js_1.SIZE_PREFIX_LENGTH : 0;
  2672. if (opt_file_identifier) {
  2673. var file_identifier = opt_file_identifier;
  2674. this.prep(this.minalign, constants_js_1.SIZEOF_INT + constants_js_1.FILE_IDENTIFIER_LENGTH + size_prefix);
  2675. if (file_identifier.length != constants_js_1.FILE_IDENTIFIER_LENGTH) {
  2676. throw new Error('FlatBuffers: file identifier must be length ' + constants_js_1.FILE_IDENTIFIER_LENGTH);
  2677. }
  2678. for (var i = constants_js_1.FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) {
  2679. this.writeInt8(file_identifier.charCodeAt(i));
  2680. }
  2681. }
  2682. this.prep(this.minalign, constants_js_1.SIZEOF_INT + size_prefix);
  2683. this.addOffset(root_table);
  2684. if (size_prefix) {
  2685. this.addInt32(this.bb.capacity() - this.space);
  2686. }
  2687. this.bb.setPosition(this.space);
  2688. };
  2689. /**
  2690. * Finalize a size prefixed buffer, pointing to the given `root_table`.
  2691. */
  2692. Builder.prototype.finishSizePrefixed = function (root_table, opt_file_identifier) {
  2693. this.finish(root_table, opt_file_identifier, true);
  2694. };
  2695. /**
  2696. * This checks a required field has been set in a given table that has
  2697. * just been constructed.
  2698. */
  2699. Builder.prototype.requiredField = function (table, field) {
  2700. var table_start = this.bb.capacity() - table;
  2701. var vtable_start = table_start - this.bb.readInt32(table_start);
  2702. var ok = this.bb.readInt16(vtable_start + field) != 0;
  2703. // If this fails, the caller will show what field needs to be set.
  2704. if (!ok) {
  2705. throw new Error('FlatBuffers: field ' + field + ' must be set');
  2706. }
  2707. };
  2708. /**
  2709. * Start a new array/vector of objects. Users usually will not call
  2710. * this directly. The FlatBuffers compiler will create a start/end
  2711. * method for vector types in generated code.
  2712. *
  2713. * @param elem_size The size of each element in the array
  2714. * @param num_elems The number of elements in the array
  2715. * @param alignment The alignment of the array
  2716. */
  2717. Builder.prototype.startVector = function (elem_size, num_elems, alignment) {
  2718. this.notNested();
  2719. this.vector_num_elems = num_elems;
  2720. this.prep(constants_js_1.SIZEOF_INT, elem_size * num_elems);
  2721. this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.
  2722. };
  2723. /**
  2724. * Finish off the creation of an array and all its elements. The array must be
  2725. * created with `startVector`.
  2726. *
  2727. * @returns The offset at which the newly created array
  2728. * starts.
  2729. */
  2730. Builder.prototype.endVector = function () {
  2731. this.writeInt32(this.vector_num_elems);
  2732. return this.offset();
  2733. };
  2734. /**
  2735. * Encode the string `s` in the buffer using UTF-8. If the string passed has
  2736. * already been seen, we return the offset of the already written string
  2737. *
  2738. * @param s The string to encode
  2739. * @return The offset in the buffer where the encoded string starts
  2740. */
  2741. Builder.prototype.createSharedString = function (s) {
  2742. if (!s) {
  2743. return 0;
  2744. }
  2745. if (!this.string_maps) {
  2746. this.string_maps = new Map();
  2747. }
  2748. if (this.string_maps.has(s)) {
  2749. return this.string_maps.get(s);
  2750. }
  2751. var offset = this.createString(s);
  2752. this.string_maps.set(s, offset);
  2753. return offset;
  2754. };
  2755. /**
  2756. * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed
  2757. * instead of a string, it is assumed to contain valid UTF-8 encoded data.
  2758. *
  2759. * @param s The string to encode
  2760. * @return The offset in the buffer where the encoded string starts
  2761. */
  2762. Builder.prototype.createString = function (s) {
  2763. if (s === null || s === undefined) {
  2764. return 0;
  2765. }
  2766. var utf8;
  2767. if (s instanceof Uint8Array) {
  2768. utf8 = s;
  2769. } else {
  2770. utf8 = [];
  2771. var i = 0;
  2772. while (i < s.length) {
  2773. var codePoint = void 0;
  2774. // Decode UTF-16
  2775. var a = s.charCodeAt(i++);
  2776. if (a < 0xD800 || a >= 0xDC00) {
  2777. codePoint = a;
  2778. } else {
  2779. var b = s.charCodeAt(i++);
  2780. codePoint = (a << 10) + b + (0x10000 - (0xD800 << 10) - 0xDC00);
  2781. }
  2782. // Encode UTF-8
  2783. if (codePoint < 0x80) {
  2784. utf8.push(codePoint);
  2785. } else {
  2786. if (codePoint < 0x800) {
  2787. utf8.push(codePoint >> 6 & 0x1F | 0xC0);
  2788. } else {
  2789. if (codePoint < 0x10000) {
  2790. utf8.push(codePoint >> 12 & 0x0F | 0xE0);
  2791. } else {
  2792. utf8.push(codePoint >> 18 & 0x07 | 0xF0, codePoint >> 12 & 0x3F | 0x80);
  2793. }
  2794. utf8.push(codePoint >> 6 & 0x3F | 0x80);
  2795. }
  2796. utf8.push(codePoint & 0x3F | 0x80);
  2797. }
  2798. }
  2799. }
  2800. this.addInt8(0);
  2801. this.startVector(1, utf8.length, 1);
  2802. this.bb.setPosition(this.space -= utf8.length);
  2803. for (var i = 0, offset = this.space, bytes = this.bb.bytes(); i < utf8.length; i++) {
  2804. bytes[offset++] = utf8[i];
  2805. }
  2806. return this.endVector();
  2807. };
  2808. /**
  2809. * A helper function to pack an object
  2810. *
  2811. * @returns offset of obj
  2812. */
  2813. Builder.prototype.createObjectOffset = function (obj) {
  2814. if (obj === null) {
  2815. return 0;
  2816. }
  2817. if (typeof obj === 'string') {
  2818. return this.createString(obj);
  2819. } else {
  2820. return obj.pack(this);
  2821. }
  2822. };
  2823. /**
  2824. * A helper function to pack a list of object
  2825. *
  2826. * @returns list of offsets of each non null object
  2827. */
  2828. Builder.prototype.createObjectOffsetList = function (list) {
  2829. var ret = [];
  2830. for (var i = 0; i < list.length; ++i) {
  2831. var val = list[i];
  2832. if (val !== null) {
  2833. ret.push(this.createObjectOffset(val));
  2834. } else {
  2835. throw new Error('FlatBuffers: Argument for createObjectOffsetList cannot contain null.');
  2836. }
  2837. }
  2838. return ret;
  2839. };
  2840. Builder.prototype.createStructOffsetList = function (list, startFunc) {
  2841. startFunc(this, list.length);
  2842. this.createObjectOffsetList(list);
  2843. return this.endVector();
  2844. };
  2845. return Builder;
  2846. }();
  2847. exports.Builder = Builder;
  2848. /***/ }),
  2849. /***/ 1603:
  2850. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  2851. "use strict";
  2852. Object.defineProperty(exports, "__esModule", ({
  2853. value: true
  2854. }));
  2855. exports.ByteBuffer = void 0;
  2856. var constants_js_1 = __webpack_require__(1083);
  2857. var utils_js_1 = __webpack_require__(8700);
  2858. var encoding_js_1 = __webpack_require__(1958);
  2859. var ByteBuffer = /** @class */function () {
  2860. /**
  2861. * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)
  2862. */
  2863. function ByteBuffer(bytes_) {
  2864. this.bytes_ = bytes_;
  2865. this.position_ = 0;
  2866. }
  2867. /**
  2868. * Create and allocate a new ByteBuffer with a given size.
  2869. */
  2870. ByteBuffer.allocate = function (byte_size) {
  2871. return new ByteBuffer(new Uint8Array(byte_size));
  2872. };
  2873. ByteBuffer.prototype.clear = function () {
  2874. this.position_ = 0;
  2875. };
  2876. /**
  2877. * Get the underlying `Uint8Array`.
  2878. */
  2879. ByteBuffer.prototype.bytes = function () {
  2880. return this.bytes_;
  2881. };
  2882. /**
  2883. * Get the buffer's position.
  2884. */
  2885. ByteBuffer.prototype.position = function () {
  2886. return this.position_;
  2887. };
  2888. /**
  2889. * Set the buffer's position.
  2890. */
  2891. ByteBuffer.prototype.setPosition = function (position) {
  2892. this.position_ = position;
  2893. };
  2894. /**
  2895. * Get the buffer's capacity.
  2896. */
  2897. ByteBuffer.prototype.capacity = function () {
  2898. return this.bytes_.length;
  2899. };
  2900. ByteBuffer.prototype.readInt8 = function (offset) {
  2901. return this.readUint8(offset) << 24 >> 24;
  2902. };
  2903. ByteBuffer.prototype.readUint8 = function (offset) {
  2904. return this.bytes_[offset];
  2905. };
  2906. ByteBuffer.prototype.readInt16 = function (offset) {
  2907. return this.readUint16(offset) << 16 >> 16;
  2908. };
  2909. ByteBuffer.prototype.readUint16 = function (offset) {
  2910. return this.bytes_[offset] | this.bytes_[offset + 1] << 8;
  2911. };
  2912. ByteBuffer.prototype.readInt32 = function (offset) {
  2913. return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;
  2914. };
  2915. ByteBuffer.prototype.readUint32 = function (offset) {
  2916. return this.readInt32(offset) >>> 0;
  2917. };
  2918. ByteBuffer.prototype.readInt64 = function (offset) {
  2919. return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
  2920. };
  2921. ByteBuffer.prototype.readUint64 = function (offset) {
  2922. return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));
  2923. };
  2924. ByteBuffer.prototype.readFloat32 = function (offset) {
  2925. utils_js_1.int32[0] = this.readInt32(offset);
  2926. return utils_js_1.float32[0];
  2927. };
  2928. ByteBuffer.prototype.readFloat64 = function (offset) {
  2929. utils_js_1.int32[utils_js_1.isLittleEndian ? 0 : 1] = this.readInt32(offset);
  2930. utils_js_1.int32[utils_js_1.isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);
  2931. return utils_js_1.float64[0];
  2932. };
  2933. ByteBuffer.prototype.writeInt8 = function (offset, value) {
  2934. this.bytes_[offset] = value;
  2935. };
  2936. ByteBuffer.prototype.writeUint8 = function (offset, value) {
  2937. this.bytes_[offset] = value;
  2938. };
  2939. ByteBuffer.prototype.writeInt16 = function (offset, value) {
  2940. this.bytes_[offset] = value;
  2941. this.bytes_[offset + 1] = value >> 8;
  2942. };
  2943. ByteBuffer.prototype.writeUint16 = function (offset, value) {
  2944. this.bytes_[offset] = value;
  2945. this.bytes_[offset + 1] = value >> 8;
  2946. };
  2947. ByteBuffer.prototype.writeInt32 = function (offset, value) {
  2948. this.bytes_[offset] = value;
  2949. this.bytes_[offset + 1] = value >> 8;
  2950. this.bytes_[offset + 2] = value >> 16;
  2951. this.bytes_[offset + 3] = value >> 24;
  2952. };
  2953. ByteBuffer.prototype.writeUint32 = function (offset, value) {
  2954. this.bytes_[offset] = value;
  2955. this.bytes_[offset + 1] = value >> 8;
  2956. this.bytes_[offset + 2] = value >> 16;
  2957. this.bytes_[offset + 3] = value >> 24;
  2958. };
  2959. ByteBuffer.prototype.writeInt64 = function (offset, value) {
  2960. this.writeInt32(offset, Number(BigInt.asIntN(32, value)));
  2961. this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));
  2962. };
  2963. ByteBuffer.prototype.writeUint64 = function (offset, value) {
  2964. this.writeUint32(offset, Number(BigInt.asUintN(32, value)));
  2965. this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));
  2966. };
  2967. ByteBuffer.prototype.writeFloat32 = function (offset, value) {
  2968. utils_js_1.float32[0] = value;
  2969. this.writeInt32(offset, utils_js_1.int32[0]);
  2970. };
  2971. ByteBuffer.prototype.writeFloat64 = function (offset, value) {
  2972. utils_js_1.float64[0] = value;
  2973. this.writeInt32(offset, utils_js_1.int32[utils_js_1.isLittleEndian ? 0 : 1]);
  2974. this.writeInt32(offset + 4, utils_js_1.int32[utils_js_1.isLittleEndian ? 1 : 0]);
  2975. };
  2976. /**
  2977. * Return the file identifier. Behavior is undefined for FlatBuffers whose
  2978. * schema does not include a file_identifier (likely points at padding or the
  2979. * start of a the root vtable).
  2980. */
  2981. ByteBuffer.prototype.getBufferIdentifier = function () {
  2982. if (this.bytes_.length < this.position_ + constants_js_1.SIZEOF_INT + constants_js_1.FILE_IDENTIFIER_LENGTH) {
  2983. throw new Error('FlatBuffers: ByteBuffer is too short to contain an identifier.');
  2984. }
  2985. var result = "";
  2986. for (var i = 0; i < constants_js_1.FILE_IDENTIFIER_LENGTH; i++) {
  2987. result += String.fromCharCode(this.readInt8(this.position_ + constants_js_1.SIZEOF_INT + i));
  2988. }
  2989. return result;
  2990. };
  2991. /**
  2992. * Look up a field in the vtable, return an offset into the object, or 0 if the
  2993. * field is not present.
  2994. */
  2995. ByteBuffer.prototype.__offset = function (bb_pos, vtable_offset) {
  2996. var vtable = bb_pos - this.readInt32(bb_pos);
  2997. return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;
  2998. };
  2999. /**
  3000. * Initialize any Table-derived type to point to the union at the given offset.
  3001. */
  3002. ByteBuffer.prototype.__union = function (t, offset) {
  3003. t.bb_pos = offset + this.readInt32(offset);
  3004. t.bb = this;
  3005. return t;
  3006. };
  3007. /**
  3008. * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.
  3009. * This allocates a new string and converts to wide chars upon each access.
  3010. *
  3011. * To avoid the conversion to UTF-16, pass Encoding.UTF8_BYTES as
  3012. * the "optionalEncoding" argument. This is useful for avoiding conversion to
  3013. * and from UTF-16 when the data will just be packaged back up in another
  3014. * FlatBuffer later on.
  3015. *
  3016. * @param offset
  3017. * @param opt_encoding Defaults to UTF16_STRING
  3018. */
  3019. ByteBuffer.prototype.__string = function (offset, opt_encoding) {
  3020. offset += this.readInt32(offset);
  3021. var length = this.readInt32(offset);
  3022. var result = '';
  3023. var i = 0;
  3024. offset += constants_js_1.SIZEOF_INT;
  3025. if (opt_encoding === encoding_js_1.Encoding.UTF8_BYTES) {
  3026. return this.bytes_.subarray(offset, offset + length);
  3027. }
  3028. while (i < length) {
  3029. var codePoint = void 0;
  3030. // Decode UTF-8
  3031. var a = this.readUint8(offset + i++);
  3032. if (a < 0xC0) {
  3033. codePoint = a;
  3034. } else {
  3035. var b = this.readUint8(offset + i++);
  3036. if (a < 0xE0) {
  3037. codePoint = (a & 0x1F) << 6 | b & 0x3F;
  3038. } else {
  3039. var c = this.readUint8(offset + i++);
  3040. if (a < 0xF0) {
  3041. codePoint = (a & 0x0F) << 12 | (b & 0x3F) << 6 | c & 0x3F;
  3042. } else {
  3043. var d = this.readUint8(offset + i++);
  3044. codePoint = (a & 0x07) << 18 | (b & 0x3F) << 12 | (c & 0x3F) << 6 | d & 0x3F;
  3045. }
  3046. }
  3047. }
  3048. // Encode UTF-16
  3049. if (codePoint < 0x10000) {
  3050. result += String.fromCharCode(codePoint);
  3051. } else {
  3052. codePoint -= 0x10000;
  3053. result += String.fromCharCode((codePoint >> 10) + 0xD800, (codePoint & (1 << 10) - 1) + 0xDC00);
  3054. }
  3055. }
  3056. return result;
  3057. };
  3058. /**
  3059. * Handle unions that can contain string as its member, if a Table-derived type then initialize it,
  3060. * if a string then return a new one
  3061. *
  3062. * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this
  3063. * makes the behaviour of __union_with_string different compared to __union
  3064. */
  3065. ByteBuffer.prototype.__union_with_string = function (o, offset) {
  3066. if (typeof o === 'string') {
  3067. return this.__string(offset);
  3068. }
  3069. return this.__union(o, offset);
  3070. };
  3071. /**
  3072. * Retrieve the relative offset stored at "offset"
  3073. */
  3074. ByteBuffer.prototype.__indirect = function (offset) {
  3075. return offset + this.readInt32(offset);
  3076. };
  3077. /**
  3078. * Get the start of data of a vector whose offset is stored at "offset" in this object.
  3079. */
  3080. ByteBuffer.prototype.__vector = function (offset) {
  3081. return offset + this.readInt32(offset) + constants_js_1.SIZEOF_INT; // data starts after the length
  3082. };
  3083. /**
  3084. * Get the length of a vector whose offset is stored at "offset" in this object.
  3085. */
  3086. ByteBuffer.prototype.__vector_len = function (offset) {
  3087. return this.readInt32(offset + this.readInt32(offset));
  3088. };
  3089. ByteBuffer.prototype.__has_identifier = function (ident) {
  3090. if (ident.length != constants_js_1.FILE_IDENTIFIER_LENGTH) {
  3091. throw new Error('FlatBuffers: file identifier must be length ' + constants_js_1.FILE_IDENTIFIER_LENGTH);
  3092. }
  3093. for (var i = 0; i < constants_js_1.FILE_IDENTIFIER_LENGTH; i++) {
  3094. if (ident.charCodeAt(i) != this.readInt8(this.position() + constants_js_1.SIZEOF_INT + i)) {
  3095. return false;
  3096. }
  3097. }
  3098. return true;
  3099. };
  3100. /**
  3101. * A helper function for generating list for obj api
  3102. */
  3103. ByteBuffer.prototype.createScalarList = function (listAccessor, listLength) {
  3104. var ret = [];
  3105. for (var i = 0; i < listLength; ++i) {
  3106. if (listAccessor(i) !== null) {
  3107. ret.push(listAccessor(i));
  3108. }
  3109. }
  3110. return ret;
  3111. };
  3112. /**
  3113. * A helper function for generating list for obj api
  3114. * @param listAccessor function that accepts an index and return data at that index
  3115. * @param listLength listLength
  3116. * @param res result list
  3117. */
  3118. ByteBuffer.prototype.createObjList = function (listAccessor, listLength) {
  3119. var ret = [];
  3120. for (var i = 0; i < listLength; ++i) {
  3121. var val = listAccessor(i);
  3122. if (val !== null) {
  3123. ret.push(val.unpack());
  3124. }
  3125. }
  3126. return ret;
  3127. };
  3128. return ByteBuffer;
  3129. }();
  3130. exports.ByteBuffer = ByteBuffer;
  3131. /***/ }),
  3132. /***/ 1083:
  3133. /***/ (function(__unused_webpack_module, exports) {
  3134. "use strict";
  3135. Object.defineProperty(exports, "__esModule", ({
  3136. value: true
  3137. }));
  3138. exports.SIZE_PREFIX_LENGTH = exports.FILE_IDENTIFIER_LENGTH = exports.SIZEOF_INT = exports.SIZEOF_SHORT = void 0;
  3139. exports.SIZEOF_SHORT = 2;
  3140. exports.SIZEOF_INT = 4;
  3141. exports.FILE_IDENTIFIER_LENGTH = 4;
  3142. exports.SIZE_PREFIX_LENGTH = 4;
  3143. /***/ }),
  3144. /***/ 1958:
  3145. /***/ (function(__unused_webpack_module, exports) {
  3146. "use strict";
  3147. Object.defineProperty(exports, "__esModule", ({
  3148. value: true
  3149. }));
  3150. exports.Encoding = void 0;
  3151. var Encoding;
  3152. (function (Encoding) {
  3153. Encoding[Encoding["UTF8_BYTES"] = 1] = "UTF8_BYTES";
  3154. Encoding[Encoding["UTF16_STRING"] = 2] = "UTF16_STRING";
  3155. })(Encoding = exports.Encoding || (exports.Encoding = {}));
  3156. /***/ }),
  3157. /***/ 1095:
  3158. /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
  3159. "use strict";
  3160. var __webpack_unused_export__;
  3161. __webpack_unused_export__ = ({
  3162. value: true
  3163. });
  3164. 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;
  3165. var constants_js_1 = __webpack_require__(1083);
  3166. __webpack_unused_export__ = ({
  3167. enumerable: true,
  3168. get: function get() {
  3169. return constants_js_1.SIZEOF_SHORT;
  3170. }
  3171. });
  3172. var constants_js_2 = __webpack_require__(1083);
  3173. __webpack_unused_export__ = ({
  3174. enumerable: true,
  3175. get: function get() {
  3176. return constants_js_2.SIZEOF_INT;
  3177. }
  3178. });
  3179. var constants_js_3 = __webpack_require__(1083);
  3180. __webpack_unused_export__ = ({
  3181. enumerable: true,
  3182. get: function get() {
  3183. return constants_js_3.FILE_IDENTIFIER_LENGTH;
  3184. }
  3185. });
  3186. var constants_js_4 = __webpack_require__(1083);
  3187. Object.defineProperty(exports, "XU", ({
  3188. enumerable: true,
  3189. get: function get() {
  3190. return constants_js_4.SIZE_PREFIX_LENGTH;
  3191. }
  3192. }));
  3193. var utils_js_1 = __webpack_require__(8700);
  3194. __webpack_unused_export__ = ({
  3195. enumerable: true,
  3196. get: function get() {
  3197. return utils_js_1.int32;
  3198. }
  3199. });
  3200. __webpack_unused_export__ = ({
  3201. enumerable: true,
  3202. get: function get() {
  3203. return utils_js_1.float32;
  3204. }
  3205. });
  3206. __webpack_unused_export__ = ({
  3207. enumerable: true,
  3208. get: function get() {
  3209. return utils_js_1.float64;
  3210. }
  3211. });
  3212. __webpack_unused_export__ = ({
  3213. enumerable: true,
  3214. get: function get() {
  3215. return utils_js_1.isLittleEndian;
  3216. }
  3217. });
  3218. var encoding_js_1 = __webpack_require__(1958);
  3219. __webpack_unused_export__ = ({
  3220. enumerable: true,
  3221. get: function get() {
  3222. return encoding_js_1.Encoding;
  3223. }
  3224. });
  3225. var builder_js_1 = __webpack_require__(4634);
  3226. __webpack_unused_export__ = ({
  3227. enumerable: true,
  3228. get: function get() {
  3229. return builder_js_1.Builder;
  3230. }
  3231. });
  3232. var byte_buffer_js_1 = __webpack_require__(1603);
  3233. Object.defineProperty(exports, "cZ", ({
  3234. enumerable: true,
  3235. get: function get() {
  3236. return byte_buffer_js_1.ByteBuffer;
  3237. }
  3238. }));
  3239. /***/ }),
  3240. /***/ 8700:
  3241. /***/ (function(__unused_webpack_module, exports) {
  3242. "use strict";
  3243. Object.defineProperty(exports, "__esModule", ({
  3244. value: true
  3245. }));
  3246. exports.isLittleEndian = exports.float64 = exports.float32 = exports.int32 = void 0;
  3247. exports.int32 = new Int32Array(2);
  3248. exports.float32 = new Float32Array(exports.int32.buffer);
  3249. exports.float64 = new Float64Array(exports.int32.buffer);
  3250. exports.isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
  3251. /***/ }),
  3252. /***/ 5299:
  3253. /***/ (function(__unused_webpack_module, exports) {
  3254. /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  3255. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  3256. var e, m;
  3257. var eLen = nBytes * 8 - mLen - 1;
  3258. var eMax = (1 << eLen) - 1;
  3259. var eBias = eMax >> 1;
  3260. var nBits = -7;
  3261. var i = isLE ? nBytes - 1 : 0;
  3262. var d = isLE ? -1 : 1;
  3263. var s = buffer[offset + i];
  3264. i += d;
  3265. e = s & (1 << -nBits) - 1;
  3266. s >>= -nBits;
  3267. nBits += eLen;
  3268. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  3269. m = e & (1 << -nBits) - 1;
  3270. e >>= -nBits;
  3271. nBits += mLen;
  3272. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  3273. if (e === 0) {
  3274. e = 1 - eBias;
  3275. } else if (e === eMax) {
  3276. return m ? NaN : (s ? -1 : 1) * Infinity;
  3277. } else {
  3278. m = m + Math.pow(2, mLen);
  3279. e = e - eBias;
  3280. }
  3281. return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  3282. };
  3283. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  3284. var e, m, c;
  3285. var eLen = nBytes * 8 - mLen - 1;
  3286. var eMax = (1 << eLen) - 1;
  3287. var eBias = eMax >> 1;
  3288. var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
  3289. var i = isLE ? 0 : nBytes - 1;
  3290. var d = isLE ? 1 : -1;
  3291. var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  3292. value = Math.abs(value);
  3293. if (isNaN(value) || value === Infinity) {
  3294. m = isNaN(value) ? 1 : 0;
  3295. e = eMax;
  3296. } else {
  3297. e = Math.floor(Math.log(value) / Math.LN2);
  3298. if (value * (c = Math.pow(2, -e)) < 1) {
  3299. e--;
  3300. c *= 2;
  3301. }
  3302. if (e + eBias >= 1) {
  3303. value += rt / c;
  3304. } else {
  3305. value += rt * Math.pow(2, 1 - eBias);
  3306. }
  3307. if (value * c >= 2) {
  3308. e++;
  3309. c /= 2;
  3310. }
  3311. if (e + eBias >= eMax) {
  3312. m = 0;
  3313. e = eMax;
  3314. } else if (e + eBias >= 1) {
  3315. m = (value * c - 1) * Math.pow(2, mLen);
  3316. e = e + eBias;
  3317. } else {
  3318. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
  3319. e = 0;
  3320. }
  3321. }
  3322. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  3323. e = e << mLen | m;
  3324. eLen += mLen;
  3325. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  3326. buffer[offset + i - d] |= s * 128;
  3327. };
  3328. /***/ }),
  3329. /***/ 8813:
  3330. /***/ (function(module) {
  3331. var containers = []; // will store container HTMLElement references
  3332. var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
  3333. var usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';
  3334. function insertCss(css, options) {
  3335. options = options || {};
  3336. if (css === undefined) {
  3337. throw new Error(usage);
  3338. }
  3339. var position = options.prepend === true ? 'prepend' : 'append';
  3340. var container = options.container !== undefined ? options.container : document.querySelector('head');
  3341. var containerId = containers.indexOf(container);
  3342. // first time we see this container, create the necessary entries
  3343. if (containerId === -1) {
  3344. containerId = containers.push(container) - 1;
  3345. styleElements[containerId] = {};
  3346. }
  3347. // try to get the correponding container + position styleElement, create it otherwise
  3348. var styleElement;
  3349. if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {
  3350. styleElement = styleElements[containerId][position];
  3351. } else {
  3352. styleElement = styleElements[containerId][position] = createStyleElement();
  3353. if (position === 'prepend') {
  3354. container.insertBefore(styleElement, container.childNodes[0]);
  3355. } else {
  3356. container.appendChild(styleElement);
  3357. }
  3358. }
  3359. // strip potential UTF-8 BOM if css was read from a file
  3360. if (css.charCodeAt(0) === 0xFEFF) {
  3361. css = css.substr(1, css.length);
  3362. }
  3363. // actually add the stylesheet
  3364. if (styleElement.styleSheet) {
  3365. styleElement.styleSheet.cssText += css;
  3366. } else {
  3367. styleElement.textContent += css;
  3368. }
  3369. return styleElement;
  3370. }
  3371. ;
  3372. function createStyleElement() {
  3373. var styleElement = document.createElement('style');
  3374. styleElement.setAttribute('type', 'text/css');
  3375. return styleElement;
  3376. }
  3377. module.exports = insertCss;
  3378. module.exports.insertCss = insertCss;
  3379. /***/ }),
  3380. /***/ 6879:
  3381. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  3382. 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); }
  3383. var utils = __webpack_require__(7099);
  3384. var AND = '&&',
  3385. OR = '||',
  3386. AND_STR = 'and',
  3387. OR_STR = 'or',
  3388. NOT = '!',
  3389. EQUAL = '=',
  3390. LIKE = '~',
  3391. NOTEQUAL = NOT + EQUAL,
  3392. NOTLIKE = NOT + LIKE,
  3393. GT = '>',
  3394. GE = '>=',
  3395. LT = '<',
  3396. LE = '<=',
  3397. WILDCARD = '*',
  3398. COMMA = ',',
  3399. DELIMITER = '.',
  3400. LEFT = '(',
  3401. RIGHT = ')',
  3402. WHERE = 'where',
  3403. synopsis = {
  3404. pathway: [],
  3405. groups: {}
  3406. },
  3407. AST = {},
  3408. options = {};
  3409. var print = console.log;
  3410. // ------------------ splitter -------------------- //
  3411. function Tokenize(query) {
  3412. var parts = __splitTrim(query, WHERE);
  3413. var pathway = parts[0];
  3414. var where = parts[1];
  3415. synopsis.pathway = __splitTrim(pathway, COMMA);
  3416. for (var i = 0, len = synopsis.pathway.length; i < len; i++) {
  3417. synopsis.pathway[i] = __splitTrim(synopsis.pathway[i], DELIMITER);
  3418. if (synopsis.pathway[i][0] == WILDCARD) synopsis.pathway[i].shift();
  3419. if (synopsis.pathway[i].length === 0) synopsis.pathway.splice(i, 1);
  3420. }
  3421. var lastLeft = -1,
  3422. lastRight = -1,
  3423. current = 0;
  3424. while (current < where.length) {
  3425. if (where[current] === LEFT) {
  3426. lastLeft = current;
  3427. } else if (where[current] === RIGHT) {
  3428. lastRight = current;
  3429. if (lastRight > lastLeft && lastLeft !== -1) {
  3430. var k = 'gr' + '_' + new Date().getTime();
  3431. synopsis.groups[k] = where.substring(lastLeft + 1, lastRight);
  3432. where = where.replace(LEFT + synopsis.groups[k] + RIGHT, k);
  3433. current = -1;
  3434. }
  3435. }
  3436. current += 1;
  3437. }
  3438. LogicalGrouping(AST, where);
  3439. }
  3440. function LogicalGrouping(current, where) {
  3441. var lastAnd = __findIndex(where, AND),
  3442. lastOr = __findIndex(where, OR);
  3443. if (lastAnd !== Number.MAX_VALUE || lastOr !== Number.MAX_VALUE) {
  3444. if (lastAnd < lastOr) {
  3445. current.and = current.and || [];
  3446. var parts = __splitTrim(where, AND);
  3447. current.and.push(parts[0]);
  3448. LogicalGrouping(current.and, parts[1]);
  3449. } else {
  3450. current.or = current.or || [];
  3451. var parts = __splitTrim(where, OR);
  3452. current.or.push(parts[0]);
  3453. LogicalGrouping(current.or, parts[1]);
  3454. }
  3455. } else {
  3456. if (synopsis.groups[where]) {
  3457. where = synopsis.groups[where];
  3458. LogicalGrouping(current, where);
  3459. } else {
  3460. if (Array.isArray(current)) current.push(where);else current.or = [where];
  3461. ExtractExpression(AST.or ? AST.or : AST.and);
  3462. }
  3463. }
  3464. }
  3465. function ExtractExpression(logicalGroup) {
  3466. for (var k in logicalGroup) {
  3467. if (logicalGroup.hasOwnProperty(k)) {
  3468. if (Array.isArray(logicalGroup[k])) {
  3469. ExtractExpression(logicalGroup[k]);
  3470. } else if (typeof logicalGroup[k] === 'string') {
  3471. if (__contains(logicalGroup[k], NOTEQUAL)) {
  3472. var parts = __splitTrim(logicalGroup[k], NOTEQUAL);
  3473. logicalGroup[k] = {
  3474. ne: [parts[0], parts[1]]
  3475. };
  3476. } else if (__contains(logicalGroup[k], NOTLIKE)) {
  3477. var parts = __splitTrim(logicalGroup[k], NOTLIKE);
  3478. logicalGroup[k] = {
  3479. nreq: [parts[0], parts[1]]
  3480. };
  3481. } else if (__contains(logicalGroup[k], LIKE)) {
  3482. var parts = __splitTrim(logicalGroup[k], LIKE);
  3483. logicalGroup[k] = {
  3484. // rough eq
  3485. req: [parts[0], parts[1]]
  3486. };
  3487. } else if (__contains(logicalGroup[k], GE)) {
  3488. var parts = __splitTrim(logicalGroup[k], GE);
  3489. logicalGroup[k] = {
  3490. // greater than or equal
  3491. ge: [parts[0], parts[1]]
  3492. };
  3493. } else if (__contains(logicalGroup[k], GT)) {
  3494. var parts = __splitTrim(logicalGroup[k], GT);
  3495. logicalGroup[k] = {
  3496. // greater than
  3497. gt: [parts[0], parts[1]]
  3498. };
  3499. } else if (__contains(logicalGroup[k], LE)) {
  3500. var parts = __splitTrim(logicalGroup[k], LE);
  3501. logicalGroup[k] = {
  3502. // less than or equal
  3503. le: [parts[0], parts[1]]
  3504. };
  3505. } else if (__contains(logicalGroup[k], LT)) {
  3506. var parts = __splitTrim(logicalGroup[k], LT);
  3507. logicalGroup[k] = {
  3508. // less than
  3509. lt: [parts[0], parts[1]]
  3510. };
  3511. } else if (__contains(logicalGroup[k], EQUAL)) {
  3512. var parts = __splitTrim(logicalGroup[k], EQUAL);
  3513. logicalGroup[k] = {
  3514. eq: [parts[0], parts[1]]
  3515. };
  3516. }
  3517. }
  3518. }
  3519. }
  3520. }
  3521. function __findIndex(str, token) {
  3522. var index = str.indexOf(token);
  3523. return index === -1 ? Number.MAX_VALUE : index;
  3524. }
  3525. function __splitTrim(str, token) {
  3526. return str.split(token).map(function (p) {
  3527. return p.trim();
  3528. });
  3529. }
  3530. function __contains(a, b) {
  3531. return a.indexOf(b) > -1;
  3532. }
  3533. function __hierarchize(obj, dottedPath) {
  3534. var parts = __splitTrim(dottedPath, DELIMITER);
  3535. var res = obj;
  3536. for (var p in parts) {
  3537. if (res.hasOwnProperty(parts[p])) res = res[parts[p]];else return '';
  3538. }
  3539. // support comparison for Date/DateString
  3540. if (utils.isDate(res)) res = res.valueOf();else if (utils.isDateString(res)) res = utils.parseDateFromString(res);else res = res.toString();
  3541. return res;
  3542. }
  3543. function FilterOR(ASTNode, row) {
  3544. var res = false;
  3545. for (var k in ASTNode) {
  3546. var filterFunc = k === AND_STR ? FilterAND : k === OR_STR ? FilterOR : Filter;
  3547. res = res || filterFunc(ASTNode[k], row);
  3548. if (options.trace) print(synopsis.step, '======((( or', ASTNode[k], res);
  3549. if (res) return res;
  3550. }
  3551. return res;
  3552. }
  3553. function FilterAND(ASTNode, row) {
  3554. var res = true;
  3555. for (var k in ASTNode) {
  3556. var filterFunc = k === AND_STR ? FilterAND : k === OR_STR ? FilterOR : Filter;
  3557. res = res && filterFunc(ASTNode[k], row);
  3558. if (options.trace) print(synopsis.step, '======((( and', ASTNode[k], res);
  3559. if (!res) return res;
  3560. }
  3561. return res;
  3562. }
  3563. function Filter(ASTNode, row) {
  3564. synopsis.step += 1;
  3565. if (ASTNode.or) {
  3566. var res = FilterOR(ASTNode.or, row);
  3567. if (options.trace) print(synopsis.step, 'OR', ASTNode, res);
  3568. return res;
  3569. } else if (ASTNode.and) {
  3570. var res = FilterAND(ASTNode.and, row);
  3571. if (options.trace) print(synopsis.step, 'AND', ASTNode, res);
  3572. return res;
  3573. } else if (_typeof(ASTNode) === 'object') {
  3574. if (ASTNode.eq) {
  3575. // =
  3576. return __hierarchize(row, ASTNode.eq[0]) === ASTNode.eq[1];
  3577. } else if (ASTNode.ne) {
  3578. // !=
  3579. return __hierarchize(row, ASTNode.ne[0]) !== ASTNode.ne[1];
  3580. } else if (ASTNode.req) {
  3581. // ~
  3582. return __contains(__hierarchize(row, ASTNode.req[0]), ASTNode.req[1]);
  3583. } else if (ASTNode.nreq) {
  3584. // ~
  3585. return !__contains(__hierarchize(row, ASTNode.nreq[0]), ASTNode.nreq[1]);
  3586. } else if (ASTNode.gt) {
  3587. // >
  3588. return __hierarchize(row, ASTNode.gt[0]) > ASTNode.gt[1];
  3589. } else if (ASTNode.ge) {
  3590. // >=
  3591. return __hierarchize(row, ASTNode.ge[0]) >= ASTNode.ge[1];
  3592. } else if (ASTNode.lt) {
  3593. // <
  3594. return __hierarchize(row, ASTNode.lt[0]) < ASTNode.lt[1];
  3595. } else if (ASTNode.le) {
  3596. // <=
  3597. return __hierarchize(row, ASTNode.le[0]) <= ASTNode.le[1];
  3598. } else {
  3599. return Filter(ASTNode, row);
  3600. }
  3601. }
  3602. }
  3603. function Parse(dataSource) {
  3604. var result = [];
  3605. for (var k in dataSource) if (Filter(AST, dataSource[k])) result.push(dataSource[k]);
  3606. return result;
  3607. }
  3608. function Fields(result) {
  3609. if (result && synopsis.pathway.length > 0) {
  3610. //print(synopsis.pathway);
  3611. return result.map(function (ele) {
  3612. var res = {};
  3613. for (var i = 0, len = synopsis.pathway.length; i < len; i++) {
  3614. var key = synopsis.pathway[i].join(DELIMITER);
  3615. res[key] = __hierarchize(ele, key);
  3616. }
  3617. return res;
  3618. });
  3619. }
  3620. return result;
  3621. }
  3622. function Query(dataSource, query, opts) {
  3623. synopsis = {
  3624. pathway: [],
  3625. groups: {},
  3626. step: 0
  3627. };
  3628. AST = {};
  3629. opts = opts || {
  3630. trace: false
  3631. };
  3632. options = opts;
  3633. Tokenize(query);
  3634. return Fields(Parse(dataSource));
  3635. }
  3636. if ( true && typeof module.exports != 'undefined') module.exports = Query;
  3637. if (typeof window != 'undefined') window.Query = Query;
  3638. /***/ }),
  3639. /***/ 7099:
  3640. /***/ (function(module) {
  3641. function getObjectType(obj) {
  3642. return Object.prototype.toString.call(obj);
  3643. }
  3644. function isDate(obj) {
  3645. return getObjectType(obj) === '[object Date]';
  3646. }
  3647. function isString(obj) {
  3648. return getObjectType(obj) === '[object String]';
  3649. }
  3650. function isDateString(obj) {
  3651. return isString(obj) && !isNaN(Date.parse(obj));
  3652. }
  3653. function isNumber(obj) {
  3654. return typeof obj === 'number';
  3655. }
  3656. function parseDateFromString(str) {
  3657. return Date.parse(str);
  3658. }
  3659. module.exports = {
  3660. getObjectType: getObjectType,
  3661. isDate: isDate,
  3662. isString: isString,
  3663. isDateString: isDateString,
  3664. parseDateFromString: parseDateFromString,
  3665. isNumber: isNumber
  3666. };
  3667. /***/ }),
  3668. /***/ 2138:
  3669. /***/ (function(module, exports, __webpack_require__) {
  3670. /* module decorator */ module = __webpack_require__.nmd(module);
  3671. 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); }
  3672. /**
  3673. * lodash (Custom Build) <https://lodash.com/>
  3674. * Build: `lodash modularize exports="npm" -o ./`
  3675. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  3676. * Released under MIT license <https://lodash.com/license>
  3677. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  3678. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  3679. */
  3680. /** Used as the size to enable large array optimizations. */
  3681. var LARGE_ARRAY_SIZE = 200;
  3682. /** Used to stand-in for `undefined` hash values. */
  3683. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  3684. /** Used as references for various `Number` constants. */
  3685. var MAX_SAFE_INTEGER = 9007199254740991;
  3686. /** `Object#toString` result references. */
  3687. var argsTag = '[object Arguments]',
  3688. arrayTag = '[object Array]',
  3689. boolTag = '[object Boolean]',
  3690. dateTag = '[object Date]',
  3691. errorTag = '[object Error]',
  3692. funcTag = '[object Function]',
  3693. genTag = '[object GeneratorFunction]',
  3694. mapTag = '[object Map]',
  3695. numberTag = '[object Number]',
  3696. objectTag = '[object Object]',
  3697. promiseTag = '[object Promise]',
  3698. regexpTag = '[object RegExp]',
  3699. setTag = '[object Set]',
  3700. stringTag = '[object String]',
  3701. symbolTag = '[object Symbol]',
  3702. weakMapTag = '[object WeakMap]';
  3703. var arrayBufferTag = '[object ArrayBuffer]',
  3704. dataViewTag = '[object DataView]',
  3705. float32Tag = '[object Float32Array]',
  3706. float64Tag = '[object Float64Array]',
  3707. int8Tag = '[object Int8Array]',
  3708. int16Tag = '[object Int16Array]',
  3709. int32Tag = '[object Int32Array]',
  3710. uint8Tag = '[object Uint8Array]',
  3711. uint8ClampedTag = '[object Uint8ClampedArray]',
  3712. uint16Tag = '[object Uint16Array]',
  3713. uint32Tag = '[object Uint32Array]';
  3714. /**
  3715. * Used to match `RegExp`
  3716. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  3717. */
  3718. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  3719. /** Used to match `RegExp` flags from their coerced string values. */
  3720. var reFlags = /\w*$/;
  3721. /** Used to detect host constructors (Safari). */
  3722. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  3723. /** Used to detect unsigned integer values. */
  3724. var reIsUint = /^(?:0|[1-9]\d*)$/;
  3725. /** Used to identify `toStringTag` values supported by `_.clone`. */
  3726. var cloneableTags = {};
  3727. 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;
  3728. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  3729. /** Detect free variable `global` from Node.js. */
  3730. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  3731. /** Detect free variable `self`. */
  3732. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  3733. /** Used as a reference to the global object. */
  3734. var root = freeGlobal || freeSelf || Function('return this')();
  3735. /** Detect free variable `exports`. */
  3736. var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  3737. /** Detect free variable `module`. */
  3738. var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
  3739. /** Detect the popular CommonJS extension `module.exports`. */
  3740. var moduleExports = freeModule && freeModule.exports === freeExports;
  3741. /**
  3742. * Adds the key-value `pair` to `map`.
  3743. *
  3744. * @private
  3745. * @param {Object} map The map to modify.
  3746. * @param {Array} pair The key-value pair to add.
  3747. * @returns {Object} Returns `map`.
  3748. */
  3749. function addMapEntry(map, pair) {
  3750. // Don't return `map.set` because it's not chainable in IE 11.
  3751. map.set(pair[0], pair[1]);
  3752. return map;
  3753. }
  3754. /**
  3755. * Adds `value` to `set`.
  3756. *
  3757. * @private
  3758. * @param {Object} set The set to modify.
  3759. * @param {*} value The value to add.
  3760. * @returns {Object} Returns `set`.
  3761. */
  3762. function addSetEntry(set, value) {
  3763. // Don't return `set.add` because it's not chainable in IE 11.
  3764. set.add(value);
  3765. return set;
  3766. }
  3767. /**
  3768. * A specialized version of `_.forEach` for arrays without support for
  3769. * iteratee shorthands.
  3770. *
  3771. * @private
  3772. * @param {Array} [array] The array to iterate over.
  3773. * @param {Function} iteratee The function invoked per iteration.
  3774. * @returns {Array} Returns `array`.
  3775. */
  3776. function arrayEach(array, iteratee) {
  3777. var index = -1,
  3778. length = array ? array.length : 0;
  3779. while (++index < length) {
  3780. if (iteratee(array[index], index, array) === false) {
  3781. break;
  3782. }
  3783. }
  3784. return array;
  3785. }
  3786. /**
  3787. * Appends the elements of `values` to `array`.
  3788. *
  3789. * @private
  3790. * @param {Array} array The array to modify.
  3791. * @param {Array} values The values to append.
  3792. * @returns {Array} Returns `array`.
  3793. */
  3794. function arrayPush(array, values) {
  3795. var index = -1,
  3796. length = values.length,
  3797. offset = array.length;
  3798. while (++index < length) {
  3799. array[offset + index] = values[index];
  3800. }
  3801. return array;
  3802. }
  3803. /**
  3804. * A specialized version of `_.reduce` for arrays without support for
  3805. * iteratee shorthands.
  3806. *
  3807. * @private
  3808. * @param {Array} [array] The array to iterate over.
  3809. * @param {Function} iteratee The function invoked per iteration.
  3810. * @param {*} [accumulator] The initial value.
  3811. * @param {boolean} [initAccum] Specify using the first element of `array` as
  3812. * the initial value.
  3813. * @returns {*} Returns the accumulated value.
  3814. */
  3815. function arrayReduce(array, iteratee, accumulator, initAccum) {
  3816. var index = -1,
  3817. length = array ? array.length : 0;
  3818. if (initAccum && length) {
  3819. accumulator = array[++index];
  3820. }
  3821. while (++index < length) {
  3822. accumulator = iteratee(accumulator, array[index], index, array);
  3823. }
  3824. return accumulator;
  3825. }
  3826. /**
  3827. * The base implementation of `_.times` without support for iteratee shorthands
  3828. * or max array length checks.
  3829. *
  3830. * @private
  3831. * @param {number} n The number of times to invoke `iteratee`.
  3832. * @param {Function} iteratee The function invoked per iteration.
  3833. * @returns {Array} Returns the array of results.
  3834. */
  3835. function baseTimes(n, iteratee) {
  3836. var index = -1,
  3837. result = Array(n);
  3838. while (++index < n) {
  3839. result[index] = iteratee(index);
  3840. }
  3841. return result;
  3842. }
  3843. /**
  3844. * Gets the value at `key` of `object`.
  3845. *
  3846. * @private
  3847. * @param {Object} [object] The object to query.
  3848. * @param {string} key The key of the property to get.
  3849. * @returns {*} Returns the property value.
  3850. */
  3851. function getValue(object, key) {
  3852. return object == null ? undefined : object[key];
  3853. }
  3854. /**
  3855. * Checks if `value` is a host object in IE < 9.
  3856. *
  3857. * @private
  3858. * @param {*} value The value to check.
  3859. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  3860. */
  3861. function isHostObject(value) {
  3862. // Many host objects are `Object` objects that can coerce to strings
  3863. // despite having improperly defined `toString` methods.
  3864. var result = false;
  3865. if (value != null && typeof value.toString != 'function') {
  3866. try {
  3867. result = !!(value + '');
  3868. } catch (e) {}
  3869. }
  3870. return result;
  3871. }
  3872. /**
  3873. * Converts `map` to its key-value pairs.
  3874. *
  3875. * @private
  3876. * @param {Object} map The map to convert.
  3877. * @returns {Array} Returns the key-value pairs.
  3878. */
  3879. function mapToArray(map) {
  3880. var index = -1,
  3881. result = Array(map.size);
  3882. map.forEach(function (value, key) {
  3883. result[++index] = [key, value];
  3884. });
  3885. return result;
  3886. }
  3887. /**
  3888. * Creates a unary function that invokes `func` with its argument transformed.
  3889. *
  3890. * @private
  3891. * @param {Function} func The function to wrap.
  3892. * @param {Function} transform The argument transform.
  3893. * @returns {Function} Returns the new function.
  3894. */
  3895. function overArg(func, transform) {
  3896. return function (arg) {
  3897. return func(transform(arg));
  3898. };
  3899. }
  3900. /**
  3901. * Converts `set` to an array of its values.
  3902. *
  3903. * @private
  3904. * @param {Object} set The set to convert.
  3905. * @returns {Array} Returns the values.
  3906. */
  3907. function setToArray(set) {
  3908. var index = -1,
  3909. result = Array(set.size);
  3910. set.forEach(function (value) {
  3911. result[++index] = value;
  3912. });
  3913. return result;
  3914. }
  3915. /** Used for built-in method references. */
  3916. var arrayProto = Array.prototype,
  3917. funcProto = Function.prototype,
  3918. objectProto = Object.prototype;
  3919. /** Used to detect overreaching core-js shims. */
  3920. var coreJsData = root['__core-js_shared__'];
  3921. /** Used to detect methods masquerading as native. */
  3922. var maskSrcKey = function () {
  3923. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3924. return uid ? 'Symbol(src)_1.' + uid : '';
  3925. }();
  3926. /** Used to resolve the decompiled source of functions. */
  3927. var funcToString = funcProto.toString;
  3928. /** Used to check objects for own properties. */
  3929. var hasOwnProperty = objectProto.hasOwnProperty;
  3930. /**
  3931. * Used to resolve the
  3932. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3933. * of values.
  3934. */
  3935. var objectToString = objectProto.toString;
  3936. /** Used to detect if a method is native. */
  3937. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  3938. /** Built-in value references. */
  3939. var Buffer = moduleExports ? root.Buffer : undefined,
  3940. _Symbol = root.Symbol,
  3941. Uint8Array = root.Uint8Array,
  3942. getPrototype = overArg(Object.getPrototypeOf, Object),
  3943. objectCreate = Object.create,
  3944. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3945. splice = arrayProto.splice;
  3946. /* Built-in method references for those with the same name as other `lodash` methods. */
  3947. var nativeGetSymbols = Object.getOwnPropertySymbols,
  3948. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3949. nativeKeys = overArg(Object.keys, Object);
  3950. /* Built-in method references that are verified to be native. */
  3951. var DataView = getNative(root, 'DataView'),
  3952. Map = getNative(root, 'Map'),
  3953. Promise = getNative(root, 'Promise'),
  3954. Set = getNative(root, 'Set'),
  3955. WeakMap = getNative(root, 'WeakMap'),
  3956. nativeCreate = getNative(Object, 'create');
  3957. /** Used to detect maps, sets, and weakmaps. */
  3958. var dataViewCtorString = toSource(DataView),
  3959. mapCtorString = toSource(Map),
  3960. promiseCtorString = toSource(Promise),
  3961. setCtorString = toSource(Set),
  3962. weakMapCtorString = toSource(WeakMap);
  3963. /** Used to convert symbols to primitives and strings. */
  3964. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  3965. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  3966. /**
  3967. * Creates a hash object.
  3968. *
  3969. * @private
  3970. * @constructor
  3971. * @param {Array} [entries] The key-value pairs to cache.
  3972. */
  3973. function Hash(entries) {
  3974. var index = -1,
  3975. length = entries ? entries.length : 0;
  3976. this.clear();
  3977. while (++index < length) {
  3978. var entry = entries[index];
  3979. this.set(entry[0], entry[1]);
  3980. }
  3981. }
  3982. /**
  3983. * Removes all key-value entries from the hash.
  3984. *
  3985. * @private
  3986. * @name clear
  3987. * @memberOf Hash
  3988. */
  3989. function hashClear() {
  3990. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3991. }
  3992. /**
  3993. * Removes `key` and its value from the hash.
  3994. *
  3995. * @private
  3996. * @name delete
  3997. * @memberOf Hash
  3998. * @param {Object} hash The hash to modify.
  3999. * @param {string} key The key of the value to remove.
  4000. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  4001. */
  4002. function hashDelete(key) {
  4003. return this.has(key) && delete this.__data__[key];
  4004. }
  4005. /**
  4006. * Gets the hash value for `key`.
  4007. *
  4008. * @private
  4009. * @name get
  4010. * @memberOf Hash
  4011. * @param {string} key The key of the value to get.
  4012. * @returns {*} Returns the entry value.
  4013. */
  4014. function hashGet(key) {
  4015. var data = this.__data__;
  4016. if (nativeCreate) {
  4017. var result = data[key];
  4018. return result === HASH_UNDEFINED ? undefined : result;
  4019. }
  4020. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  4021. }
  4022. /**
  4023. * Checks if a hash value for `key` exists.
  4024. *
  4025. * @private
  4026. * @name has
  4027. * @memberOf Hash
  4028. * @param {string} key The key of the entry to check.
  4029. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4030. */
  4031. function hashHas(key) {
  4032. var data = this.__data__;
  4033. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  4034. }
  4035. /**
  4036. * Sets the hash `key` to `value`.
  4037. *
  4038. * @private
  4039. * @name set
  4040. * @memberOf Hash
  4041. * @param {string} key The key of the value to set.
  4042. * @param {*} value The value to set.
  4043. * @returns {Object} Returns the hash instance.
  4044. */
  4045. function hashSet(key, value) {
  4046. var data = this.__data__;
  4047. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  4048. return this;
  4049. }
  4050. // Add methods to `Hash`.
  4051. Hash.prototype.clear = hashClear;
  4052. Hash.prototype['delete'] = hashDelete;
  4053. Hash.prototype.get = hashGet;
  4054. Hash.prototype.has = hashHas;
  4055. Hash.prototype.set = hashSet;
  4056. /**
  4057. * Creates an list cache object.
  4058. *
  4059. * @private
  4060. * @constructor
  4061. * @param {Array} [entries] The key-value pairs to cache.
  4062. */
  4063. function ListCache(entries) {
  4064. var index = -1,
  4065. length = entries ? entries.length : 0;
  4066. this.clear();
  4067. while (++index < length) {
  4068. var entry = entries[index];
  4069. this.set(entry[0], entry[1]);
  4070. }
  4071. }
  4072. /**
  4073. * Removes all key-value entries from the list cache.
  4074. *
  4075. * @private
  4076. * @name clear
  4077. * @memberOf ListCache
  4078. */
  4079. function listCacheClear() {
  4080. this.__data__ = [];
  4081. }
  4082. /**
  4083. * Removes `key` and its value from the list cache.
  4084. *
  4085. * @private
  4086. * @name delete
  4087. * @memberOf ListCache
  4088. * @param {string} key The key of the value to remove.
  4089. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  4090. */
  4091. function listCacheDelete(key) {
  4092. var data = this.__data__,
  4093. index = assocIndexOf(data, key);
  4094. if (index < 0) {
  4095. return false;
  4096. }
  4097. var lastIndex = data.length - 1;
  4098. if (index == lastIndex) {
  4099. data.pop();
  4100. } else {
  4101. splice.call(data, index, 1);
  4102. }
  4103. return true;
  4104. }
  4105. /**
  4106. * Gets the list cache value for `key`.
  4107. *
  4108. * @private
  4109. * @name get
  4110. * @memberOf ListCache
  4111. * @param {string} key The key of the value to get.
  4112. * @returns {*} Returns the entry value.
  4113. */
  4114. function listCacheGet(key) {
  4115. var data = this.__data__,
  4116. index = assocIndexOf(data, key);
  4117. return index < 0 ? undefined : data[index][1];
  4118. }
  4119. /**
  4120. * Checks if a list cache value for `key` exists.
  4121. *
  4122. * @private
  4123. * @name has
  4124. * @memberOf ListCache
  4125. * @param {string} key The key of the entry to check.
  4126. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4127. */
  4128. function listCacheHas(key) {
  4129. return assocIndexOf(this.__data__, key) > -1;
  4130. }
  4131. /**
  4132. * Sets the list cache `key` to `value`.
  4133. *
  4134. * @private
  4135. * @name set
  4136. * @memberOf ListCache
  4137. * @param {string} key The key of the value to set.
  4138. * @param {*} value The value to set.
  4139. * @returns {Object} Returns the list cache instance.
  4140. */
  4141. function listCacheSet(key, value) {
  4142. var data = this.__data__,
  4143. index = assocIndexOf(data, key);
  4144. if (index < 0) {
  4145. data.push([key, value]);
  4146. } else {
  4147. data[index][1] = value;
  4148. }
  4149. return this;
  4150. }
  4151. // Add methods to `ListCache`.
  4152. ListCache.prototype.clear = listCacheClear;
  4153. ListCache.prototype['delete'] = listCacheDelete;
  4154. ListCache.prototype.get = listCacheGet;
  4155. ListCache.prototype.has = listCacheHas;
  4156. ListCache.prototype.set = listCacheSet;
  4157. /**
  4158. * Creates a map cache object to store key-value pairs.
  4159. *
  4160. * @private
  4161. * @constructor
  4162. * @param {Array} [entries] The key-value pairs to cache.
  4163. */
  4164. function MapCache(entries) {
  4165. var index = -1,
  4166. length = entries ? entries.length : 0;
  4167. this.clear();
  4168. while (++index < length) {
  4169. var entry = entries[index];
  4170. this.set(entry[0], entry[1]);
  4171. }
  4172. }
  4173. /**
  4174. * Removes all key-value entries from the map.
  4175. *
  4176. * @private
  4177. * @name clear
  4178. * @memberOf MapCache
  4179. */
  4180. function mapCacheClear() {
  4181. this.__data__ = {
  4182. 'hash': new Hash(),
  4183. 'map': new (Map || ListCache)(),
  4184. 'string': new Hash()
  4185. };
  4186. }
  4187. /**
  4188. * Removes `key` and its value from the map.
  4189. *
  4190. * @private
  4191. * @name delete
  4192. * @memberOf MapCache
  4193. * @param {string} key The key of the value to remove.
  4194. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  4195. */
  4196. function mapCacheDelete(key) {
  4197. return getMapData(this, key)['delete'](key);
  4198. }
  4199. /**
  4200. * Gets the map value for `key`.
  4201. *
  4202. * @private
  4203. * @name get
  4204. * @memberOf MapCache
  4205. * @param {string} key The key of the value to get.
  4206. * @returns {*} Returns the entry value.
  4207. */
  4208. function mapCacheGet(key) {
  4209. return getMapData(this, key).get(key);
  4210. }
  4211. /**
  4212. * Checks if a map value for `key` exists.
  4213. *
  4214. * @private
  4215. * @name has
  4216. * @memberOf MapCache
  4217. * @param {string} key The key of the entry to check.
  4218. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4219. */
  4220. function mapCacheHas(key) {
  4221. return getMapData(this, key).has(key);
  4222. }
  4223. /**
  4224. * Sets the map `key` to `value`.
  4225. *
  4226. * @private
  4227. * @name set
  4228. * @memberOf MapCache
  4229. * @param {string} key The key of the value to set.
  4230. * @param {*} value The value to set.
  4231. * @returns {Object} Returns the map cache instance.
  4232. */
  4233. function mapCacheSet(key, value) {
  4234. getMapData(this, key).set(key, value);
  4235. return this;
  4236. }
  4237. // Add methods to `MapCache`.
  4238. MapCache.prototype.clear = mapCacheClear;
  4239. MapCache.prototype['delete'] = mapCacheDelete;
  4240. MapCache.prototype.get = mapCacheGet;
  4241. MapCache.prototype.has = mapCacheHas;
  4242. MapCache.prototype.set = mapCacheSet;
  4243. /**
  4244. * Creates a stack cache object to store key-value pairs.
  4245. *
  4246. * @private
  4247. * @constructor
  4248. * @param {Array} [entries] The key-value pairs to cache.
  4249. */
  4250. function Stack(entries) {
  4251. this.__data__ = new ListCache(entries);
  4252. }
  4253. /**
  4254. * Removes all key-value entries from the stack.
  4255. *
  4256. * @private
  4257. * @name clear
  4258. * @memberOf Stack
  4259. */
  4260. function stackClear() {
  4261. this.__data__ = new ListCache();
  4262. }
  4263. /**
  4264. * Removes `key` and its value from the stack.
  4265. *
  4266. * @private
  4267. * @name delete
  4268. * @memberOf Stack
  4269. * @param {string} key The key of the value to remove.
  4270. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  4271. */
  4272. function stackDelete(key) {
  4273. return this.__data__['delete'](key);
  4274. }
  4275. /**
  4276. * Gets the stack value for `key`.
  4277. *
  4278. * @private
  4279. * @name get
  4280. * @memberOf Stack
  4281. * @param {string} key The key of the value to get.
  4282. * @returns {*} Returns the entry value.
  4283. */
  4284. function stackGet(key) {
  4285. return this.__data__.get(key);
  4286. }
  4287. /**
  4288. * Checks if a stack value for `key` exists.
  4289. *
  4290. * @private
  4291. * @name has
  4292. * @memberOf Stack
  4293. * @param {string} key The key of the entry to check.
  4294. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4295. */
  4296. function stackHas(key) {
  4297. return this.__data__.has(key);
  4298. }
  4299. /**
  4300. * Sets the stack `key` to `value`.
  4301. *
  4302. * @private
  4303. * @name set
  4304. * @memberOf Stack
  4305. * @param {string} key The key of the value to set.
  4306. * @param {*} value The value to set.
  4307. * @returns {Object} Returns the stack cache instance.
  4308. */
  4309. function stackSet(key, value) {
  4310. var cache = this.__data__;
  4311. if (cache instanceof ListCache) {
  4312. var pairs = cache.__data__;
  4313. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  4314. pairs.push([key, value]);
  4315. return this;
  4316. }
  4317. cache = this.__data__ = new MapCache(pairs);
  4318. }
  4319. cache.set(key, value);
  4320. return this;
  4321. }
  4322. // Add methods to `Stack`.
  4323. Stack.prototype.clear = stackClear;
  4324. Stack.prototype['delete'] = stackDelete;
  4325. Stack.prototype.get = stackGet;
  4326. Stack.prototype.has = stackHas;
  4327. Stack.prototype.set = stackSet;
  4328. /**
  4329. * Creates an array of the enumerable property names of the array-like `value`.
  4330. *
  4331. * @private
  4332. * @param {*} value The value to query.
  4333. * @param {boolean} inherited Specify returning inherited property names.
  4334. * @returns {Array} Returns the array of property names.
  4335. */
  4336. function arrayLikeKeys(value, inherited) {
  4337. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  4338. // Safari 9 makes `arguments.length` enumerable in strict mode.
  4339. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  4340. var length = result.length,
  4341. skipIndexes = !!length;
  4342. for (var key in value) {
  4343. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  4344. result.push(key);
  4345. }
  4346. }
  4347. return result;
  4348. }
  4349. /**
  4350. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  4351. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  4352. * for equality comparisons.
  4353. *
  4354. * @private
  4355. * @param {Object} object The object to modify.
  4356. * @param {string} key The key of the property to assign.
  4357. * @param {*} value The value to assign.
  4358. */
  4359. function assignValue(object, key, value) {
  4360. var objValue = object[key];
  4361. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
  4362. object[key] = value;
  4363. }
  4364. }
  4365. /**
  4366. * Gets the index at which the `key` is found in `array` of key-value pairs.
  4367. *
  4368. * @private
  4369. * @param {Array} array The array to inspect.
  4370. * @param {*} key The key to search for.
  4371. * @returns {number} Returns the index of the matched value, else `-1`.
  4372. */
  4373. function assocIndexOf(array, key) {
  4374. var length = array.length;
  4375. while (length--) {
  4376. if (eq(array[length][0], key)) {
  4377. return length;
  4378. }
  4379. }
  4380. return -1;
  4381. }
  4382. /**
  4383. * The base implementation of `_.assign` without support for multiple sources
  4384. * or `customizer` functions.
  4385. *
  4386. * @private
  4387. * @param {Object} object The destination object.
  4388. * @param {Object} source The source object.
  4389. * @returns {Object} Returns `object`.
  4390. */
  4391. function baseAssign(object, source) {
  4392. return object && copyObject(source, keys(source), object);
  4393. }
  4394. /**
  4395. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  4396. * traversed objects.
  4397. *
  4398. * @private
  4399. * @param {*} value The value to clone.
  4400. * @param {boolean} [isDeep] Specify a deep clone.
  4401. * @param {boolean} [isFull] Specify a clone including symbols.
  4402. * @param {Function} [customizer] The function to customize cloning.
  4403. * @param {string} [key] The key of `value`.
  4404. * @param {Object} [object] The parent object of `value`.
  4405. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  4406. * @returns {*} Returns the cloned value.
  4407. */
  4408. function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
  4409. var result;
  4410. if (customizer) {
  4411. result = object ? customizer(value, key, object, stack) : customizer(value);
  4412. }
  4413. if (result !== undefined) {
  4414. return result;
  4415. }
  4416. if (!isObject(value)) {
  4417. return value;
  4418. }
  4419. var isArr = isArray(value);
  4420. if (isArr) {
  4421. result = initCloneArray(value);
  4422. if (!isDeep) {
  4423. return copyArray(value, result);
  4424. }
  4425. } else {
  4426. var tag = getTag(value),
  4427. isFunc = tag == funcTag || tag == genTag;
  4428. if (isBuffer(value)) {
  4429. return cloneBuffer(value, isDeep);
  4430. }
  4431. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  4432. if (isHostObject(value)) {
  4433. return object ? value : {};
  4434. }
  4435. result = initCloneObject(isFunc ? {} : value);
  4436. if (!isDeep) {
  4437. return copySymbols(value, baseAssign(result, value));
  4438. }
  4439. } else {
  4440. if (!cloneableTags[tag]) {
  4441. return object ? value : {};
  4442. }
  4443. result = initCloneByTag(value, tag, baseClone, isDeep);
  4444. }
  4445. }
  4446. // Check for circular references and return its corresponding clone.
  4447. stack || (stack = new Stack());
  4448. var stacked = stack.get(value);
  4449. if (stacked) {
  4450. return stacked;
  4451. }
  4452. stack.set(value, result);
  4453. if (!isArr) {
  4454. var props = isFull ? getAllKeys(value) : keys(value);
  4455. }
  4456. arrayEach(props || value, function (subValue, key) {
  4457. if (props) {
  4458. key = subValue;
  4459. subValue = value[key];
  4460. }
  4461. // Recursively populate clone (susceptible to call stack limits).
  4462. assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
  4463. });
  4464. return result;
  4465. }
  4466. /**
  4467. * The base implementation of `_.create` without support for assigning
  4468. * properties to the created object.
  4469. *
  4470. * @private
  4471. * @param {Object} prototype The object to inherit from.
  4472. * @returns {Object} Returns the new object.
  4473. */
  4474. function baseCreate(proto) {
  4475. return isObject(proto) ? objectCreate(proto) : {};
  4476. }
  4477. /**
  4478. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4479. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4480. * symbols of `object`.
  4481. *
  4482. * @private
  4483. * @param {Object} object The object to query.
  4484. * @param {Function} keysFunc The function to get the keys of `object`.
  4485. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4486. * @returns {Array} Returns the array of property names and symbols.
  4487. */
  4488. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4489. var result = keysFunc(object);
  4490. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4491. }
  4492. /**
  4493. * The base implementation of `getTag`.
  4494. *
  4495. * @private
  4496. * @param {*} value The value to query.
  4497. * @returns {string} Returns the `toStringTag`.
  4498. */
  4499. function baseGetTag(value) {
  4500. return objectToString.call(value);
  4501. }
  4502. /**
  4503. * The base implementation of `_.isNative` without bad shim checks.
  4504. *
  4505. * @private
  4506. * @param {*} value The value to check.
  4507. * @returns {boolean} Returns `true` if `value` is a native function,
  4508. * else `false`.
  4509. */
  4510. function baseIsNative(value) {
  4511. if (!isObject(value) || isMasked(value)) {
  4512. return false;
  4513. }
  4514. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  4515. return pattern.test(toSource(value));
  4516. }
  4517. /**
  4518. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4519. *
  4520. * @private
  4521. * @param {Object} object The object to query.
  4522. * @returns {Array} Returns the array of property names.
  4523. */
  4524. function baseKeys(object) {
  4525. if (!isPrototype(object)) {
  4526. return nativeKeys(object);
  4527. }
  4528. var result = [];
  4529. for (var key in Object(object)) {
  4530. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4531. result.push(key);
  4532. }
  4533. }
  4534. return result;
  4535. }
  4536. /**
  4537. * Creates a clone of `buffer`.
  4538. *
  4539. * @private
  4540. * @param {Buffer} buffer The buffer to clone.
  4541. * @param {boolean} [isDeep] Specify a deep clone.
  4542. * @returns {Buffer} Returns the cloned buffer.
  4543. */
  4544. function cloneBuffer(buffer, isDeep) {
  4545. if (isDeep) {
  4546. return buffer.slice();
  4547. }
  4548. var result = new buffer.constructor(buffer.length);
  4549. buffer.copy(result);
  4550. return result;
  4551. }
  4552. /**
  4553. * Creates a clone of `arrayBuffer`.
  4554. *
  4555. * @private
  4556. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  4557. * @returns {ArrayBuffer} Returns the cloned array buffer.
  4558. */
  4559. function cloneArrayBuffer(arrayBuffer) {
  4560. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  4561. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  4562. return result;
  4563. }
  4564. /**
  4565. * Creates a clone of `dataView`.
  4566. *
  4567. * @private
  4568. * @param {Object} dataView The data view to clone.
  4569. * @param {boolean} [isDeep] Specify a deep clone.
  4570. * @returns {Object} Returns the cloned data view.
  4571. */
  4572. function cloneDataView(dataView, isDeep) {
  4573. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  4574. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  4575. }
  4576. /**
  4577. * Creates a clone of `map`.
  4578. *
  4579. * @private
  4580. * @param {Object} map The map to clone.
  4581. * @param {Function} cloneFunc The function to clone values.
  4582. * @param {boolean} [isDeep] Specify a deep clone.
  4583. * @returns {Object} Returns the cloned map.
  4584. */
  4585. function cloneMap(map, isDeep, cloneFunc) {
  4586. var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
  4587. return arrayReduce(array, addMapEntry, new map.constructor());
  4588. }
  4589. /**
  4590. * Creates a clone of `regexp`.
  4591. *
  4592. * @private
  4593. * @param {Object} regexp The regexp to clone.
  4594. * @returns {Object} Returns the cloned regexp.
  4595. */
  4596. function cloneRegExp(regexp) {
  4597. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  4598. result.lastIndex = regexp.lastIndex;
  4599. return result;
  4600. }
  4601. /**
  4602. * Creates a clone of `set`.
  4603. *
  4604. * @private
  4605. * @param {Object} set The set to clone.
  4606. * @param {Function} cloneFunc The function to clone values.
  4607. * @param {boolean} [isDeep] Specify a deep clone.
  4608. * @returns {Object} Returns the cloned set.
  4609. */
  4610. function cloneSet(set, isDeep, cloneFunc) {
  4611. var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
  4612. return arrayReduce(array, addSetEntry, new set.constructor());
  4613. }
  4614. /**
  4615. * Creates a clone of the `symbol` object.
  4616. *
  4617. * @private
  4618. * @param {Object} symbol The symbol object to clone.
  4619. * @returns {Object} Returns the cloned symbol object.
  4620. */
  4621. function cloneSymbol(symbol) {
  4622. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  4623. }
  4624. /**
  4625. * Creates a clone of `typedArray`.
  4626. *
  4627. * @private
  4628. * @param {Object} typedArray The typed array to clone.
  4629. * @param {boolean} [isDeep] Specify a deep clone.
  4630. * @returns {Object} Returns the cloned typed array.
  4631. */
  4632. function cloneTypedArray(typedArray, isDeep) {
  4633. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  4634. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  4635. }
  4636. /**
  4637. * Copies the values of `source` to `array`.
  4638. *
  4639. * @private
  4640. * @param {Array} source The array to copy values from.
  4641. * @param {Array} [array=[]] The array to copy values to.
  4642. * @returns {Array} Returns `array`.
  4643. */
  4644. function copyArray(source, array) {
  4645. var index = -1,
  4646. length = source.length;
  4647. array || (array = Array(length));
  4648. while (++index < length) {
  4649. array[index] = source[index];
  4650. }
  4651. return array;
  4652. }
  4653. /**
  4654. * Copies properties of `source` to `object`.
  4655. *
  4656. * @private
  4657. * @param {Object} source The object to copy properties from.
  4658. * @param {Array} props The property identifiers to copy.
  4659. * @param {Object} [object={}] The object to copy properties to.
  4660. * @param {Function} [customizer] The function to customize copied values.
  4661. * @returns {Object} Returns `object`.
  4662. */
  4663. function copyObject(source, props, object, customizer) {
  4664. object || (object = {});
  4665. var index = -1,
  4666. length = props.length;
  4667. while (++index < length) {
  4668. var key = props[index];
  4669. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
  4670. assignValue(object, key, newValue === undefined ? source[key] : newValue);
  4671. }
  4672. return object;
  4673. }
  4674. /**
  4675. * Copies own symbol properties of `source` to `object`.
  4676. *
  4677. * @private
  4678. * @param {Object} source The object to copy symbols from.
  4679. * @param {Object} [object={}] The object to copy symbols to.
  4680. * @returns {Object} Returns `object`.
  4681. */
  4682. function copySymbols(source, object) {
  4683. return copyObject(source, getSymbols(source), object);
  4684. }
  4685. /**
  4686. * Creates an array of own enumerable property names and symbols of `object`.
  4687. *
  4688. * @private
  4689. * @param {Object} object The object to query.
  4690. * @returns {Array} Returns the array of property names and symbols.
  4691. */
  4692. function getAllKeys(object) {
  4693. return baseGetAllKeys(object, keys, getSymbols);
  4694. }
  4695. /**
  4696. * Gets the data for `map`.
  4697. *
  4698. * @private
  4699. * @param {Object} map The map to query.
  4700. * @param {string} key The reference key.
  4701. * @returns {*} Returns the map data.
  4702. */
  4703. function getMapData(map, key) {
  4704. var data = map.__data__;
  4705. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  4706. }
  4707. /**
  4708. * Gets the native function at `key` of `object`.
  4709. *
  4710. * @private
  4711. * @param {Object} object The object to query.
  4712. * @param {string} key The key of the method to get.
  4713. * @returns {*} Returns the function if it's native, else `undefined`.
  4714. */
  4715. function getNative(object, key) {
  4716. var value = getValue(object, key);
  4717. return baseIsNative(value) ? value : undefined;
  4718. }
  4719. /**
  4720. * Creates an array of the own enumerable symbol properties of `object`.
  4721. *
  4722. * @private
  4723. * @param {Object} object The object to query.
  4724. * @returns {Array} Returns the array of symbols.
  4725. */
  4726. var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
  4727. /**
  4728. * Gets the `toStringTag` of `value`.
  4729. *
  4730. * @private
  4731. * @param {*} value The value to query.
  4732. * @returns {string} Returns the `toStringTag`.
  4733. */
  4734. var getTag = baseGetTag;
  4735. // Fallback for data views, maps, sets, and weak maps in IE 11,
  4736. // for data views in Edge < 14, and promises in Node.js.
  4737. 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) {
  4738. getTag = function getTag(value) {
  4739. var result = objectToString.call(value),
  4740. Ctor = result == objectTag ? value.constructor : undefined,
  4741. ctorString = Ctor ? toSource(Ctor) : undefined;
  4742. if (ctorString) {
  4743. switch (ctorString) {
  4744. case dataViewCtorString:
  4745. return dataViewTag;
  4746. case mapCtorString:
  4747. return mapTag;
  4748. case promiseCtorString:
  4749. return promiseTag;
  4750. case setCtorString:
  4751. return setTag;
  4752. case weakMapCtorString:
  4753. return weakMapTag;
  4754. }
  4755. }
  4756. return result;
  4757. };
  4758. }
  4759. /**
  4760. * Initializes an array clone.
  4761. *
  4762. * @private
  4763. * @param {Array} array The array to clone.
  4764. * @returns {Array} Returns the initialized clone.
  4765. */
  4766. function initCloneArray(array) {
  4767. var length = array.length,
  4768. result = array.constructor(length);
  4769. // Add properties assigned by `RegExp#exec`.
  4770. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  4771. result.index = array.index;
  4772. result.input = array.input;
  4773. }
  4774. return result;
  4775. }
  4776. /**
  4777. * Initializes an object clone.
  4778. *
  4779. * @private
  4780. * @param {Object} object The object to clone.
  4781. * @returns {Object} Returns the initialized clone.
  4782. */
  4783. function initCloneObject(object) {
  4784. return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  4785. }
  4786. /**
  4787. * Initializes an object clone based on its `toStringTag`.
  4788. *
  4789. * **Note:** This function only supports cloning values with tags of
  4790. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  4791. *
  4792. * @private
  4793. * @param {Object} object The object to clone.
  4794. * @param {string} tag The `toStringTag` of the object to clone.
  4795. * @param {Function} cloneFunc The function to clone values.
  4796. * @param {boolean} [isDeep] Specify a deep clone.
  4797. * @returns {Object} Returns the initialized clone.
  4798. */
  4799. function initCloneByTag(object, tag, cloneFunc, isDeep) {
  4800. var Ctor = object.constructor;
  4801. switch (tag) {
  4802. case arrayBufferTag:
  4803. return cloneArrayBuffer(object);
  4804. case boolTag:
  4805. case dateTag:
  4806. return new Ctor(+object);
  4807. case dataViewTag:
  4808. return cloneDataView(object, isDeep);
  4809. case float32Tag:
  4810. case float64Tag:
  4811. case int8Tag:
  4812. case int16Tag:
  4813. case int32Tag:
  4814. case uint8Tag:
  4815. case uint8ClampedTag:
  4816. case uint16Tag:
  4817. case uint32Tag:
  4818. return cloneTypedArray(object, isDeep);
  4819. case mapTag:
  4820. return cloneMap(object, isDeep, cloneFunc);
  4821. case numberTag:
  4822. case stringTag:
  4823. return new Ctor(object);
  4824. case regexpTag:
  4825. return cloneRegExp(object);
  4826. case setTag:
  4827. return cloneSet(object, isDeep, cloneFunc);
  4828. case symbolTag:
  4829. return cloneSymbol(object);
  4830. }
  4831. }
  4832. /**
  4833. * Checks if `value` is a valid array-like index.
  4834. *
  4835. * @private
  4836. * @param {*} value The value to check.
  4837. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  4838. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  4839. */
  4840. function isIndex(value, length) {
  4841. length = length == null ? MAX_SAFE_INTEGER : length;
  4842. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  4843. }
  4844. /**
  4845. * Checks if `value` is suitable for use as unique object key.
  4846. *
  4847. * @private
  4848. * @param {*} value The value to check.
  4849. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  4850. */
  4851. function isKeyable(value) {
  4852. var type = _typeof(value);
  4853. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  4854. }
  4855. /**
  4856. * Checks if `func` has its source masked.
  4857. *
  4858. * @private
  4859. * @param {Function} func The function to check.
  4860. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  4861. */
  4862. function isMasked(func) {
  4863. return !!maskSrcKey && maskSrcKey in func;
  4864. }
  4865. /**
  4866. * Checks if `value` is likely a prototype object.
  4867. *
  4868. * @private
  4869. * @param {*} value The value to check.
  4870. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  4871. */
  4872. function isPrototype(value) {
  4873. var Ctor = value && value.constructor,
  4874. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  4875. return value === proto;
  4876. }
  4877. /**
  4878. * Converts `func` to its source code.
  4879. *
  4880. * @private
  4881. * @param {Function} func The function to process.
  4882. * @returns {string} Returns the source code.
  4883. */
  4884. function toSource(func) {
  4885. if (func != null) {
  4886. try {
  4887. return funcToString.call(func);
  4888. } catch (e) {}
  4889. try {
  4890. return func + '';
  4891. } catch (e) {}
  4892. }
  4893. return '';
  4894. }
  4895. /**
  4896. * This method is like `_.clone` except that it recursively clones `value`.
  4897. *
  4898. * @static
  4899. * @memberOf _
  4900. * @since 1.0.0
  4901. * @category Lang
  4902. * @param {*} value The value to recursively clone.
  4903. * @returns {*} Returns the deep cloned value.
  4904. * @see _.clone
  4905. * @example
  4906. *
  4907. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  4908. *
  4909. * var deep = _.cloneDeep(objects);
  4910. * console.log(deep[0] === objects[0]);
  4911. * // => false
  4912. */
  4913. function cloneDeep(value) {
  4914. return baseClone(value, true, true);
  4915. }
  4916. /**
  4917. * Performs a
  4918. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  4919. * comparison between two values to determine if they are equivalent.
  4920. *
  4921. * @static
  4922. * @memberOf _
  4923. * @since 4.0.0
  4924. * @category Lang
  4925. * @param {*} value The value to compare.
  4926. * @param {*} other The other value to compare.
  4927. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4928. * @example
  4929. *
  4930. * var object = { 'a': 1 };
  4931. * var other = { 'a': 1 };
  4932. *
  4933. * _.eq(object, object);
  4934. * // => true
  4935. *
  4936. * _.eq(object, other);
  4937. * // => false
  4938. *
  4939. * _.eq('a', 'a');
  4940. * // => true
  4941. *
  4942. * _.eq('a', Object('a'));
  4943. * // => false
  4944. *
  4945. * _.eq(NaN, NaN);
  4946. * // => true
  4947. */
  4948. function eq(value, other) {
  4949. return value === other || value !== value && other !== other;
  4950. }
  4951. /**
  4952. * Checks if `value` is likely an `arguments` object.
  4953. *
  4954. * @static
  4955. * @memberOf _
  4956. * @since 0.1.0
  4957. * @category Lang
  4958. * @param {*} value The value to check.
  4959. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4960. * else `false`.
  4961. * @example
  4962. *
  4963. * _.isArguments(function() { return arguments; }());
  4964. * // => true
  4965. *
  4966. * _.isArguments([1, 2, 3]);
  4967. * // => false
  4968. */
  4969. function isArguments(value) {
  4970. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  4971. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  4972. }
  4973. /**
  4974. * Checks if `value` is classified as an `Array` object.
  4975. *
  4976. * @static
  4977. * @memberOf _
  4978. * @since 0.1.0
  4979. * @category Lang
  4980. * @param {*} value The value to check.
  4981. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  4982. * @example
  4983. *
  4984. * _.isArray([1, 2, 3]);
  4985. * // => true
  4986. *
  4987. * _.isArray(document.body.children);
  4988. * // => false
  4989. *
  4990. * _.isArray('abc');
  4991. * // => false
  4992. *
  4993. * _.isArray(_.noop);
  4994. * // => false
  4995. */
  4996. var isArray = Array.isArray;
  4997. /**
  4998. * Checks if `value` is array-like. A value is considered array-like if it's
  4999. * not a function and has a `value.length` that's an integer greater than or
  5000. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  5001. *
  5002. * @static
  5003. * @memberOf _
  5004. * @since 4.0.0
  5005. * @category Lang
  5006. * @param {*} value The value to check.
  5007. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  5008. * @example
  5009. *
  5010. * _.isArrayLike([1, 2, 3]);
  5011. * // => true
  5012. *
  5013. * _.isArrayLike(document.body.children);
  5014. * // => true
  5015. *
  5016. * _.isArrayLike('abc');
  5017. * // => true
  5018. *
  5019. * _.isArrayLike(_.noop);
  5020. * // => false
  5021. */
  5022. function isArrayLike(value) {
  5023. return value != null && isLength(value.length) && !isFunction(value);
  5024. }
  5025. /**
  5026. * This method is like `_.isArrayLike` except that it also checks if `value`
  5027. * is an object.
  5028. *
  5029. * @static
  5030. * @memberOf _
  5031. * @since 4.0.0
  5032. * @category Lang
  5033. * @param {*} value The value to check.
  5034. * @returns {boolean} Returns `true` if `value` is an array-like object,
  5035. * else `false`.
  5036. * @example
  5037. *
  5038. * _.isArrayLikeObject([1, 2, 3]);
  5039. * // => true
  5040. *
  5041. * _.isArrayLikeObject(document.body.children);
  5042. * // => true
  5043. *
  5044. * _.isArrayLikeObject('abc');
  5045. * // => false
  5046. *
  5047. * _.isArrayLikeObject(_.noop);
  5048. * // => false
  5049. */
  5050. function isArrayLikeObject(value) {
  5051. return isObjectLike(value) && isArrayLike(value);
  5052. }
  5053. /**
  5054. * Checks if `value` is a buffer.
  5055. *
  5056. * @static
  5057. * @memberOf _
  5058. * @since 4.3.0
  5059. * @category Lang
  5060. * @param {*} value The value to check.
  5061. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  5062. * @example
  5063. *
  5064. * _.isBuffer(new Buffer(2));
  5065. * // => true
  5066. *
  5067. * _.isBuffer(new Uint8Array(2));
  5068. * // => false
  5069. */
  5070. var isBuffer = nativeIsBuffer || stubFalse;
  5071. /**
  5072. * Checks if `value` is classified as a `Function` object.
  5073. *
  5074. * @static
  5075. * @memberOf _
  5076. * @since 0.1.0
  5077. * @category Lang
  5078. * @param {*} value The value to check.
  5079. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  5080. * @example
  5081. *
  5082. * _.isFunction(_);
  5083. * // => true
  5084. *
  5085. * _.isFunction(/abc/);
  5086. * // => false
  5087. */
  5088. function isFunction(value) {
  5089. // The use of `Object#toString` avoids issues with the `typeof` operator
  5090. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  5091. var tag = isObject(value) ? objectToString.call(value) : '';
  5092. return tag == funcTag || tag == genTag;
  5093. }
  5094. /**
  5095. * Checks if `value` is a valid array-like length.
  5096. *
  5097. * **Note:** This method is loosely based on
  5098. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  5099. *
  5100. * @static
  5101. * @memberOf _
  5102. * @since 4.0.0
  5103. * @category Lang
  5104. * @param {*} value The value to check.
  5105. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  5106. * @example
  5107. *
  5108. * _.isLength(3);
  5109. * // => true
  5110. *
  5111. * _.isLength(Number.MIN_VALUE);
  5112. * // => false
  5113. *
  5114. * _.isLength(Infinity);
  5115. * // => false
  5116. *
  5117. * _.isLength('3');
  5118. * // => false
  5119. */
  5120. function isLength(value) {
  5121. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  5122. }
  5123. /**
  5124. * Checks if `value` is the
  5125. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  5126. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  5127. *
  5128. * @static
  5129. * @memberOf _
  5130. * @since 0.1.0
  5131. * @category Lang
  5132. * @param {*} value The value to check.
  5133. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  5134. * @example
  5135. *
  5136. * _.isObject({});
  5137. * // => true
  5138. *
  5139. * _.isObject([1, 2, 3]);
  5140. * // => true
  5141. *
  5142. * _.isObject(_.noop);
  5143. * // => true
  5144. *
  5145. * _.isObject(null);
  5146. * // => false
  5147. */
  5148. function isObject(value) {
  5149. var type = _typeof(value);
  5150. return !!value && (type == 'object' || type == 'function');
  5151. }
  5152. /**
  5153. * Checks if `value` is object-like. A value is object-like if it's not `null`
  5154. * and has a `typeof` result of "object".
  5155. *
  5156. * @static
  5157. * @memberOf _
  5158. * @since 4.0.0
  5159. * @category Lang
  5160. * @param {*} value The value to check.
  5161. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  5162. * @example
  5163. *
  5164. * _.isObjectLike({});
  5165. * // => true
  5166. *
  5167. * _.isObjectLike([1, 2, 3]);
  5168. * // => true
  5169. *
  5170. * _.isObjectLike(_.noop);
  5171. * // => false
  5172. *
  5173. * _.isObjectLike(null);
  5174. * // => false
  5175. */
  5176. function isObjectLike(value) {
  5177. return !!value && _typeof(value) == 'object';
  5178. }
  5179. /**
  5180. * Creates an array of the own enumerable property names of `object`.
  5181. *
  5182. * **Note:** Non-object values are coerced to objects. See the
  5183. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  5184. * for more details.
  5185. *
  5186. * @static
  5187. * @since 0.1.0
  5188. * @memberOf _
  5189. * @category Object
  5190. * @param {Object} object The object to query.
  5191. * @returns {Array} Returns the array of property names.
  5192. * @example
  5193. *
  5194. * function Foo() {
  5195. * this.a = 1;
  5196. * this.b = 2;
  5197. * }
  5198. *
  5199. * Foo.prototype.c = 3;
  5200. *
  5201. * _.keys(new Foo);
  5202. * // => ['a', 'b'] (iteration order is not guaranteed)
  5203. *
  5204. * _.keys('hi');
  5205. * // => ['0', '1']
  5206. */
  5207. function keys(object) {
  5208. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  5209. }
  5210. /**
  5211. * This method returns a new empty array.
  5212. *
  5213. * @static
  5214. * @memberOf _
  5215. * @since 4.13.0
  5216. * @category Util
  5217. * @returns {Array} Returns the new empty array.
  5218. * @example
  5219. *
  5220. * var arrays = _.times(2, _.stubArray);
  5221. *
  5222. * console.log(arrays);
  5223. * // => [[], []]
  5224. *
  5225. * console.log(arrays[0] === arrays[1]);
  5226. * // => false
  5227. */
  5228. function stubArray() {
  5229. return [];
  5230. }
  5231. /**
  5232. * This method returns `false`.
  5233. *
  5234. * @static
  5235. * @memberOf _
  5236. * @since 4.13.0
  5237. * @category Util
  5238. * @returns {boolean} Returns `false`.
  5239. * @example
  5240. *
  5241. * _.times(2, _.stubFalse);
  5242. * // => [false, false]
  5243. */
  5244. function stubFalse() {
  5245. return false;
  5246. }
  5247. module.exports = cloneDeep;
  5248. /***/ }),
  5249. /***/ 7820:
  5250. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  5251. 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); }
  5252. /**
  5253. * lodash (Custom Build) <https://lodash.com/>
  5254. * Build: `lodash modularize exports="npm" -o ./`
  5255. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  5256. * Released under MIT license <https://lodash.com/license>
  5257. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  5258. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  5259. */
  5260. /** Used as references for various `Number` constants. */
  5261. var MAX_SAFE_INTEGER = 9007199254740991;
  5262. /** `Object#toString` result references. */
  5263. var argsTag = '[object Arguments]',
  5264. funcTag = '[object Function]',
  5265. genTag = '[object GeneratorFunction]',
  5266. mapTag = '[object Map]',
  5267. objectTag = '[object Object]',
  5268. promiseTag = '[object Promise]',
  5269. setTag = '[object Set]',
  5270. weakMapTag = '[object WeakMap]';
  5271. var dataViewTag = '[object DataView]';
  5272. /**
  5273. * Used to match `RegExp`
  5274. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  5275. */
  5276. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  5277. /** Used to detect host constructors (Safari). */
  5278. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  5279. /** Used to detect unsigned integer values. */
  5280. var reIsUint = /^(?:0|[1-9]\d*)$/;
  5281. /** Detect free variable `global` from Node.js. */
  5282. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  5283. /** Detect free variable `self`. */
  5284. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  5285. /** Used as a reference to the global object. */
  5286. var root = freeGlobal || freeSelf || Function('return this')();
  5287. /**
  5288. * A specialized version of `_.map` for arrays without support for iteratee
  5289. * shorthands.
  5290. *
  5291. * @private
  5292. * @param {Array} [array] The array to iterate over.
  5293. * @param {Function} iteratee The function invoked per iteration.
  5294. * @returns {Array} Returns the new mapped array.
  5295. */
  5296. function arrayMap(array, iteratee) {
  5297. var index = -1,
  5298. length = array ? array.length : 0,
  5299. result = Array(length);
  5300. while (++index < length) {
  5301. result[index] = iteratee(array[index], index, array);
  5302. }
  5303. return result;
  5304. }
  5305. /**
  5306. * The base implementation of `_.times` without support for iteratee shorthands
  5307. * or max array length checks.
  5308. *
  5309. * @private
  5310. * @param {number} n The number of times to invoke `iteratee`.
  5311. * @param {Function} iteratee The function invoked per iteration.
  5312. * @returns {Array} Returns the array of results.
  5313. */
  5314. function baseTimes(n, iteratee) {
  5315. var index = -1,
  5316. result = Array(n);
  5317. while (++index < n) {
  5318. result[index] = iteratee(index);
  5319. }
  5320. return result;
  5321. }
  5322. /**
  5323. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  5324. * of key-value pairs for `object` corresponding to the property names of `props`.
  5325. *
  5326. * @private
  5327. * @param {Object} object The object to query.
  5328. * @param {Array} props The property names to get values for.
  5329. * @returns {Object} Returns the key-value pairs.
  5330. */
  5331. function baseToPairs(object, props) {
  5332. return arrayMap(props, function (key) {
  5333. return [key, object[key]];
  5334. });
  5335. }
  5336. /**
  5337. * Gets the value at `key` of `object`.
  5338. *
  5339. * @private
  5340. * @param {Object} [object] The object to query.
  5341. * @param {string} key The key of the property to get.
  5342. * @returns {*} Returns the property value.
  5343. */
  5344. function getValue(object, key) {
  5345. return object == null ? undefined : object[key];
  5346. }
  5347. /**
  5348. * Checks if `value` is a host object in IE < 9.
  5349. *
  5350. * @private
  5351. * @param {*} value The value to check.
  5352. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  5353. */
  5354. function isHostObject(value) {
  5355. // Many host objects are `Object` objects that can coerce to strings
  5356. // despite having improperly defined `toString` methods.
  5357. var result = false;
  5358. if (value != null && typeof value.toString != 'function') {
  5359. try {
  5360. result = !!(value + '');
  5361. } catch (e) {}
  5362. }
  5363. return result;
  5364. }
  5365. /**
  5366. * Converts `map` to its key-value pairs.
  5367. *
  5368. * @private
  5369. * @param {Object} map The map to convert.
  5370. * @returns {Array} Returns the key-value pairs.
  5371. */
  5372. function mapToArray(map) {
  5373. var index = -1,
  5374. result = Array(map.size);
  5375. map.forEach(function (value, key) {
  5376. result[++index] = [key, value];
  5377. });
  5378. return result;
  5379. }
  5380. /**
  5381. * Creates a unary function that invokes `func` with its argument transformed.
  5382. *
  5383. * @private
  5384. * @param {Function} func The function to wrap.
  5385. * @param {Function} transform The argument transform.
  5386. * @returns {Function} Returns the new function.
  5387. */
  5388. function overArg(func, transform) {
  5389. return function (arg) {
  5390. return func(transform(arg));
  5391. };
  5392. }
  5393. /**
  5394. * Converts `set` to its value-value pairs.
  5395. *
  5396. * @private
  5397. * @param {Object} set The set to convert.
  5398. * @returns {Array} Returns the value-value pairs.
  5399. */
  5400. function setToPairs(set) {
  5401. var index = -1,
  5402. result = Array(set.size);
  5403. set.forEach(function (value) {
  5404. result[++index] = [value, value];
  5405. });
  5406. return result;
  5407. }
  5408. /** Used for built-in method references. */
  5409. var funcProto = Function.prototype,
  5410. objectProto = Object.prototype;
  5411. /** Used to detect overreaching core-js shims. */
  5412. var coreJsData = root['__core-js_shared__'];
  5413. /** Used to detect methods masquerading as native. */
  5414. var maskSrcKey = function () {
  5415. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  5416. return uid ? 'Symbol(src)_1.' + uid : '';
  5417. }();
  5418. /** Used to resolve the decompiled source of functions. */
  5419. var funcToString = funcProto.toString;
  5420. /** Used to check objects for own properties. */
  5421. var hasOwnProperty = objectProto.hasOwnProperty;
  5422. /**
  5423. * Used to resolve the
  5424. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  5425. * of values.
  5426. */
  5427. var objectToString = objectProto.toString;
  5428. /** Used to detect if a method is native. */
  5429. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  5430. /** Built-in value references. */
  5431. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  5432. /* Built-in method references for those with the same name as other `lodash` methods. */
  5433. var nativeKeys = overArg(Object.keys, Object);
  5434. /* Built-in method references that are verified to be native. */
  5435. var DataView = getNative(root, 'DataView'),
  5436. Map = getNative(root, 'Map'),
  5437. Promise = getNative(root, 'Promise'),
  5438. Set = getNative(root, 'Set'),
  5439. WeakMap = getNative(root, 'WeakMap');
  5440. /** Used to detect maps, sets, and weakmaps. */
  5441. var dataViewCtorString = toSource(DataView),
  5442. mapCtorString = toSource(Map),
  5443. promiseCtorString = toSource(Promise),
  5444. setCtorString = toSource(Set),
  5445. weakMapCtorString = toSource(WeakMap);
  5446. /**
  5447. * Creates an array of the enumerable property names of the array-like `value`.
  5448. *
  5449. * @private
  5450. * @param {*} value The value to query.
  5451. * @param {boolean} inherited Specify returning inherited property names.
  5452. * @returns {Array} Returns the array of property names.
  5453. */
  5454. function arrayLikeKeys(value, inherited) {
  5455. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  5456. // Safari 9 makes `arguments.length` enumerable in strict mode.
  5457. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  5458. var length = result.length,
  5459. skipIndexes = !!length;
  5460. for (var key in value) {
  5461. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  5462. result.push(key);
  5463. }
  5464. }
  5465. return result;
  5466. }
  5467. /**
  5468. * The base implementation of `getTag`.
  5469. *
  5470. * @private
  5471. * @param {*} value The value to query.
  5472. * @returns {string} Returns the `toStringTag`.
  5473. */
  5474. function baseGetTag(value) {
  5475. return objectToString.call(value);
  5476. }
  5477. /**
  5478. * The base implementation of `_.isNative` without bad shim checks.
  5479. *
  5480. * @private
  5481. * @param {*} value The value to check.
  5482. * @returns {boolean} Returns `true` if `value` is a native function,
  5483. * else `false`.
  5484. */
  5485. function baseIsNative(value) {
  5486. if (!isObject(value) || isMasked(value)) {
  5487. return false;
  5488. }
  5489. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  5490. return pattern.test(toSource(value));
  5491. }
  5492. /**
  5493. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  5494. *
  5495. * @private
  5496. * @param {Object} object The object to query.
  5497. * @returns {Array} Returns the array of property names.
  5498. */
  5499. function baseKeys(object) {
  5500. if (!isPrototype(object)) {
  5501. return nativeKeys(object);
  5502. }
  5503. var result = [];
  5504. for (var key in Object(object)) {
  5505. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  5506. result.push(key);
  5507. }
  5508. }
  5509. return result;
  5510. }
  5511. /**
  5512. * Creates a `_.toPairs` or `_.toPairsIn` function.
  5513. *
  5514. * @private
  5515. * @param {Function} keysFunc The function to get the keys of a given object.
  5516. * @returns {Function} Returns the new pairs function.
  5517. */
  5518. function createToPairs(keysFunc) {
  5519. return function (object) {
  5520. var tag = getTag(object);
  5521. if (tag == mapTag) {
  5522. return mapToArray(object);
  5523. }
  5524. if (tag == setTag) {
  5525. return setToPairs(object);
  5526. }
  5527. return baseToPairs(object, keysFunc(object));
  5528. };
  5529. }
  5530. /**
  5531. * Gets the native function at `key` of `object`.
  5532. *
  5533. * @private
  5534. * @param {Object} object The object to query.
  5535. * @param {string} key The key of the method to get.
  5536. * @returns {*} Returns the function if it's native, else `undefined`.
  5537. */
  5538. function getNative(object, key) {
  5539. var value = getValue(object, key);
  5540. return baseIsNative(value) ? value : undefined;
  5541. }
  5542. /**
  5543. * Gets the `toStringTag` of `value`.
  5544. *
  5545. * @private
  5546. * @param {*} value The value to query.
  5547. * @returns {string} Returns the `toStringTag`.
  5548. */
  5549. var getTag = baseGetTag;
  5550. // Fallback for data views, maps, sets, and weak maps in IE 11,
  5551. // for data views in Edge < 14, and promises in Node.js.
  5552. 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) {
  5553. getTag = function getTag(value) {
  5554. var result = objectToString.call(value),
  5555. Ctor = result == objectTag ? value.constructor : undefined,
  5556. ctorString = Ctor ? toSource(Ctor) : undefined;
  5557. if (ctorString) {
  5558. switch (ctorString) {
  5559. case dataViewCtorString:
  5560. return dataViewTag;
  5561. case mapCtorString:
  5562. return mapTag;
  5563. case promiseCtorString:
  5564. return promiseTag;
  5565. case setCtorString:
  5566. return setTag;
  5567. case weakMapCtorString:
  5568. return weakMapTag;
  5569. }
  5570. }
  5571. return result;
  5572. };
  5573. }
  5574. /**
  5575. * Checks if `value` is a valid array-like index.
  5576. *
  5577. * @private
  5578. * @param {*} value The value to check.
  5579. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  5580. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  5581. */
  5582. function isIndex(value, length) {
  5583. length = length == null ? MAX_SAFE_INTEGER : length;
  5584. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  5585. }
  5586. /**
  5587. * Checks if `func` has its source masked.
  5588. *
  5589. * @private
  5590. * @param {Function} func The function to check.
  5591. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  5592. */
  5593. function isMasked(func) {
  5594. return !!maskSrcKey && maskSrcKey in func;
  5595. }
  5596. /**
  5597. * Checks if `value` is likely a prototype object.
  5598. *
  5599. * @private
  5600. * @param {*} value The value to check.
  5601. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  5602. */
  5603. function isPrototype(value) {
  5604. var Ctor = value && value.constructor,
  5605. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  5606. return value === proto;
  5607. }
  5608. /**
  5609. * Converts `func` to its source code.
  5610. *
  5611. * @private
  5612. * @param {Function} func The function to process.
  5613. * @returns {string} Returns the source code.
  5614. */
  5615. function toSource(func) {
  5616. if (func != null) {
  5617. try {
  5618. return funcToString.call(func);
  5619. } catch (e) {}
  5620. try {
  5621. return func + '';
  5622. } catch (e) {}
  5623. }
  5624. return '';
  5625. }
  5626. /**
  5627. * Checks if `value` is likely an `arguments` object.
  5628. *
  5629. * @static
  5630. * @memberOf _
  5631. * @since 0.1.0
  5632. * @category Lang
  5633. * @param {*} value The value to check.
  5634. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  5635. * else `false`.
  5636. * @example
  5637. *
  5638. * _.isArguments(function() { return arguments; }());
  5639. * // => true
  5640. *
  5641. * _.isArguments([1, 2, 3]);
  5642. * // => false
  5643. */
  5644. function isArguments(value) {
  5645. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  5646. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  5647. }
  5648. /**
  5649. * Checks if `value` is classified as an `Array` object.
  5650. *
  5651. * @static
  5652. * @memberOf _
  5653. * @since 0.1.0
  5654. * @category Lang
  5655. * @param {*} value The value to check.
  5656. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  5657. * @example
  5658. *
  5659. * _.isArray([1, 2, 3]);
  5660. * // => true
  5661. *
  5662. * _.isArray(document.body.children);
  5663. * // => false
  5664. *
  5665. * _.isArray('abc');
  5666. * // => false
  5667. *
  5668. * _.isArray(_.noop);
  5669. * // => false
  5670. */
  5671. var isArray = Array.isArray;
  5672. /**
  5673. * Checks if `value` is array-like. A value is considered array-like if it's
  5674. * not a function and has a `value.length` that's an integer greater than or
  5675. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  5676. *
  5677. * @static
  5678. * @memberOf _
  5679. * @since 4.0.0
  5680. * @category Lang
  5681. * @param {*} value The value to check.
  5682. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  5683. * @example
  5684. *
  5685. * _.isArrayLike([1, 2, 3]);
  5686. * // => true
  5687. *
  5688. * _.isArrayLike(document.body.children);
  5689. * // => true
  5690. *
  5691. * _.isArrayLike('abc');
  5692. * // => true
  5693. *
  5694. * _.isArrayLike(_.noop);
  5695. * // => false
  5696. */
  5697. function isArrayLike(value) {
  5698. return value != null && isLength(value.length) && !isFunction(value);
  5699. }
  5700. /**
  5701. * This method is like `_.isArrayLike` except that it also checks if `value`
  5702. * is an object.
  5703. *
  5704. * @static
  5705. * @memberOf _
  5706. * @since 4.0.0
  5707. * @category Lang
  5708. * @param {*} value The value to check.
  5709. * @returns {boolean} Returns `true` if `value` is an array-like object,
  5710. * else `false`.
  5711. * @example
  5712. *
  5713. * _.isArrayLikeObject([1, 2, 3]);
  5714. * // => true
  5715. *
  5716. * _.isArrayLikeObject(document.body.children);
  5717. * // => true
  5718. *
  5719. * _.isArrayLikeObject('abc');
  5720. * // => false
  5721. *
  5722. * _.isArrayLikeObject(_.noop);
  5723. * // => false
  5724. */
  5725. function isArrayLikeObject(value) {
  5726. return isObjectLike(value) && isArrayLike(value);
  5727. }
  5728. /**
  5729. * Checks if `value` is classified as a `Function` object.
  5730. *
  5731. * @static
  5732. * @memberOf _
  5733. * @since 0.1.0
  5734. * @category Lang
  5735. * @param {*} value The value to check.
  5736. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  5737. * @example
  5738. *
  5739. * _.isFunction(_);
  5740. * // => true
  5741. *
  5742. * _.isFunction(/abc/);
  5743. * // => false
  5744. */
  5745. function isFunction(value) {
  5746. // The use of `Object#toString` avoids issues with the `typeof` operator
  5747. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  5748. var tag = isObject(value) ? objectToString.call(value) : '';
  5749. return tag == funcTag || tag == genTag;
  5750. }
  5751. /**
  5752. * Checks if `value` is a valid array-like length.
  5753. *
  5754. * **Note:** This method is loosely based on
  5755. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  5756. *
  5757. * @static
  5758. * @memberOf _
  5759. * @since 4.0.0
  5760. * @category Lang
  5761. * @param {*} value The value to check.
  5762. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  5763. * @example
  5764. *
  5765. * _.isLength(3);
  5766. * // => true
  5767. *
  5768. * _.isLength(Number.MIN_VALUE);
  5769. * // => false
  5770. *
  5771. * _.isLength(Infinity);
  5772. * // => false
  5773. *
  5774. * _.isLength('3');
  5775. * // => false
  5776. */
  5777. function isLength(value) {
  5778. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  5779. }
  5780. /**
  5781. * Checks if `value` is the
  5782. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  5783. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  5784. *
  5785. * @static
  5786. * @memberOf _
  5787. * @since 0.1.0
  5788. * @category Lang
  5789. * @param {*} value The value to check.
  5790. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  5791. * @example
  5792. *
  5793. * _.isObject({});
  5794. * // => true
  5795. *
  5796. * _.isObject([1, 2, 3]);
  5797. * // => true
  5798. *
  5799. * _.isObject(_.noop);
  5800. * // => true
  5801. *
  5802. * _.isObject(null);
  5803. * // => false
  5804. */
  5805. function isObject(value) {
  5806. var type = _typeof(value);
  5807. return !!value && (type == 'object' || type == 'function');
  5808. }
  5809. /**
  5810. * Checks if `value` is object-like. A value is object-like if it's not `null`
  5811. * and has a `typeof` result of "object".
  5812. *
  5813. * @static
  5814. * @memberOf _
  5815. * @since 4.0.0
  5816. * @category Lang
  5817. * @param {*} value The value to check.
  5818. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  5819. * @example
  5820. *
  5821. * _.isObjectLike({});
  5822. * // => true
  5823. *
  5824. * _.isObjectLike([1, 2, 3]);
  5825. * // => true
  5826. *
  5827. * _.isObjectLike(_.noop);
  5828. * // => false
  5829. *
  5830. * _.isObjectLike(null);
  5831. * // => false
  5832. */
  5833. function isObjectLike(value) {
  5834. return !!value && _typeof(value) == 'object';
  5835. }
  5836. /**
  5837. * Creates an array of the own enumerable property names of `object`.
  5838. *
  5839. * **Note:** Non-object values are coerced to objects. See the
  5840. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  5841. * for more details.
  5842. *
  5843. * @static
  5844. * @since 0.1.0
  5845. * @memberOf _
  5846. * @category Object
  5847. * @param {Object} object The object to query.
  5848. * @returns {Array} Returns the array of property names.
  5849. * @example
  5850. *
  5851. * function Foo() {
  5852. * this.a = 1;
  5853. * this.b = 2;
  5854. * }
  5855. *
  5856. * Foo.prototype.c = 3;
  5857. *
  5858. * _.keys(new Foo);
  5859. * // => ['a', 'b'] (iteration order is not guaranteed)
  5860. *
  5861. * _.keys('hi');
  5862. * // => ['0', '1']
  5863. */
  5864. function keys(object) {
  5865. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  5866. }
  5867. /**
  5868. * Creates an array of own enumerable string keyed-value pairs for `object`
  5869. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  5870. * entries are returned.
  5871. *
  5872. * @static
  5873. * @memberOf _
  5874. * @since 4.0.0
  5875. * @alias entries
  5876. * @category Object
  5877. * @param {Object} object The object to query.
  5878. * @returns {Array} Returns the key-value pairs.
  5879. * @example
  5880. *
  5881. * function Foo() {
  5882. * this.a = 1;
  5883. * this.b = 2;
  5884. * }
  5885. *
  5886. * Foo.prototype.c = 3;
  5887. *
  5888. * _.toPairs(new Foo);
  5889. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  5890. */
  5891. var toPairs = createToPairs(keys);
  5892. module.exports = toPairs;
  5893. /***/ }),
  5894. /***/ 9819:
  5895. /***/ (function(module, exports, __webpack_require__) {
  5896. /* module decorator */ module = __webpack_require__.nmd(module);
  5897. 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); }
  5898. /**
  5899. * lodash (Custom Build) <https://lodash.com/>
  5900. * Build: `lodash modularize exports="npm" -o ./`
  5901. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  5902. * Released under MIT license <https://lodash.com/license>
  5903. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  5904. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  5905. */
  5906. /** Used as the size to enable large array optimizations. */
  5907. var LARGE_ARRAY_SIZE = 200;
  5908. /** Used as the `TypeError` message for "Functions" methods. */
  5909. var FUNC_ERROR_TEXT = 'Expected a function';
  5910. /** Used to stand-in for `undefined` hash values. */
  5911. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  5912. /** Used to compose bitmasks for comparison styles. */
  5913. var UNORDERED_COMPARE_FLAG = 1,
  5914. PARTIAL_COMPARE_FLAG = 2;
  5915. /** Used as references for various `Number` constants. */
  5916. var INFINITY = 1 / 0,
  5917. MAX_SAFE_INTEGER = 9007199254740991;
  5918. /** `Object#toString` result references. */
  5919. var argsTag = '[object Arguments]',
  5920. arrayTag = '[object Array]',
  5921. boolTag = '[object Boolean]',
  5922. dateTag = '[object Date]',
  5923. errorTag = '[object Error]',
  5924. funcTag = '[object Function]',
  5925. genTag = '[object GeneratorFunction]',
  5926. mapTag = '[object Map]',
  5927. numberTag = '[object Number]',
  5928. objectTag = '[object Object]',
  5929. promiseTag = '[object Promise]',
  5930. regexpTag = '[object RegExp]',
  5931. setTag = '[object Set]',
  5932. stringTag = '[object String]',
  5933. symbolTag = '[object Symbol]',
  5934. weakMapTag = '[object WeakMap]';
  5935. var arrayBufferTag = '[object ArrayBuffer]',
  5936. dataViewTag = '[object DataView]',
  5937. float32Tag = '[object Float32Array]',
  5938. float64Tag = '[object Float64Array]',
  5939. int8Tag = '[object Int8Array]',
  5940. int16Tag = '[object Int16Array]',
  5941. int32Tag = '[object Int32Array]',
  5942. uint8Tag = '[object Uint8Array]',
  5943. uint8ClampedTag = '[object Uint8ClampedArray]',
  5944. uint16Tag = '[object Uint16Array]',
  5945. uint32Tag = '[object Uint32Array]';
  5946. /** Used to match property names within property paths. */
  5947. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  5948. reIsPlainProp = /^\w*$/,
  5949. reLeadingDot = /^\./,
  5950. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  5951. /**
  5952. * Used to match `RegExp`
  5953. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  5954. */
  5955. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  5956. /** Used to match backslashes in property paths. */
  5957. var reEscapeChar = /\\(\\)?/g;
  5958. /** Used to detect host constructors (Safari). */
  5959. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  5960. /** Used to detect unsigned integer values. */
  5961. var reIsUint = /^(?:0|[1-9]\d*)$/;
  5962. /** Used to identify `toStringTag` values of typed arrays. */
  5963. var typedArrayTags = {};
  5964. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  5965. 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;
  5966. /** Detect free variable `global` from Node.js. */
  5967. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  5968. /** Detect free variable `self`. */
  5969. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  5970. /** Used as a reference to the global object. */
  5971. var root = freeGlobal || freeSelf || Function('return this')();
  5972. /** Detect free variable `exports`. */
  5973. var freeExports = ( false ? 0 : _typeof(exports)) == 'object' && exports && !exports.nodeType && exports;
  5974. /** Detect free variable `module`. */
  5975. var freeModule = freeExports && ( false ? 0 : _typeof(module)) == 'object' && module && !module.nodeType && module;
  5976. /** Detect the popular CommonJS extension `module.exports`. */
  5977. var moduleExports = freeModule && freeModule.exports === freeExports;
  5978. /** Detect free variable `process` from Node.js. */
  5979. var freeProcess = moduleExports && freeGlobal.process;
  5980. /** Used to access faster Node.js helpers. */
  5981. var nodeUtil = function () {
  5982. try {
  5983. return freeProcess && freeProcess.binding('util');
  5984. } catch (e) {}
  5985. }();
  5986. /* Node.js helper references. */
  5987. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  5988. /**
  5989. * A specialized version of `_.includes` for arrays without support for
  5990. * specifying an index to search from.
  5991. *
  5992. * @private
  5993. * @param {Array} [array] The array to inspect.
  5994. * @param {*} target The value to search for.
  5995. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  5996. */
  5997. function arrayIncludes(array, value) {
  5998. var length = array ? array.length : 0;
  5999. return !!length && baseIndexOf(array, value, 0) > -1;
  6000. }
  6001. /**
  6002. * This function is like `arrayIncludes` except that it accepts a comparator.
  6003. *
  6004. * @private
  6005. * @param {Array} [array] The array to inspect.
  6006. * @param {*} target The value to search for.
  6007. * @param {Function} comparator The comparator invoked per element.
  6008. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  6009. */
  6010. function arrayIncludesWith(array, value, comparator) {
  6011. var index = -1,
  6012. length = array ? array.length : 0;
  6013. while (++index < length) {
  6014. if (comparator(value, array[index])) {
  6015. return true;
  6016. }
  6017. }
  6018. return false;
  6019. }
  6020. /**
  6021. * A specialized version of `_.some` for arrays without support for iteratee
  6022. * shorthands.
  6023. *
  6024. * @private
  6025. * @param {Array} [array] The array to iterate over.
  6026. * @param {Function} predicate The function invoked per iteration.
  6027. * @returns {boolean} Returns `true` if any element passes the predicate check,
  6028. * else `false`.
  6029. */
  6030. function arraySome(array, predicate) {
  6031. var index = -1,
  6032. length = array ? array.length : 0;
  6033. while (++index < length) {
  6034. if (predicate(array[index], index, array)) {
  6035. return true;
  6036. }
  6037. }
  6038. return false;
  6039. }
  6040. /**
  6041. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  6042. * support for iteratee shorthands.
  6043. *
  6044. * @private
  6045. * @param {Array} array The array to inspect.
  6046. * @param {Function} predicate The function invoked per iteration.
  6047. * @param {number} fromIndex The index to search from.
  6048. * @param {boolean} [fromRight] Specify iterating from right to left.
  6049. * @returns {number} Returns the index of the matched value, else `-1`.
  6050. */
  6051. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  6052. var length = array.length,
  6053. index = fromIndex + (fromRight ? 1 : -1);
  6054. while (fromRight ? index-- : ++index < length) {
  6055. if (predicate(array[index], index, array)) {
  6056. return index;
  6057. }
  6058. }
  6059. return -1;
  6060. }
  6061. /**
  6062. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  6063. *
  6064. * @private
  6065. * @param {Array} array The array to inspect.
  6066. * @param {*} value The value to search for.
  6067. * @param {number} fromIndex The index to search from.
  6068. * @returns {number} Returns the index of the matched value, else `-1`.
  6069. */
  6070. function baseIndexOf(array, value, fromIndex) {
  6071. if (value !== value) {
  6072. return baseFindIndex(array, baseIsNaN, fromIndex);
  6073. }
  6074. var index = fromIndex - 1,
  6075. length = array.length;
  6076. while (++index < length) {
  6077. if (array[index] === value) {
  6078. return index;
  6079. }
  6080. }
  6081. return -1;
  6082. }
  6083. /**
  6084. * The base implementation of `_.isNaN` without support for number objects.
  6085. *
  6086. * @private
  6087. * @param {*} value The value to check.
  6088. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  6089. */
  6090. function baseIsNaN(value) {
  6091. return value !== value;
  6092. }
  6093. /**
  6094. * The base implementation of `_.property` without support for deep paths.
  6095. *
  6096. * @private
  6097. * @param {string} key The key of the property to get.
  6098. * @returns {Function} Returns the new accessor function.
  6099. */
  6100. function baseProperty(key) {
  6101. return function (object) {
  6102. return object == null ? undefined : object[key];
  6103. };
  6104. }
  6105. /**
  6106. * The base implementation of `_.times` without support for iteratee shorthands
  6107. * or max array length checks.
  6108. *
  6109. * @private
  6110. * @param {number} n The number of times to invoke `iteratee`.
  6111. * @param {Function} iteratee The function invoked per iteration.
  6112. * @returns {Array} Returns the array of results.
  6113. */
  6114. function baseTimes(n, iteratee) {
  6115. var index = -1,
  6116. result = Array(n);
  6117. while (++index < n) {
  6118. result[index] = iteratee(index);
  6119. }
  6120. return result;
  6121. }
  6122. /**
  6123. * The base implementation of `_.unary` without support for storing metadata.
  6124. *
  6125. * @private
  6126. * @param {Function} func The function to cap arguments for.
  6127. * @returns {Function} Returns the new capped function.
  6128. */
  6129. function baseUnary(func) {
  6130. return function (value) {
  6131. return func(value);
  6132. };
  6133. }
  6134. /**
  6135. * Checks if a cache value for `key` exists.
  6136. *
  6137. * @private
  6138. * @param {Object} cache The cache to query.
  6139. * @param {string} key The key of the entry to check.
  6140. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  6141. */
  6142. function cacheHas(cache, key) {
  6143. return cache.has(key);
  6144. }
  6145. /**
  6146. * Gets the value at `key` of `object`.
  6147. *
  6148. * @private
  6149. * @param {Object} [object] The object to query.
  6150. * @param {string} key The key of the property to get.
  6151. * @returns {*} Returns the property value.
  6152. */
  6153. function getValue(object, key) {
  6154. return object == null ? undefined : object[key];
  6155. }
  6156. /**
  6157. * Checks if `value` is a host object in IE < 9.
  6158. *
  6159. * @private
  6160. * @param {*} value The value to check.
  6161. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  6162. */
  6163. function isHostObject(value) {
  6164. // Many host objects are `Object` objects that can coerce to strings
  6165. // despite having improperly defined `toString` methods.
  6166. var result = false;
  6167. if (value != null && typeof value.toString != 'function') {
  6168. try {
  6169. result = !!(value + '');
  6170. } catch (e) {}
  6171. }
  6172. return result;
  6173. }
  6174. /**
  6175. * Converts `map` to its key-value pairs.
  6176. *
  6177. * @private
  6178. * @param {Object} map The map to convert.
  6179. * @returns {Array} Returns the key-value pairs.
  6180. */
  6181. function mapToArray(map) {
  6182. var index = -1,
  6183. result = Array(map.size);
  6184. map.forEach(function (value, key) {
  6185. result[++index] = [key, value];
  6186. });
  6187. return result;
  6188. }
  6189. /**
  6190. * Creates a unary function that invokes `func` with its argument transformed.
  6191. *
  6192. * @private
  6193. * @param {Function} func The function to wrap.
  6194. * @param {Function} transform The argument transform.
  6195. * @returns {Function} Returns the new function.
  6196. */
  6197. function overArg(func, transform) {
  6198. return function (arg) {
  6199. return func(transform(arg));
  6200. };
  6201. }
  6202. /**
  6203. * Converts `set` to an array of its values.
  6204. *
  6205. * @private
  6206. * @param {Object} set The set to convert.
  6207. * @returns {Array} Returns the values.
  6208. */
  6209. function setToArray(set) {
  6210. var index = -1,
  6211. result = Array(set.size);
  6212. set.forEach(function (value) {
  6213. result[++index] = value;
  6214. });
  6215. return result;
  6216. }
  6217. /** Used for built-in method references. */
  6218. var arrayProto = Array.prototype,
  6219. funcProto = Function.prototype,
  6220. objectProto = Object.prototype;
  6221. /** Used to detect overreaching core-js shims. */
  6222. var coreJsData = root['__core-js_shared__'];
  6223. /** Used to detect methods masquerading as native. */
  6224. var maskSrcKey = function () {
  6225. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  6226. return uid ? 'Symbol(src)_1.' + uid : '';
  6227. }();
  6228. /** Used to resolve the decompiled source of functions. */
  6229. var funcToString = funcProto.toString;
  6230. /** Used to check objects for own properties. */
  6231. var hasOwnProperty = objectProto.hasOwnProperty;
  6232. /**
  6233. * Used to resolve the
  6234. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  6235. * of values.
  6236. */
  6237. var objectToString = objectProto.toString;
  6238. /** Used to detect if a method is native. */
  6239. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  6240. /** Built-in value references. */
  6241. var _Symbol = root.Symbol,
  6242. Uint8Array = root.Uint8Array,
  6243. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  6244. splice = arrayProto.splice;
  6245. /* Built-in method references for those with the same name as other `lodash` methods. */
  6246. var nativeKeys = overArg(Object.keys, Object);
  6247. /* Built-in method references that are verified to be native. */
  6248. var DataView = getNative(root, 'DataView'),
  6249. Map = getNative(root, 'Map'),
  6250. Promise = getNative(root, 'Promise'),
  6251. Set = getNative(root, 'Set'),
  6252. WeakMap = getNative(root, 'WeakMap'),
  6253. nativeCreate = getNative(Object, 'create');
  6254. /** Used to detect maps, sets, and weakmaps. */
  6255. var dataViewCtorString = toSource(DataView),
  6256. mapCtorString = toSource(Map),
  6257. promiseCtorString = toSource(Promise),
  6258. setCtorString = toSource(Set),
  6259. weakMapCtorString = toSource(WeakMap);
  6260. /** Used to convert symbols to primitives and strings. */
  6261. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  6262. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  6263. symbolToString = symbolProto ? symbolProto.toString : undefined;
  6264. /**
  6265. * Creates a hash object.
  6266. *
  6267. * @private
  6268. * @constructor
  6269. * @param {Array} [entries] The key-value pairs to cache.
  6270. */
  6271. function Hash(entries) {
  6272. var index = -1,
  6273. length = entries ? entries.length : 0;
  6274. this.clear();
  6275. while (++index < length) {
  6276. var entry = entries[index];
  6277. this.set(entry[0], entry[1]);
  6278. }
  6279. }
  6280. /**
  6281. * Removes all key-value entries from the hash.
  6282. *
  6283. * @private
  6284. * @name clear
  6285. * @memberOf Hash
  6286. */
  6287. function hashClear() {
  6288. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  6289. }
  6290. /**
  6291. * Removes `key` and its value from the hash.
  6292. *
  6293. * @private
  6294. * @name delete
  6295. * @memberOf Hash
  6296. * @param {Object} hash The hash to modify.
  6297. * @param {string} key The key of the value to remove.
  6298. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  6299. */
  6300. function hashDelete(key) {
  6301. return this.has(key) && delete this.__data__[key];
  6302. }
  6303. /**
  6304. * Gets the hash value for `key`.
  6305. *
  6306. * @private
  6307. * @name get
  6308. * @memberOf Hash
  6309. * @param {string} key The key of the value to get.
  6310. * @returns {*} Returns the entry value.
  6311. */
  6312. function hashGet(key) {
  6313. var data = this.__data__;
  6314. if (nativeCreate) {
  6315. var result = data[key];
  6316. return result === HASH_UNDEFINED ? undefined : result;
  6317. }
  6318. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  6319. }
  6320. /**
  6321. * Checks if a hash value for `key` exists.
  6322. *
  6323. * @private
  6324. * @name has
  6325. * @memberOf Hash
  6326. * @param {string} key The key of the entry to check.
  6327. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  6328. */
  6329. function hashHas(key) {
  6330. var data = this.__data__;
  6331. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  6332. }
  6333. /**
  6334. * Sets the hash `key` to `value`.
  6335. *
  6336. * @private
  6337. * @name set
  6338. * @memberOf Hash
  6339. * @param {string} key The key of the value to set.
  6340. * @param {*} value The value to set.
  6341. * @returns {Object} Returns the hash instance.
  6342. */
  6343. function hashSet(key, value) {
  6344. var data = this.__data__;
  6345. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  6346. return this;
  6347. }
  6348. // Add methods to `Hash`.
  6349. Hash.prototype.clear = hashClear;
  6350. Hash.prototype['delete'] = hashDelete;
  6351. Hash.prototype.get = hashGet;
  6352. Hash.prototype.has = hashHas;
  6353. Hash.prototype.set = hashSet;
  6354. /**
  6355. * Creates an list cache object.
  6356. *
  6357. * @private
  6358. * @constructor
  6359. * @param {Array} [entries] The key-value pairs to cache.
  6360. */
  6361. function ListCache(entries) {
  6362. var index = -1,
  6363. length = entries ? entries.length : 0;
  6364. this.clear();
  6365. while (++index < length) {
  6366. var entry = entries[index];
  6367. this.set(entry[0], entry[1]);
  6368. }
  6369. }
  6370. /**
  6371. * Removes all key-value entries from the list cache.
  6372. *
  6373. * @private
  6374. * @name clear
  6375. * @memberOf ListCache
  6376. */
  6377. function listCacheClear() {
  6378. this.__data__ = [];
  6379. }
  6380. /**
  6381. * Removes `key` and its value from the list cache.
  6382. *
  6383. * @private
  6384. * @name delete
  6385. * @memberOf ListCache
  6386. * @param {string} key The key of the value to remove.
  6387. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  6388. */
  6389. function listCacheDelete(key) {
  6390. var data = this.__data__,
  6391. index = assocIndexOf(data, key);
  6392. if (index < 0) {
  6393. return false;
  6394. }
  6395. var lastIndex = data.length - 1;
  6396. if (index == lastIndex) {
  6397. data.pop();
  6398. } else {
  6399. splice.call(data, index, 1);
  6400. }
  6401. return true;
  6402. }
  6403. /**
  6404. * Gets the list cache value for `key`.
  6405. *
  6406. * @private
  6407. * @name get
  6408. * @memberOf ListCache
  6409. * @param {string} key The key of the value to get.
  6410. * @returns {*} Returns the entry value.
  6411. */
  6412. function listCacheGet(key) {
  6413. var data = this.__data__,
  6414. index = assocIndexOf(data, key);
  6415. return index < 0 ? undefined : data[index][1];
  6416. }
  6417. /**
  6418. * Checks if a list cache value for `key` exists.
  6419. *
  6420. * @private
  6421. * @name has
  6422. * @memberOf ListCache
  6423. * @param {string} key The key of the entry to check.
  6424. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  6425. */
  6426. function listCacheHas(key) {
  6427. return assocIndexOf(this.__data__, key) > -1;
  6428. }
  6429. /**
  6430. * Sets the list cache `key` to `value`.
  6431. *
  6432. * @private
  6433. * @name set
  6434. * @memberOf ListCache
  6435. * @param {string} key The key of the value to set.
  6436. * @param {*} value The value to set.
  6437. * @returns {Object} Returns the list cache instance.
  6438. */
  6439. function listCacheSet(key, value) {
  6440. var data = this.__data__,
  6441. index = assocIndexOf(data, key);
  6442. if (index < 0) {
  6443. data.push([key, value]);
  6444. } else {
  6445. data[index][1] = value;
  6446. }
  6447. return this;
  6448. }
  6449. // Add methods to `ListCache`.
  6450. ListCache.prototype.clear = listCacheClear;
  6451. ListCache.prototype['delete'] = listCacheDelete;
  6452. ListCache.prototype.get = listCacheGet;
  6453. ListCache.prototype.has = listCacheHas;
  6454. ListCache.prototype.set = listCacheSet;
  6455. /**
  6456. * Creates a map cache object to store key-value pairs.
  6457. *
  6458. * @private
  6459. * @constructor
  6460. * @param {Array} [entries] The key-value pairs to cache.
  6461. */
  6462. function MapCache(entries) {
  6463. var index = -1,
  6464. length = entries ? entries.length : 0;
  6465. this.clear();
  6466. while (++index < length) {
  6467. var entry = entries[index];
  6468. this.set(entry[0], entry[1]);
  6469. }
  6470. }
  6471. /**
  6472. * Removes all key-value entries from the map.
  6473. *
  6474. * @private
  6475. * @name clear
  6476. * @memberOf MapCache
  6477. */
  6478. function mapCacheClear() {
  6479. this.__data__ = {
  6480. 'hash': new Hash(),
  6481. 'map': new (Map || ListCache)(),
  6482. 'string': new Hash()
  6483. };
  6484. }
  6485. /**
  6486. * Removes `key` and its value from the map.
  6487. *
  6488. * @private
  6489. * @name delete
  6490. * @memberOf MapCache
  6491. * @param {string} key The key of the value to remove.
  6492. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  6493. */
  6494. function mapCacheDelete(key) {
  6495. return getMapData(this, key)['delete'](key);
  6496. }
  6497. /**
  6498. * Gets the map value for `key`.
  6499. *
  6500. * @private
  6501. * @name get
  6502. * @memberOf MapCache
  6503. * @param {string} key The key of the value to get.
  6504. * @returns {*} Returns the entry value.
  6505. */
  6506. function mapCacheGet(key) {
  6507. return getMapData(this, key).get(key);
  6508. }
  6509. /**
  6510. * Checks if a map value for `key` exists.
  6511. *
  6512. * @private
  6513. * @name has
  6514. * @memberOf MapCache
  6515. * @param {string} key The key of the entry to check.
  6516. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  6517. */
  6518. function mapCacheHas(key) {
  6519. return getMapData(this, key).has(key);
  6520. }
  6521. /**
  6522. * Sets the map `key` to `value`.
  6523. *
  6524. * @private
  6525. * @name set
  6526. * @memberOf MapCache
  6527. * @param {string} key The key of the value to set.
  6528. * @param {*} value The value to set.
  6529. * @returns {Object} Returns the map cache instance.
  6530. */
  6531. function mapCacheSet(key, value) {
  6532. getMapData(this, key).set(key, value);
  6533. return this;
  6534. }
  6535. // Add methods to `MapCache`.
  6536. MapCache.prototype.clear = mapCacheClear;
  6537. MapCache.prototype['delete'] = mapCacheDelete;
  6538. MapCache.prototype.get = mapCacheGet;
  6539. MapCache.prototype.has = mapCacheHas;
  6540. MapCache.prototype.set = mapCacheSet;
  6541. /**
  6542. *
  6543. * Creates an array cache object to store unique values.
  6544. *
  6545. * @private
  6546. * @constructor
  6547. * @param {Array} [values] The values to cache.
  6548. */
  6549. function SetCache(values) {
  6550. var index = -1,
  6551. length = values ? values.length : 0;
  6552. this.__data__ = new MapCache();
  6553. while (++index < length) {
  6554. this.add(values[index]);
  6555. }
  6556. }
  6557. /**
  6558. * Adds `value` to the array cache.
  6559. *
  6560. * @private
  6561. * @name add
  6562. * @memberOf SetCache
  6563. * @alias push
  6564. * @param {*} value The value to cache.
  6565. * @returns {Object} Returns the cache instance.
  6566. */
  6567. function setCacheAdd(value) {
  6568. this.__data__.set(value, HASH_UNDEFINED);
  6569. return this;
  6570. }
  6571. /**
  6572. * Checks if `value` is in the array cache.
  6573. *
  6574. * @private
  6575. * @name has
  6576. * @memberOf SetCache
  6577. * @param {*} value The value to search for.
  6578. * @returns {number} Returns `true` if `value` is found, else `false`.
  6579. */
  6580. function setCacheHas(value) {
  6581. return this.__data__.has(value);
  6582. }
  6583. // Add methods to `SetCache`.
  6584. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  6585. SetCache.prototype.has = setCacheHas;
  6586. /**
  6587. * Creates a stack cache object to store key-value pairs.
  6588. *
  6589. * @private
  6590. * @constructor
  6591. * @param {Array} [entries] The key-value pairs to cache.
  6592. */
  6593. function Stack(entries) {
  6594. this.__data__ = new ListCache(entries);
  6595. }
  6596. /**
  6597. * Removes all key-value entries from the stack.
  6598. *
  6599. * @private
  6600. * @name clear
  6601. * @memberOf Stack
  6602. */
  6603. function stackClear() {
  6604. this.__data__ = new ListCache();
  6605. }
  6606. /**
  6607. * Removes `key` and its value from the stack.
  6608. *
  6609. * @private
  6610. * @name delete
  6611. * @memberOf Stack
  6612. * @param {string} key The key of the value to remove.
  6613. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  6614. */
  6615. function stackDelete(key) {
  6616. return this.__data__['delete'](key);
  6617. }
  6618. /**
  6619. * Gets the stack value for `key`.
  6620. *
  6621. * @private
  6622. * @name get
  6623. * @memberOf Stack
  6624. * @param {string} key The key of the value to get.
  6625. * @returns {*} Returns the entry value.
  6626. */
  6627. function stackGet(key) {
  6628. return this.__data__.get(key);
  6629. }
  6630. /**
  6631. * Checks if a stack value for `key` exists.
  6632. *
  6633. * @private
  6634. * @name has
  6635. * @memberOf Stack
  6636. * @param {string} key The key of the entry to check.
  6637. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  6638. */
  6639. function stackHas(key) {
  6640. return this.__data__.has(key);
  6641. }
  6642. /**
  6643. * Sets the stack `key` to `value`.
  6644. *
  6645. * @private
  6646. * @name set
  6647. * @memberOf Stack
  6648. * @param {string} key The key of the value to set.
  6649. * @param {*} value The value to set.
  6650. * @returns {Object} Returns the stack cache instance.
  6651. */
  6652. function stackSet(key, value) {
  6653. var cache = this.__data__;
  6654. if (cache instanceof ListCache) {
  6655. var pairs = cache.__data__;
  6656. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  6657. pairs.push([key, value]);
  6658. return this;
  6659. }
  6660. cache = this.__data__ = new MapCache(pairs);
  6661. }
  6662. cache.set(key, value);
  6663. return this;
  6664. }
  6665. // Add methods to `Stack`.
  6666. Stack.prototype.clear = stackClear;
  6667. Stack.prototype['delete'] = stackDelete;
  6668. Stack.prototype.get = stackGet;
  6669. Stack.prototype.has = stackHas;
  6670. Stack.prototype.set = stackSet;
  6671. /**
  6672. * Creates an array of the enumerable property names of the array-like `value`.
  6673. *
  6674. * @private
  6675. * @param {*} value The value to query.
  6676. * @param {boolean} inherited Specify returning inherited property names.
  6677. * @returns {Array} Returns the array of property names.
  6678. */
  6679. function arrayLikeKeys(value, inherited) {
  6680. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  6681. // Safari 9 makes `arguments.length` enumerable in strict mode.
  6682. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  6683. var length = result.length,
  6684. skipIndexes = !!length;
  6685. for (var key in value) {
  6686. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  6687. result.push(key);
  6688. }
  6689. }
  6690. return result;
  6691. }
  6692. /**
  6693. * Gets the index at which the `key` is found in `array` of key-value pairs.
  6694. *
  6695. * @private
  6696. * @param {Array} array The array to inspect.
  6697. * @param {*} key The key to search for.
  6698. * @returns {number} Returns the index of the matched value, else `-1`.
  6699. */
  6700. function assocIndexOf(array, key) {
  6701. var length = array.length;
  6702. while (length--) {
  6703. if (eq(array[length][0], key)) {
  6704. return length;
  6705. }
  6706. }
  6707. return -1;
  6708. }
  6709. /**
  6710. * The base implementation of `_.get` without support for default values.
  6711. *
  6712. * @private
  6713. * @param {Object} object The object to query.
  6714. * @param {Array|string} path The path of the property to get.
  6715. * @returns {*} Returns the resolved value.
  6716. */
  6717. function baseGet(object, path) {
  6718. path = isKey(path, object) ? [path] : castPath(path);
  6719. var index = 0,
  6720. length = path.length;
  6721. while (object != null && index < length) {
  6722. object = object[toKey(path[index++])];
  6723. }
  6724. return index && index == length ? object : undefined;
  6725. }
  6726. /**
  6727. * The base implementation of `getTag`.
  6728. *
  6729. * @private
  6730. * @param {*} value The value to query.
  6731. * @returns {string} Returns the `toStringTag`.
  6732. */
  6733. function baseGetTag(value) {
  6734. return objectToString.call(value);
  6735. }
  6736. /**
  6737. * The base implementation of `_.hasIn` without support for deep paths.
  6738. *
  6739. * @private
  6740. * @param {Object} [object] The object to query.
  6741. * @param {Array|string} key The key to check.
  6742. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  6743. */
  6744. function baseHasIn(object, key) {
  6745. return object != null && key in Object(object);
  6746. }
  6747. /**
  6748. * The base implementation of `_.isEqual` which supports partial comparisons
  6749. * and tracks traversed objects.
  6750. *
  6751. * @private
  6752. * @param {*} value The value to compare.
  6753. * @param {*} other The other value to compare.
  6754. * @param {Function} [customizer] The function to customize comparisons.
  6755. * @param {boolean} [bitmask] The bitmask of comparison flags.
  6756. * The bitmask may be composed of the following flags:
  6757. * 1 - Unordered comparison
  6758. * 2 - Partial comparison
  6759. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  6760. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  6761. */
  6762. function baseIsEqual(value, other, customizer, bitmask, stack) {
  6763. if (value === other) {
  6764. return true;
  6765. }
  6766. if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
  6767. return value !== value && other !== other;
  6768. }
  6769. return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
  6770. }
  6771. /**
  6772. * A specialized version of `baseIsEqual` for arrays and objects which performs
  6773. * deep comparisons and tracks traversed objects enabling objects with circular
  6774. * references to be compared.
  6775. *
  6776. * @private
  6777. * @param {Object} object The object to compare.
  6778. * @param {Object} other The other object to compare.
  6779. * @param {Function} equalFunc The function to determine equivalents of values.
  6780. * @param {Function} [customizer] The function to customize comparisons.
  6781. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`
  6782. * for more details.
  6783. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  6784. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6785. */
  6786. function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
  6787. var objIsArr = isArray(object),
  6788. othIsArr = isArray(other),
  6789. objTag = arrayTag,
  6790. othTag = arrayTag;
  6791. if (!objIsArr) {
  6792. objTag = getTag(object);
  6793. objTag = objTag == argsTag ? objectTag : objTag;
  6794. }
  6795. if (!othIsArr) {
  6796. othTag = getTag(other);
  6797. othTag = othTag == argsTag ? objectTag : othTag;
  6798. }
  6799. var objIsObj = objTag == objectTag && !isHostObject(object),
  6800. othIsObj = othTag == objectTag && !isHostObject(other),
  6801. isSameTag = objTag == othTag;
  6802. if (isSameTag && !objIsObj) {
  6803. stack || (stack = new Stack());
  6804. return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
  6805. }
  6806. if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
  6807. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  6808. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  6809. if (objIsWrapped || othIsWrapped) {
  6810. var objUnwrapped = objIsWrapped ? object.value() : object,
  6811. othUnwrapped = othIsWrapped ? other.value() : other;
  6812. stack || (stack = new Stack());
  6813. return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
  6814. }
  6815. }
  6816. if (!isSameTag) {
  6817. return false;
  6818. }
  6819. stack || (stack = new Stack());
  6820. return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
  6821. }
  6822. /**
  6823. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  6824. *
  6825. * @private
  6826. * @param {Object} object The object to inspect.
  6827. * @param {Object} source The object of property values to match.
  6828. * @param {Array} matchData The property names, values, and compare flags to match.
  6829. * @param {Function} [customizer] The function to customize comparisons.
  6830. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  6831. */
  6832. function baseIsMatch(object, source, matchData, customizer) {
  6833. var index = matchData.length,
  6834. length = index,
  6835. noCustomizer = !customizer;
  6836. if (object == null) {
  6837. return !length;
  6838. }
  6839. object = Object(object);
  6840. while (index--) {
  6841. var data = matchData[index];
  6842. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  6843. return false;
  6844. }
  6845. }
  6846. while (++index < length) {
  6847. data = matchData[index];
  6848. var key = data[0],
  6849. objValue = object[key],
  6850. srcValue = data[1];
  6851. if (noCustomizer && data[2]) {
  6852. if (objValue === undefined && !(key in object)) {
  6853. return false;
  6854. }
  6855. } else {
  6856. var stack = new Stack();
  6857. if (customizer) {
  6858. var result = customizer(objValue, srcValue, key, object, source, stack);
  6859. }
  6860. if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) {
  6861. return false;
  6862. }
  6863. }
  6864. }
  6865. return true;
  6866. }
  6867. /**
  6868. * The base implementation of `_.isNative` without bad shim checks.
  6869. *
  6870. * @private
  6871. * @param {*} value The value to check.
  6872. * @returns {boolean} Returns `true` if `value` is a native function,
  6873. * else `false`.
  6874. */
  6875. function baseIsNative(value) {
  6876. if (!isObject(value) || isMasked(value)) {
  6877. return false;
  6878. }
  6879. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  6880. return pattern.test(toSource(value));
  6881. }
  6882. /**
  6883. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  6884. *
  6885. * @private
  6886. * @param {*} value The value to check.
  6887. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  6888. */
  6889. function baseIsTypedArray(value) {
  6890. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];
  6891. }
  6892. /**
  6893. * The base implementation of `_.iteratee`.
  6894. *
  6895. * @private
  6896. * @param {*} [value=_.identity] The value to convert to an iteratee.
  6897. * @returns {Function} Returns the iteratee.
  6898. */
  6899. function baseIteratee(value) {
  6900. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  6901. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  6902. if (typeof value == 'function') {
  6903. return value;
  6904. }
  6905. if (value == null) {
  6906. return identity;
  6907. }
  6908. if (_typeof(value) == 'object') {
  6909. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  6910. }
  6911. return property(value);
  6912. }
  6913. /**
  6914. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  6915. *
  6916. * @private
  6917. * @param {Object} object The object to query.
  6918. * @returns {Array} Returns the array of property names.
  6919. */
  6920. function baseKeys(object) {
  6921. if (!isPrototype(object)) {
  6922. return nativeKeys(object);
  6923. }
  6924. var result = [];
  6925. for (var key in Object(object)) {
  6926. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  6927. result.push(key);
  6928. }
  6929. }
  6930. return result;
  6931. }
  6932. /**
  6933. * The base implementation of `_.matches` which doesn't clone `source`.
  6934. *
  6935. * @private
  6936. * @param {Object} source The object of property values to match.
  6937. * @returns {Function} Returns the new spec function.
  6938. */
  6939. function baseMatches(source) {
  6940. var matchData = getMatchData(source);
  6941. if (matchData.length == 1 && matchData[0][2]) {
  6942. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  6943. }
  6944. return function (object) {
  6945. return object === source || baseIsMatch(object, source, matchData);
  6946. };
  6947. }
  6948. /**
  6949. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  6950. *
  6951. * @private
  6952. * @param {string} path The path of the property to get.
  6953. * @param {*} srcValue The value to match.
  6954. * @returns {Function} Returns the new spec function.
  6955. */
  6956. function baseMatchesProperty(path, srcValue) {
  6957. if (isKey(path) && isStrictComparable(srcValue)) {
  6958. return matchesStrictComparable(toKey(path), srcValue);
  6959. }
  6960. return function (object) {
  6961. var objValue = get(object, path);
  6962. return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
  6963. };
  6964. }
  6965. /**
  6966. * A specialized version of `baseProperty` which supports deep paths.
  6967. *
  6968. * @private
  6969. * @param {Array|string} path The path of the property to get.
  6970. * @returns {Function} Returns the new accessor function.
  6971. */
  6972. function basePropertyDeep(path) {
  6973. return function (object) {
  6974. return baseGet(object, path);
  6975. };
  6976. }
  6977. /**
  6978. * The base implementation of `_.toString` which doesn't convert nullish
  6979. * values to empty strings.
  6980. *
  6981. * @private
  6982. * @param {*} value The value to process.
  6983. * @returns {string} Returns the string.
  6984. */
  6985. function baseToString(value) {
  6986. // Exit early for strings to avoid a performance hit in some environments.
  6987. if (typeof value == 'string') {
  6988. return value;
  6989. }
  6990. if (isSymbol(value)) {
  6991. return symbolToString ? symbolToString.call(value) : '';
  6992. }
  6993. var result = value + '';
  6994. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  6995. }
  6996. /**
  6997. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  6998. *
  6999. * @private
  7000. * @param {Array} array The array to inspect.
  7001. * @param {Function} [iteratee] The iteratee invoked per element.
  7002. * @param {Function} [comparator] The comparator invoked per element.
  7003. * @returns {Array} Returns the new duplicate free array.
  7004. */
  7005. function baseUniq(array, iteratee, comparator) {
  7006. var index = -1,
  7007. includes = arrayIncludes,
  7008. length = array.length,
  7009. isCommon = true,
  7010. result = [],
  7011. seen = result;
  7012. if (comparator) {
  7013. isCommon = false;
  7014. includes = arrayIncludesWith;
  7015. } else if (length >= LARGE_ARRAY_SIZE) {
  7016. var set = iteratee ? null : createSet(array);
  7017. if (set) {
  7018. return setToArray(set);
  7019. }
  7020. isCommon = false;
  7021. includes = cacheHas;
  7022. seen = new SetCache();
  7023. } else {
  7024. seen = iteratee ? [] : result;
  7025. }
  7026. outer: while (++index < length) {
  7027. var value = array[index],
  7028. computed = iteratee ? iteratee(value) : value;
  7029. value = comparator || value !== 0 ? value : 0;
  7030. if (isCommon && computed === computed) {
  7031. var seenIndex = seen.length;
  7032. while (seenIndex--) {
  7033. if (seen[seenIndex] === computed) {
  7034. continue outer;
  7035. }
  7036. }
  7037. if (iteratee) {
  7038. seen.push(computed);
  7039. }
  7040. result.push(value);
  7041. } else if (!includes(seen, computed, comparator)) {
  7042. if (seen !== result) {
  7043. seen.push(computed);
  7044. }
  7045. result.push(value);
  7046. }
  7047. }
  7048. return result;
  7049. }
  7050. /**
  7051. * Casts `value` to a path array if it's not one.
  7052. *
  7053. * @private
  7054. * @param {*} value The value to inspect.
  7055. * @returns {Array} Returns the cast property path array.
  7056. */
  7057. function castPath(value) {
  7058. return isArray(value) ? value : stringToPath(value);
  7059. }
  7060. /**
  7061. * Creates a set object of `values`.
  7062. *
  7063. * @private
  7064. * @param {Array} values The values to add to the set.
  7065. * @returns {Object} Returns the new set.
  7066. */
  7067. var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function (values) {
  7068. return new Set(values);
  7069. };
  7070. /**
  7071. * A specialized version of `baseIsEqualDeep` for arrays with support for
  7072. * partial deep comparisons.
  7073. *
  7074. * @private
  7075. * @param {Array} array The array to compare.
  7076. * @param {Array} other The other array to compare.
  7077. * @param {Function} equalFunc The function to determine equivalents of values.
  7078. * @param {Function} customizer The function to customize comparisons.
  7079. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  7080. * for more details.
  7081. * @param {Object} stack Tracks traversed `array` and `other` objects.
  7082. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  7083. */
  7084. function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
  7085. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  7086. arrLength = array.length,
  7087. othLength = other.length;
  7088. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  7089. return false;
  7090. }
  7091. // Assume cyclic values are equal.
  7092. var stacked = stack.get(array);
  7093. if (stacked && stack.get(other)) {
  7094. return stacked == other;
  7095. }
  7096. var index = -1,
  7097. result = true,
  7098. seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : undefined;
  7099. stack.set(array, other);
  7100. stack.set(other, array);
  7101. // Ignore non-index properties.
  7102. while (++index < arrLength) {
  7103. var arrValue = array[index],
  7104. othValue = other[index];
  7105. if (customizer) {
  7106. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  7107. }
  7108. if (compared !== undefined) {
  7109. if (compared) {
  7110. continue;
  7111. }
  7112. result = false;
  7113. break;
  7114. }
  7115. // Recursively compare arrays (susceptible to call stack limits).
  7116. if (seen) {
  7117. if (!arraySome(other, function (othValue, othIndex) {
  7118. if (!seen.has(othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  7119. return seen.add(othIndex);
  7120. }
  7121. })) {
  7122. result = false;
  7123. break;
  7124. }
  7125. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {
  7126. result = false;
  7127. break;
  7128. }
  7129. }
  7130. stack['delete'](array);
  7131. stack['delete'](other);
  7132. return result;
  7133. }
  7134. /**
  7135. * A specialized version of `baseIsEqualDeep` for comparing objects of
  7136. * the same `toStringTag`.
  7137. *
  7138. * **Note:** This function only supports comparing values with tags of
  7139. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  7140. *
  7141. * @private
  7142. * @param {Object} object The object to compare.
  7143. * @param {Object} other The other object to compare.
  7144. * @param {string} tag The `toStringTag` of the objects to compare.
  7145. * @param {Function} equalFunc The function to determine equivalents of values.
  7146. * @param {Function} customizer The function to customize comparisons.
  7147. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  7148. * for more details.
  7149. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7150. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7151. */
  7152. function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
  7153. switch (tag) {
  7154. case dataViewTag:
  7155. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  7156. return false;
  7157. }
  7158. object = object.buffer;
  7159. other = other.buffer;
  7160. case arrayBufferTag:
  7161. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  7162. return false;
  7163. }
  7164. return true;
  7165. case boolTag:
  7166. case dateTag:
  7167. case numberTag:
  7168. // Coerce booleans to `1` or `0` and dates to milliseconds.
  7169. // Invalid dates are coerced to `NaN`.
  7170. return eq(+object, +other);
  7171. case errorTag:
  7172. return object.name == other.name && object.message == other.message;
  7173. case regexpTag:
  7174. case stringTag:
  7175. // Coerce regexes to strings and treat strings, primitives and objects,
  7176. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  7177. // for more details.
  7178. return object == other + '';
  7179. case mapTag:
  7180. var convert = mapToArray;
  7181. case setTag:
  7182. var isPartial = bitmask & PARTIAL_COMPARE_FLAG;
  7183. convert || (convert = setToArray);
  7184. if (object.size != other.size && !isPartial) {
  7185. return false;
  7186. }
  7187. // Assume cyclic values are equal.
  7188. var stacked = stack.get(object);
  7189. if (stacked) {
  7190. return stacked == other;
  7191. }
  7192. bitmask |= UNORDERED_COMPARE_FLAG;
  7193. // Recursively compare objects (susceptible to call stack limits).
  7194. stack.set(object, other);
  7195. var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);
  7196. stack['delete'](object);
  7197. return result;
  7198. case symbolTag:
  7199. if (symbolValueOf) {
  7200. return symbolValueOf.call(object) == symbolValueOf.call(other);
  7201. }
  7202. }
  7203. return false;
  7204. }
  7205. /**
  7206. * A specialized version of `baseIsEqualDeep` for objects with support for
  7207. * partial deep comparisons.
  7208. *
  7209. * @private
  7210. * @param {Object} object The object to compare.
  7211. * @param {Object} other The other object to compare.
  7212. * @param {Function} equalFunc The function to determine equivalents of values.
  7213. * @param {Function} customizer The function to customize comparisons.
  7214. * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`
  7215. * for more details.
  7216. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7217. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7218. */
  7219. function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
  7220. var isPartial = bitmask & PARTIAL_COMPARE_FLAG,
  7221. objProps = keys(object),
  7222. objLength = objProps.length,
  7223. othProps = keys(other),
  7224. othLength = othProps.length;
  7225. if (objLength != othLength && !isPartial) {
  7226. return false;
  7227. }
  7228. var index = objLength;
  7229. while (index--) {
  7230. var key = objProps[index];
  7231. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  7232. return false;
  7233. }
  7234. }
  7235. // Assume cyclic values are equal.
  7236. var stacked = stack.get(object);
  7237. if (stacked && stack.get(other)) {
  7238. return stacked == other;
  7239. }
  7240. var result = true;
  7241. stack.set(object, other);
  7242. stack.set(other, object);
  7243. var skipCtor = isPartial;
  7244. while (++index < objLength) {
  7245. key = objProps[index];
  7246. var objValue = object[key],
  7247. othValue = other[key];
  7248. if (customizer) {
  7249. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  7250. }
  7251. // Recursively compare objects (susceptible to call stack limits).
  7252. if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) {
  7253. result = false;
  7254. break;
  7255. }
  7256. skipCtor || (skipCtor = key == 'constructor');
  7257. }
  7258. if (result && !skipCtor) {
  7259. var objCtor = object.constructor,
  7260. othCtor = other.constructor;
  7261. // Non `Object` object instances with different constructors are not equal.
  7262. if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  7263. result = false;
  7264. }
  7265. }
  7266. stack['delete'](object);
  7267. stack['delete'](other);
  7268. return result;
  7269. }
  7270. /**
  7271. * Gets the data for `map`.
  7272. *
  7273. * @private
  7274. * @param {Object} map The map to query.
  7275. * @param {string} key The reference key.
  7276. * @returns {*} Returns the map data.
  7277. */
  7278. function getMapData(map, key) {
  7279. var data = map.__data__;
  7280. return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
  7281. }
  7282. /**
  7283. * Gets the property names, values, and compare flags of `object`.
  7284. *
  7285. * @private
  7286. * @param {Object} object The object to query.
  7287. * @returns {Array} Returns the match data of `object`.
  7288. */
  7289. function getMatchData(object) {
  7290. var result = keys(object),
  7291. length = result.length;
  7292. while (length--) {
  7293. var key = result[length],
  7294. value = object[key];
  7295. result[length] = [key, value, isStrictComparable(value)];
  7296. }
  7297. return result;
  7298. }
  7299. /**
  7300. * Gets the native function at `key` of `object`.
  7301. *
  7302. * @private
  7303. * @param {Object} object The object to query.
  7304. * @param {string} key The key of the method to get.
  7305. * @returns {*} Returns the function if it's native, else `undefined`.
  7306. */
  7307. function getNative(object, key) {
  7308. var value = getValue(object, key);
  7309. return baseIsNative(value) ? value : undefined;
  7310. }
  7311. /**
  7312. * Gets the `toStringTag` of `value`.
  7313. *
  7314. * @private
  7315. * @param {*} value The value to query.
  7316. * @returns {string} Returns the `toStringTag`.
  7317. */
  7318. var getTag = baseGetTag;
  7319. // Fallback for data views, maps, sets, and weak maps in IE 11,
  7320. // for data views in Edge < 14, and promises in Node.js.
  7321. 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) {
  7322. getTag = function getTag(value) {
  7323. var result = objectToString.call(value),
  7324. Ctor = result == objectTag ? value.constructor : undefined,
  7325. ctorString = Ctor ? toSource(Ctor) : undefined;
  7326. if (ctorString) {
  7327. switch (ctorString) {
  7328. case dataViewCtorString:
  7329. return dataViewTag;
  7330. case mapCtorString:
  7331. return mapTag;
  7332. case promiseCtorString:
  7333. return promiseTag;
  7334. case setCtorString:
  7335. return setTag;
  7336. case weakMapCtorString:
  7337. return weakMapTag;
  7338. }
  7339. }
  7340. return result;
  7341. };
  7342. }
  7343. /**
  7344. * Checks if `path` exists on `object`.
  7345. *
  7346. * @private
  7347. * @param {Object} object The object to query.
  7348. * @param {Array|string} path The path to check.
  7349. * @param {Function} hasFunc The function to check properties.
  7350. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7351. */
  7352. function hasPath(object, path, hasFunc) {
  7353. path = isKey(path, object) ? [path] : castPath(path);
  7354. var result,
  7355. index = -1,
  7356. length = path.length;
  7357. while (++index < length) {
  7358. var key = toKey(path[index]);
  7359. if (!(result = object != null && hasFunc(object, key))) {
  7360. break;
  7361. }
  7362. object = object[key];
  7363. }
  7364. if (result) {
  7365. return result;
  7366. }
  7367. var length = object ? object.length : 0;
  7368. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  7369. }
  7370. /**
  7371. * Checks if `value` is a valid array-like index.
  7372. *
  7373. * @private
  7374. * @param {*} value The value to check.
  7375. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7376. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7377. */
  7378. function isIndex(value, length) {
  7379. length = length == null ? MAX_SAFE_INTEGER : length;
  7380. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  7381. }
  7382. /**
  7383. * Checks if `value` is a property name and not a property path.
  7384. *
  7385. * @private
  7386. * @param {*} value The value to check.
  7387. * @param {Object} [object] The object to query keys on.
  7388. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7389. */
  7390. function isKey(value, object) {
  7391. if (isArray(value)) {
  7392. return false;
  7393. }
  7394. var type = _typeof(value);
  7395. if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
  7396. return true;
  7397. }
  7398. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  7399. }
  7400. /**
  7401. * Checks if `value` is suitable for use as unique object key.
  7402. *
  7403. * @private
  7404. * @param {*} value The value to check.
  7405. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7406. */
  7407. function isKeyable(value) {
  7408. var type = _typeof(value);
  7409. return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
  7410. }
  7411. /**
  7412. * Checks if `func` has its source masked.
  7413. *
  7414. * @private
  7415. * @param {Function} func The function to check.
  7416. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7417. */
  7418. function isMasked(func) {
  7419. return !!maskSrcKey && maskSrcKey in func;
  7420. }
  7421. /**
  7422. * Checks if `value` is likely a prototype object.
  7423. *
  7424. * @private
  7425. * @param {*} value The value to check.
  7426. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7427. */
  7428. function isPrototype(value) {
  7429. var Ctor = value && value.constructor,
  7430. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  7431. return value === proto;
  7432. }
  7433. /**
  7434. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7435. *
  7436. * @private
  7437. * @param {*} value The value to check.
  7438. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7439. * equality comparisons, else `false`.
  7440. */
  7441. function isStrictComparable(value) {
  7442. return value === value && !isObject(value);
  7443. }
  7444. /**
  7445. * A specialized version of `matchesProperty` for source values suitable
  7446. * for strict equality comparisons, i.e. `===`.
  7447. *
  7448. * @private
  7449. * @param {string} key The key of the property to get.
  7450. * @param {*} srcValue The value to match.
  7451. * @returns {Function} Returns the new spec function.
  7452. */
  7453. function matchesStrictComparable(key, srcValue) {
  7454. return function (object) {
  7455. if (object == null) {
  7456. return false;
  7457. }
  7458. return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
  7459. };
  7460. }
  7461. /**
  7462. * Converts `string` to a property path array.
  7463. *
  7464. * @private
  7465. * @param {string} string The string to convert.
  7466. * @returns {Array} Returns the property path array.
  7467. */
  7468. var stringToPath = memoize(function (string) {
  7469. string = toString(string);
  7470. var result = [];
  7471. if (reLeadingDot.test(string)) {
  7472. result.push('');
  7473. }
  7474. string.replace(rePropName, function (match, number, quote, string) {
  7475. result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
  7476. });
  7477. return result;
  7478. });
  7479. /**
  7480. * Converts `value` to a string key if it's not a string or symbol.
  7481. *
  7482. * @private
  7483. * @param {*} value The value to inspect.
  7484. * @returns {string|symbol} Returns the key.
  7485. */
  7486. function toKey(value) {
  7487. if (typeof value == 'string' || isSymbol(value)) {
  7488. return value;
  7489. }
  7490. var result = value + '';
  7491. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  7492. }
  7493. /**
  7494. * Converts `func` to its source code.
  7495. *
  7496. * @private
  7497. * @param {Function} func The function to process.
  7498. * @returns {string} Returns the source code.
  7499. */
  7500. function toSource(func) {
  7501. if (func != null) {
  7502. try {
  7503. return funcToString.call(func);
  7504. } catch (e) {}
  7505. try {
  7506. return func + '';
  7507. } catch (e) {}
  7508. }
  7509. return '';
  7510. }
  7511. /**
  7512. * This method is like `_.uniq` except that it accepts `iteratee` which is
  7513. * invoked for each element in `array` to generate the criterion by which
  7514. * uniqueness is computed. The iteratee is invoked with one argument: (value).
  7515. *
  7516. * @static
  7517. * @memberOf _
  7518. * @since 4.0.0
  7519. * @category Array
  7520. * @param {Array} array The array to inspect.
  7521. * @param {Function} [iteratee=_.identity]
  7522. * The iteratee invoked per element.
  7523. * @returns {Array} Returns the new duplicate free array.
  7524. * @example
  7525. *
  7526. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  7527. * // => [2.1, 1.2]
  7528. *
  7529. * // The `_.property` iteratee shorthand.
  7530. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  7531. * // => [{ 'x': 1 }, { 'x': 2 }]
  7532. */
  7533. function uniqBy(array, iteratee) {
  7534. return array && array.length ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
  7535. }
  7536. /**
  7537. * Creates a function that memoizes the result of `func`. If `resolver` is
  7538. * provided, it determines the cache key for storing the result based on the
  7539. * arguments provided to the memoized function. By default, the first argument
  7540. * provided to the memoized function is used as the map cache key. The `func`
  7541. * is invoked with the `this` binding of the memoized function.
  7542. *
  7543. * **Note:** The cache is exposed as the `cache` property on the memoized
  7544. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  7545. * constructor with one whose instances implement the
  7546. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  7547. * method interface of `delete`, `get`, `has`, and `set`.
  7548. *
  7549. * @static
  7550. * @memberOf _
  7551. * @since 0.1.0
  7552. * @category Function
  7553. * @param {Function} func The function to have its output memoized.
  7554. * @param {Function} [resolver] The function to resolve the cache key.
  7555. * @returns {Function} Returns the new memoized function.
  7556. * @example
  7557. *
  7558. * var object = { 'a': 1, 'b': 2 };
  7559. * var other = { 'c': 3, 'd': 4 };
  7560. *
  7561. * var values = _.memoize(_.values);
  7562. * values(object);
  7563. * // => [1, 2]
  7564. *
  7565. * values(other);
  7566. * // => [3, 4]
  7567. *
  7568. * object.a = 2;
  7569. * values(object);
  7570. * // => [1, 2]
  7571. *
  7572. * // Modify the result cache.
  7573. * values.cache.set(object, ['a', 'b']);
  7574. * values(object);
  7575. * // => ['a', 'b']
  7576. *
  7577. * // Replace `_.memoize.Cache`.
  7578. * _.memoize.Cache = WeakMap;
  7579. */
  7580. function memoize(func, resolver) {
  7581. if (typeof func != 'function' || resolver && typeof resolver != 'function') {
  7582. throw new TypeError(FUNC_ERROR_TEXT);
  7583. }
  7584. var memoized = function memoized() {
  7585. var args = arguments,
  7586. key = resolver ? resolver.apply(this, args) : args[0],
  7587. cache = memoized.cache;
  7588. if (cache.has(key)) {
  7589. return cache.get(key);
  7590. }
  7591. var result = func.apply(this, args);
  7592. memoized.cache = cache.set(key, result);
  7593. return result;
  7594. };
  7595. memoized.cache = new (memoize.Cache || MapCache)();
  7596. return memoized;
  7597. }
  7598. // Assign cache to `_.memoize`.
  7599. memoize.Cache = MapCache;
  7600. /**
  7601. * Performs a
  7602. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7603. * comparison between two values to determine if they are equivalent.
  7604. *
  7605. * @static
  7606. * @memberOf _
  7607. * @since 4.0.0
  7608. * @category Lang
  7609. * @param {*} value The value to compare.
  7610. * @param {*} other The other value to compare.
  7611. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  7612. * @example
  7613. *
  7614. * var object = { 'a': 1 };
  7615. * var other = { 'a': 1 };
  7616. *
  7617. * _.eq(object, object);
  7618. * // => true
  7619. *
  7620. * _.eq(object, other);
  7621. * // => false
  7622. *
  7623. * _.eq('a', 'a');
  7624. * // => true
  7625. *
  7626. * _.eq('a', Object('a'));
  7627. * // => false
  7628. *
  7629. * _.eq(NaN, NaN);
  7630. * // => true
  7631. */
  7632. function eq(value, other) {
  7633. return value === other || value !== value && other !== other;
  7634. }
  7635. /**
  7636. * Checks if `value` is likely an `arguments` object.
  7637. *
  7638. * @static
  7639. * @memberOf _
  7640. * @since 0.1.0
  7641. * @category Lang
  7642. * @param {*} value The value to check.
  7643. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  7644. * else `false`.
  7645. * @example
  7646. *
  7647. * _.isArguments(function() { return arguments; }());
  7648. * // => true
  7649. *
  7650. * _.isArguments([1, 2, 3]);
  7651. * // => false
  7652. */
  7653. function isArguments(value) {
  7654. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  7655. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  7656. }
  7657. /**
  7658. * Checks if `value` is classified as an `Array` object.
  7659. *
  7660. * @static
  7661. * @memberOf _
  7662. * @since 0.1.0
  7663. * @category Lang
  7664. * @param {*} value The value to check.
  7665. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  7666. * @example
  7667. *
  7668. * _.isArray([1, 2, 3]);
  7669. * // => true
  7670. *
  7671. * _.isArray(document.body.children);
  7672. * // => false
  7673. *
  7674. * _.isArray('abc');
  7675. * // => false
  7676. *
  7677. * _.isArray(_.noop);
  7678. * // => false
  7679. */
  7680. var isArray = Array.isArray;
  7681. /**
  7682. * Checks if `value` is array-like. A value is considered array-like if it's
  7683. * not a function and has a `value.length` that's an integer greater than or
  7684. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  7685. *
  7686. * @static
  7687. * @memberOf _
  7688. * @since 4.0.0
  7689. * @category Lang
  7690. * @param {*} value The value to check.
  7691. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  7692. * @example
  7693. *
  7694. * _.isArrayLike([1, 2, 3]);
  7695. * // => true
  7696. *
  7697. * _.isArrayLike(document.body.children);
  7698. * // => true
  7699. *
  7700. * _.isArrayLike('abc');
  7701. * // => true
  7702. *
  7703. * _.isArrayLike(_.noop);
  7704. * // => false
  7705. */
  7706. function isArrayLike(value) {
  7707. return value != null && isLength(value.length) && !isFunction(value);
  7708. }
  7709. /**
  7710. * This method is like `_.isArrayLike` except that it also checks if `value`
  7711. * is an object.
  7712. *
  7713. * @static
  7714. * @memberOf _
  7715. * @since 4.0.0
  7716. * @category Lang
  7717. * @param {*} value The value to check.
  7718. * @returns {boolean} Returns `true` if `value` is an array-like object,
  7719. * else `false`.
  7720. * @example
  7721. *
  7722. * _.isArrayLikeObject([1, 2, 3]);
  7723. * // => true
  7724. *
  7725. * _.isArrayLikeObject(document.body.children);
  7726. * // => true
  7727. *
  7728. * _.isArrayLikeObject('abc');
  7729. * // => false
  7730. *
  7731. * _.isArrayLikeObject(_.noop);
  7732. * // => false
  7733. */
  7734. function isArrayLikeObject(value) {
  7735. return isObjectLike(value) && isArrayLike(value);
  7736. }
  7737. /**
  7738. * Checks if `value` is classified as a `Function` object.
  7739. *
  7740. * @static
  7741. * @memberOf _
  7742. * @since 0.1.0
  7743. * @category Lang
  7744. * @param {*} value The value to check.
  7745. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  7746. * @example
  7747. *
  7748. * _.isFunction(_);
  7749. * // => true
  7750. *
  7751. * _.isFunction(/abc/);
  7752. * // => false
  7753. */
  7754. function isFunction(value) {
  7755. // The use of `Object#toString` avoids issues with the `typeof` operator
  7756. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  7757. var tag = isObject(value) ? objectToString.call(value) : '';
  7758. return tag == funcTag || tag == genTag;
  7759. }
  7760. /**
  7761. * Checks if `value` is a valid array-like length.
  7762. *
  7763. * **Note:** This method is loosely based on
  7764. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  7765. *
  7766. * @static
  7767. * @memberOf _
  7768. * @since 4.0.0
  7769. * @category Lang
  7770. * @param {*} value The value to check.
  7771. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  7772. * @example
  7773. *
  7774. * _.isLength(3);
  7775. * // => true
  7776. *
  7777. * _.isLength(Number.MIN_VALUE);
  7778. * // => false
  7779. *
  7780. * _.isLength(Infinity);
  7781. * // => false
  7782. *
  7783. * _.isLength('3');
  7784. * // => false
  7785. */
  7786. function isLength(value) {
  7787. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  7788. }
  7789. /**
  7790. * Checks if `value` is the
  7791. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  7792. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  7793. *
  7794. * @static
  7795. * @memberOf _
  7796. * @since 0.1.0
  7797. * @category Lang
  7798. * @param {*} value The value to check.
  7799. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  7800. * @example
  7801. *
  7802. * _.isObject({});
  7803. * // => true
  7804. *
  7805. * _.isObject([1, 2, 3]);
  7806. * // => true
  7807. *
  7808. * _.isObject(_.noop);
  7809. * // => true
  7810. *
  7811. * _.isObject(null);
  7812. * // => false
  7813. */
  7814. function isObject(value) {
  7815. var type = _typeof(value);
  7816. return !!value && (type == 'object' || type == 'function');
  7817. }
  7818. /**
  7819. * Checks if `value` is object-like. A value is object-like if it's not `null`
  7820. * and has a `typeof` result of "object".
  7821. *
  7822. * @static
  7823. * @memberOf _
  7824. * @since 4.0.0
  7825. * @category Lang
  7826. * @param {*} value The value to check.
  7827. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  7828. * @example
  7829. *
  7830. * _.isObjectLike({});
  7831. * // => true
  7832. *
  7833. * _.isObjectLike([1, 2, 3]);
  7834. * // => true
  7835. *
  7836. * _.isObjectLike(_.noop);
  7837. * // => false
  7838. *
  7839. * _.isObjectLike(null);
  7840. * // => false
  7841. */
  7842. function isObjectLike(value) {
  7843. return !!value && _typeof(value) == 'object';
  7844. }
  7845. /**
  7846. * Checks if `value` is classified as a `Symbol` primitive or object.
  7847. *
  7848. * @static
  7849. * @memberOf _
  7850. * @since 4.0.0
  7851. * @category Lang
  7852. * @param {*} value The value to check.
  7853. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  7854. * @example
  7855. *
  7856. * _.isSymbol(Symbol.iterator);
  7857. * // => true
  7858. *
  7859. * _.isSymbol('abc');
  7860. * // => false
  7861. */
  7862. function isSymbol(value) {
  7863. return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
  7864. }
  7865. /**
  7866. * Checks if `value` is classified as a typed array.
  7867. *
  7868. * @static
  7869. * @memberOf _
  7870. * @since 3.0.0
  7871. * @category Lang
  7872. * @param {*} value The value to check.
  7873. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  7874. * @example
  7875. *
  7876. * _.isTypedArray(new Uint8Array);
  7877. * // => true
  7878. *
  7879. * _.isTypedArray([]);
  7880. * // => false
  7881. */
  7882. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  7883. /**
  7884. * Converts `value` to a string. An empty string is returned for `null`
  7885. * and `undefined` values. The sign of `-0` is preserved.
  7886. *
  7887. * @static
  7888. * @memberOf _
  7889. * @since 4.0.0
  7890. * @category Lang
  7891. * @param {*} value The value to process.
  7892. * @returns {string} Returns the string.
  7893. * @example
  7894. *
  7895. * _.toString(null);
  7896. * // => ''
  7897. *
  7898. * _.toString(-0);
  7899. * // => '-0'
  7900. *
  7901. * _.toString([1, 2, 3]);
  7902. * // => '1,2,3'
  7903. */
  7904. function toString(value) {
  7905. return value == null ? '' : baseToString(value);
  7906. }
  7907. /**
  7908. * Gets the value at `path` of `object`. If the resolved value is
  7909. * `undefined`, the `defaultValue` is returned in its place.
  7910. *
  7911. * @static
  7912. * @memberOf _
  7913. * @since 3.7.0
  7914. * @category Object
  7915. * @param {Object} object The object to query.
  7916. * @param {Array|string} path The path of the property to get.
  7917. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  7918. * @returns {*} Returns the resolved value.
  7919. * @example
  7920. *
  7921. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  7922. *
  7923. * _.get(object, 'a[0].b.c');
  7924. * // => 3
  7925. *
  7926. * _.get(object, ['a', '0', 'b', 'c']);
  7927. * // => 3
  7928. *
  7929. * _.get(object, 'a.b.c', 'default');
  7930. * // => 'default'
  7931. */
  7932. function get(object, path, defaultValue) {
  7933. var result = object == null ? undefined : baseGet(object, path);
  7934. return result === undefined ? defaultValue : result;
  7935. }
  7936. /**
  7937. * Checks if `path` is a direct or inherited property of `object`.
  7938. *
  7939. * @static
  7940. * @memberOf _
  7941. * @since 4.0.0
  7942. * @category Object
  7943. * @param {Object} object The object to query.
  7944. * @param {Array|string} path The path to check.
  7945. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7946. * @example
  7947. *
  7948. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  7949. *
  7950. * _.hasIn(object, 'a');
  7951. * // => true
  7952. *
  7953. * _.hasIn(object, 'a.b');
  7954. * // => true
  7955. *
  7956. * _.hasIn(object, ['a', 'b']);
  7957. * // => true
  7958. *
  7959. * _.hasIn(object, 'b');
  7960. * // => false
  7961. */
  7962. function hasIn(object, path) {
  7963. return object != null && hasPath(object, path, baseHasIn);
  7964. }
  7965. /**
  7966. * Creates an array of the own enumerable property names of `object`.
  7967. *
  7968. * **Note:** Non-object values are coerced to objects. See the
  7969. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7970. * for more details.
  7971. *
  7972. * @static
  7973. * @since 0.1.0
  7974. * @memberOf _
  7975. * @category Object
  7976. * @param {Object} object The object to query.
  7977. * @returns {Array} Returns the array of property names.
  7978. * @example
  7979. *
  7980. * function Foo() {
  7981. * this.a = 1;
  7982. * this.b = 2;
  7983. * }
  7984. *
  7985. * Foo.prototype.c = 3;
  7986. *
  7987. * _.keys(new Foo);
  7988. * // => ['a', 'b'] (iteration order is not guaranteed)
  7989. *
  7990. * _.keys('hi');
  7991. * // => ['0', '1']
  7992. */
  7993. function keys(object) {
  7994. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  7995. }
  7996. /**
  7997. * This method returns the first argument it receives.
  7998. *
  7999. * @static
  8000. * @since 0.1.0
  8001. * @memberOf _
  8002. * @category Util
  8003. * @param {*} value Any value.
  8004. * @returns {*} Returns `value`.
  8005. * @example
  8006. *
  8007. * var object = { 'a': 1 };
  8008. *
  8009. * console.log(_.identity(object) === object);
  8010. * // => true
  8011. */
  8012. function identity(value) {
  8013. return value;
  8014. }
  8015. /**
  8016. * This method returns `undefined`.
  8017. *
  8018. * @static
  8019. * @memberOf _
  8020. * @since 2.3.0
  8021. * @category Util
  8022. * @example
  8023. *
  8024. * _.times(2, _.noop);
  8025. * // => [undefined, undefined]
  8026. */
  8027. function noop() {
  8028. // No operation performed.
  8029. }
  8030. /**
  8031. * Creates a function that returns the value at `path` of a given object.
  8032. *
  8033. * @static
  8034. * @memberOf _
  8035. * @since 2.4.0
  8036. * @category Util
  8037. * @param {Array|string} path The path of the property to get.
  8038. * @returns {Function} Returns the new accessor function.
  8039. * @example
  8040. *
  8041. * var objects = [
  8042. * { 'a': { 'b': 2 } },
  8043. * { 'a': { 'b': 1 } }
  8044. * ];
  8045. *
  8046. * _.map(objects, _.property('a.b'));
  8047. * // => [2, 1]
  8048. *
  8049. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  8050. * // => [1, 2]
  8051. */
  8052. function property(path) {
  8053. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  8054. }
  8055. module.exports = uniqBy;
  8056. /***/ }),
  8057. /***/ 1943:
  8058. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  8059. "use strict";
  8060. module.exports = Pbf;
  8061. var ieee754 = __webpack_require__(5299);
  8062. function Pbf(buf) {
  8063. this.buf = ArrayBuffer.isView && ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf || 0);
  8064. this.pos = 0;
  8065. this.type = 0;
  8066. this.length = this.buf.length;
  8067. }
  8068. Pbf.Varint = 0; // varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum
  8069. Pbf.Fixed64 = 1; // 64-bit: double, fixed64, sfixed64
  8070. Pbf.Bytes = 2; // length-delimited: string, bytes, embedded messages, packed repeated fields
  8071. Pbf.Fixed32 = 5; // 32-bit: float, fixed32, sfixed32
  8072. var SHIFT_LEFT_32 = (1 << 16) * (1 << 16),
  8073. SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;
  8074. // Threshold chosen based on both benchmarking and knowledge about browser string
  8075. // data structures (which currently switch structure types at 12 bytes or more)
  8076. var TEXT_DECODER_MIN_LENGTH = 12;
  8077. var utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf8');
  8078. Pbf.prototype = {
  8079. destroy: function destroy() {
  8080. this.buf = null;
  8081. },
  8082. // === READING =================================================================
  8083. readFields: function readFields(readField, result, end) {
  8084. end = end || this.length;
  8085. while (this.pos < end) {
  8086. var val = this.readVarint(),
  8087. tag = val >> 3,
  8088. startPos = this.pos;
  8089. this.type = val & 0x7;
  8090. readField(tag, result, this);
  8091. if (this.pos === startPos) this.skip(val);
  8092. }
  8093. return result;
  8094. },
  8095. readMessage: function readMessage(readField, result) {
  8096. return this.readFields(readField, result, this.readVarint() + this.pos);
  8097. },
  8098. readFixed32: function readFixed32() {
  8099. var val = readUInt32(this.buf, this.pos);
  8100. this.pos += 4;
  8101. return val;
  8102. },
  8103. readSFixed32: function readSFixed32() {
  8104. var val = readInt32(this.buf, this.pos);
  8105. this.pos += 4;
  8106. return val;
  8107. },
  8108. // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
  8109. readFixed64: function readFixed64() {
  8110. var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
  8111. this.pos += 8;
  8112. return val;
  8113. },
  8114. readSFixed64: function readSFixed64() {
  8115. var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;
  8116. this.pos += 8;
  8117. return val;
  8118. },
  8119. readFloat: function readFloat() {
  8120. var val = ieee754.read(this.buf, this.pos, true, 23, 4);
  8121. this.pos += 4;
  8122. return val;
  8123. },
  8124. readDouble: function readDouble() {
  8125. var val = ieee754.read(this.buf, this.pos, true, 52, 8);
  8126. this.pos += 8;
  8127. return val;
  8128. },
  8129. readVarint: function readVarint(isSigned) {
  8130. var buf = this.buf,
  8131. val,
  8132. b;
  8133. b = buf[this.pos++];
  8134. val = b & 0x7f;
  8135. if (b < 0x80) return val;
  8136. b = buf[this.pos++];
  8137. val |= (b & 0x7f) << 7;
  8138. if (b < 0x80) return val;
  8139. b = buf[this.pos++];
  8140. val |= (b & 0x7f) << 14;
  8141. if (b < 0x80) return val;
  8142. b = buf[this.pos++];
  8143. val |= (b & 0x7f) << 21;
  8144. if (b < 0x80) return val;
  8145. b = buf[this.pos];
  8146. val |= (b & 0x0f) << 28;
  8147. return readVarintRemainder(val, isSigned, this);
  8148. },
  8149. readVarint64: function readVarint64() {
  8150. // for compatibility with v2.0.1
  8151. return this.readVarint(true);
  8152. },
  8153. readSVarint: function readSVarint() {
  8154. var num = this.readVarint();
  8155. return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding
  8156. },
  8157. readBoolean: function readBoolean() {
  8158. return Boolean(this.readVarint());
  8159. },
  8160. readString: function readString() {
  8161. var end = this.readVarint() + this.pos;
  8162. var pos = this.pos;
  8163. this.pos = end;
  8164. if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
  8165. // longer strings are fast with the built-in browser TextDecoder API
  8166. return readUtf8TextDecoder(this.buf, pos, end);
  8167. }
  8168. // short strings are fast with our custom implementation
  8169. return readUtf8(this.buf, pos, end);
  8170. },
  8171. readBytes: function readBytes() {
  8172. var end = this.readVarint() + this.pos,
  8173. buffer = this.buf.subarray(this.pos, end);
  8174. this.pos = end;
  8175. return buffer;
  8176. },
  8177. // verbose for performance reasons; doesn't affect gzipped size
  8178. readPackedVarint: function readPackedVarint(arr, isSigned) {
  8179. if (this.type !== Pbf.Bytes) return arr.push(this.readVarint(isSigned));
  8180. var end = readPackedEnd(this);
  8181. arr = arr || [];
  8182. while (this.pos < end) arr.push(this.readVarint(isSigned));
  8183. return arr;
  8184. },
  8185. readPackedSVarint: function readPackedSVarint(arr) {
  8186. if (this.type !== Pbf.Bytes) return arr.push(this.readSVarint());
  8187. var end = readPackedEnd(this);
  8188. arr = arr || [];
  8189. while (this.pos < end) arr.push(this.readSVarint());
  8190. return arr;
  8191. },
  8192. readPackedBoolean: function readPackedBoolean(arr) {
  8193. if (this.type !== Pbf.Bytes) return arr.push(this.readBoolean());
  8194. var end = readPackedEnd(this);
  8195. arr = arr || [];
  8196. while (this.pos < end) arr.push(this.readBoolean());
  8197. return arr;
  8198. },
  8199. readPackedFloat: function readPackedFloat(arr) {
  8200. if (this.type !== Pbf.Bytes) return arr.push(this.readFloat());
  8201. var end = readPackedEnd(this);
  8202. arr = arr || [];
  8203. while (this.pos < end) arr.push(this.readFloat());
  8204. return arr;
  8205. },
  8206. readPackedDouble: function readPackedDouble(arr) {
  8207. if (this.type !== Pbf.Bytes) return arr.push(this.readDouble());
  8208. var end = readPackedEnd(this);
  8209. arr = arr || [];
  8210. while (this.pos < end) arr.push(this.readDouble());
  8211. return arr;
  8212. },
  8213. readPackedFixed32: function readPackedFixed32(arr) {
  8214. if (this.type !== Pbf.Bytes) return arr.push(this.readFixed32());
  8215. var end = readPackedEnd(this);
  8216. arr = arr || [];
  8217. while (this.pos < end) arr.push(this.readFixed32());
  8218. return arr;
  8219. },
  8220. readPackedSFixed32: function readPackedSFixed32(arr) {
  8221. if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed32());
  8222. var end = readPackedEnd(this);
  8223. arr = arr || [];
  8224. while (this.pos < end) arr.push(this.readSFixed32());
  8225. return arr;
  8226. },
  8227. readPackedFixed64: function readPackedFixed64(arr) {
  8228. if (this.type !== Pbf.Bytes) return arr.push(this.readFixed64());
  8229. var end = readPackedEnd(this);
  8230. arr = arr || [];
  8231. while (this.pos < end) arr.push(this.readFixed64());
  8232. return arr;
  8233. },
  8234. readPackedSFixed64: function readPackedSFixed64(arr) {
  8235. if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed64());
  8236. var end = readPackedEnd(this);
  8237. arr = arr || [];
  8238. while (this.pos < end) arr.push(this.readSFixed64());
  8239. return arr;
  8240. },
  8241. skip: function skip(val) {
  8242. var type = val & 0x7;
  8243. if (type === Pbf.Varint) while (this.buf[this.pos++] > 0x7f) {} else if (type === Pbf.Bytes) this.pos = this.readVarint() + this.pos;else if (type === Pbf.Fixed32) this.pos += 4;else if (type === Pbf.Fixed64) this.pos += 8;else throw new Error('Unimplemented type: ' + type);
  8244. },
  8245. // === WRITING =================================================================
  8246. writeTag: function writeTag(tag, type) {
  8247. this.writeVarint(tag << 3 | type);
  8248. },
  8249. realloc: function realloc(min) {
  8250. var length = this.length || 16;
  8251. while (length < this.pos + min) length *= 2;
  8252. if (length !== this.length) {
  8253. var buf = new Uint8Array(length);
  8254. buf.set(this.buf);
  8255. this.buf = buf;
  8256. this.length = length;
  8257. }
  8258. },
  8259. finish: function finish() {
  8260. this.length = this.pos;
  8261. this.pos = 0;
  8262. return this.buf.subarray(0, this.length);
  8263. },
  8264. writeFixed32: function writeFixed32(val) {
  8265. this.realloc(4);
  8266. writeInt32(this.buf, val, this.pos);
  8267. this.pos += 4;
  8268. },
  8269. writeSFixed32: function writeSFixed32(val) {
  8270. this.realloc(4);
  8271. writeInt32(this.buf, val, this.pos);
  8272. this.pos += 4;
  8273. },
  8274. writeFixed64: function writeFixed64(val) {
  8275. this.realloc(8);
  8276. writeInt32(this.buf, val & -1, this.pos);
  8277. writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
  8278. this.pos += 8;
  8279. },
  8280. writeSFixed64: function writeSFixed64(val) {
  8281. this.realloc(8);
  8282. writeInt32(this.buf, val & -1, this.pos);
  8283. writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);
  8284. this.pos += 8;
  8285. },
  8286. writeVarint: function writeVarint(val) {
  8287. val = +val || 0;
  8288. if (val > 0xfffffff || val < 0) {
  8289. writeBigVarint(val, this);
  8290. return;
  8291. }
  8292. this.realloc(4);
  8293. this.buf[this.pos++] = val & 0x7f | (val > 0x7f ? 0x80 : 0);
  8294. if (val <= 0x7f) return;
  8295. this.buf[this.pos++] = (val >>>= 7) & 0x7f | (val > 0x7f ? 0x80 : 0);
  8296. if (val <= 0x7f) return;
  8297. this.buf[this.pos++] = (val >>>= 7) & 0x7f | (val > 0x7f ? 0x80 : 0);
  8298. if (val <= 0x7f) return;
  8299. this.buf[this.pos++] = val >>> 7 & 0x7f;
  8300. },
  8301. writeSVarint: function writeSVarint(val) {
  8302. this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);
  8303. },
  8304. writeBoolean: function writeBoolean(val) {
  8305. this.writeVarint(Boolean(val));
  8306. },
  8307. writeString: function writeString(str) {
  8308. str = String(str);
  8309. this.realloc(str.length * 4);
  8310. this.pos++; // reserve 1 byte for short string length
  8311. var startPos = this.pos;
  8312. // write the string directly to the buffer and see how much was written
  8313. this.pos = writeUtf8(this.buf, str, this.pos);
  8314. var len = this.pos - startPos;
  8315. if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);
  8316. // finally, write the message length in the reserved place and restore the position
  8317. this.pos = startPos - 1;
  8318. this.writeVarint(len);
  8319. this.pos += len;
  8320. },
  8321. writeFloat: function writeFloat(val) {
  8322. this.realloc(4);
  8323. ieee754.write(this.buf, val, this.pos, true, 23, 4);
  8324. this.pos += 4;
  8325. },
  8326. writeDouble: function writeDouble(val) {
  8327. this.realloc(8);
  8328. ieee754.write(this.buf, val, this.pos, true, 52, 8);
  8329. this.pos += 8;
  8330. },
  8331. writeBytes: function writeBytes(buffer) {
  8332. var len = buffer.length;
  8333. this.writeVarint(len);
  8334. this.realloc(len);
  8335. for (var i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];
  8336. },
  8337. writeRawMessage: function writeRawMessage(fn, obj) {
  8338. this.pos++; // reserve 1 byte for short message length
  8339. // write the message directly to the buffer and see how much was written
  8340. var startPos = this.pos;
  8341. fn(obj, this);
  8342. var len = this.pos - startPos;
  8343. if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);
  8344. // finally, write the message length in the reserved place and restore the position
  8345. this.pos = startPos - 1;
  8346. this.writeVarint(len);
  8347. this.pos += len;
  8348. },
  8349. writeMessage: function writeMessage(tag, fn, obj) {
  8350. this.writeTag(tag, Pbf.Bytes);
  8351. this.writeRawMessage(fn, obj);
  8352. },
  8353. writePackedVarint: function writePackedVarint(tag, arr) {
  8354. if (arr.length) this.writeMessage(tag, _writePackedVarint, arr);
  8355. },
  8356. writePackedSVarint: function writePackedSVarint(tag, arr) {
  8357. if (arr.length) this.writeMessage(tag, _writePackedSVarint, arr);
  8358. },
  8359. writePackedBoolean: function writePackedBoolean(tag, arr) {
  8360. if (arr.length) this.writeMessage(tag, _writePackedBoolean, arr);
  8361. },
  8362. writePackedFloat: function writePackedFloat(tag, arr) {
  8363. if (arr.length) this.writeMessage(tag, _writePackedFloat, arr);
  8364. },
  8365. writePackedDouble: function writePackedDouble(tag, arr) {
  8366. if (arr.length) this.writeMessage(tag, _writePackedDouble, arr);
  8367. },
  8368. writePackedFixed32: function writePackedFixed32(tag, arr) {
  8369. if (arr.length) this.writeMessage(tag, _writePackedFixed, arr);
  8370. },
  8371. writePackedSFixed32: function writePackedSFixed32(tag, arr) {
  8372. if (arr.length) this.writeMessage(tag, _writePackedSFixed, arr);
  8373. },
  8374. writePackedFixed64: function writePackedFixed64(tag, arr) {
  8375. if (arr.length) this.writeMessage(tag, _writePackedFixed2, arr);
  8376. },
  8377. writePackedSFixed64: function writePackedSFixed64(tag, arr) {
  8378. if (arr.length) this.writeMessage(tag, _writePackedSFixed2, arr);
  8379. },
  8380. writeBytesField: function writeBytesField(tag, buffer) {
  8381. this.writeTag(tag, Pbf.Bytes);
  8382. this.writeBytes(buffer);
  8383. },
  8384. writeFixed32Field: function writeFixed32Field(tag, val) {
  8385. this.writeTag(tag, Pbf.Fixed32);
  8386. this.writeFixed32(val);
  8387. },
  8388. writeSFixed32Field: function writeSFixed32Field(tag, val) {
  8389. this.writeTag(tag, Pbf.Fixed32);
  8390. this.writeSFixed32(val);
  8391. },
  8392. writeFixed64Field: function writeFixed64Field(tag, val) {
  8393. this.writeTag(tag, Pbf.Fixed64);
  8394. this.writeFixed64(val);
  8395. },
  8396. writeSFixed64Field: function writeSFixed64Field(tag, val) {
  8397. this.writeTag(tag, Pbf.Fixed64);
  8398. this.writeSFixed64(val);
  8399. },
  8400. writeVarintField: function writeVarintField(tag, val) {
  8401. this.writeTag(tag, Pbf.Varint);
  8402. this.writeVarint(val);
  8403. },
  8404. writeSVarintField: function writeSVarintField(tag, val) {
  8405. this.writeTag(tag, Pbf.Varint);
  8406. this.writeSVarint(val);
  8407. },
  8408. writeStringField: function writeStringField(tag, str) {
  8409. this.writeTag(tag, Pbf.Bytes);
  8410. this.writeString(str);
  8411. },
  8412. writeFloatField: function writeFloatField(tag, val) {
  8413. this.writeTag(tag, Pbf.Fixed32);
  8414. this.writeFloat(val);
  8415. },
  8416. writeDoubleField: function writeDoubleField(tag, val) {
  8417. this.writeTag(tag, Pbf.Fixed64);
  8418. this.writeDouble(val);
  8419. },
  8420. writeBooleanField: function writeBooleanField(tag, val) {
  8421. this.writeVarintField(tag, Boolean(val));
  8422. }
  8423. };
  8424. function readVarintRemainder(l, s, p) {
  8425. var buf = p.buf,
  8426. h,
  8427. b;
  8428. b = buf[p.pos++];
  8429. h = (b & 0x70) >> 4;
  8430. if (b < 0x80) return toNum(l, h, s);
  8431. b = buf[p.pos++];
  8432. h |= (b & 0x7f) << 3;
  8433. if (b < 0x80) return toNum(l, h, s);
  8434. b = buf[p.pos++];
  8435. h |= (b & 0x7f) << 10;
  8436. if (b < 0x80) return toNum(l, h, s);
  8437. b = buf[p.pos++];
  8438. h |= (b & 0x7f) << 17;
  8439. if (b < 0x80) return toNum(l, h, s);
  8440. b = buf[p.pos++];
  8441. h |= (b & 0x7f) << 24;
  8442. if (b < 0x80) return toNum(l, h, s);
  8443. b = buf[p.pos++];
  8444. h |= (b & 0x01) << 31;
  8445. if (b < 0x80) return toNum(l, h, s);
  8446. throw new Error('Expected varint not more than 10 bytes');
  8447. }
  8448. function readPackedEnd(pbf) {
  8449. return pbf.type === Pbf.Bytes ? pbf.readVarint() + pbf.pos : pbf.pos + 1;
  8450. }
  8451. function toNum(low, high, isSigned) {
  8452. if (isSigned) {
  8453. return high * 0x100000000 + (low >>> 0);
  8454. }
  8455. return (high >>> 0) * 0x100000000 + (low >>> 0);
  8456. }
  8457. function writeBigVarint(val, pbf) {
  8458. var low, high;
  8459. if (val >= 0) {
  8460. low = val % 0x100000000 | 0;
  8461. high = val / 0x100000000 | 0;
  8462. } else {
  8463. low = ~(-val % 0x100000000);
  8464. high = ~(-val / 0x100000000);
  8465. if (low ^ 0xffffffff) {
  8466. low = low + 1 | 0;
  8467. } else {
  8468. low = 0;
  8469. high = high + 1 | 0;
  8470. }
  8471. }
  8472. if (val >= 0x10000000000000000 || val < -0x10000000000000000) {
  8473. throw new Error('Given varint doesn\'t fit into 10 bytes');
  8474. }
  8475. pbf.realloc(10);
  8476. writeBigVarintLow(low, high, pbf);
  8477. writeBigVarintHigh(high, pbf);
  8478. }
  8479. function writeBigVarintLow(low, high, pbf) {
  8480. pbf.buf[pbf.pos++] = low & 0x7f | 0x80;
  8481. low >>>= 7;
  8482. pbf.buf[pbf.pos++] = low & 0x7f | 0x80;
  8483. low >>>= 7;
  8484. pbf.buf[pbf.pos++] = low & 0x7f | 0x80;
  8485. low >>>= 7;
  8486. pbf.buf[pbf.pos++] = low & 0x7f | 0x80;
  8487. low >>>= 7;
  8488. pbf.buf[pbf.pos] = low & 0x7f;
  8489. }
  8490. function writeBigVarintHigh(high, pbf) {
  8491. var lsb = (high & 0x07) << 4;
  8492. pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 0x80 : 0);
  8493. if (!high) return;
  8494. pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0);
  8495. if (!high) return;
  8496. pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0);
  8497. if (!high) return;
  8498. pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0);
  8499. if (!high) return;
  8500. pbf.buf[pbf.pos++] = high & 0x7f | ((high >>>= 7) ? 0x80 : 0);
  8501. if (!high) return;
  8502. pbf.buf[pbf.pos++] = high & 0x7f;
  8503. }
  8504. function makeRoomForExtraLength(startPos, len, pbf) {
  8505. var extraLen = len <= 0x3fff ? 1 : len <= 0x1fffff ? 2 : len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));
  8506. // if 1 byte isn't enough for encoding message length, shift the data to the right
  8507. pbf.realloc(extraLen);
  8508. for (var i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];
  8509. }
  8510. function _writePackedVarint(arr, pbf) {
  8511. for (var i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]);
  8512. }
  8513. function _writePackedSVarint(arr, pbf) {
  8514. for (var i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]);
  8515. }
  8516. function _writePackedFloat(arr, pbf) {
  8517. for (var i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]);
  8518. }
  8519. function _writePackedDouble(arr, pbf) {
  8520. for (var i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]);
  8521. }
  8522. function _writePackedBoolean(arr, pbf) {
  8523. for (var i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]);
  8524. }
  8525. function _writePackedFixed(arr, pbf) {
  8526. for (var i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]);
  8527. }
  8528. function _writePackedSFixed(arr, pbf) {
  8529. for (var i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]);
  8530. }
  8531. function _writePackedFixed2(arr, pbf) {
  8532. for (var i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]);
  8533. }
  8534. function _writePackedSFixed2(arr, pbf) {
  8535. for (var i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]);
  8536. }
  8537. // Buffer code below from https://github.com/feross/buffer, MIT-licensed
  8538. function readUInt32(buf, pos) {
  8539. return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16) + buf[pos + 3] * 0x1000000;
  8540. }
  8541. function writeInt32(buf, val, pos) {
  8542. buf[pos] = val;
  8543. buf[pos + 1] = val >>> 8;
  8544. buf[pos + 2] = val >>> 16;
  8545. buf[pos + 3] = val >>> 24;
  8546. }
  8547. function readInt32(buf, pos) {
  8548. return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16) + (buf[pos + 3] << 24);
  8549. }
  8550. function readUtf8(buf, pos, end) {
  8551. var str = '';
  8552. var i = pos;
  8553. while (i < end) {
  8554. var b0 = buf[i];
  8555. var c = null; // codepoint
  8556. var bytesPerSequence = b0 > 0xEF ? 4 : b0 > 0xDF ? 3 : b0 > 0xBF ? 2 : 1;
  8557. if (i + bytesPerSequence > end) break;
  8558. var b1, b2, b3;
  8559. if (bytesPerSequence === 1) {
  8560. if (b0 < 0x80) {
  8561. c = b0;
  8562. }
  8563. } else if (bytesPerSequence === 2) {
  8564. b1 = buf[i + 1];
  8565. if ((b1 & 0xC0) === 0x80) {
  8566. c = (b0 & 0x1F) << 0x6 | b1 & 0x3F;
  8567. if (c <= 0x7F) {
  8568. c = null;
  8569. }
  8570. }
  8571. } else if (bytesPerSequence === 3) {
  8572. b1 = buf[i + 1];
  8573. b2 = buf[i + 2];
  8574. if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {
  8575. c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | b2 & 0x3F;
  8576. if (c <= 0x7FF || c >= 0xD800 && c <= 0xDFFF) {
  8577. c = null;
  8578. }
  8579. }
  8580. } else if (bytesPerSequence === 4) {
  8581. b1 = buf[i + 1];
  8582. b2 = buf[i + 2];
  8583. b3 = buf[i + 3];
  8584. if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
  8585. c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | b3 & 0x3F;
  8586. if (c <= 0xFFFF || c >= 0x110000) {
  8587. c = null;
  8588. }
  8589. }
  8590. }
  8591. if (c === null) {
  8592. c = 0xFFFD;
  8593. bytesPerSequence = 1;
  8594. } else if (c > 0xFFFF) {
  8595. c -= 0x10000;
  8596. str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);
  8597. c = 0xDC00 | c & 0x3FF;
  8598. }
  8599. str += String.fromCharCode(c);
  8600. i += bytesPerSequence;
  8601. }
  8602. return str;
  8603. }
  8604. function readUtf8TextDecoder(buf, pos, end) {
  8605. return utf8TextDecoder.decode(buf.subarray(pos, end));
  8606. }
  8607. function writeUtf8(buf, str, pos) {
  8608. for (var i = 0, c, lead; i < str.length; i++) {
  8609. c = str.charCodeAt(i); // code point
  8610. if (c > 0xD7FF && c < 0xE000) {
  8611. if (lead) {
  8612. if (c < 0xDC00) {
  8613. buf[pos++] = 0xEF;
  8614. buf[pos++] = 0xBF;
  8615. buf[pos++] = 0xBD;
  8616. lead = c;
  8617. continue;
  8618. } else {
  8619. c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;
  8620. lead = null;
  8621. }
  8622. } else {
  8623. if (c > 0xDBFF || i + 1 === str.length) {
  8624. buf[pos++] = 0xEF;
  8625. buf[pos++] = 0xBF;
  8626. buf[pos++] = 0xBD;
  8627. } else {
  8628. lead = c;
  8629. }
  8630. continue;
  8631. }
  8632. } else if (lead) {
  8633. buf[pos++] = 0xEF;
  8634. buf[pos++] = 0xBF;
  8635. buf[pos++] = 0xBD;
  8636. lead = null;
  8637. }
  8638. if (c < 0x80) {
  8639. buf[pos++] = c;
  8640. } else {
  8641. if (c < 0x800) {
  8642. buf[pos++] = c >> 0x6 | 0xC0;
  8643. } else {
  8644. if (c < 0x10000) {
  8645. buf[pos++] = c >> 0xC | 0xE0;
  8646. } else {
  8647. buf[pos++] = c >> 0x12 | 0xF0;
  8648. buf[pos++] = c >> 0xC & 0x3F | 0x80;
  8649. }
  8650. buf[pos++] = c >> 0x6 & 0x3F | 0x80;
  8651. }
  8652. buf[pos++] = c & 0x3F | 0x80;
  8653. }
  8654. }
  8655. return pos;
  8656. }
  8657. /***/ }),
  8658. /***/ 4689:
  8659. /***/ (function(module, exports, __webpack_require__) {
  8660. 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); }
  8661. (function (global, factory) {
  8662. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  8663. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  8664. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  8665. __WEBPACK_AMD_DEFINE_FACTORY__),
  8666. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  8667. })(this, function () {
  8668. 'use strict';
  8669. var globals = function globals(defs) {
  8670. defs('EPSG:4326', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
  8671. defs('EPSG:4269', "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees");
  8672. defs('EPSG:3857', "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
  8673. defs.WGS84 = defs['EPSG:4326'];
  8674. defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857
  8675. defs.GOOGLE = defs['EPSG:3857'];
  8676. defs['EPSG:900913'] = defs['EPSG:3857'];
  8677. defs['EPSG:102113'] = defs['EPSG:3857'];
  8678. };
  8679. var PJD_3PARAM = 1;
  8680. var PJD_7PARAM = 2;
  8681. var PJD_GRIDSHIFT = 3;
  8682. var PJD_WGS84 = 4; // WGS84 or equivalent
  8683. var PJD_NODATUM = 5; // WGS84 or equivalent
  8684. var SRS_WGS84_SEMIMAJOR = 6378137.0; // only used in grid shift transforms
  8685. var SRS_WGS84_SEMIMINOR = 6356752.314; // only used in grid shift transforms
  8686. var SRS_WGS84_ESQUARED = 0.0066943799901413165; // only used in grid shift transforms
  8687. var SEC_TO_RAD = 4.84813681109535993589914102357e-6;
  8688. var HALF_PI = Math.PI / 2;
  8689. // ellipoid pj_set_ell.c
  8690. var SIXTH = 0.1666666666666666667;
  8691. /* 1/6 */
  8692. var RA4 = 0.04722222222222222222;
  8693. /* 17/360 */
  8694. var RA6 = 0.02215608465608465608;
  8695. var EPSLN = 1.0e-10;
  8696. // you'd think you could use Number.EPSILON above but that makes
  8697. // Mollweide get into an infinate loop.
  8698. var D2R = 0.01745329251994329577;
  8699. var R2D = 57.29577951308232088;
  8700. var FORTPI = Math.PI / 4;
  8701. var TWO_PI = Math.PI * 2;
  8702. // SPI is slightly greater than Math.PI, so values that exceed the -180..180
  8703. // degree range by a tiny amount don't get wrapped. This prevents points that
  8704. // have drifted from their original location along the 180th meridian (due to
  8705. // floating point error) from changing their sign.
  8706. var SPI = 3.14159265359;
  8707. var exports$1 = {};
  8708. exports$1.greenwich = 0.0; //"0dE",
  8709. exports$1.lisbon = -9.131906111111; //"9d07'54.862\"W",
  8710. exports$1.paris = 2.337229166667; //"2d20'14.025\"E",
  8711. exports$1.bogota = -74.080916666667; //"74d04'51.3\"W",
  8712. exports$1.madrid = -3.687938888889; //"3d41'16.58\"W",
  8713. exports$1.rome = 12.452333333333; //"12d27'8.4\"E",
  8714. exports$1.bern = 7.439583333333; //"7d26'22.5\"E",
  8715. exports$1.jakarta = 106.807719444444; //"106d48'27.79\"E",
  8716. exports$1.ferro = -17.666666666667; //"17d40'W",
  8717. exports$1.brussels = 4.367975; //"4d22'4.71\"E",
  8718. exports$1.stockholm = 18.058277777778; //"18d3'29.8\"E",
  8719. exports$1.athens = 23.7163375; //"23d42'58.815\"E",
  8720. exports$1.oslo = 10.722916666667; //"10d43'22.5\"E"
  8721. var _units = {
  8722. ft: {
  8723. to_meter: 0.3048
  8724. },
  8725. 'us-ft': {
  8726. to_meter: 1200 / 3937
  8727. }
  8728. };
  8729. var ignoredChar = /[\s_\-\/\(\)]/g;
  8730. function match(obj, key) {
  8731. if (obj[key]) {
  8732. return obj[key];
  8733. }
  8734. var keys = Object.keys(obj);
  8735. var lkey = key.toLowerCase().replace(ignoredChar, '');
  8736. var i = -1;
  8737. var testkey, processedKey;
  8738. while (++i < keys.length) {
  8739. testkey = keys[i];
  8740. processedKey = testkey.toLowerCase().replace(ignoredChar, '');
  8741. if (processedKey === lkey) {
  8742. return obj[testkey];
  8743. }
  8744. }
  8745. }
  8746. var parseProj = function parseProj(defData) {
  8747. var self = {};
  8748. var paramObj = defData.split('+').map(function (v) {
  8749. return v.trim();
  8750. }).filter(function (a) {
  8751. return a;
  8752. }).reduce(function (p, a) {
  8753. var split = a.split('=');
  8754. split.push(true);
  8755. p[split[0].toLowerCase()] = split[1];
  8756. return p;
  8757. }, {});
  8758. var paramName, paramVal, paramOutname;
  8759. var params = {
  8760. proj: 'projName',
  8761. datum: 'datumCode',
  8762. rf: function rf(v) {
  8763. self.rf = parseFloat(v);
  8764. },
  8765. lat_0: function lat_0(v) {
  8766. self.lat0 = v * D2R;
  8767. },
  8768. lat_1: function lat_1(v) {
  8769. self.lat1 = v * D2R;
  8770. },
  8771. lat_2: function lat_2(v) {
  8772. self.lat2 = v * D2R;
  8773. },
  8774. lat_ts: function lat_ts(v) {
  8775. self.lat_ts = v * D2R;
  8776. },
  8777. lon_0: function lon_0(v) {
  8778. self.long0 = v * D2R;
  8779. },
  8780. lon_1: function lon_1(v) {
  8781. self.long1 = v * D2R;
  8782. },
  8783. lon_2: function lon_2(v) {
  8784. self.long2 = v * D2R;
  8785. },
  8786. alpha: function alpha(v) {
  8787. self.alpha = parseFloat(v) * D2R;
  8788. },
  8789. gamma: function gamma(v) {
  8790. self.rectified_grid_angle = parseFloat(v);
  8791. },
  8792. lonc: function lonc(v) {
  8793. self.longc = v * D2R;
  8794. },
  8795. x_0: function x_0(v) {
  8796. self.x0 = parseFloat(v);
  8797. },
  8798. y_0: function y_0(v) {
  8799. self.y0 = parseFloat(v);
  8800. },
  8801. k_0: function k_0(v) {
  8802. self.k0 = parseFloat(v);
  8803. },
  8804. k: function k(v) {
  8805. self.k0 = parseFloat(v);
  8806. },
  8807. a: function a(v) {
  8808. self.a = parseFloat(v);
  8809. },
  8810. b: function b(v) {
  8811. self.b = parseFloat(v);
  8812. },
  8813. r_a: function r_a() {
  8814. self.R_A = true;
  8815. },
  8816. zone: function zone(v) {
  8817. self.zone = parseInt(v, 10);
  8818. },
  8819. south: function south() {
  8820. self.utmSouth = true;
  8821. },
  8822. towgs84: function towgs84(v) {
  8823. self.datum_params = v.split(",").map(function (a) {
  8824. return parseFloat(a);
  8825. });
  8826. },
  8827. to_meter: function to_meter(v) {
  8828. self.to_meter = parseFloat(v);
  8829. },
  8830. units: function units(v) {
  8831. self.units = v;
  8832. var unit = match(_units, v);
  8833. if (unit) {
  8834. self.to_meter = unit.to_meter;
  8835. }
  8836. },
  8837. from_greenwich: function from_greenwich(v) {
  8838. self.from_greenwich = v * D2R;
  8839. },
  8840. pm: function pm(v) {
  8841. var pm = match(exports$1, v);
  8842. self.from_greenwich = (pm ? pm : parseFloat(v)) * D2R;
  8843. },
  8844. nadgrids: function nadgrids(v) {
  8845. if (v === '@null') {
  8846. self.datumCode = 'none';
  8847. } else {
  8848. self.nadgrids = v;
  8849. }
  8850. },
  8851. axis: function axis(v) {
  8852. var legalAxis = "ewnsud";
  8853. if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) {
  8854. self.axis = v;
  8855. }
  8856. },
  8857. approx: function approx() {
  8858. self.approx = true;
  8859. }
  8860. };
  8861. for (paramName in paramObj) {
  8862. paramVal = paramObj[paramName];
  8863. if (paramName in params) {
  8864. paramOutname = params[paramName];
  8865. if (typeof paramOutname === 'function') {
  8866. paramOutname(paramVal);
  8867. } else {
  8868. self[paramOutname] = paramVal;
  8869. }
  8870. } else {
  8871. self[paramName] = paramVal;
  8872. }
  8873. }
  8874. if (typeof self.datumCode === 'string' && self.datumCode !== "WGS84") {
  8875. self.datumCode = self.datumCode.toLowerCase();
  8876. }
  8877. return self;
  8878. };
  8879. var NEUTRAL = 1;
  8880. var KEYWORD = 2;
  8881. var NUMBER = 3;
  8882. var QUOTED = 4;
  8883. var AFTERQUOTE = 5;
  8884. var ENDED = -1;
  8885. var whitespace = /\s/;
  8886. var latin = /[A-Za-z]/;
  8887. var keyword = /[A-Za-z84_]/;
  8888. var endThings = /[,\]]/;
  8889. var digets = /[\d\.E\-\+]/;
  8890. // const ignoredChar = /[\s_\-\/\(\)]/g;
  8891. function Parser(text) {
  8892. if (typeof text !== 'string') {
  8893. throw new Error('not a string');
  8894. }
  8895. this.text = text.trim();
  8896. this.level = 0;
  8897. this.place = 0;
  8898. this.root = null;
  8899. this.stack = [];
  8900. this.currentObject = null;
  8901. this.state = NEUTRAL;
  8902. }
  8903. Parser.prototype.readCharicter = function () {
  8904. var _char = this.text[this.place++];
  8905. if (this.state !== QUOTED) {
  8906. while (whitespace.test(_char)) {
  8907. if (this.place >= this.text.length) {
  8908. return;
  8909. }
  8910. _char = this.text[this.place++];
  8911. }
  8912. }
  8913. switch (this.state) {
  8914. case NEUTRAL:
  8915. return this.neutral(_char);
  8916. case KEYWORD:
  8917. return this.keyword(_char);
  8918. case QUOTED:
  8919. return this.quoted(_char);
  8920. case AFTERQUOTE:
  8921. return this.afterquote(_char);
  8922. case NUMBER:
  8923. return this.number(_char);
  8924. case ENDED:
  8925. return;
  8926. }
  8927. };
  8928. Parser.prototype.afterquote = function (_char2) {
  8929. if (_char2 === '"') {
  8930. this.word += '"';
  8931. this.state = QUOTED;
  8932. return;
  8933. }
  8934. if (endThings.test(_char2)) {
  8935. this.word = this.word.trim();
  8936. this.afterItem(_char2);
  8937. return;
  8938. }
  8939. throw new Error('havn\'t handled "' + _char2 + '" in afterquote yet, index ' + this.place);
  8940. };
  8941. Parser.prototype.afterItem = function (_char3) {
  8942. if (_char3 === ',') {
  8943. if (this.word !== null) {
  8944. this.currentObject.push(this.word);
  8945. }
  8946. this.word = null;
  8947. this.state = NEUTRAL;
  8948. return;
  8949. }
  8950. if (_char3 === ']') {
  8951. this.level--;
  8952. if (this.word !== null) {
  8953. this.currentObject.push(this.word);
  8954. this.word = null;
  8955. }
  8956. this.state = NEUTRAL;
  8957. this.currentObject = this.stack.pop();
  8958. if (!this.currentObject) {
  8959. this.state = ENDED;
  8960. }
  8961. return;
  8962. }
  8963. };
  8964. Parser.prototype.number = function (_char4) {
  8965. if (digets.test(_char4)) {
  8966. this.word += _char4;
  8967. return;
  8968. }
  8969. if (endThings.test(_char4)) {
  8970. this.word = parseFloat(this.word);
  8971. this.afterItem(_char4);
  8972. return;
  8973. }
  8974. throw new Error('havn\'t handled "' + _char4 + '" in number yet, index ' + this.place);
  8975. };
  8976. Parser.prototype.quoted = function (_char5) {
  8977. if (_char5 === '"') {
  8978. this.state = AFTERQUOTE;
  8979. return;
  8980. }
  8981. this.word += _char5;
  8982. return;
  8983. };
  8984. Parser.prototype.keyword = function (_char6) {
  8985. if (keyword.test(_char6)) {
  8986. this.word += _char6;
  8987. return;
  8988. }
  8989. if (_char6 === '[') {
  8990. var newObjects = [];
  8991. newObjects.push(this.word);
  8992. this.level++;
  8993. if (this.root === null) {
  8994. this.root = newObjects;
  8995. } else {
  8996. this.currentObject.push(newObjects);
  8997. }
  8998. this.stack.push(this.currentObject);
  8999. this.currentObject = newObjects;
  9000. this.state = NEUTRAL;
  9001. return;
  9002. }
  9003. if (endThings.test(_char6)) {
  9004. this.afterItem(_char6);
  9005. return;
  9006. }
  9007. throw new Error('havn\'t handled "' + _char6 + '" in keyword yet, index ' + this.place);
  9008. };
  9009. Parser.prototype.neutral = function (_char7) {
  9010. if (latin.test(_char7)) {
  9011. this.word = _char7;
  9012. this.state = KEYWORD;
  9013. return;
  9014. }
  9015. if (_char7 === '"') {
  9016. this.word = '';
  9017. this.state = QUOTED;
  9018. return;
  9019. }
  9020. if (digets.test(_char7)) {
  9021. this.word = _char7;
  9022. this.state = NUMBER;
  9023. return;
  9024. }
  9025. if (endThings.test(_char7)) {
  9026. this.afterItem(_char7);
  9027. return;
  9028. }
  9029. throw new Error('havn\'t handled "' + _char7 + '" in neutral yet, index ' + this.place);
  9030. };
  9031. Parser.prototype.output = function () {
  9032. while (this.place < this.text.length) {
  9033. this.readCharicter();
  9034. }
  9035. if (this.state === ENDED) {
  9036. return this.root;
  9037. }
  9038. throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
  9039. };
  9040. function parseString(txt) {
  9041. var parser = new Parser(txt);
  9042. return parser.output();
  9043. }
  9044. function mapit(obj, key, value) {
  9045. if (Array.isArray(key)) {
  9046. value.unshift(key);
  9047. key = null;
  9048. }
  9049. var thing = key ? {} : obj;
  9050. var out = value.reduce(function (newObj, item) {
  9051. sExpr(item, newObj);
  9052. return newObj;
  9053. }, thing);
  9054. if (key) {
  9055. obj[key] = out;
  9056. }
  9057. }
  9058. function sExpr(v, obj) {
  9059. if (!Array.isArray(v)) {
  9060. obj[v] = true;
  9061. return;
  9062. }
  9063. var key = v.shift();
  9064. if (key === 'PARAMETER') {
  9065. key = v.shift();
  9066. }
  9067. if (v.length === 1) {
  9068. if (Array.isArray(v[0])) {
  9069. obj[key] = {};
  9070. sExpr(v[0], obj[key]);
  9071. return;
  9072. }
  9073. obj[key] = v[0];
  9074. return;
  9075. }
  9076. if (!v.length) {
  9077. obj[key] = true;
  9078. return;
  9079. }
  9080. if (key === 'TOWGS84') {
  9081. obj[key] = v;
  9082. return;
  9083. }
  9084. if (key === 'AXIS') {
  9085. if (!(key in obj)) {
  9086. obj[key] = [];
  9087. }
  9088. obj[key].push(v);
  9089. return;
  9090. }
  9091. if (!Array.isArray(key)) {
  9092. obj[key] = {};
  9093. }
  9094. var i;
  9095. switch (key) {
  9096. case 'UNIT':
  9097. case 'PRIMEM':
  9098. case 'VERT_DATUM':
  9099. obj[key] = {
  9100. name: v[0].toLowerCase(),
  9101. convert: v[1]
  9102. };
  9103. if (v.length === 3) {
  9104. sExpr(v[2], obj[key]);
  9105. }
  9106. return;
  9107. case 'SPHEROID':
  9108. case 'ELLIPSOID':
  9109. obj[key] = {
  9110. name: v[0],
  9111. a: v[1],
  9112. rf: v[2]
  9113. };
  9114. if (v.length === 4) {
  9115. sExpr(v[3], obj[key]);
  9116. }
  9117. return;
  9118. case 'PROJECTEDCRS':
  9119. case 'PROJCRS':
  9120. case 'GEOGCS':
  9121. case 'GEOCCS':
  9122. case 'PROJCS':
  9123. case 'LOCAL_CS':
  9124. case 'GEODCRS':
  9125. case 'GEODETICCRS':
  9126. case 'GEODETICDATUM':
  9127. case 'EDATUM':
  9128. case 'ENGINEERINGDATUM':
  9129. case 'VERT_CS':
  9130. case 'VERTCRS':
  9131. case 'VERTICALCRS':
  9132. case 'COMPD_CS':
  9133. case 'COMPOUNDCRS':
  9134. case 'ENGINEERINGCRS':
  9135. case 'ENGCRS':
  9136. case 'FITTED_CS':
  9137. case 'LOCAL_DATUM':
  9138. case 'DATUM':
  9139. v[0] = ['name', v[0]];
  9140. mapit(obj, key, v);
  9141. return;
  9142. default:
  9143. i = -1;
  9144. while (++i < v.length) {
  9145. if (!Array.isArray(v[i])) {
  9146. return sExpr(v, obj[key]);
  9147. }
  9148. }
  9149. return mapit(obj, key, v);
  9150. }
  9151. }
  9152. var D2R$1 = 0.01745329251994329577;
  9153. function rename(obj, params) {
  9154. var outName = params[0];
  9155. var inName = params[1];
  9156. if (!(outName in obj) && inName in obj) {
  9157. obj[outName] = obj[inName];
  9158. if (params.length === 3) {
  9159. obj[outName] = params[2](obj[outName]);
  9160. }
  9161. }
  9162. }
  9163. function d2r(input) {
  9164. return input * D2R$1;
  9165. }
  9166. function cleanWKT(wkt) {
  9167. if (wkt.type === 'GEOGCS') {
  9168. wkt.projName = 'longlat';
  9169. } else if (wkt.type === 'LOCAL_CS') {
  9170. wkt.projName = 'identity';
  9171. wkt.local = true;
  9172. } else {
  9173. if (_typeof(wkt.PROJECTION) === 'object') {
  9174. wkt.projName = Object.keys(wkt.PROJECTION)[0];
  9175. } else {
  9176. wkt.projName = wkt.PROJECTION;
  9177. }
  9178. }
  9179. if (wkt.AXIS) {
  9180. var axisOrder = '';
  9181. for (var i = 0, ii = wkt.AXIS.length; i < ii; ++i) {
  9182. var axis = [wkt.AXIS[i][0].toLowerCase(), wkt.AXIS[i][1].toLowerCase()];
  9183. if (axis[0].indexOf('north') !== -1 || (axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'north') {
  9184. axisOrder += 'n';
  9185. } else if (axis[0].indexOf('south') !== -1 || (axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'south') {
  9186. axisOrder += 's';
  9187. } else if (axis[0].indexOf('east') !== -1 || (axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'east') {
  9188. axisOrder += 'e';
  9189. } else if (axis[0].indexOf('west') !== -1 || (axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'west') {
  9190. axisOrder += 'w';
  9191. }
  9192. }
  9193. if (axisOrder.length === 2) {
  9194. axisOrder += 'u';
  9195. }
  9196. if (axisOrder.length === 3) {
  9197. wkt.axis = axisOrder;
  9198. }
  9199. }
  9200. if (wkt.UNIT) {
  9201. wkt.units = wkt.UNIT.name.toLowerCase();
  9202. if (wkt.units === 'metre') {
  9203. wkt.units = 'meter';
  9204. }
  9205. if (wkt.UNIT.convert) {
  9206. if (wkt.type === 'GEOGCS') {
  9207. if (wkt.DATUM && wkt.DATUM.SPHEROID) {
  9208. wkt.to_meter = wkt.UNIT.convert * wkt.DATUM.SPHEROID.a;
  9209. }
  9210. } else {
  9211. wkt.to_meter = wkt.UNIT.convert;
  9212. }
  9213. }
  9214. }
  9215. var geogcs = wkt.GEOGCS;
  9216. if (wkt.type === 'GEOGCS') {
  9217. geogcs = wkt;
  9218. }
  9219. if (geogcs) {
  9220. //if(wkt.GEOGCS.PRIMEM&&wkt.GEOGCS.PRIMEM.convert){
  9221. // wkt.from_greenwich=wkt.GEOGCS.PRIMEM.convert*D2R;
  9222. //}
  9223. if (geogcs.DATUM) {
  9224. wkt.datumCode = geogcs.DATUM.name.toLowerCase();
  9225. } else {
  9226. wkt.datumCode = geogcs.name.toLowerCase();
  9227. }
  9228. if (wkt.datumCode.slice(0, 2) === 'd_') {
  9229. wkt.datumCode = wkt.datumCode.slice(2);
  9230. }
  9231. if (wkt.datumCode === 'new_zealand_geodetic_datum_1949' || wkt.datumCode === 'new_zealand_1949') {
  9232. wkt.datumCode = 'nzgd49';
  9233. }
  9234. if (wkt.datumCode === 'wgs_1984' || wkt.datumCode === 'world_geodetic_system_1984') {
  9235. if (wkt.PROJECTION === 'Mercator_Auxiliary_Sphere') {
  9236. wkt.sphere = true;
  9237. }
  9238. wkt.datumCode = 'wgs84';
  9239. }
  9240. if (wkt.datumCode.slice(-6) === '_ferro') {
  9241. wkt.datumCode = wkt.datumCode.slice(0, -6);
  9242. }
  9243. if (wkt.datumCode.slice(-8) === '_jakarta') {
  9244. wkt.datumCode = wkt.datumCode.slice(0, -8);
  9245. }
  9246. if (~wkt.datumCode.indexOf('belge')) {
  9247. wkt.datumCode = 'rnb72';
  9248. }
  9249. if (geogcs.DATUM && geogcs.DATUM.SPHEROID) {
  9250. wkt.ellps = geogcs.DATUM.SPHEROID.name.replace('_19', '').replace(/[Cc]larke\_18/, 'clrk');
  9251. if (wkt.ellps.toLowerCase().slice(0, 13) === 'international') {
  9252. wkt.ellps = 'intl';
  9253. }
  9254. wkt.a = geogcs.DATUM.SPHEROID.a;
  9255. wkt.rf = parseFloat(geogcs.DATUM.SPHEROID.rf, 10);
  9256. }
  9257. if (geogcs.DATUM && geogcs.DATUM.TOWGS84) {
  9258. wkt.datum_params = geogcs.DATUM.TOWGS84;
  9259. }
  9260. if (~wkt.datumCode.indexOf('osgb_1936')) {
  9261. wkt.datumCode = 'osgb36';
  9262. }
  9263. if (~wkt.datumCode.indexOf('osni_1952')) {
  9264. wkt.datumCode = 'osni52';
  9265. }
  9266. if (~wkt.datumCode.indexOf('tm65') || ~wkt.datumCode.indexOf('geodetic_datum_of_1965')) {
  9267. wkt.datumCode = 'ire65';
  9268. }
  9269. if (wkt.datumCode === 'ch1903+') {
  9270. wkt.datumCode = 'ch1903';
  9271. }
  9272. if (~wkt.datumCode.indexOf('israel')) {
  9273. wkt.datumCode = 'isr93';
  9274. }
  9275. }
  9276. if (wkt.b && !isFinite(wkt.b)) {
  9277. wkt.b = wkt.a;
  9278. }
  9279. function toMeter(input) {
  9280. var ratio = wkt.to_meter || 1;
  9281. return input * ratio;
  9282. }
  9283. var renamer = function renamer(a) {
  9284. return rename(wkt, a);
  9285. };
  9286. var list = [['standard_parallel_1', 'Standard_Parallel_1'], ['standard_parallel_1', 'Latitude of 1st standard parallel'], ['standard_parallel_2', 'Standard_Parallel_2'], ['standard_parallel_2', 'Latitude of 2nd standard parallel'], ['false_easting', 'False_Easting'], ['false_easting', 'False easting'], ['false-easting', 'Easting at false origin'], ['false_northing', 'False_Northing'], ['false_northing', 'False northing'], ['false_northing', 'Northing at false origin'], ['central_meridian', 'Central_Meridian'], ['central_meridian', 'Longitude of natural origin'], ['central_meridian', 'Longitude of false origin'], ['latitude_of_origin', 'Latitude_Of_Origin'], ['latitude_of_origin', 'Central_Parallel'], ['latitude_of_origin', 'Latitude of natural origin'], ['latitude_of_origin', 'Latitude of false origin'], ['scale_factor', 'Scale_Factor'], ['k0', 'scale_factor'], ['latitude_of_center', 'Latitude_Of_Center'], ['latitude_of_center', 'Latitude_of_center'], ['lat0', 'latitude_of_center', d2r], ['longitude_of_center', 'Longitude_Of_Center'], ['longitude_of_center', 'Longitude_of_center'], ['longc', 'longitude_of_center', d2r], ['x0', 'false_easting', toMeter], ['y0', 'false_northing', toMeter], ['long0', 'central_meridian', d2r], ['lat0', 'latitude_of_origin', d2r], ['lat0', 'standard_parallel_1', d2r], ['lat1', 'standard_parallel_1', d2r], ['lat2', 'standard_parallel_2', d2r], ['azimuth', 'Azimuth'], ['alpha', 'azimuth', d2r], ['srsCode', 'name']];
  9287. list.forEach(renamer);
  9288. if (!wkt.long0 && wkt.longc && (wkt.projName === 'Albers_Conic_Equal_Area' || wkt.projName === 'Lambert_Azimuthal_Equal_Area')) {
  9289. wkt.long0 = wkt.longc;
  9290. }
  9291. if (!wkt.lat_ts && wkt.lat1 && (wkt.projName === 'Stereographic_South_Pole' || wkt.projName === 'Polar Stereographic (variant B)')) {
  9292. wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90);
  9293. wkt.lat_ts = wkt.lat1;
  9294. }
  9295. }
  9296. var wkt = function wkt(_wkt) {
  9297. var lisp = parseString(_wkt);
  9298. var type = lisp.shift();
  9299. var name = lisp.shift();
  9300. lisp.unshift(['name', name]);
  9301. lisp.unshift(['type', type]);
  9302. var obj = {};
  9303. sExpr(lisp, obj);
  9304. cleanWKT(obj);
  9305. return obj;
  9306. };
  9307. function defs(name) {
  9308. /*global console*/
  9309. var that = this;
  9310. if (arguments.length === 2) {
  9311. var def = arguments[1];
  9312. if (typeof def === 'string') {
  9313. if (def.charAt(0) === '+') {
  9314. defs[name] = parseProj(arguments[1]);
  9315. } else {
  9316. defs[name] = wkt(arguments[1]);
  9317. }
  9318. } else {
  9319. defs[name] = def;
  9320. }
  9321. } else if (arguments.length === 1) {
  9322. if (Array.isArray(name)) {
  9323. return name.map(function (v) {
  9324. if (Array.isArray(v)) {
  9325. defs.apply(that, v);
  9326. } else {
  9327. defs(v);
  9328. }
  9329. });
  9330. } else if (typeof name === 'string') {
  9331. if (name in defs) {
  9332. return defs[name];
  9333. }
  9334. } else if ('EPSG' in name) {
  9335. defs['EPSG:' + name.EPSG] = name;
  9336. } else if ('ESRI' in name) {
  9337. defs['ESRI:' + name.ESRI] = name;
  9338. } else if ('IAU2000' in name) {
  9339. defs['IAU2000:' + name.IAU2000] = name;
  9340. } else {
  9341. console.log(name);
  9342. }
  9343. return;
  9344. }
  9345. }
  9346. globals(defs);
  9347. function testObj(code) {
  9348. return typeof code === 'string';
  9349. }
  9350. function testDef(code) {
  9351. return code in defs;
  9352. }
  9353. var codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS', 'GEOCCS', 'PROJCS', 'LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];
  9354. function testWKT(code) {
  9355. return codeWords.some(function (word) {
  9356. return code.indexOf(word) > -1;
  9357. });
  9358. }
  9359. var codes = ['3857', '900913', '3785', '102113'];
  9360. function checkMercator(item) {
  9361. var auth = match(item, 'authority');
  9362. if (!auth) {
  9363. return;
  9364. }
  9365. var code = match(auth, 'epsg');
  9366. return code && codes.indexOf(code) > -1;
  9367. }
  9368. function checkProjStr(item) {
  9369. var ext = match(item, 'extension');
  9370. if (!ext) {
  9371. return;
  9372. }
  9373. return match(ext, 'proj4');
  9374. }
  9375. function testProj(code) {
  9376. return code[0] === '+';
  9377. }
  9378. function parse(code) {
  9379. if (testObj(code)) {
  9380. //check to see if this is a WKT string
  9381. if (testDef(code)) {
  9382. return defs[code];
  9383. }
  9384. if (testWKT(code)) {
  9385. var out = wkt(code);
  9386. // test of spetial case, due to this being a very common and often malformed
  9387. if (checkMercator(out)) {
  9388. return defs['EPSG:3857'];
  9389. }
  9390. var maybeProjStr = checkProjStr(out);
  9391. if (maybeProjStr) {
  9392. return parseProj(maybeProjStr);
  9393. }
  9394. return out;
  9395. }
  9396. if (testProj(code)) {
  9397. return parseProj(code);
  9398. }
  9399. } else {
  9400. return code;
  9401. }
  9402. }
  9403. var extend = function extend(destination, source) {
  9404. destination = destination || {};
  9405. var value, property;
  9406. if (!source) {
  9407. return destination;
  9408. }
  9409. for (property in source) {
  9410. value = source[property];
  9411. if (value !== undefined) {
  9412. destination[property] = value;
  9413. }
  9414. }
  9415. return destination;
  9416. };
  9417. var msfnz = function msfnz(eccent, sinphi, cosphi) {
  9418. var con = eccent * sinphi;
  9419. return cosphi / Math.sqrt(1 - con * con);
  9420. };
  9421. var sign = function sign(x) {
  9422. return x < 0 ? -1 : 1;
  9423. };
  9424. var adjust_lon = function adjust_lon(x) {
  9425. return Math.abs(x) <= SPI ? x : x - sign(x) * TWO_PI;
  9426. };
  9427. var tsfnz = function tsfnz(eccent, phi, sinphi) {
  9428. var con = eccent * sinphi;
  9429. var com = 0.5 * eccent;
  9430. con = Math.pow((1 - con) / (1 + con), com);
  9431. return Math.tan(0.5 * (HALF_PI - phi)) / con;
  9432. };
  9433. var phi2z = function phi2z(eccent, ts) {
  9434. var eccnth = 0.5 * eccent;
  9435. var con, dphi;
  9436. var phi = HALF_PI - 2 * Math.atan(ts);
  9437. for (var i = 0; i <= 15; i++) {
  9438. con = eccent * Math.sin(phi);
  9439. dphi = HALF_PI - 2 * Math.atan(ts * Math.pow((1 - con) / (1 + con), eccnth)) - phi;
  9440. phi += dphi;
  9441. if (Math.abs(dphi) <= 0.0000000001) {
  9442. return phi;
  9443. }
  9444. }
  9445. //console.log("phi2z has NoConvergence");
  9446. return -9999;
  9447. };
  9448. function init() {
  9449. var con = this.b / this.a;
  9450. this.es = 1 - con * con;
  9451. if (!('x0' in this)) {
  9452. this.x0 = 0;
  9453. }
  9454. if (!('y0' in this)) {
  9455. this.y0 = 0;
  9456. }
  9457. this.e = Math.sqrt(this.es);
  9458. if (this.lat_ts) {
  9459. if (this.sphere) {
  9460. this.k0 = Math.cos(this.lat_ts);
  9461. } else {
  9462. this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
  9463. }
  9464. } else {
  9465. if (!this.k0) {
  9466. if (this.k) {
  9467. this.k0 = this.k;
  9468. } else {
  9469. this.k0 = 1;
  9470. }
  9471. }
  9472. }
  9473. }
  9474. /* Mercator forward equations--mapping lat,long to x,y
  9475. --------------------------------------------------*/
  9476. function forward(p) {
  9477. var lon = p.x;
  9478. var lat = p.y;
  9479. // convert to radians
  9480. if (lat * R2D > 90 && lat * R2D < -90 && lon * R2D > 180 && lon * R2D < -180) {
  9481. return null;
  9482. }
  9483. var x, y;
  9484. if (Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
  9485. return null;
  9486. } else {
  9487. if (this.sphere) {
  9488. x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
  9489. y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));
  9490. } else {
  9491. var sinphi = Math.sin(lat);
  9492. var ts = tsfnz(this.e, lat, sinphi);
  9493. x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
  9494. y = this.y0 - this.a * this.k0 * Math.log(ts);
  9495. }
  9496. p.x = x;
  9497. p.y = y;
  9498. return p;
  9499. }
  9500. }
  9501. /* Mercator inverse equations--mapping x,y to lat/long
  9502. --------------------------------------------------*/
  9503. function inverse(p) {
  9504. var x = p.x - this.x0;
  9505. var y = p.y - this.y0;
  9506. var lon, lat;
  9507. if (this.sphere) {
  9508. lat = HALF_PI - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));
  9509. } else {
  9510. var ts = Math.exp(-y / (this.a * this.k0));
  9511. lat = phi2z(this.e, ts);
  9512. if (lat === -9999) {
  9513. return null;
  9514. }
  9515. }
  9516. lon = adjust_lon(this.long0 + x / (this.a * this.k0));
  9517. p.x = lon;
  9518. p.y = lat;
  9519. return p;
  9520. }
  9521. var names$1 = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "merc"];
  9522. var merc = {
  9523. init: init,
  9524. forward: forward,
  9525. inverse: inverse,
  9526. names: names$1
  9527. };
  9528. function init$1() {
  9529. //no-op for longlat
  9530. }
  9531. function identity(pt) {
  9532. return pt;
  9533. }
  9534. var names$2 = ["longlat", "identity"];
  9535. var longlat = {
  9536. init: init$1,
  9537. forward: identity,
  9538. inverse: identity,
  9539. names: names$2
  9540. };
  9541. var projs = [merc, longlat];
  9542. var names = {};
  9543. var projStore = [];
  9544. function add(proj, i) {
  9545. var len = projStore.length;
  9546. if (!proj.names) {
  9547. console.log(i);
  9548. return true;
  9549. }
  9550. projStore[len] = proj;
  9551. proj.names.forEach(function (n) {
  9552. names[n.toLowerCase()] = len;
  9553. });
  9554. return this;
  9555. }
  9556. function get(name) {
  9557. if (!name) {
  9558. return false;
  9559. }
  9560. var n = name.toLowerCase();
  9561. if (typeof names[n] !== 'undefined' && projStore[names[n]]) {
  9562. return projStore[names[n]];
  9563. }
  9564. }
  9565. function start() {
  9566. projs.forEach(add);
  9567. }
  9568. var projections = {
  9569. start: start,
  9570. add: add,
  9571. get: get
  9572. };
  9573. var exports$2 = {};
  9574. exports$2.MERIT = {
  9575. a: 6378137.0,
  9576. rf: 298.257,
  9577. ellipseName: "MERIT 1983"
  9578. };
  9579. exports$2.SGS85 = {
  9580. a: 6378136.0,
  9581. rf: 298.257,
  9582. ellipseName: "Soviet Geodetic System 85"
  9583. };
  9584. exports$2.GRS80 = {
  9585. a: 6378137.0,
  9586. rf: 298.257222101,
  9587. ellipseName: "GRS 1980(IUGG, 1980)"
  9588. };
  9589. exports$2.IAU76 = {
  9590. a: 6378140.0,
  9591. rf: 298.257,
  9592. ellipseName: "IAU 1976"
  9593. };
  9594. exports$2.airy = {
  9595. a: 6377563.396,
  9596. b: 6356256.910,
  9597. ellipseName: "Airy 1830"
  9598. };
  9599. exports$2.APL4 = {
  9600. a: 6378137,
  9601. rf: 298.25,
  9602. ellipseName: "Appl. Physics. 1965"
  9603. };
  9604. exports$2.NWL9D = {
  9605. a: 6378145.0,
  9606. rf: 298.25,
  9607. ellipseName: "Naval Weapons Lab., 1965"
  9608. };
  9609. exports$2.mod_airy = {
  9610. a: 6377340.189,
  9611. b: 6356034.446,
  9612. ellipseName: "Modified Airy"
  9613. };
  9614. exports$2.andrae = {
  9615. a: 6377104.43,
  9616. rf: 300.0,
  9617. ellipseName: "Andrae 1876 (Den., Iclnd.)"
  9618. };
  9619. exports$2.aust_SA = {
  9620. a: 6378160.0,
  9621. rf: 298.25,
  9622. ellipseName: "Australian Natl & S. Amer. 1969"
  9623. };
  9624. exports$2.GRS67 = {
  9625. a: 6378160.0,
  9626. rf: 298.2471674270,
  9627. ellipseName: "GRS 67(IUGG 1967)"
  9628. };
  9629. exports$2.bessel = {
  9630. a: 6377397.155,
  9631. rf: 299.1528128,
  9632. ellipseName: "Bessel 1841"
  9633. };
  9634. exports$2.bess_nam = {
  9635. a: 6377483.865,
  9636. rf: 299.1528128,
  9637. ellipseName: "Bessel 1841 (Namibia)"
  9638. };
  9639. exports$2.clrk66 = {
  9640. a: 6378206.4,
  9641. b: 6356583.8,
  9642. ellipseName: "Clarke 1866"
  9643. };
  9644. exports$2.clrk80 = {
  9645. a: 6378249.145,
  9646. rf: 293.4663,
  9647. ellipseName: "Clarke 1880 mod."
  9648. };
  9649. exports$2.clrk80ign = {
  9650. a: 6378249.2,
  9651. b: 6356515,
  9652. rf: 293.4660213,
  9653. ellipseName: "Clarke 1880 (IGN)"
  9654. };
  9655. exports$2.clrk58 = {
  9656. a: 6378293.645208759,
  9657. rf: 294.2606763692654,
  9658. ellipseName: "Clarke 1858"
  9659. };
  9660. exports$2.CPM = {
  9661. a: 6375738.7,
  9662. rf: 334.29,
  9663. ellipseName: "Comm. des Poids et Mesures 1799"
  9664. };
  9665. exports$2.delmbr = {
  9666. a: 6376428.0,
  9667. rf: 311.5,
  9668. ellipseName: "Delambre 1810 (Belgium)"
  9669. };
  9670. exports$2.engelis = {
  9671. a: 6378136.05,
  9672. rf: 298.2566,
  9673. ellipseName: "Engelis 1985"
  9674. };
  9675. exports$2.evrst30 = {
  9676. a: 6377276.345,
  9677. rf: 300.8017,
  9678. ellipseName: "Everest 1830"
  9679. };
  9680. exports$2.evrst48 = {
  9681. a: 6377304.063,
  9682. rf: 300.8017,
  9683. ellipseName: "Everest 1948"
  9684. };
  9685. exports$2.evrst56 = {
  9686. a: 6377301.243,
  9687. rf: 300.8017,
  9688. ellipseName: "Everest 1956"
  9689. };
  9690. exports$2.evrst69 = {
  9691. a: 6377295.664,
  9692. rf: 300.8017,
  9693. ellipseName: "Everest 1969"
  9694. };
  9695. exports$2.evrstSS = {
  9696. a: 6377298.556,
  9697. rf: 300.8017,
  9698. ellipseName: "Everest (Sabah & Sarawak)"
  9699. };
  9700. exports$2.fschr60 = {
  9701. a: 6378166.0,
  9702. rf: 298.3,
  9703. ellipseName: "Fischer (Mercury Datum) 1960"
  9704. };
  9705. exports$2.fschr60m = {
  9706. a: 6378155.0,
  9707. rf: 298.3,
  9708. ellipseName: "Fischer 1960"
  9709. };
  9710. exports$2.fschr68 = {
  9711. a: 6378150.0,
  9712. rf: 298.3,
  9713. ellipseName: "Fischer 1968"
  9714. };
  9715. exports$2.helmert = {
  9716. a: 6378200.0,
  9717. rf: 298.3,
  9718. ellipseName: "Helmert 1906"
  9719. };
  9720. exports$2.hough = {
  9721. a: 6378270.0,
  9722. rf: 297.0,
  9723. ellipseName: "Hough"
  9724. };
  9725. exports$2.intl = {
  9726. a: 6378388.0,
  9727. rf: 297.0,
  9728. ellipseName: "International 1909 (Hayford)"
  9729. };
  9730. exports$2.kaula = {
  9731. a: 6378163.0,
  9732. rf: 298.24,
  9733. ellipseName: "Kaula 1961"
  9734. };
  9735. exports$2.lerch = {
  9736. a: 6378139.0,
  9737. rf: 298.257,
  9738. ellipseName: "Lerch 1979"
  9739. };
  9740. exports$2.mprts = {
  9741. a: 6397300.0,
  9742. rf: 191.0,
  9743. ellipseName: "Maupertius 1738"
  9744. };
  9745. exports$2.new_intl = {
  9746. a: 6378157.5,
  9747. b: 6356772.2,
  9748. ellipseName: "New International 1967"
  9749. };
  9750. exports$2.plessis = {
  9751. a: 6376523.0,
  9752. rf: 6355863.0,
  9753. ellipseName: "Plessis 1817 (France)"
  9754. };
  9755. exports$2.krass = {
  9756. a: 6378245.0,
  9757. rf: 298.3,
  9758. ellipseName: "Krassovsky, 1942"
  9759. };
  9760. exports$2.SEasia = {
  9761. a: 6378155.0,
  9762. b: 6356773.3205,
  9763. ellipseName: "Southeast Asia"
  9764. };
  9765. exports$2.walbeck = {
  9766. a: 6376896.0,
  9767. b: 6355834.8467,
  9768. ellipseName: "Walbeck"
  9769. };
  9770. exports$2.WGS60 = {
  9771. a: 6378165.0,
  9772. rf: 298.3,
  9773. ellipseName: "WGS 60"
  9774. };
  9775. exports$2.WGS66 = {
  9776. a: 6378145.0,
  9777. rf: 298.25,
  9778. ellipseName: "WGS 66"
  9779. };
  9780. exports$2.WGS7 = {
  9781. a: 6378135.0,
  9782. rf: 298.26,
  9783. ellipseName: "WGS 72"
  9784. };
  9785. var WGS84 = exports$2.WGS84 = {
  9786. a: 6378137.0,
  9787. rf: 298.257223563,
  9788. ellipseName: "WGS 84"
  9789. };
  9790. exports$2.sphere = {
  9791. a: 6370997.0,
  9792. b: 6370997.0,
  9793. ellipseName: "Normal Sphere (r=6370997)"
  9794. };
  9795. function eccentricity(a, b, rf, R_A) {
  9796. var a2 = a * a; // used in geocentric
  9797. var b2 = b * b; // used in geocentric
  9798. var es = (a2 - b2) / a2; // e ^ 2
  9799. var e = 0;
  9800. if (R_A) {
  9801. a *= 1 - es * (SIXTH + es * (RA4 + es * RA6));
  9802. a2 = a * a;
  9803. es = 0;
  9804. } else {
  9805. e = Math.sqrt(es); // eccentricity
  9806. }
  9807. var ep2 = (a2 - b2) / b2; // used in geocentric
  9808. return {
  9809. es: es,
  9810. e: e,
  9811. ep2: ep2
  9812. };
  9813. }
  9814. function sphere(a, b, rf, ellps, sphere) {
  9815. if (!a) {
  9816. // do we have an ellipsoid?
  9817. var ellipse = match(exports$2, ellps);
  9818. if (!ellipse) {
  9819. ellipse = WGS84;
  9820. }
  9821. a = ellipse.a;
  9822. b = ellipse.b;
  9823. rf = ellipse.rf;
  9824. }
  9825. if (rf && !b) {
  9826. b = (1.0 - 1.0 / rf) * a;
  9827. }
  9828. if (rf === 0 || Math.abs(a - b) < EPSLN) {
  9829. sphere = true;
  9830. b = a;
  9831. }
  9832. return {
  9833. a: a,
  9834. b: b,
  9835. rf: rf,
  9836. sphere: sphere
  9837. };
  9838. }
  9839. var exports$3 = {};
  9840. exports$3.wgs84 = {
  9841. towgs84: "0,0,0",
  9842. ellipse: "WGS84",
  9843. datumName: "WGS84"
  9844. };
  9845. exports$3.ch1903 = {
  9846. towgs84: "674.374,15.056,405.346",
  9847. ellipse: "bessel",
  9848. datumName: "swiss"
  9849. };
  9850. exports$3.ggrs87 = {
  9851. towgs84: "-199.87,74.79,246.62",
  9852. ellipse: "GRS80",
  9853. datumName: "Greek_Geodetic_Reference_System_1987"
  9854. };
  9855. exports$3.nad83 = {
  9856. towgs84: "0,0,0",
  9857. ellipse: "GRS80",
  9858. datumName: "North_American_Datum_1983"
  9859. };
  9860. exports$3.nad27 = {
  9861. nadgrids: "@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
  9862. ellipse: "clrk66",
  9863. datumName: "North_American_Datum_1927"
  9864. };
  9865. exports$3.potsdam = {
  9866. towgs84: "598.1,73.7,418.2,0.202,0.045,-2.455,6.7",
  9867. ellipse: "bessel",
  9868. datumName: "Potsdam Rauenberg 1950 DHDN"
  9869. };
  9870. exports$3.carthage = {
  9871. towgs84: "-263.0,6.0,431.0",
  9872. ellipse: "clark80",
  9873. datumName: "Carthage 1934 Tunisia"
  9874. };
  9875. exports$3.hermannskogel = {
  9876. towgs84: "577.326,90.129,463.919,5.137,1.474,5.297,2.4232",
  9877. ellipse: "bessel",
  9878. datumName: "Hermannskogel"
  9879. };
  9880. exports$3.osni52 = {
  9881. towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
  9882. ellipse: "airy",
  9883. datumName: "Irish National"
  9884. };
  9885. exports$3.ire65 = {
  9886. towgs84: "482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",
  9887. ellipse: "mod_airy",
  9888. datumName: "Ireland 1965"
  9889. };
  9890. exports$3.rassadiran = {
  9891. towgs84: "-133.63,-157.5,-158.62",
  9892. ellipse: "intl",
  9893. datumName: "Rassadiran"
  9894. };
  9895. exports$3.nzgd49 = {
  9896. towgs84: "59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",
  9897. ellipse: "intl",
  9898. datumName: "New Zealand Geodetic Datum 1949"
  9899. };
  9900. exports$3.osgb36 = {
  9901. towgs84: "446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",
  9902. ellipse: "airy",
  9903. datumName: "Airy 1830"
  9904. };
  9905. exports$3.s_jtsk = {
  9906. towgs84: "589,76,480",
  9907. ellipse: 'bessel',
  9908. datumName: 'S-JTSK (Ferro)'
  9909. };
  9910. exports$3.beduaram = {
  9911. towgs84: '-106,-87,188',
  9912. ellipse: 'clrk80',
  9913. datumName: 'Beduaram'
  9914. };
  9915. exports$3.gunung_segara = {
  9916. towgs84: '-403,684,41',
  9917. ellipse: 'bessel',
  9918. datumName: 'Gunung Segara Jakarta'
  9919. };
  9920. exports$3.rnb72 = {
  9921. towgs84: "106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",
  9922. ellipse: "intl",
  9923. datumName: "Reseau National Belge 1972"
  9924. };
  9925. function datum(datumCode, datum_params, a, b, es, ep2, nadgrids) {
  9926. var out = {};
  9927. if (datumCode === undefined || datumCode === 'none') {
  9928. out.datum_type = PJD_NODATUM;
  9929. } else {
  9930. out.datum_type = PJD_WGS84;
  9931. }
  9932. if (datum_params) {
  9933. out.datum_params = datum_params.map(parseFloat);
  9934. if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {
  9935. out.datum_type = PJD_3PARAM;
  9936. }
  9937. if (out.datum_params.length > 3) {
  9938. if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {
  9939. out.datum_type = PJD_7PARAM;
  9940. out.datum_params[3] *= SEC_TO_RAD;
  9941. out.datum_params[4] *= SEC_TO_RAD;
  9942. out.datum_params[5] *= SEC_TO_RAD;
  9943. out.datum_params[6] = out.datum_params[6] / 1000000.0 + 1.0;
  9944. }
  9945. }
  9946. }
  9947. if (nadgrids) {
  9948. out.datum_type = PJD_GRIDSHIFT;
  9949. out.grids = nadgrids;
  9950. }
  9951. out.a = a; //datum object also uses these values
  9952. out.b = b;
  9953. out.es = es;
  9954. out.ep2 = ep2;
  9955. return out;
  9956. }
  9957. /**
  9958. * Resources for details of NTv2 file formats:
  9959. * - https://web.archive.org/web/20140127204822if_/http://www.mgs.gov.on.ca:80/stdprodconsume/groups/content/@mgs/@iandit/documents/resourcelist/stel02_047447.pdf
  9960. * - http://mimaka.com/help/gs/html/004_NTV2%20Data%20Format.htm
  9961. */
  9962. var loadedNadgrids = {};
  9963. /**
  9964. * Load a binary NTv2 file (.gsb) to a key that can be used in a proj string like +nadgrids=<key>. Pass the NTv2 file
  9965. * as an ArrayBuffer.
  9966. */
  9967. function nadgrid(key, data) {
  9968. var view = new DataView(data);
  9969. var isLittleEndian = detectLittleEndian(view);
  9970. var header = readHeader(view, isLittleEndian);
  9971. if (header.nSubgrids > 1) {
  9972. console.log('Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored');
  9973. }
  9974. var subgrids = readSubgrids(view, header, isLittleEndian);
  9975. var nadgrid = {
  9976. header: header,
  9977. subgrids: subgrids
  9978. };
  9979. loadedNadgrids[key] = nadgrid;
  9980. return nadgrid;
  9981. }
  9982. /**
  9983. * Given a proj4 value for nadgrids, return an array of loaded grids
  9984. */
  9985. function getNadgrids(nadgrids) {
  9986. // Format details: http://proj.maptools.org/gen_parms.html
  9987. if (nadgrids === undefined) {
  9988. return null;
  9989. }
  9990. var grids = nadgrids.split(',');
  9991. return grids.map(parseNadgridString);
  9992. }
  9993. function parseNadgridString(value) {
  9994. if (value.length === 0) {
  9995. return null;
  9996. }
  9997. var optional = value[0] === '@';
  9998. if (optional) {
  9999. value = value.slice(1);
  10000. }
  10001. if (value === 'null') {
  10002. return {
  10003. name: 'null',
  10004. mandatory: !optional,
  10005. grid: null,
  10006. isNull: true
  10007. };
  10008. }
  10009. return {
  10010. name: value,
  10011. mandatory: !optional,
  10012. grid: loadedNadgrids[value] || null,
  10013. isNull: false
  10014. };
  10015. }
  10016. function secondsToRadians(seconds) {
  10017. return seconds / 3600 * Math.PI / 180;
  10018. }
  10019. function detectLittleEndian(view) {
  10020. var nFields = view.getInt32(8, false);
  10021. if (nFields === 11) {
  10022. return false;
  10023. }
  10024. nFields = view.getInt32(8, true);
  10025. if (nFields !== 11) {
  10026. console.warn('Failed to detect nadgrid endian-ness, defaulting to little-endian');
  10027. }
  10028. return true;
  10029. }
  10030. function readHeader(view, isLittleEndian) {
  10031. return {
  10032. nFields: view.getInt32(8, isLittleEndian),
  10033. nSubgridFields: view.getInt32(24, isLittleEndian),
  10034. nSubgrids: view.getInt32(40, isLittleEndian),
  10035. shiftType: decodeString(view, 56, 56 + 8).trim(),
  10036. fromSemiMajorAxis: view.getFloat64(120, isLittleEndian),
  10037. fromSemiMinorAxis: view.getFloat64(136, isLittleEndian),
  10038. toSemiMajorAxis: view.getFloat64(152, isLittleEndian),
  10039. toSemiMinorAxis: view.getFloat64(168, isLittleEndian)
  10040. };
  10041. }
  10042. function decodeString(view, start, end) {
  10043. return String.fromCharCode.apply(null, new Uint8Array(view.buffer.slice(start, end)));
  10044. }
  10045. function readSubgrids(view, header, isLittleEndian) {
  10046. var gridOffset = 176;
  10047. var grids = [];
  10048. for (var i = 0; i < header.nSubgrids; i++) {
  10049. var subHeader = readGridHeader(view, gridOffset, isLittleEndian);
  10050. var nodes = readGridNodes(view, gridOffset, subHeader, isLittleEndian);
  10051. var lngColumnCount = Math.round(1 + (subHeader.upperLongitude - subHeader.lowerLongitude) / subHeader.longitudeInterval);
  10052. var latColumnCount = Math.round(1 + (subHeader.upperLatitude - subHeader.lowerLatitude) / subHeader.latitudeInterval);
  10053. // Proj4 operates on radians whereas the coordinates are in seconds in the grid
  10054. grids.push({
  10055. ll: [secondsToRadians(subHeader.lowerLongitude), secondsToRadians(subHeader.lowerLatitude)],
  10056. del: [secondsToRadians(subHeader.longitudeInterval), secondsToRadians(subHeader.latitudeInterval)],
  10057. lim: [lngColumnCount, latColumnCount],
  10058. count: subHeader.gridNodeCount,
  10059. cvs: mapNodes(nodes)
  10060. });
  10061. }
  10062. return grids;
  10063. }
  10064. function mapNodes(nodes) {
  10065. return nodes.map(function (r) {
  10066. return [secondsToRadians(r.longitudeShift), secondsToRadians(r.latitudeShift)];
  10067. });
  10068. }
  10069. function readGridHeader(view, offset, isLittleEndian) {
  10070. return {
  10071. name: decodeString(view, offset + 8, offset + 16).trim(),
  10072. parent: decodeString(view, offset + 24, offset + 24 + 8).trim(),
  10073. lowerLatitude: view.getFloat64(offset + 72, isLittleEndian),
  10074. upperLatitude: view.getFloat64(offset + 88, isLittleEndian),
  10075. lowerLongitude: view.getFloat64(offset + 104, isLittleEndian),
  10076. upperLongitude: view.getFloat64(offset + 120, isLittleEndian),
  10077. latitudeInterval: view.getFloat64(offset + 136, isLittleEndian),
  10078. longitudeInterval: view.getFloat64(offset + 152, isLittleEndian),
  10079. gridNodeCount: view.getInt32(offset + 168, isLittleEndian)
  10080. };
  10081. }
  10082. function readGridNodes(view, offset, gridHeader, isLittleEndian) {
  10083. var nodesOffset = offset + 176;
  10084. var gridRecordLength = 16;
  10085. var gridShiftRecords = [];
  10086. for (var i = 0; i < gridHeader.gridNodeCount; i++) {
  10087. var record = {
  10088. latitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength, isLittleEndian),
  10089. longitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength + 4, isLittleEndian),
  10090. latitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 8, isLittleEndian),
  10091. longitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 12, isLittleEndian)
  10092. };
  10093. gridShiftRecords.push(record);
  10094. }
  10095. return gridShiftRecords;
  10096. }
  10097. function Projection(srsCode, callback) {
  10098. if (!(this instanceof Projection)) {
  10099. return new Projection(srsCode);
  10100. }
  10101. callback = callback || function (error) {
  10102. if (error) {
  10103. throw error;
  10104. }
  10105. };
  10106. var json = parse(srsCode);
  10107. if (_typeof(json) !== 'object') {
  10108. callback(srsCode);
  10109. return;
  10110. }
  10111. var ourProj = Projection.projections.get(json.projName);
  10112. if (!ourProj) {
  10113. callback(srsCode);
  10114. return;
  10115. }
  10116. if (json.datumCode && json.datumCode !== 'none') {
  10117. var datumDef = match(exports$3, json.datumCode);
  10118. if (datumDef) {
  10119. json.datum_params = json.datum_params || (datumDef.towgs84 ? datumDef.towgs84.split(',') : null);
  10120. json.ellps = datumDef.ellipse;
  10121. json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;
  10122. }
  10123. }
  10124. json.k0 = json.k0 || 1.0;
  10125. json.axis = json.axis || 'enu';
  10126. json.ellps = json.ellps || 'wgs84';
  10127. json.lat1 = json.lat1 || json.lat0; // Lambert_Conformal_Conic_1SP, for example, needs this
  10128. var sphere_ = sphere(json.a, json.b, json.rf, json.ellps, json.sphere);
  10129. var ecc = eccentricity(sphere_.a, sphere_.b, sphere_.rf, json.R_A);
  10130. var nadgrids = getNadgrids(json.nadgrids);
  10131. var datumObj = json.datum || datum(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2, nadgrids);
  10132. extend(this, json); // transfer everything over from the projection because we don't know what we'll need
  10133. extend(this, ourProj); // transfer all the methods from the projection
  10134. // copy the 4 things over we calculated in deriveConstants.sphere
  10135. this.a = sphere_.a;
  10136. this.b = sphere_.b;
  10137. this.rf = sphere_.rf;
  10138. this.sphere = sphere_.sphere;
  10139. // copy the 3 things we calculated in deriveConstants.eccentricity
  10140. this.es = ecc.es;
  10141. this.e = ecc.e;
  10142. this.ep2 = ecc.ep2;
  10143. // add in the datum object
  10144. this.datum = datumObj;
  10145. // init the projection
  10146. this.init();
  10147. // legecy callback from back in the day when it went to spatialreference.org
  10148. callback(null, this);
  10149. }
  10150. Projection.projections = projections;
  10151. Projection.projections.start();
  10152. 'use strict';
  10153. function compareDatums(source, dest) {
  10154. if (source.datum_type !== dest.datum_type) {
  10155. return false; // false, datums are not equal
  10156. } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {
  10157. // the tolerance for es is to ensure that GRS80 and WGS84
  10158. // are considered identical
  10159. return false;
  10160. } else if (source.datum_type === PJD_3PARAM) {
  10161. return source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2];
  10162. } else if (source.datum_type === PJD_7PARAM) {
  10163. return source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6];
  10164. } else {
  10165. return true; // datums are equal
  10166. }
  10167. } // cs_compare_datums()
  10168. /*
  10169. * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates
  10170. * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),
  10171. * according to the current ellipsoid parameters.
  10172. *
  10173. * Latitude : Geodetic latitude in radians (input)
  10174. * Longitude : Geodetic longitude in radians (input)
  10175. * Height : Geodetic height, in meters (input)
  10176. * X : Calculated Geocentric X coordinate, in meters (output)
  10177. * Y : Calculated Geocentric Y coordinate, in meters (output)
  10178. * Z : Calculated Geocentric Z coordinate, in meters (output)
  10179. *
  10180. */
  10181. function geodeticToGeocentric(p, es, a) {
  10182. var Longitude = p.x;
  10183. var Latitude = p.y;
  10184. var Height = p.z ? p.z : 0; //Z value not always supplied
  10185. var Rn; /* Earth radius at location */
  10186. var Sin_Lat; /* Math.sin(Latitude) */
  10187. var Sin2_Lat; /* Square of Math.sin(Latitude) */
  10188. var Cos_Lat; /* Math.cos(Latitude) */
  10189. /*
  10190. ** Don't blow up if Latitude is just a little out of the value
  10191. ** range as it may just be a rounding issue. Also removed longitude
  10192. ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.
  10193. */
  10194. if (Latitude < -HALF_PI && Latitude > -1.001 * HALF_PI) {
  10195. Latitude = -HALF_PI;
  10196. } else if (Latitude > HALF_PI && Latitude < 1.001 * HALF_PI) {
  10197. Latitude = HALF_PI;
  10198. } else if (Latitude < -HALF_PI) {
  10199. /* Latitude out of range */
  10200. //..reportError('geocent:lat out of range:' + Latitude);
  10201. return {
  10202. x: -Infinity,
  10203. y: -Infinity,
  10204. z: p.z
  10205. };
  10206. } else if (Latitude > HALF_PI) {
  10207. /* Latitude out of range */
  10208. return {
  10209. x: Infinity,
  10210. y: Infinity,
  10211. z: p.z
  10212. };
  10213. }
  10214. if (Longitude > Math.PI) {
  10215. Longitude -= 2 * Math.PI;
  10216. }
  10217. Sin_Lat = Math.sin(Latitude);
  10218. Cos_Lat = Math.cos(Latitude);
  10219. Sin2_Lat = Sin_Lat * Sin_Lat;
  10220. Rn = a / Math.sqrt(1.0e0 - es * Sin2_Lat);
  10221. return {
  10222. x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),
  10223. y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),
  10224. z: (Rn * (1 - es) + Height) * Sin_Lat
  10225. };
  10226. } // cs_geodetic_to_geocentric()
  10227. function geocentricToGeodetic(p, es, a, b) {
  10228. /* local defintions and variables */
  10229. /* end-criterium of loop, accuracy of sin(Latitude) */
  10230. var genau = 1e-12;
  10231. var genau2 = genau * genau;
  10232. var maxiter = 30;
  10233. var P; /* distance between semi-minor axis and location */
  10234. var RR; /* distance between center and location */
  10235. var CT; /* sin of geocentric latitude */
  10236. var ST; /* cos of geocentric latitude */
  10237. var RX;
  10238. var RK;
  10239. var RN; /* Earth radius at location */
  10240. var CPHI0; /* cos of start or old geodetic latitude in iterations */
  10241. var SPHI0; /* sin of start or old geodetic latitude in iterations */
  10242. var CPHI; /* cos of searched geodetic latitude */
  10243. var SPHI; /* sin of searched geodetic latitude */
  10244. var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */
  10245. var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */
  10246. var X = p.x;
  10247. var Y = p.y;
  10248. var Z = p.z ? p.z : 0.0; //Z value not always supplied
  10249. var Longitude;
  10250. var Latitude;
  10251. var Height;
  10252. P = Math.sqrt(X * X + Y * Y);
  10253. RR = Math.sqrt(X * X + Y * Y + Z * Z);
  10254. /* special cases for latitude and longitude */
  10255. if (P / a < genau) {
  10256. /* special case, if P=0. (X=0., Y=0.) */
  10257. Longitude = 0.0;
  10258. /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis
  10259. * of ellipsoid (=center of mass), Latitude becomes PI/2 */
  10260. if (RR / a < genau) {
  10261. Latitude = HALF_PI;
  10262. Height = -b;
  10263. return {
  10264. x: p.x,
  10265. y: p.y,
  10266. z: p.z
  10267. };
  10268. }
  10269. } else {
  10270. /* ellipsoidal (geodetic) longitude
  10271. * interval: -PI < Longitude <= +PI */
  10272. Longitude = Math.atan2(Y, X);
  10273. }
  10274. /* --------------------------------------------------------------
  10275. * Following iterative algorithm was developped by
  10276. * "Institut for Erdmessung", University of Hannover, July 1988.
  10277. * Internet: www.ife.uni-hannover.de
  10278. * Iterative computation of CPHI,SPHI and Height.
  10279. * Iteration of CPHI and SPHI to 10**-12 radian resp.
  10280. * 2*10**-7 arcsec.
  10281. * --------------------------------------------------------------
  10282. */
  10283. CT = Z / RR;
  10284. ST = P / RR;
  10285. RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);
  10286. CPHI0 = ST * (1.0 - es) * RX;
  10287. SPHI0 = CT * RX;
  10288. iter = 0;
  10289. /* loop to find sin(Latitude) resp. Latitude
  10290. * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */
  10291. do {
  10292. iter++;
  10293. RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);
  10294. /* ellipsoidal (geodetic) height */
  10295. Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);
  10296. RK = es * RN / (RN + Height);
  10297. RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);
  10298. CPHI = ST * (1.0 - RK) * RX;
  10299. SPHI = CT * RX;
  10300. SDPHI = SPHI * CPHI0 - CPHI * SPHI0;
  10301. CPHI0 = CPHI;
  10302. SPHI0 = SPHI;
  10303. } while (SDPHI * SDPHI > genau2 && iter < maxiter);
  10304. /* ellipsoidal (geodetic) latitude */
  10305. Latitude = Math.atan(SPHI / Math.abs(CPHI));
  10306. return {
  10307. x: Longitude,
  10308. y: Latitude,
  10309. z: Height
  10310. };
  10311. } // cs_geocentric_to_geodetic()
  10312. /****************************************************************/
  10313. // pj_geocentic_to_wgs84( p )
  10314. // p = point to transform in geocentric coordinates (x,y,z)
  10315. /** point object, nothing fancy, just allows values to be
  10316. passed back and forth by reference rather than by value.
  10317. Other point classes may be used as long as they have
  10318. x and y properties, which will get modified in the transform method.
  10319. */
  10320. function geocentricToWgs84(p, datum_type, datum_params) {
  10321. if (datum_type === PJD_3PARAM) {
  10322. // if( x[io] === HUGE_VAL )
  10323. // continue;
  10324. return {
  10325. x: p.x + datum_params[0],
  10326. y: p.y + datum_params[1],
  10327. z: p.z + datum_params[2]
  10328. };
  10329. } else if (datum_type === PJD_7PARAM) {
  10330. var Dx_BF = datum_params[0];
  10331. var Dy_BF = datum_params[1];
  10332. var Dz_BF = datum_params[2];
  10333. var Rx_BF = datum_params[3];
  10334. var Ry_BF = datum_params[4];
  10335. var Rz_BF = datum_params[5];
  10336. var M_BF = datum_params[6];
  10337. // if( x[io] === HUGE_VAL )
  10338. // continue;
  10339. return {
  10340. x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,
  10341. y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,
  10342. z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF
  10343. };
  10344. }
  10345. } // cs_geocentric_to_wgs84
  10346. /****************************************************************/
  10347. // pj_geocentic_from_wgs84()
  10348. // coordinate system definition,
  10349. // point to transform in geocentric coordinates (x,y,z)
  10350. function geocentricFromWgs84(p, datum_type, datum_params) {
  10351. if (datum_type === PJD_3PARAM) {
  10352. //if( x[io] === HUGE_VAL )
  10353. // continue;
  10354. return {
  10355. x: p.x - datum_params[0],
  10356. y: p.y - datum_params[1],
  10357. z: p.z - datum_params[2]
  10358. };
  10359. } else if (datum_type === PJD_7PARAM) {
  10360. var Dx_BF = datum_params[0];
  10361. var Dy_BF = datum_params[1];
  10362. var Dz_BF = datum_params[2];
  10363. var Rx_BF = datum_params[3];
  10364. var Ry_BF = datum_params[4];
  10365. var Rz_BF = datum_params[5];
  10366. var M_BF = datum_params[6];
  10367. var x_tmp = (p.x - Dx_BF) / M_BF;
  10368. var y_tmp = (p.y - Dy_BF) / M_BF;
  10369. var z_tmp = (p.z - Dz_BF) / M_BF;
  10370. //if( x[io] === HUGE_VAL )
  10371. // continue;
  10372. return {
  10373. x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,
  10374. y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,
  10375. z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp
  10376. };
  10377. } //cs_geocentric_from_wgs84()
  10378. }
  10379. function checkParams(type) {
  10380. return type === PJD_3PARAM || type === PJD_7PARAM;
  10381. }
  10382. var datum_transform = function datum_transform(source, dest, point) {
  10383. // Short cut if the datums are identical.
  10384. if (compareDatums(source, dest)) {
  10385. return point; // in this case, zero is sucess,
  10386. // whereas cs_compare_datums returns 1 to indicate TRUE
  10387. // confusing, should fix this
  10388. }
  10389. // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest
  10390. if (source.datum_type === PJD_NODATUM || dest.datum_type === PJD_NODATUM) {
  10391. return point;
  10392. }
  10393. // If this datum requires grid shifts, then apply it to geodetic coordinates.
  10394. var source_a = source.a;
  10395. var source_es = source.es;
  10396. if (source.datum_type === PJD_GRIDSHIFT) {
  10397. var gridShiftCode = applyGridShift(source, false, point);
  10398. if (gridShiftCode !== 0) {
  10399. return undefined;
  10400. }
  10401. source_a = SRS_WGS84_SEMIMAJOR;
  10402. source_es = SRS_WGS84_ESQUARED;
  10403. }
  10404. var dest_a = dest.a;
  10405. var dest_b = dest.b;
  10406. var dest_es = dest.es;
  10407. if (dest.datum_type === PJD_GRIDSHIFT) {
  10408. dest_a = SRS_WGS84_SEMIMAJOR;
  10409. dest_b = SRS_WGS84_SEMIMINOR;
  10410. dest_es = SRS_WGS84_ESQUARED;
  10411. }
  10412. // Do we need to go through geocentric coordinates?
  10413. if (source_es === dest_es && source_a === dest_a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {
  10414. return point;
  10415. }
  10416. // Convert to geocentric coordinates.
  10417. point = geodeticToGeocentric(point, source_es, source_a);
  10418. // Convert between datums
  10419. if (checkParams(source.datum_type)) {
  10420. point = geocentricToWgs84(point, source.datum_type, source.datum_params);
  10421. }
  10422. if (checkParams(dest.datum_type)) {
  10423. point = geocentricFromWgs84(point, dest.datum_type, dest.datum_params);
  10424. }
  10425. point = geocentricToGeodetic(point, dest_es, dest_a, dest_b);
  10426. if (dest.datum_type === PJD_GRIDSHIFT) {
  10427. var destGridShiftResult = applyGridShift(dest, true, point);
  10428. if (destGridShiftResult !== 0) {
  10429. return undefined;
  10430. }
  10431. }
  10432. return point;
  10433. };
  10434. function applyGridShift(source, inverse, point) {
  10435. if (source.grids === null || source.grids.length === 0) {
  10436. console.log('Grid shift grids not found');
  10437. return -1;
  10438. }
  10439. var input = {
  10440. x: -point.x,
  10441. y: point.y
  10442. };
  10443. var output = {
  10444. x: Number.NaN,
  10445. y: Number.NaN
  10446. };
  10447. var attemptedGrids = [];
  10448. for (var i = 0; i < source.grids.length; i++) {
  10449. var grid = source.grids[i];
  10450. attemptedGrids.push(grid.name);
  10451. if (grid.isNull) {
  10452. output = input;
  10453. break;
  10454. }
  10455. if (grid.grid === null) {
  10456. if (grid.mandatory) {
  10457. console.log("Unable to find mandatory grid '" + grid.name + "'");
  10458. return -1;
  10459. }
  10460. continue;
  10461. }
  10462. var subgrid = grid.grid.subgrids[0];
  10463. // skip tables that don't match our point at all
  10464. var epsilon = (Math.abs(subgrid.del[1]) + Math.abs(subgrid.del[0])) / 10000.0;
  10465. var minX = subgrid.ll[0] - epsilon;
  10466. var minY = subgrid.ll[1] - epsilon;
  10467. var maxX = subgrid.ll[0] + (subgrid.lim[0] - 1) * subgrid.del[0] + epsilon;
  10468. var maxY = subgrid.ll[1] + (subgrid.lim[1] - 1) * subgrid.del[1] + epsilon;
  10469. if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x) {
  10470. continue;
  10471. }
  10472. output = applySubgridShift(input, inverse, subgrid);
  10473. if (!isNaN(output.x)) {
  10474. break;
  10475. }
  10476. }
  10477. if (isNaN(output.x)) {
  10478. console.log("Failed to find a grid shift table for location '" + -input.x * R2D + " " + input.y * R2D + " tried: '" + attemptedGrids + "'");
  10479. return -1;
  10480. }
  10481. point.x = -output.x;
  10482. point.y = output.y;
  10483. return 0;
  10484. }
  10485. function applySubgridShift(pin, inverse, ct) {
  10486. var val = {
  10487. x: Number.NaN,
  10488. y: Number.NaN
  10489. };
  10490. if (isNaN(pin.x)) {
  10491. return val;
  10492. }
  10493. var tb = {
  10494. x: pin.x,
  10495. y: pin.y
  10496. };
  10497. tb.x -= ct.ll[0];
  10498. tb.y -= ct.ll[1];
  10499. tb.x = adjust_lon(tb.x - Math.PI) + Math.PI;
  10500. var t = nadInterpolate(tb, ct);
  10501. if (inverse) {
  10502. if (isNaN(t.x)) {
  10503. return val;
  10504. }
  10505. t.x = tb.x - t.x;
  10506. t.y = tb.y - t.y;
  10507. var i = 9,
  10508. tol = 1e-12;
  10509. var dif, del;
  10510. do {
  10511. del = nadInterpolate(t, ct);
  10512. if (isNaN(del.x)) {
  10513. console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");
  10514. break;
  10515. }
  10516. dif = {
  10517. x: tb.x - (del.x + t.x),
  10518. y: tb.y - (del.y + t.y)
  10519. };
  10520. t.x += dif.x;
  10521. t.y += dif.y;
  10522. } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol);
  10523. if (i < 0) {
  10524. console.log("Inverse grid shift iterator failed to converge.");
  10525. return val;
  10526. }
  10527. val.x = adjust_lon(t.x + ct.ll[0]);
  10528. val.y = t.y + ct.ll[1];
  10529. } else {
  10530. if (!isNaN(t.x)) {
  10531. val.x = pin.x + t.x;
  10532. val.y = pin.y + t.y;
  10533. }
  10534. }
  10535. return val;
  10536. }
  10537. function nadInterpolate(pin, ct) {
  10538. var t = {
  10539. x: pin.x / ct.del[0],
  10540. y: pin.y / ct.del[1]
  10541. };
  10542. var indx = {
  10543. x: Math.floor(t.x),
  10544. y: Math.floor(t.y)
  10545. };
  10546. var frct = {
  10547. x: t.x - 1.0 * indx.x,
  10548. y: t.y - 1.0 * indx.y
  10549. };
  10550. var val = {
  10551. x: Number.NaN,
  10552. y: Number.NaN
  10553. };
  10554. var inx;
  10555. if (indx.x < 0 || indx.x >= ct.lim[0]) {
  10556. return val;
  10557. }
  10558. if (indx.y < 0 || indx.y >= ct.lim[1]) {
  10559. return val;
  10560. }
  10561. inx = indx.y * ct.lim[0] + indx.x;
  10562. var f00 = {
  10563. x: ct.cvs[inx][0],
  10564. y: ct.cvs[inx][1]
  10565. };
  10566. inx++;
  10567. var f10 = {
  10568. x: ct.cvs[inx][0],
  10569. y: ct.cvs[inx][1]
  10570. };
  10571. inx += ct.lim[0];
  10572. var f11 = {
  10573. x: ct.cvs[inx][0],
  10574. y: ct.cvs[inx][1]
  10575. };
  10576. inx--;
  10577. var f01 = {
  10578. x: ct.cvs[inx][0],
  10579. y: ct.cvs[inx][1]
  10580. };
  10581. var m11 = frct.x * frct.y,
  10582. m10 = frct.x * (1.0 - frct.y),
  10583. m00 = (1.0 - frct.x) * (1.0 - frct.y),
  10584. m01 = (1.0 - frct.x) * frct.y;
  10585. val.x = m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x;
  10586. val.y = m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y;
  10587. return val;
  10588. }
  10589. var adjust_axis = function adjust_axis(crs, denorm, point) {
  10590. var xin = point.x,
  10591. yin = point.y,
  10592. zin = point.z || 0.0;
  10593. var v, t, i;
  10594. var out = {};
  10595. for (i = 0; i < 3; i++) {
  10596. if (denorm && i === 2 && point.z === undefined) {
  10597. continue;
  10598. }
  10599. if (i === 0) {
  10600. v = xin;
  10601. if ("ew".indexOf(crs.axis[i]) !== -1) {
  10602. t = 'x';
  10603. } else {
  10604. t = 'y';
  10605. }
  10606. } else if (i === 1) {
  10607. v = yin;
  10608. if ("ns".indexOf(crs.axis[i]) !== -1) {
  10609. t = 'y';
  10610. } else {
  10611. t = 'x';
  10612. }
  10613. } else {
  10614. v = zin;
  10615. t = 'z';
  10616. }
  10617. switch (crs.axis[i]) {
  10618. case 'e':
  10619. out[t] = v;
  10620. break;
  10621. case 'w':
  10622. out[t] = -v;
  10623. break;
  10624. case 'n':
  10625. out[t] = v;
  10626. break;
  10627. case 's':
  10628. out[t] = -v;
  10629. break;
  10630. case 'u':
  10631. if (point[t] !== undefined) {
  10632. out.z = v;
  10633. }
  10634. break;
  10635. case 'd':
  10636. if (point[t] !== undefined) {
  10637. out.z = -v;
  10638. }
  10639. break;
  10640. default:
  10641. //console.log("ERROR: unknow axis ("+crs.axis[i]+") - check definition of "+crs.projName);
  10642. return null;
  10643. }
  10644. }
  10645. return out;
  10646. };
  10647. var toPoint = function toPoint(array) {
  10648. var out = {
  10649. x: array[0],
  10650. y: array[1]
  10651. };
  10652. if (array.length > 2) {
  10653. out.z = array[2];
  10654. }
  10655. if (array.length > 3) {
  10656. out.m = array[3];
  10657. }
  10658. return out;
  10659. };
  10660. var checkSanity = function checkSanity(point) {
  10661. checkCoord(point.x);
  10662. checkCoord(point.y);
  10663. };
  10664. function checkCoord(num) {
  10665. if (typeof Number.isFinite === 'function') {
  10666. if (Number.isFinite(num)) {
  10667. return;
  10668. }
  10669. throw new TypeError('coordinates must be finite numbers');
  10670. }
  10671. if (typeof num !== 'number' || num !== num || !isFinite(num)) {
  10672. throw new TypeError('coordinates must be finite numbers');
  10673. }
  10674. }
  10675. function checkNotWGS(source, dest) {
  10676. return (source.datum.datum_type === PJD_3PARAM || source.datum.datum_type === PJD_7PARAM || source.datum.datum_type === PJD_GRIDSHIFT) && dest.datumCode !== 'WGS84' || (dest.datum.datum_type === PJD_3PARAM || dest.datum.datum_type === PJD_7PARAM || dest.datum.datum_type === PJD_GRIDSHIFT) && source.datumCode !== 'WGS84';
  10677. }
  10678. function transform(source, dest, point, enforceAxis) {
  10679. var wgs84;
  10680. if (Array.isArray(point)) {
  10681. point = toPoint(point);
  10682. } else {
  10683. // Clone the point object so inputs don't get modified
  10684. point = {
  10685. x: point.x,
  10686. y: point.y,
  10687. z: point.z,
  10688. m: point.m
  10689. };
  10690. }
  10691. var hasZ = point.z !== undefined;
  10692. checkSanity(point);
  10693. // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84
  10694. if (source.datum && dest.datum && checkNotWGS(source, dest)) {
  10695. wgs84 = new Projection('WGS84');
  10696. point = transform(source, wgs84, point, enforceAxis);
  10697. source = wgs84;
  10698. }
  10699. // DGR, 2010/11/12
  10700. if (enforceAxis && source.axis !== 'enu') {
  10701. point = adjust_axis(source, false, point);
  10702. }
  10703. // Transform source points to long/lat, if they aren't already.
  10704. if (source.projName === 'longlat') {
  10705. point = {
  10706. x: point.x * D2R,
  10707. y: point.y * D2R,
  10708. z: point.z || 0
  10709. };
  10710. } else {
  10711. if (source.to_meter) {
  10712. point = {
  10713. x: point.x * source.to_meter,
  10714. y: point.y * source.to_meter,
  10715. z: point.z || 0
  10716. };
  10717. }
  10718. point = source.inverse(point); // Convert Cartesian to longlat
  10719. if (!point) {
  10720. return;
  10721. }
  10722. }
  10723. // Adjust for the prime meridian if necessary
  10724. if (source.from_greenwich) {
  10725. point.x += source.from_greenwich;
  10726. }
  10727. // Convert datums if needed, and if possible.
  10728. point = datum_transform(source.datum, dest.datum, point);
  10729. if (!point) {
  10730. return;
  10731. }
  10732. // Adjust for the prime meridian if necessary
  10733. if (dest.from_greenwich) {
  10734. point = {
  10735. x: point.x - dest.from_greenwich,
  10736. y: point.y,
  10737. z: point.z || 0
  10738. };
  10739. }
  10740. if (dest.projName === 'longlat') {
  10741. // convert radians to decimal degrees
  10742. point = {
  10743. x: point.x * R2D,
  10744. y: point.y * R2D,
  10745. z: point.z || 0
  10746. };
  10747. } else {
  10748. // else project
  10749. point = dest.forward(point);
  10750. if (dest.to_meter) {
  10751. point = {
  10752. x: point.x / dest.to_meter,
  10753. y: point.y / dest.to_meter,
  10754. z: point.z || 0
  10755. };
  10756. }
  10757. }
  10758. // DGR, 2010/11/12
  10759. if (enforceAxis && dest.axis !== 'enu') {
  10760. return adjust_axis(dest, true, point);
  10761. }
  10762. if (!hasZ) {
  10763. delete point.z;
  10764. }
  10765. return point;
  10766. }
  10767. var wgs84 = Projection('WGS84');
  10768. function transformer(from, to, coords, enforceAxis) {
  10769. var transformedArray, out, keys;
  10770. if (Array.isArray(coords)) {
  10771. transformedArray = transform(from, to, coords, enforceAxis) || {
  10772. x: NaN,
  10773. y: NaN
  10774. };
  10775. if (coords.length > 2) {
  10776. if (typeof from.name !== 'undefined' && from.name === 'geocent' || typeof to.name !== 'undefined' && to.name === 'geocent') {
  10777. if (typeof transformedArray.z === 'number') {
  10778. return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));
  10779. } else {
  10780. return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));
  10781. }
  10782. } else {
  10783. return [transformedArray.x, transformedArray.y].concat(coords.splice(2));
  10784. }
  10785. } else {
  10786. return [transformedArray.x, transformedArray.y];
  10787. }
  10788. } else {
  10789. out = transform(from, to, coords, enforceAxis);
  10790. keys = Object.keys(coords);
  10791. if (keys.length === 2) {
  10792. return out;
  10793. }
  10794. keys.forEach(function (key) {
  10795. if (typeof from.name !== 'undefined' && from.name === 'geocent' || typeof to.name !== 'undefined' && to.name === 'geocent') {
  10796. if (key === 'x' || key === 'y' || key === 'z') {
  10797. return;
  10798. }
  10799. } else {
  10800. if (key === 'x' || key === 'y') {
  10801. return;
  10802. }
  10803. }
  10804. out[key] = coords[key];
  10805. });
  10806. return out;
  10807. }
  10808. }
  10809. function checkProj(item) {
  10810. if (item instanceof Projection) {
  10811. return item;
  10812. }
  10813. if (item.oProj) {
  10814. return item.oProj;
  10815. }
  10816. return Projection(item);
  10817. }
  10818. function proj4$1(fromProj, toProj, coord) {
  10819. fromProj = checkProj(fromProj);
  10820. var single = false;
  10821. var obj;
  10822. if (typeof toProj === 'undefined') {
  10823. toProj = fromProj;
  10824. fromProj = wgs84;
  10825. single = true;
  10826. } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {
  10827. coord = toProj;
  10828. toProj = fromProj;
  10829. fromProj = wgs84;
  10830. single = true;
  10831. }
  10832. toProj = checkProj(toProj);
  10833. if (coord) {
  10834. return transformer(fromProj, toProj, coord);
  10835. } else {
  10836. obj = {
  10837. forward: function forward(coords, enforceAxis) {
  10838. return transformer(fromProj, toProj, coords, enforceAxis);
  10839. },
  10840. inverse: function inverse(coords, enforceAxis) {
  10841. return transformer(toProj, fromProj, coords, enforceAxis);
  10842. }
  10843. };
  10844. if (single) {
  10845. obj.oProj = toProj;
  10846. }
  10847. return obj;
  10848. }
  10849. }
  10850. /**
  10851. * UTM zones are grouped, and assigned to one of a group of 6
  10852. * sets.
  10853. *
  10854. * {int} @private
  10855. */
  10856. var NUM_100K_SETS = 6;
  10857. /**
  10858. * The column letters (for easting) of the lower left value, per
  10859. * set.
  10860. *
  10861. * {string} @private
  10862. */
  10863. var SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';
  10864. /**
  10865. * The row letters (for northing) of the lower left value, per
  10866. * set.
  10867. *
  10868. * {string} @private
  10869. */
  10870. var SET_ORIGIN_ROW_LETTERS = 'AFAFAF';
  10871. var A = 65; // A
  10872. var I = 73; // I
  10873. var O = 79; // O
  10874. var V = 86; // V
  10875. var Z = 90; // Z
  10876. var mgrs = {
  10877. forward: forward$1,
  10878. inverse: inverse$1,
  10879. toPoint: toPoint$1
  10880. };
  10881. /**
  10882. * Conversion of lat/lon to MGRS.
  10883. *
  10884. * @param {object} ll Object literal with lat and lon properties on a
  10885. * WGS84 ellipsoid.
  10886. * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for
  10887. * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.
  10888. * @return {string} the MGRS string for the given location and accuracy.
  10889. */
  10890. function forward$1(ll, accuracy) {
  10891. accuracy = accuracy || 5; // default accuracy 1m
  10892. return encode(LLtoUTM({
  10893. lat: ll[1],
  10894. lon: ll[0]
  10895. }), accuracy);
  10896. }
  10897. /**
  10898. * Conversion of MGRS to lat/lon.
  10899. *
  10900. * @param {string} mgrs MGRS string.
  10901. * @return {array} An array with left (longitude), bottom (latitude), right
  10902. * (longitude) and top (latitude) values in WGS84, representing the
  10903. * bounding box for the provided MGRS reference.
  10904. */
  10905. function inverse$1(mgrs) {
  10906. var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  10907. if (bbox.lat && bbox.lon) {
  10908. return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];
  10909. }
  10910. return [bbox.left, bbox.bottom, bbox.right, bbox.top];
  10911. }
  10912. function toPoint$1(mgrs) {
  10913. var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
  10914. if (bbox.lat && bbox.lon) {
  10915. return [bbox.lon, bbox.lat];
  10916. }
  10917. return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];
  10918. }
  10919. /**
  10920. * Conversion from degrees to radians.
  10921. *
  10922. * @private
  10923. * @param {number} deg the angle in degrees.
  10924. * @return {number} the angle in radians.
  10925. */
  10926. function degToRad(deg) {
  10927. return deg * (Math.PI / 180.0);
  10928. }
  10929. /**
  10930. * Conversion from radians to degrees.
  10931. *
  10932. * @private
  10933. * @param {number} rad the angle in radians.
  10934. * @return {number} the angle in degrees.
  10935. */
  10936. function radToDeg(rad) {
  10937. return 180.0 * (rad / Math.PI);
  10938. }
  10939. /**
  10940. * Converts a set of Longitude and Latitude co-ordinates to UTM
  10941. * using the WGS84 ellipsoid.
  10942. *
  10943. * @private
  10944. * @param {object} ll Object literal with lat and lon properties
  10945. * representing the WGS84 coordinate to be converted.
  10946. * @return {object} Object literal containing the UTM value with easting,
  10947. * northing, zoneNumber and zoneLetter properties, and an optional
  10948. * accuracy property in digits. Returns null if the conversion failed.
  10949. */
  10950. function LLtoUTM(ll) {
  10951. var Lat = ll.lat;
  10952. var Long = ll.lon;
  10953. var a = 6378137.0; //ellip.radius;
  10954. var eccSquared = 0.00669438; //ellip.eccsq;
  10955. var k0 = 0.9996;
  10956. var LongOrigin;
  10957. var eccPrimeSquared;
  10958. var N, T, C, A, M;
  10959. var LatRad = degToRad(Lat);
  10960. var LongRad = degToRad(Long);
  10961. var LongOriginRad;
  10962. var ZoneNumber;
  10963. // (int)
  10964. ZoneNumber = Math.floor((Long + 180) / 6) + 1;
  10965. //Make sure the longitude 180.00 is in Zone 60
  10966. if (Long === 180) {
  10967. ZoneNumber = 60;
  10968. }
  10969. // Special zone for Norway
  10970. if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {
  10971. ZoneNumber = 32;
  10972. }
  10973. // Special zones for Svalbard
  10974. if (Lat >= 72.0 && Lat < 84.0) {
  10975. if (Long >= 0.0 && Long < 9.0) {
  10976. ZoneNumber = 31;
  10977. } else if (Long >= 9.0 && Long < 21.0) {
  10978. ZoneNumber = 33;
  10979. } else if (Long >= 21.0 && Long < 33.0) {
  10980. ZoneNumber = 35;
  10981. } else if (Long >= 33.0 && Long < 42.0) {
  10982. ZoneNumber = 37;
  10983. }
  10984. }
  10985. LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin
  10986. // in middle of
  10987. // zone
  10988. LongOriginRad = degToRad(LongOrigin);
  10989. eccPrimeSquared = eccSquared / (1 - eccSquared);
  10990. N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));
  10991. T = Math.tan(LatRad) * Math.tan(LatRad);
  10992. C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);
  10993. A = Math.cos(LatRad) * (LongRad - LongOriginRad);
  10994. M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - 35 * eccSquared * eccSquared * eccSquared / 3072 * Math.sin(6 * LatRad));
  10995. var UTMEasting = k0 * N * (A + (1 - T + C) * A * A * A / 6.0 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A * A * A * A * A / 120.0) + 500000.0;
  10996. var UTMNorthing = k0 * (M + N * Math.tan(LatRad) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24.0 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * A * A * A * A * A / 720.0));
  10997. if (Lat < 0.0) {
  10998. UTMNorthing += 10000000.0; //10000000 meter offset for
  10999. // southern hemisphere
  11000. }
  11001. return {
  11002. northing: Math.round(UTMNorthing),
  11003. easting: Math.round(UTMEasting),
  11004. zoneNumber: ZoneNumber,
  11005. zoneLetter: getLetterDesignator(Lat)
  11006. };
  11007. }
  11008. /**
  11009. * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience
  11010. * class where the Zone can be specified as a single string eg."60N" which
  11011. * is then broken down into the ZoneNumber and ZoneLetter.
  11012. *
  11013. * @private
  11014. * @param {object} utm An object literal with northing, easting, zoneNumber
  11015. * and zoneLetter properties. If an optional accuracy property is
  11016. * provided (in meters), a bounding box will be returned instead of
  11017. * latitude and longitude.
  11018. * @return {object} An object literal containing either lat and lon values
  11019. * (if no accuracy was provided), or top, right, bottom and left values
  11020. * for the bounding box calculated according to the provided accuracy.
  11021. * Returns null if the conversion failed.
  11022. */
  11023. function UTMtoLL(utm) {
  11024. var UTMNorthing = utm.northing;
  11025. var UTMEasting = utm.easting;
  11026. var zoneLetter = utm.zoneLetter;
  11027. var zoneNumber = utm.zoneNumber;
  11028. // check the ZoneNummber is valid
  11029. if (zoneNumber < 0 || zoneNumber > 60) {
  11030. return null;
  11031. }
  11032. var k0 = 0.9996;
  11033. var a = 6378137.0; //ellip.radius;
  11034. var eccSquared = 0.00669438; //ellip.eccsq;
  11035. var eccPrimeSquared;
  11036. var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));
  11037. var N1, T1, C1, R1, D, M;
  11038. var LongOrigin;
  11039. var mu, phi1Rad;
  11040. // remove 500,000 meter offset for longitude
  11041. var x = UTMEasting - 500000.0;
  11042. var y = UTMNorthing;
  11043. // We must know somehow if we are in the Northern or Southern
  11044. // hemisphere, this is the only time we use the letter So even
  11045. // if the Zone letter isn't exactly correct it should indicate
  11046. // the hemisphere correctly
  11047. if (zoneLetter < 'N') {
  11048. y -= 10000000.0; // remove 10,000,000 meter offset used
  11049. // for southern hemisphere
  11050. }
  11051. // There are 60 zones with zone 1 being at West -180 to -174
  11052. LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin
  11053. // in middle of
  11054. // zone
  11055. eccPrimeSquared = eccSquared / (1 - eccSquared);
  11056. M = y / k0;
  11057. mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));
  11058. phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + 151 * e1 * e1 * e1 / 96 * Math.sin(6 * mu);
  11059. // double phi1 = ProjMath.radToDeg(phi1Rad);
  11060. N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));
  11061. T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);
  11062. C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);
  11063. R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);
  11064. D = x / (N1 * k0);
  11065. var lat = phi1Rad - N1 * Math.tan(phi1Rad) / R1 * (D * D / 2 - (5 + 3 * T1 + 10 * C1 - 4 * C1 * C1 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C1 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C1 * C1) * D * D * D * D * D * D / 720);
  11066. lat = radToDeg(lat);
  11067. var lon = (D - (1 + 2 * T1 + C1) * D * D * D / 6 + (5 - 2 * C1 + 28 * T1 - 3 * C1 * C1 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad);
  11068. lon = LongOrigin + radToDeg(lon);
  11069. var result;
  11070. if (utm.accuracy) {
  11071. var topRight = UTMtoLL({
  11072. northing: utm.northing + utm.accuracy,
  11073. easting: utm.easting + utm.accuracy,
  11074. zoneLetter: utm.zoneLetter,
  11075. zoneNumber: utm.zoneNumber
  11076. });
  11077. result = {
  11078. top: topRight.lat,
  11079. right: topRight.lon,
  11080. bottom: lat,
  11081. left: lon
  11082. };
  11083. } else {
  11084. result = {
  11085. lat: lat,
  11086. lon: lon
  11087. };
  11088. }
  11089. return result;
  11090. }
  11091. /**
  11092. * Calculates the MGRS letter designator for the given latitude.
  11093. *
  11094. * @private
  11095. * @param {number} lat The latitude in WGS84 to get the letter designator
  11096. * for.
  11097. * @return {char} The letter designator.
  11098. */
  11099. function getLetterDesignator(lat) {
  11100. //This is here as an error flag to show that the Latitude is
  11101. //outside MGRS limits
  11102. var LetterDesignator = 'Z';
  11103. if (84 >= lat && lat >= 72) {
  11104. LetterDesignator = 'X';
  11105. } else if (72 > lat && lat >= 64) {
  11106. LetterDesignator = 'W';
  11107. } else if (64 > lat && lat >= 56) {
  11108. LetterDesignator = 'V';
  11109. } else if (56 > lat && lat >= 48) {
  11110. LetterDesignator = 'U';
  11111. } else if (48 > lat && lat >= 40) {
  11112. LetterDesignator = 'T';
  11113. } else if (40 > lat && lat >= 32) {
  11114. LetterDesignator = 'S';
  11115. } else if (32 > lat && lat >= 24) {
  11116. LetterDesignator = 'R';
  11117. } else if (24 > lat && lat >= 16) {
  11118. LetterDesignator = 'Q';
  11119. } else if (16 > lat && lat >= 8) {
  11120. LetterDesignator = 'P';
  11121. } else if (8 > lat && lat >= 0) {
  11122. LetterDesignator = 'N';
  11123. } else if (0 > lat && lat >= -8) {
  11124. LetterDesignator = 'M';
  11125. } else if (-8 > lat && lat >= -16) {
  11126. LetterDesignator = 'L';
  11127. } else if (-16 > lat && lat >= -24) {
  11128. LetterDesignator = 'K';
  11129. } else if (-24 > lat && lat >= -32) {
  11130. LetterDesignator = 'J';
  11131. } else if (-32 > lat && lat >= -40) {
  11132. LetterDesignator = 'H';
  11133. } else if (-40 > lat && lat >= -48) {
  11134. LetterDesignator = 'G';
  11135. } else if (-48 > lat && lat >= -56) {
  11136. LetterDesignator = 'F';
  11137. } else if (-56 > lat && lat >= -64) {
  11138. LetterDesignator = 'E';
  11139. } else if (-64 > lat && lat >= -72) {
  11140. LetterDesignator = 'D';
  11141. } else if (-72 > lat && lat >= -80) {
  11142. LetterDesignator = 'C';
  11143. }
  11144. return LetterDesignator;
  11145. }
  11146. /**
  11147. * Encodes a UTM location as MGRS string.
  11148. *
  11149. * @private
  11150. * @param {object} utm An object literal with easting, northing,
  11151. * zoneLetter, zoneNumber
  11152. * @param {number} accuracy Accuracy in digits (1-5).
  11153. * @return {string} MGRS string for the given UTM location.
  11154. */
  11155. function encode(utm, accuracy) {
  11156. // prepend with leading zeroes
  11157. var seasting = "00000" + utm.easting,
  11158. snorthing = "00000" + utm.northing;
  11159. return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);
  11160. }
  11161. /**
  11162. * Get the two letter 100k designator for a given UTM easting,
  11163. * northing and zone number value.
  11164. *
  11165. * @private
  11166. * @param {number} easting
  11167. * @param {number} northing
  11168. * @param {number} zoneNumber
  11169. * @return the two letter 100k designator for the given UTM location.
  11170. */
  11171. function get100kID(easting, northing, zoneNumber) {
  11172. var setParm = get100kSetForZone(zoneNumber);
  11173. var setColumn = Math.floor(easting / 100000);
  11174. var setRow = Math.floor(northing / 100000) % 20;
  11175. return getLetter100kID(setColumn, setRow, setParm);
  11176. }
  11177. /**
  11178. * Given a UTM zone number, figure out the MGRS 100K set it is in.
  11179. *
  11180. * @private
  11181. * @param {number} i An UTM zone number.
  11182. * @return {number} the 100k set the UTM zone is in.
  11183. */
  11184. function get100kSetForZone(i) {
  11185. var setParm = i % NUM_100K_SETS;
  11186. if (setParm === 0) {
  11187. setParm = NUM_100K_SETS;
  11188. }
  11189. return setParm;
  11190. }
  11191. /**
  11192. * Get the two-letter MGRS 100k designator given information
  11193. * translated from the UTM northing, easting and zone number.
  11194. *
  11195. * @private
  11196. * @param {number} column the column index as it relates to the MGRS
  11197. * 100k set spreadsheet, created from the UTM easting.
  11198. * Values are 1-8.
  11199. * @param {number} row the row index as it relates to the MGRS 100k set
  11200. * spreadsheet, created from the UTM northing value. Values
  11201. * are from 0-19.
  11202. * @param {number} parm the set block, as it relates to the MGRS 100k set
  11203. * spreadsheet, created from the UTM zone. Values are from
  11204. * 1-60.
  11205. * @return two letter MGRS 100k code.
  11206. */
  11207. function getLetter100kID(column, row, parm) {
  11208. // colOrigin and rowOrigin are the letters at the origin of the set
  11209. var index = parm - 1;
  11210. var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);
  11211. var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index);
  11212. // colInt and rowInt are the letters to build to return
  11213. var colInt = colOrigin + column - 1;
  11214. var rowInt = rowOrigin + row;
  11215. var rollover = false;
  11216. if (colInt > Z) {
  11217. colInt = colInt - Z + A - 1;
  11218. rollover = true;
  11219. }
  11220. if (colInt === I || colOrigin < I && colInt > I || (colInt > I || colOrigin < I) && rollover) {
  11221. colInt++;
  11222. }
  11223. if (colInt === O || colOrigin < O && colInt > O || (colInt > O || colOrigin < O) && rollover) {
  11224. colInt++;
  11225. if (colInt === I) {
  11226. colInt++;
  11227. }
  11228. }
  11229. if (colInt > Z) {
  11230. colInt = colInt - Z + A - 1;
  11231. }
  11232. if (rowInt > V) {
  11233. rowInt = rowInt - V + A - 1;
  11234. rollover = true;
  11235. } else {
  11236. rollover = false;
  11237. }
  11238. if (rowInt === I || rowOrigin < I && rowInt > I || (rowInt > I || rowOrigin < I) && rollover) {
  11239. rowInt++;
  11240. }
  11241. if (rowInt === O || rowOrigin < O && rowInt > O || (rowInt > O || rowOrigin < O) && rollover) {
  11242. rowInt++;
  11243. if (rowInt === I) {
  11244. rowInt++;
  11245. }
  11246. }
  11247. if (rowInt > V) {
  11248. rowInt = rowInt - V + A - 1;
  11249. }
  11250. var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);
  11251. return twoLetter;
  11252. }
  11253. /**
  11254. * Decode the UTM parameters from a MGRS string.
  11255. *
  11256. * @private
  11257. * @param {string} mgrsString an UPPERCASE coordinate string is expected.
  11258. * @return {object} An object literal with easting, northing, zoneLetter,
  11259. * zoneNumber and accuracy (in meters) properties.
  11260. */
  11261. function decode(mgrsString) {
  11262. if (mgrsString && mgrsString.length === 0) {
  11263. throw "MGRSPoint coverting from nothing";
  11264. }
  11265. var length = mgrsString.length;
  11266. var hunK = null;
  11267. var sb = "";
  11268. var testChar;
  11269. var i = 0;
  11270. // get Zone number
  11271. while (!/[A-Z]/.test(testChar = mgrsString.charAt(i))) {
  11272. if (i >= 2) {
  11273. throw "MGRSPoint bad conversion from: " + mgrsString;
  11274. }
  11275. sb += testChar;
  11276. i++;
  11277. }
  11278. var zoneNumber = parseInt(sb, 10);
  11279. if (i === 0 || i + 3 > length) {
  11280. // A good MGRS string has to be 4-5 digits long,
  11281. // ##AAA/#AAA at least.
  11282. throw "MGRSPoint bad conversion from: " + mgrsString;
  11283. }
  11284. var zoneLetter = mgrsString.charAt(i++);
  11285. // Should we check the zone letter here? Why not.
  11286. if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {
  11287. throw "MGRSPoint zone letter " + zoneLetter + " not handled: " + mgrsString;
  11288. }
  11289. hunK = mgrsString.substring(i, i += 2);
  11290. var set = get100kSetForZone(zoneNumber);
  11291. var east100k = getEastingFromChar(hunK.charAt(0), set);
  11292. var north100k = getNorthingFromChar(hunK.charAt(1), set);
  11293. // We have a bug where the northing may be 2000000 too low.
  11294. // How
  11295. // do we know when to roll over?
  11296. while (north100k < getMinNorthing(zoneLetter)) {
  11297. north100k += 2000000;
  11298. }
  11299. // calculate the char index for easting/northing separator
  11300. var remainder = length - i;
  11301. if (remainder % 2 !== 0) {
  11302. throw "MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters" + mgrsString;
  11303. }
  11304. var sep = remainder / 2;
  11305. var sepEasting = 0.0;
  11306. var sepNorthing = 0.0;
  11307. var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;
  11308. if (sep > 0) {
  11309. accuracyBonus = 100000.0 / Math.pow(10, sep);
  11310. sepEastingString = mgrsString.substring(i, i + sep);
  11311. sepEasting = parseFloat(sepEastingString) * accuracyBonus;
  11312. sepNorthingString = mgrsString.substring(i + sep);
  11313. sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;
  11314. }
  11315. easting = sepEasting + east100k;
  11316. northing = sepNorthing + north100k;
  11317. return {
  11318. easting: easting,
  11319. northing: northing,
  11320. zoneLetter: zoneLetter,
  11321. zoneNumber: zoneNumber,
  11322. accuracy: accuracyBonus
  11323. };
  11324. }
  11325. /**
  11326. * Given the first letter from a two-letter MGRS 100k zone, and given the
  11327. * MGRS table set for the zone number, figure out the easting value that
  11328. * should be added to the other, secondary easting value.
  11329. *
  11330. * @private
  11331. * @param {char} e The first letter from a two-letter MGRS 100´k zone.
  11332. * @param {number} set The MGRS table set for the zone number.
  11333. * @return {number} The easting value for the given letter and set.
  11334. */
  11335. function getEastingFromChar(e, set) {
  11336. // colOrigin is the letter at the origin of the set for the
  11337. // column
  11338. var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);
  11339. var eastingValue = 100000.0;
  11340. var rewindMarker = false;
  11341. while (curCol !== e.charCodeAt(0)) {
  11342. curCol++;
  11343. if (curCol === I) {
  11344. curCol++;
  11345. }
  11346. if (curCol === O) {
  11347. curCol++;
  11348. }
  11349. if (curCol > Z) {
  11350. if (rewindMarker) {
  11351. throw "Bad character: " + e;
  11352. }
  11353. curCol = A;
  11354. rewindMarker = true;
  11355. }
  11356. eastingValue += 100000.0;
  11357. }
  11358. return eastingValue;
  11359. }
  11360. /**
  11361. * Given the second letter from a two-letter MGRS 100k zone, and given the
  11362. * MGRS table set for the zone number, figure out the northing value that
  11363. * should be added to the other, secondary northing value. You have to
  11364. * remember that Northings are determined from the equator, and the vertical
  11365. * cycle of letters mean a 2000000 additional northing meters. This happens
  11366. * approx. every 18 degrees of latitude. This method does *NOT* count any
  11367. * additional northings. You have to figure out how many 2000000 meters need
  11368. * to be added for the zone letter of the MGRS coordinate.
  11369. *
  11370. * @private
  11371. * @param {char} n Second letter of the MGRS 100k zone
  11372. * @param {number} set The MGRS table set number, which is dependent on the
  11373. * UTM zone number.
  11374. * @return {number} The northing value for the given letter and set.
  11375. */
  11376. function getNorthingFromChar(n, set) {
  11377. if (n > 'V') {
  11378. throw "MGRSPoint given invalid Northing " + n;
  11379. }
  11380. // rowOrigin is the letter at the origin of the set for the
  11381. // column
  11382. var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);
  11383. var northingValue = 0.0;
  11384. var rewindMarker = false;
  11385. while (curRow !== n.charCodeAt(0)) {
  11386. curRow++;
  11387. if (curRow === I) {
  11388. curRow++;
  11389. }
  11390. if (curRow === O) {
  11391. curRow++;
  11392. }
  11393. // fixing a bug making whole application hang in this loop
  11394. // when 'n' is a wrong character
  11395. if (curRow > V) {
  11396. if (rewindMarker) {
  11397. // making sure that this loop ends
  11398. throw "Bad character: " + n;
  11399. }
  11400. curRow = A;
  11401. rewindMarker = true;
  11402. }
  11403. northingValue += 100000.0;
  11404. }
  11405. return northingValue;
  11406. }
  11407. /**
  11408. * The function getMinNorthing returns the minimum northing value of a MGRS
  11409. * zone.
  11410. *
  11411. * Ported from Geotrans' c Lattitude_Band_Value structure table.
  11412. *
  11413. * @private
  11414. * @param {char} zoneLetter The MGRS zone to get the min northing for.
  11415. * @return {number}
  11416. */
  11417. function getMinNorthing(zoneLetter) {
  11418. var northing;
  11419. switch (zoneLetter) {
  11420. case 'C':
  11421. northing = 1100000.0;
  11422. break;
  11423. case 'D':
  11424. northing = 2000000.0;
  11425. break;
  11426. case 'E':
  11427. northing = 2800000.0;
  11428. break;
  11429. case 'F':
  11430. northing = 3700000.0;
  11431. break;
  11432. case 'G':
  11433. northing = 4600000.0;
  11434. break;
  11435. case 'H':
  11436. northing = 5500000.0;
  11437. break;
  11438. case 'J':
  11439. northing = 6400000.0;
  11440. break;
  11441. case 'K':
  11442. northing = 7300000.0;
  11443. break;
  11444. case 'L':
  11445. northing = 8200000.0;
  11446. break;
  11447. case 'M':
  11448. northing = 9100000.0;
  11449. break;
  11450. case 'N':
  11451. northing = 0.0;
  11452. break;
  11453. case 'P':
  11454. northing = 800000.0;
  11455. break;
  11456. case 'Q':
  11457. northing = 1700000.0;
  11458. break;
  11459. case 'R':
  11460. northing = 2600000.0;
  11461. break;
  11462. case 'S':
  11463. northing = 3500000.0;
  11464. break;
  11465. case 'T':
  11466. northing = 4400000.0;
  11467. break;
  11468. case 'U':
  11469. northing = 5300000.0;
  11470. break;
  11471. case 'V':
  11472. northing = 6200000.0;
  11473. break;
  11474. case 'W':
  11475. northing = 7000000.0;
  11476. break;
  11477. case 'X':
  11478. northing = 7900000.0;
  11479. break;
  11480. default:
  11481. northing = -1.0;
  11482. }
  11483. if (northing >= 0.0) {
  11484. return northing;
  11485. } else {
  11486. throw "Invalid zone letter: " + zoneLetter;
  11487. }
  11488. }
  11489. function Point(x, y, z) {
  11490. if (!(this instanceof Point)) {
  11491. return new Point(x, y, z);
  11492. }
  11493. if (Array.isArray(x)) {
  11494. this.x = x[0];
  11495. this.y = x[1];
  11496. this.z = x[2] || 0.0;
  11497. } else if (_typeof(x) === 'object') {
  11498. this.x = x.x;
  11499. this.y = x.y;
  11500. this.z = x.z || 0.0;
  11501. } else if (typeof x === 'string' && typeof y === 'undefined') {
  11502. var coords = x.split(',');
  11503. this.x = parseFloat(coords[0], 10);
  11504. this.y = parseFloat(coords[1], 10);
  11505. this.z = parseFloat(coords[2], 10) || 0.0;
  11506. } else {
  11507. this.x = x;
  11508. this.y = y;
  11509. this.z = z || 0.0;
  11510. }
  11511. console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');
  11512. }
  11513. Point.fromMGRS = function (mgrsStr) {
  11514. return new Point(toPoint$1(mgrsStr));
  11515. };
  11516. Point.prototype.toMGRS = function (accuracy) {
  11517. return forward$1([this.x, this.y], accuracy);
  11518. };
  11519. var C00 = 1;
  11520. var C02 = 0.25;
  11521. var C04 = 0.046875;
  11522. var C06 = 0.01953125;
  11523. var C08 = 0.01068115234375;
  11524. var C22 = 0.75;
  11525. var C44 = 0.46875;
  11526. var C46 = 0.01302083333333333333;
  11527. var C48 = 0.00712076822916666666;
  11528. var C66 = 0.36458333333333333333;
  11529. var C68 = 0.00569661458333333333;
  11530. var C88 = 0.3076171875;
  11531. var pj_enfn = function pj_enfn(es) {
  11532. var en = [];
  11533. en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));
  11534. en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));
  11535. var t = es * es;
  11536. en[2] = t * (C44 - es * (C46 + es * C48));
  11537. t *= es;
  11538. en[3] = t * (C66 - es * C68);
  11539. en[4] = t * es * C88;
  11540. return en;
  11541. };
  11542. var pj_mlfn = function pj_mlfn(phi, sphi, cphi, en) {
  11543. cphi *= sphi;
  11544. sphi *= sphi;
  11545. return en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])));
  11546. };
  11547. var MAX_ITER = 20;
  11548. var pj_inv_mlfn = function pj_inv_mlfn(arg, es, en) {
  11549. var k = 1 / (1 - es);
  11550. var phi = arg;
  11551. for (var i = MAX_ITER; i; --i) {
  11552. /* rarely goes over 2 iterations */
  11553. var s = Math.sin(phi);
  11554. var t = 1 - es * s * s;
  11555. //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;
  11556. //phi -= t * (t * Math.sqrt(t)) * k;
  11557. t = (pj_mlfn(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;
  11558. phi -= t;
  11559. if (Math.abs(t) < EPSLN) {
  11560. return phi;
  11561. }
  11562. }
  11563. //..reportError("cass:pj_inv_mlfn: Convergence error");
  11564. return phi;
  11565. };
  11566. // Heavily based on this tmerc projection implementation
  11567. // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js
  11568. function init$2() {
  11569. this.x0 = this.x0 !== undefined ? this.x0 : 0;
  11570. this.y0 = this.y0 !== undefined ? this.y0 : 0;
  11571. this.long0 = this.long0 !== undefined ? this.long0 : 0;
  11572. this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;
  11573. if (this.es) {
  11574. this.en = pj_enfn(this.es);
  11575. this.ml0 = pj_mlfn(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);
  11576. }
  11577. }
  11578. /**
  11579. Transverse Mercator Forward - long/lat to x/y
  11580. long/lat in radians
  11581. */
  11582. function forward$2(p) {
  11583. var lon = p.x;
  11584. var lat = p.y;
  11585. var delta_lon = adjust_lon(lon - this.long0);
  11586. var con;
  11587. var x, y;
  11588. var sin_phi = Math.sin(lat);
  11589. var cos_phi = Math.cos(lat);
  11590. if (!this.es) {
  11591. var b = cos_phi * Math.sin(delta_lon);
  11592. if (Math.abs(Math.abs(b) - 1) < EPSLN) {
  11593. return 93;
  11594. } else {
  11595. x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;
  11596. y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));
  11597. b = Math.abs(y);
  11598. if (b >= 1) {
  11599. if (b - 1 > EPSLN) {
  11600. return 93;
  11601. } else {
  11602. y = 0;
  11603. }
  11604. } else {
  11605. y = Math.acos(y);
  11606. }
  11607. if (lat < 0) {
  11608. y = -y;
  11609. }
  11610. y = this.a * this.k0 * (y - this.lat0) + this.y0;
  11611. }
  11612. } else {
  11613. var al = cos_phi * delta_lon;
  11614. var als = Math.pow(al, 2);
  11615. var c = this.ep2 * Math.pow(cos_phi, 2);
  11616. var cs = Math.pow(c, 2);
  11617. var tq = Math.abs(cos_phi) > EPSLN ? Math.tan(lat) : 0;
  11618. var t = Math.pow(tq, 2);
  11619. var ts = Math.pow(t, 2);
  11620. con = 1 - this.es * Math.pow(sin_phi, 2);
  11621. al = al / Math.sqrt(con);
  11622. var ml = pj_mlfn(lat, sin_phi, cos_phi, this.en);
  11623. x = this.a * (this.k0 * al * (1 + als / 6 * (1 - t + c + als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c + als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) + this.x0;
  11624. y = this.a * (this.k0 * (ml - this.ml0 + sin_phi * delta_lon * al / 2 * (1 + als / 12 * (5 - t + 9 * c + 4 * cs + als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c + als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) + this.y0;
  11625. }
  11626. p.x = x;
  11627. p.y = y;
  11628. return p;
  11629. }
  11630. /**
  11631. Transverse Mercator Inverse - x/y to long/lat
  11632. */
  11633. function inverse$2(p) {
  11634. var con, phi;
  11635. var lat, lon;
  11636. var x = (p.x - this.x0) * (1 / this.a);
  11637. var y = (p.y - this.y0) * (1 / this.a);
  11638. if (!this.es) {
  11639. var f = Math.exp(x / this.k0);
  11640. var g = 0.5 * (f - 1 / f);
  11641. var temp = this.lat0 + y / this.k0;
  11642. var h = Math.cos(temp);
  11643. con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));
  11644. lat = Math.asin(con);
  11645. if (y < 0) {
  11646. lat = -lat;
  11647. }
  11648. if (g === 0 && h === 0) {
  11649. lon = 0;
  11650. } else {
  11651. lon = adjust_lon(Math.atan2(g, h) + this.long0);
  11652. }
  11653. } else {
  11654. // ellipsoidal form
  11655. con = this.ml0 + y / this.k0;
  11656. phi = pj_inv_mlfn(con, this.es, this.en);
  11657. if (Math.abs(phi) < HALF_PI) {
  11658. var sin_phi = Math.sin(phi);
  11659. var cos_phi = Math.cos(phi);
  11660. var tan_phi = Math.abs(cos_phi) > EPSLN ? Math.tan(phi) : 0;
  11661. var c = this.ep2 * Math.pow(cos_phi, 2);
  11662. var cs = Math.pow(c, 2);
  11663. var t = Math.pow(tan_phi, 2);
  11664. var ts = Math.pow(t, 2);
  11665. con = 1 - this.es * Math.pow(sin_phi, 2);
  11666. var d = x * Math.sqrt(con) / this.k0;
  11667. var ds = Math.pow(d, 2);
  11668. con = con * tan_phi;
  11669. lat = phi - con * ds / (1 - this.es) * 0.5 * (1 - ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs - ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c - ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t))));
  11670. lon = adjust_lon(this.long0 + d * (1 - ds / 6 * (1 + 2 * t + c - ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c - ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi);
  11671. } else {
  11672. lat = HALF_PI * sign(y);
  11673. lon = 0;
  11674. }
  11675. }
  11676. p.x = lon;
  11677. p.y = lat;
  11678. return p;
  11679. }
  11680. var names$3 = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"];
  11681. var tmerc = {
  11682. init: init$2,
  11683. forward: forward$2,
  11684. inverse: inverse$2,
  11685. names: names$3
  11686. };
  11687. var sinh = function sinh(x) {
  11688. var r = Math.exp(x);
  11689. r = (r - 1 / r) / 2;
  11690. return r;
  11691. };
  11692. var hypot = function hypot(x, y) {
  11693. x = Math.abs(x);
  11694. y = Math.abs(y);
  11695. var a = Math.max(x, y);
  11696. var b = Math.min(x, y) / (a ? a : 1);
  11697. return a * Math.sqrt(1 + Math.pow(b, 2));
  11698. };
  11699. var log1py = function log1py(x) {
  11700. var y = 1 + x;
  11701. var z = y - 1;
  11702. return z === 0 ? x : x * Math.log(y) / z;
  11703. };
  11704. var asinhy = function asinhy(x) {
  11705. var y = Math.abs(x);
  11706. y = log1py(y * (1 + y / (hypot(1, y) + 1)));
  11707. return x < 0 ? -y : y;
  11708. };
  11709. var gatg = function gatg(pp, B) {
  11710. var cos_2B = 2 * Math.cos(2 * B);
  11711. var i = pp.length - 1;
  11712. var h1 = pp[i];
  11713. var h2 = 0;
  11714. var h;
  11715. while (--i >= 0) {
  11716. h = -h2 + cos_2B * h1 + pp[i];
  11717. h2 = h1;
  11718. h1 = h;
  11719. }
  11720. return B + h * Math.sin(2 * B);
  11721. };
  11722. var clens = function clens(pp, arg_r) {
  11723. var r = 2 * Math.cos(arg_r);
  11724. var i = pp.length - 1;
  11725. var hr1 = pp[i];
  11726. var hr2 = 0;
  11727. var hr;
  11728. while (--i >= 0) {
  11729. hr = -hr2 + r * hr1 + pp[i];
  11730. hr2 = hr1;
  11731. hr1 = hr;
  11732. }
  11733. return Math.sin(arg_r) * hr;
  11734. };
  11735. var cosh = function cosh(x) {
  11736. var r = Math.exp(x);
  11737. r = (r + 1 / r) / 2;
  11738. return r;
  11739. };
  11740. var clens_cmplx = function clens_cmplx(pp, arg_r, arg_i) {
  11741. var sin_arg_r = Math.sin(arg_r);
  11742. var cos_arg_r = Math.cos(arg_r);
  11743. var sinh_arg_i = sinh(arg_i);
  11744. var cosh_arg_i = cosh(arg_i);
  11745. var r = 2 * cos_arg_r * cosh_arg_i;
  11746. var i = -2 * sin_arg_r * sinh_arg_i;
  11747. var j = pp.length - 1;
  11748. var hr = pp[j];
  11749. var hi1 = 0;
  11750. var hr1 = 0;
  11751. var hi = 0;
  11752. var hr2;
  11753. var hi2;
  11754. while (--j >= 0) {
  11755. hr2 = hr1;
  11756. hi2 = hi1;
  11757. hr1 = hr;
  11758. hi1 = hi;
  11759. hr = -hr2 + r * hr1 - i * hi1 + pp[j];
  11760. hi = -hi2 + i * hr1 + r * hi1;
  11761. }
  11762. r = sin_arg_r * cosh_arg_i;
  11763. i = cos_arg_r * sinh_arg_i;
  11764. return [r * hr - i * hi, r * hi + i * hr];
  11765. };
  11766. // Heavily based on this etmerc projection implementation
  11767. // https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js
  11768. function init$3() {
  11769. if (!this.approx && (isNaN(this.es) || this.es <= 0)) {
  11770. throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
  11771. }
  11772. if (this.approx) {
  11773. // When '+approx' is set, use tmerc instead
  11774. tmerc.init.apply(this);
  11775. this.forward = tmerc.forward;
  11776. this.inverse = tmerc.inverse;
  11777. }
  11778. this.x0 = this.x0 !== undefined ? this.x0 : 0;
  11779. this.y0 = this.y0 !== undefined ? this.y0 : 0;
  11780. this.long0 = this.long0 !== undefined ? this.long0 : 0;
  11781. this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;
  11782. this.cgb = [];
  11783. this.cbg = [];
  11784. this.utg = [];
  11785. this.gtu = [];
  11786. var f = this.es / (1 + Math.sqrt(1 - this.es));
  11787. var n = f / (2 - f);
  11788. var np = n;
  11789. this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675))))));
  11790. this.cbg[0] = n * (-2 + n * (2 / 3 + n * (4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));
  11791. np = np * n;
  11792. this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));
  11793. this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * (-13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));
  11794. np = np * n;
  11795. this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));
  11796. this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));
  11797. np = np * n;
  11798. this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));
  11799. this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * (-24832 / 14175)));
  11800. np = np * n;
  11801. this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));
  11802. this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));
  11803. np = np * n;
  11804. this.cgb[5] = np * (601676 / 22275);
  11805. this.cbg[5] = np * (444337 / 155925);
  11806. np = Math.pow(n, 2);
  11807. this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));
  11808. this.utg[0] = n * (-0.5 + n * (2 / 3 + n * (-37 / 96 + n * (1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));
  11809. this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));
  11810. this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));
  11811. this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));
  11812. np = np * n;
  11813. this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720))));
  11814. this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));
  11815. np = np * n;
  11816. this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));
  11817. this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));
  11818. np = np * n;
  11819. this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));
  11820. this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));
  11821. np = np * n;
  11822. this.utg[5] = np * (-20648693 / 638668800);
  11823. this.gtu[5] = np * (212378941 / 319334400);
  11824. var Z = gatg(this.cbg, this.lat0);
  11825. this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z));
  11826. }
  11827. function forward$3(p) {
  11828. var Ce = adjust_lon(p.x - this.long0);
  11829. var Cn = p.y;
  11830. Cn = gatg(this.cbg, Cn);
  11831. var sin_Cn = Math.sin(Cn);
  11832. var cos_Cn = Math.cos(Cn);
  11833. var sin_Ce = Math.sin(Ce);
  11834. var cos_Ce = Math.cos(Ce);
  11835. Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);
  11836. Ce = Math.atan2(sin_Ce * cos_Cn, hypot(sin_Cn, cos_Cn * cos_Ce));
  11837. Ce = asinhy(Math.tan(Ce));
  11838. var tmp = clens_cmplx(this.gtu, 2 * Cn, 2 * Ce);
  11839. Cn = Cn + tmp[0];
  11840. Ce = Ce + tmp[1];
  11841. var x;
  11842. var y;
  11843. if (Math.abs(Ce) <= 2.623395162778) {
  11844. x = this.a * (this.Qn * Ce) + this.x0;
  11845. y = this.a * (this.Qn * Cn + this.Zb) + this.y0;
  11846. } else {
  11847. x = Infinity;
  11848. y = Infinity;
  11849. }
  11850. p.x = x;
  11851. p.y = y;
  11852. return p;
  11853. }
  11854. function inverse$3(p) {
  11855. var Ce = (p.x - this.x0) * (1 / this.a);
  11856. var Cn = (p.y - this.y0) * (1 / this.a);
  11857. Cn = (Cn - this.Zb) / this.Qn;
  11858. Ce = Ce / this.Qn;
  11859. var lon;
  11860. var lat;
  11861. if (Math.abs(Ce) <= 2.623395162778) {
  11862. var tmp = clens_cmplx(this.utg, 2 * Cn, 2 * Ce);
  11863. Cn = Cn + tmp[0];
  11864. Ce = Ce + tmp[1];
  11865. Ce = Math.atan(sinh(Ce));
  11866. var sin_Cn = Math.sin(Cn);
  11867. var cos_Cn = Math.cos(Cn);
  11868. var sin_Ce = Math.sin(Ce);
  11869. var cos_Ce = Math.cos(Ce);
  11870. Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn));
  11871. Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);
  11872. lon = adjust_lon(Ce + this.long0);
  11873. lat = gatg(this.cgb, Cn);
  11874. } else {
  11875. lon = Infinity;
  11876. lat = Infinity;
  11877. }
  11878. p.x = lon;
  11879. p.y = lat;
  11880. return p;
  11881. }
  11882. var names$4 = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "tmerc"];
  11883. var etmerc = {
  11884. init: init$3,
  11885. forward: forward$3,
  11886. inverse: inverse$3,
  11887. names: names$4
  11888. };
  11889. var adjust_zone = function adjust_zone(zone, lon) {
  11890. if (zone === undefined) {
  11891. zone = Math.floor((adjust_lon(lon) + Math.PI) * 30 / Math.PI) + 1;
  11892. if (zone < 0) {
  11893. return 0;
  11894. } else if (zone > 60) {
  11895. return 60;
  11896. }
  11897. }
  11898. return zone;
  11899. };
  11900. var dependsOn = 'etmerc';
  11901. function init$4() {
  11902. var zone = adjust_zone(this.zone, this.long0);
  11903. if (zone === undefined) {
  11904. throw new Error('unknown utm zone');
  11905. }
  11906. this.lat0 = 0;
  11907. this.long0 = (6 * Math.abs(zone) - 183) * D2R;
  11908. this.x0 = 500000;
  11909. this.y0 = this.utmSouth ? 10000000 : 0;
  11910. this.k0 = 0.9996;
  11911. etmerc.init.apply(this);
  11912. this.forward = etmerc.forward;
  11913. this.inverse = etmerc.inverse;
  11914. }
  11915. var names$5 = ["Universal Transverse Mercator System", "utm"];
  11916. var utm = {
  11917. init: init$4,
  11918. names: names$5,
  11919. dependsOn: dependsOn
  11920. };
  11921. var srat = function srat(esinp, exp) {
  11922. return Math.pow((1 - esinp) / (1 + esinp), exp);
  11923. };
  11924. var MAX_ITER$1 = 20;
  11925. function init$6() {
  11926. var sphi = Math.sin(this.lat0);
  11927. var cphi = Math.cos(this.lat0);
  11928. cphi *= cphi;
  11929. this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);
  11930. this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));
  11931. this.phic0 = Math.asin(sphi / this.C);
  11932. this.ratexp = 0.5 * this.C * this.e;
  11933. this.K = Math.tan(0.5 * this.phic0 + FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + FORTPI), this.C) * srat(this.e * sphi, this.ratexp));
  11934. }
  11935. function forward$5(p) {
  11936. var lon = p.x;
  11937. var lat = p.y;
  11938. p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + FORTPI), this.C) * srat(this.e * Math.sin(lat), this.ratexp)) - HALF_PI;
  11939. p.x = this.C * lon;
  11940. return p;
  11941. }
  11942. function inverse$5(p) {
  11943. var DEL_TOL = 1e-14;
  11944. var lon = p.x / this.C;
  11945. var lat = p.y;
  11946. var num = Math.pow(Math.tan(0.5 * lat + FORTPI) / this.K, 1 / this.C);
  11947. for (var i = MAX_ITER$1; i > 0; --i) {
  11948. lat = 2 * Math.atan(num * srat(this.e * Math.sin(p.y), -0.5 * this.e)) - HALF_PI;
  11949. if (Math.abs(lat - p.y) < DEL_TOL) {
  11950. break;
  11951. }
  11952. p.y = lat;
  11953. }
  11954. /* convergence failed */
  11955. if (!i) {
  11956. return null;
  11957. }
  11958. p.x = lon;
  11959. p.y = lat;
  11960. return p;
  11961. }
  11962. var names$7 = ["gauss"];
  11963. var gauss = {
  11964. init: init$6,
  11965. forward: forward$5,
  11966. inverse: inverse$5,
  11967. names: names$7
  11968. };
  11969. function init$5() {
  11970. gauss.init.apply(this);
  11971. if (!this.rc) {
  11972. return;
  11973. }
  11974. this.sinc0 = Math.sin(this.phic0);
  11975. this.cosc0 = Math.cos(this.phic0);
  11976. this.R2 = 2 * this.rc;
  11977. if (!this.title) {
  11978. this.title = "Oblique Stereographic Alternative";
  11979. }
  11980. }
  11981. function forward$4(p) {
  11982. var sinc, cosc, cosl, k;
  11983. p.x = adjust_lon(p.x - this.long0);
  11984. gauss.forward.apply(this, [p]);
  11985. sinc = Math.sin(p.y);
  11986. cosc = Math.cos(p.y);
  11987. cosl = Math.cos(p.x);
  11988. k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);
  11989. p.x = k * cosc * Math.sin(p.x);
  11990. p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);
  11991. p.x = this.a * p.x + this.x0;
  11992. p.y = this.a * p.y + this.y0;
  11993. return p;
  11994. }
  11995. function inverse$4(p) {
  11996. var sinc, cosc, lon, lat, rho;
  11997. p.x = (p.x - this.x0) / this.a;
  11998. p.y = (p.y - this.y0) / this.a;
  11999. p.x /= this.k0;
  12000. p.y /= this.k0;
  12001. if (rho = Math.sqrt(p.x * p.x + p.y * p.y)) {
  12002. var c = 2 * Math.atan2(rho, this.R2);
  12003. sinc = Math.sin(c);
  12004. cosc = Math.cos(c);
  12005. lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);
  12006. lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);
  12007. } else {
  12008. lat = this.phic0;
  12009. lon = 0;
  12010. }
  12011. p.x = lon;
  12012. p.y = lat;
  12013. gauss.inverse.apply(this, [p]);
  12014. p.x = adjust_lon(p.x + this.long0);
  12015. return p;
  12016. }
  12017. var names$6 = ["Stereographic_North_Pole", "Oblique_Stereographic", "Polar_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
  12018. var sterea = {
  12019. init: init$5,
  12020. forward: forward$4,
  12021. inverse: inverse$4,
  12022. names: names$6
  12023. };
  12024. function ssfn_(phit, sinphi, eccen) {
  12025. sinphi *= eccen;
  12026. return Math.tan(0.5 * (HALF_PI + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen);
  12027. }
  12028. function init$7() {
  12029. this.coslat0 = Math.cos(this.lat0);
  12030. this.sinlat0 = Math.sin(this.lat0);
  12031. if (this.sphere) {
  12032. if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
  12033. this.k0 = 0.5 * (1 + sign(this.lat0) * Math.sin(this.lat_ts));
  12034. }
  12035. } else {
  12036. if (Math.abs(this.coslat0) <= EPSLN) {
  12037. if (this.lat0 > 0) {
  12038. //North pole
  12039. //trace('stere:north pole');
  12040. this.con = 1;
  12041. } else {
  12042. //South pole
  12043. //trace('stere:south pole');
  12044. this.con = -1;
  12045. }
  12046. }
  12047. this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));
  12048. if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= EPSLN) {
  12049. this.k0 = 0.5 * this.cons * msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / tsfnz(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));
  12050. }
  12051. this.ms1 = msfnz(this.e, this.sinlat0, this.coslat0);
  12052. this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - HALF_PI;
  12053. this.cosX0 = Math.cos(this.X0);
  12054. this.sinX0 = Math.sin(this.X0);
  12055. }
  12056. }
  12057. // Stereographic forward equations--mapping lat,long to x,y
  12058. function forward$6(p) {
  12059. var lon = p.x;
  12060. var lat = p.y;
  12061. var sinlat = Math.sin(lat);
  12062. var coslat = Math.cos(lat);
  12063. var A, X, sinX, cosX, ts, rh;
  12064. var dlon = adjust_lon(lon - this.long0);
  12065. if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {
  12066. //case of the origine point
  12067. //trace('stere:this is the origin point');
  12068. p.x = NaN;
  12069. p.y = NaN;
  12070. return p;
  12071. }
  12072. if (this.sphere) {
  12073. //trace('stere:sphere case');
  12074. A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));
  12075. p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;
  12076. p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;
  12077. return p;
  12078. } else {
  12079. X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - HALF_PI;
  12080. cosX = Math.cos(X);
  12081. sinX = Math.sin(X);
  12082. if (Math.abs(this.coslat0) <= EPSLN) {
  12083. ts = tsfnz(this.e, lat * this.con, this.con * sinlat);
  12084. rh = 2 * this.a * this.k0 * ts / this.cons;
  12085. p.x = this.x0 + rh * Math.sin(lon - this.long0);
  12086. p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0);
  12087. //trace(p.toString());
  12088. return p;
  12089. } else if (Math.abs(this.sinlat0) < EPSLN) {
  12090. //Eq
  12091. //trace('stere:equateur');
  12092. A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));
  12093. p.y = A * sinX;
  12094. } else {
  12095. //other case
  12096. //trace('stere:normal case');
  12097. A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));
  12098. p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;
  12099. }
  12100. p.x = A * cosX * Math.sin(dlon) + this.x0;
  12101. }
  12102. //trace(p.toString());
  12103. return p;
  12104. }
  12105. //* Stereographic inverse equations--mapping x,y to lat/long
  12106. function inverse$6(p) {
  12107. p.x -= this.x0;
  12108. p.y -= this.y0;
  12109. var lon, lat, ts, ce, Chi;
  12110. var rh = Math.sqrt(p.x * p.x + p.y * p.y);
  12111. if (this.sphere) {
  12112. var c = 2 * Math.atan(rh / (2 * this.a * this.k0));
  12113. lon = this.long0;
  12114. lat = this.lat0;
  12115. if (rh <= EPSLN) {
  12116. p.x = lon;
  12117. p.y = lat;
  12118. return p;
  12119. }
  12120. lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);
  12121. if (Math.abs(this.coslat0) < EPSLN) {
  12122. if (this.lat0 > 0) {
  12123. lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
  12124. } else {
  12125. lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
  12126. }
  12127. } else {
  12128. lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));
  12129. }
  12130. p.x = lon;
  12131. p.y = lat;
  12132. return p;
  12133. } else {
  12134. if (Math.abs(this.coslat0) <= EPSLN) {
  12135. if (rh <= EPSLN) {
  12136. lat = this.lat0;
  12137. lon = this.long0;
  12138. p.x = lon;
  12139. p.y = lat;
  12140. //trace(p.toString());
  12141. return p;
  12142. }
  12143. p.x *= this.con;
  12144. p.y *= this.con;
  12145. ts = rh * this.cons / (2 * this.a * this.k0);
  12146. lat = this.con * phi2z(this.e, ts);
  12147. lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, -1 * p.y));
  12148. } else {
  12149. ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));
  12150. lon = this.long0;
  12151. if (rh <= EPSLN) {
  12152. Chi = this.X0;
  12153. } else {
  12154. Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);
  12155. lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));
  12156. }
  12157. lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi)));
  12158. }
  12159. }
  12160. p.x = lon;
  12161. p.y = lat;
  12162. //trace(p.toString());
  12163. return p;
  12164. }
  12165. var names$8 = ["stere", "Stereographic_South_Pole", "Polar Stereographic (variant B)"];
  12166. var stere = {
  12167. init: init$7,
  12168. forward: forward$6,
  12169. inverse: inverse$6,
  12170. names: names$8,
  12171. ssfn_: ssfn_
  12172. };
  12173. /*
  12174. references:
  12175. Formules et constantes pour le Calcul pour la
  12176. projection cylindrique conforme à axe oblique et pour la transformation entre
  12177. des systèmes de référence.
  12178. http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf
  12179. */
  12180. function init$8() {
  12181. var phy0 = this.lat0;
  12182. this.lambda0 = this.long0;
  12183. var sinPhy0 = Math.sin(phy0);
  12184. var semiMajorAxis = this.a;
  12185. var invF = this.rf;
  12186. var flattening = 1 / invF;
  12187. var e2 = 2 * flattening - Math.pow(flattening, 2);
  12188. var e = this.e = Math.sqrt(e2);
  12189. this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));
  12190. this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));
  12191. this.b0 = Math.asin(sinPhy0 / this.alpha);
  12192. var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));
  12193. var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));
  12194. var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));
  12195. this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;
  12196. }
  12197. function forward$7(p) {
  12198. var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));
  12199. var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));
  12200. var S = -this.alpha * (Sa1 + Sa2) + this.K;
  12201. // spheric latitude
  12202. var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4);
  12203. // spheric longitude
  12204. var I = this.alpha * (p.x - this.lambda0);
  12205. // psoeudo equatorial rotation
  12206. var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));
  12207. var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));
  12208. p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;
  12209. p.x = this.R * rotI + this.x0;
  12210. return p;
  12211. }
  12212. function inverse$7(p) {
  12213. var Y = p.x - this.x0;
  12214. var X = p.y - this.y0;
  12215. var rotI = Y / this.R;
  12216. var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);
  12217. var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));
  12218. var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));
  12219. var lambda = this.lambda0 + I / this.alpha;
  12220. var S = 0;
  12221. var phy = b;
  12222. var prevPhy = -1000;
  12223. var iteration = 0;
  12224. while (Math.abs(phy - prevPhy) > 0.0000001) {
  12225. if (++iteration > 20) {
  12226. //...reportError("omercFwdInfinity");
  12227. return;
  12228. }
  12229. //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));
  12230. S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2));
  12231. prevPhy = phy;
  12232. phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;
  12233. }
  12234. p.x = lambda;
  12235. p.y = phy;
  12236. return p;
  12237. }
  12238. var names$9 = ["somerc"];
  12239. var somerc = {
  12240. init: init$8,
  12241. forward: forward$7,
  12242. inverse: inverse$7,
  12243. names: names$9
  12244. };
  12245. var TOL = 1e-7;
  12246. function isTypeA(P) {
  12247. var typeAProjections = ['Hotine_Oblique_Mercator', 'Hotine_Oblique_Mercator_Azimuth_Natural_Origin'];
  12248. var projectionName = _typeof(P.PROJECTION) === "object" ? Object.keys(P.PROJECTION)[0] : P.PROJECTION;
  12249. return 'no_uoff' in P || 'no_off' in P || typeAProjections.indexOf(projectionName) !== -1;
  12250. }
  12251. /* Initialize the Oblique Mercator projection
  12252. ------------------------------------------*/
  12253. function init$9() {
  12254. var con,
  12255. com,
  12256. cosph0,
  12257. D,
  12258. F,
  12259. H,
  12260. L,
  12261. sinph0,
  12262. p,
  12263. J,
  12264. gamma = 0,
  12265. gamma0,
  12266. lamc = 0,
  12267. lam1 = 0,
  12268. lam2 = 0,
  12269. phi1 = 0,
  12270. phi2 = 0,
  12271. alpha_c = 0;
  12272. // only Type A uses the no_off or no_uoff property
  12273. // https://github.com/OSGeo/proj.4/issues/104
  12274. this.no_off = isTypeA(this);
  12275. this.no_rot = 'no_rot' in this;
  12276. var alp = false;
  12277. if ("alpha" in this) {
  12278. alp = true;
  12279. }
  12280. var gam = false;
  12281. if ("rectified_grid_angle" in this) {
  12282. gam = true;
  12283. }
  12284. if (alp) {
  12285. alpha_c = this.alpha;
  12286. }
  12287. if (gam) {
  12288. gamma = this.rectified_grid_angle * D2R;
  12289. }
  12290. if (alp || gam) {
  12291. lamc = this.longc;
  12292. } else {
  12293. lam1 = this.long1;
  12294. phi1 = this.lat1;
  12295. lam2 = this.long2;
  12296. phi2 = this.lat2;
  12297. if (Math.abs(phi1 - phi2) <= TOL || (con = Math.abs(phi1)) <= TOL || Math.abs(con - HALF_PI) <= TOL || Math.abs(Math.abs(this.lat0) - HALF_PI) <= TOL || Math.abs(Math.abs(phi2) - HALF_PI) <= TOL) {
  12298. throw new Error();
  12299. }
  12300. }
  12301. var one_es = 1.0 - this.es;
  12302. com = Math.sqrt(one_es);
  12303. if (Math.abs(this.lat0) > EPSLN) {
  12304. sinph0 = Math.sin(this.lat0);
  12305. cosph0 = Math.cos(this.lat0);
  12306. con = 1 - this.es * sinph0 * sinph0;
  12307. this.B = cosph0 * cosph0;
  12308. this.B = Math.sqrt(1 + this.es * this.B * this.B / one_es);
  12309. this.A = this.B * this.k0 * com / con;
  12310. D = this.B * com / (cosph0 * Math.sqrt(con));
  12311. F = D * D - 1;
  12312. if (F <= 0) {
  12313. F = 0;
  12314. } else {
  12315. F = Math.sqrt(F);
  12316. if (this.lat0 < 0) {
  12317. F = -F;
  12318. }
  12319. }
  12320. this.E = F += D;
  12321. this.E *= Math.pow(tsfnz(this.e, this.lat0, sinph0), this.B);
  12322. } else {
  12323. this.B = 1 / com;
  12324. this.A = this.k0;
  12325. this.E = D = F = 1;
  12326. }
  12327. if (alp || gam) {
  12328. if (alp) {
  12329. gamma0 = Math.asin(Math.sin(alpha_c) / D);
  12330. if (!gam) {
  12331. gamma = alpha_c;
  12332. }
  12333. } else {
  12334. gamma0 = gamma;
  12335. alpha_c = Math.asin(D * Math.sin(gamma0));
  12336. }
  12337. this.lam0 = lamc - Math.asin(0.5 * (F - 1 / F) * Math.tan(gamma0)) / this.B;
  12338. } else {
  12339. H = Math.pow(tsfnz(this.e, phi1, Math.sin(phi1)), this.B);
  12340. L = Math.pow(tsfnz(this.e, phi2, Math.sin(phi2)), this.B);
  12341. F = this.E / H;
  12342. p = (L - H) / (L + H);
  12343. J = this.E * this.E;
  12344. J = (J - L * H) / (J + L * H);
  12345. con = lam1 - lam2;
  12346. if (con < -Math.pi) {
  12347. lam2 -= TWO_PI;
  12348. } else if (con > Math.pi) {
  12349. lam2 += TWO_PI;
  12350. }
  12351. this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B);
  12352. gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0)) / (F - 1 / F));
  12353. gamma = alpha_c = Math.asin(D * Math.sin(gamma0));
  12354. }
  12355. this.singam = Math.sin(gamma0);
  12356. this.cosgam = Math.cos(gamma0);
  12357. this.sinrot = Math.sin(gamma);
  12358. this.cosrot = Math.cos(gamma);
  12359. this.rB = 1 / this.B;
  12360. this.ArB = this.A * this.rB;
  12361. this.BrA = 1 / this.ArB;
  12362. if (this.no_off) {
  12363. this.u_0 = 0;
  12364. } else {
  12365. this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(D * D - 1) / Math.cos(alpha_c)));
  12366. if (this.lat0 < 0) {
  12367. this.u_0 = -this.u_0;
  12368. }
  12369. }
  12370. F = 0.5 * gamma0;
  12371. this.v_pole_n = this.ArB * Math.log(Math.tan(FORTPI - F));
  12372. this.v_pole_s = this.ArB * Math.log(Math.tan(FORTPI + F));
  12373. }
  12374. /* Oblique Mercator forward equations--mapping lat,long to x,y
  12375. ----------------------------------------------------------*/
  12376. function forward$8(p) {
  12377. var coords = {};
  12378. var S, T, U, V, W, temp, u, v;
  12379. p.x = p.x - this.lam0;
  12380. if (Math.abs(Math.abs(p.y) - HALF_PI) > EPSLN) {
  12381. W = this.E / Math.pow(tsfnz(this.e, p.y, Math.sin(p.y)), this.B);
  12382. temp = 1 / W;
  12383. S = 0.5 * (W - temp);
  12384. T = 0.5 * (W + temp);
  12385. V = Math.sin(this.B * p.x);
  12386. U = (S * this.singam - V * this.cosgam) / T;
  12387. if (Math.abs(Math.abs(U) - 1.0) < EPSLN) {
  12388. throw new Error();
  12389. }
  12390. v = 0.5 * this.ArB * Math.log((1 - U) / (1 + U));
  12391. temp = Math.cos(this.B * p.x);
  12392. if (Math.abs(temp) < TOL) {
  12393. u = this.A * p.x;
  12394. } else {
  12395. u = this.ArB * Math.atan2(S * this.cosgam + V * this.singam, temp);
  12396. }
  12397. } else {
  12398. v = p.y > 0 ? this.v_pole_n : this.v_pole_s;
  12399. u = this.ArB * p.y;
  12400. }
  12401. if (this.no_rot) {
  12402. coords.x = u;
  12403. coords.y = v;
  12404. } else {
  12405. u -= this.u_0;
  12406. coords.x = v * this.cosrot + u * this.sinrot;
  12407. coords.y = u * this.cosrot - v * this.sinrot;
  12408. }
  12409. coords.x = this.a * coords.x + this.x0;
  12410. coords.y = this.a * coords.y + this.y0;
  12411. return coords;
  12412. }
  12413. function inverse$8(p) {
  12414. var u, v, Qp, Sp, Tp, Vp, Up;
  12415. var coords = {};
  12416. p.x = (p.x - this.x0) * (1.0 / this.a);
  12417. p.y = (p.y - this.y0) * (1.0 / this.a);
  12418. if (this.no_rot) {
  12419. v = p.y;
  12420. u = p.x;
  12421. } else {
  12422. v = p.x * this.cosrot - p.y * this.sinrot;
  12423. u = p.y * this.cosrot + p.x * this.sinrot + this.u_0;
  12424. }
  12425. Qp = Math.exp(-this.BrA * v);
  12426. Sp = 0.5 * (Qp - 1 / Qp);
  12427. Tp = 0.5 * (Qp + 1 / Qp);
  12428. Vp = Math.sin(this.BrA * u);
  12429. Up = (Vp * this.cosgam + Sp * this.singam) / Tp;
  12430. if (Math.abs(Math.abs(Up) - 1) < EPSLN) {
  12431. coords.x = 0;
  12432. coords.y = Up < 0 ? -HALF_PI : HALF_PI;
  12433. } else {
  12434. coords.y = this.E / Math.sqrt((1 + Up) / (1 - Up));
  12435. coords.y = phi2z(this.e, Math.pow(coords.y, 1 / this.B));
  12436. if (coords.y === Infinity) {
  12437. throw new Error();
  12438. }
  12439. coords.x = -this.rB * Math.atan2(Sp * this.cosgam - Vp * this.singam, Math.cos(this.BrA * u));
  12440. }
  12441. coords.x += this.lam0;
  12442. return coords;
  12443. }
  12444. var names$10 = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"];
  12445. var omerc = {
  12446. init: init$9,
  12447. forward: forward$8,
  12448. inverse: inverse$8,
  12449. names: names$10
  12450. };
  12451. function init$10() {
  12452. //double lat0; /* the reference latitude */
  12453. //double long0; /* the reference longitude */
  12454. //double lat1; /* first standard parallel */
  12455. //double lat2; /* second standard parallel */
  12456. //double r_maj; /* major axis */
  12457. //double r_min; /* minor axis */
  12458. //double false_east; /* x offset in meters */
  12459. //double false_north; /* y offset in meters */
  12460. //the above value can be set with proj4.defs
  12461. //example: proj4.defs("EPSG:2154","+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");
  12462. if (!this.lat2) {
  12463. this.lat2 = this.lat1;
  12464. } //if lat2 is not defined
  12465. if (!this.k0) {
  12466. this.k0 = 1;
  12467. }
  12468. this.x0 = this.x0 || 0;
  12469. this.y0 = this.y0 || 0;
  12470. // Standard Parallels cannot be equal and on opposite sides of the equator
  12471. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  12472. return;
  12473. }
  12474. var temp = this.b / this.a;
  12475. this.e = Math.sqrt(1 - temp * temp);
  12476. var sin1 = Math.sin(this.lat1);
  12477. var cos1 = Math.cos(this.lat1);
  12478. var ms1 = msfnz(this.e, sin1, cos1);
  12479. var ts1 = tsfnz(this.e, this.lat1, sin1);
  12480. var sin2 = Math.sin(this.lat2);
  12481. var cos2 = Math.cos(this.lat2);
  12482. var ms2 = msfnz(this.e, sin2, cos2);
  12483. var ts2 = tsfnz(this.e, this.lat2, sin2);
  12484. var ts0 = tsfnz(this.e, this.lat0, Math.sin(this.lat0));
  12485. if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
  12486. this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);
  12487. } else {
  12488. this.ns = sin1;
  12489. }
  12490. if (isNaN(this.ns)) {
  12491. this.ns = sin1;
  12492. }
  12493. this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));
  12494. this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);
  12495. if (!this.title) {
  12496. this.title = "Lambert Conformal Conic";
  12497. }
  12498. }
  12499. // Lambert Conformal conic forward equations--mapping lat,long to x,y
  12500. // -----------------------------------------------------------------
  12501. function forward$9(p) {
  12502. var lon = p.x;
  12503. var lat = p.y;
  12504. // singular cases :
  12505. if (Math.abs(2 * Math.abs(lat) - Math.PI) <= EPSLN) {
  12506. lat = sign(lat) * (HALF_PI - 2 * EPSLN);
  12507. }
  12508. var con = Math.abs(Math.abs(lat) - HALF_PI);
  12509. var ts, rh1;
  12510. if (con > EPSLN) {
  12511. ts = tsfnz(this.e, lat, Math.sin(lat));
  12512. rh1 = this.a * this.f0 * Math.pow(ts, this.ns);
  12513. } else {
  12514. con = lat * this.ns;
  12515. if (con <= 0) {
  12516. return null;
  12517. }
  12518. rh1 = 0;
  12519. }
  12520. var theta = this.ns * adjust_lon(lon - this.long0);
  12521. p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;
  12522. p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;
  12523. return p;
  12524. }
  12525. // Lambert Conformal Conic inverse equations--mapping x,y to lat/long
  12526. // -----------------------------------------------------------------
  12527. function inverse$9(p) {
  12528. var rh1, con, ts;
  12529. var lat, lon;
  12530. var x = (p.x - this.x0) / this.k0;
  12531. var y = this.rh - (p.y - this.y0) / this.k0;
  12532. if (this.ns > 0) {
  12533. rh1 = Math.sqrt(x * x + y * y);
  12534. con = 1;
  12535. } else {
  12536. rh1 = -Math.sqrt(x * x + y * y);
  12537. con = -1;
  12538. }
  12539. var theta = 0;
  12540. if (rh1 !== 0) {
  12541. theta = Math.atan2(con * x, con * y);
  12542. }
  12543. if (rh1 !== 0 || this.ns > 0) {
  12544. con = 1 / this.ns;
  12545. ts = Math.pow(rh1 / (this.a * this.f0), con);
  12546. lat = phi2z(this.e, ts);
  12547. if (lat === -9999) {
  12548. return null;
  12549. }
  12550. } else {
  12551. lat = -HALF_PI;
  12552. }
  12553. lon = adjust_lon(theta / this.ns + this.long0);
  12554. p.x = lon;
  12555. p.y = lat;
  12556. return p;
  12557. }
  12558. var names$11 = ["Lambert Tangential Conformal Conic Projection", "Lambert_Conformal_Conic", "Lambert_Conformal_Conic_1SP", "Lambert_Conformal_Conic_2SP", "lcc", "Lambert Conic Conformal (1SP)", "Lambert Conic Conformal (2SP)"];
  12559. var lcc = {
  12560. init: init$10,
  12561. forward: forward$9,
  12562. inverse: inverse$9,
  12563. names: names$11
  12564. };
  12565. function init$11() {
  12566. this.a = 6377397.155;
  12567. this.es = 0.006674372230614;
  12568. this.e = Math.sqrt(this.es);
  12569. if (!this.lat0) {
  12570. this.lat0 = 0.863937979737193;
  12571. }
  12572. if (!this.long0) {
  12573. this.long0 = 0.7417649320975901 - 0.308341501185665;
  12574. }
  12575. /* if scale not set default to 0.9999 */
  12576. if (!this.k0) {
  12577. this.k0 = 0.9999;
  12578. }
  12579. this.s45 = 0.785398163397448; /* 45 */
  12580. this.s90 = 2 * this.s45;
  12581. this.fi0 = this.lat0;
  12582. this.e2 = this.es;
  12583. this.e = Math.sqrt(this.e2);
  12584. this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2));
  12585. this.uq = 1.04216856380474;
  12586. this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);
  12587. this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);
  12588. this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;
  12589. this.k1 = this.k0;
  12590. this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));
  12591. this.s0 = 1.37008346281555;
  12592. this.n = Math.sin(this.s0);
  12593. this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);
  12594. this.ad = this.s90 - this.uq;
  12595. }
  12596. /* ellipsoid */
  12597. /* calculate xy from lat/lon */
  12598. /* Constants, identical to inverse transform function */
  12599. function forward$10(p) {
  12600. var gfi, u, deltav, s, d, eps, ro;
  12601. var lon = p.x;
  12602. var lat = p.y;
  12603. var delta_lon = adjust_lon(lon - this.long0);
  12604. /* Transformation */
  12605. gfi = Math.pow((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat)), this.alfa * this.e / 2);
  12606. u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);
  12607. deltav = -delta_lon * this.alfa;
  12608. s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));
  12609. d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));
  12610. eps = this.n * d;
  12611. ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);
  12612. p.y = ro * Math.cos(eps) / 1;
  12613. p.x = ro * Math.sin(eps) / 1;
  12614. if (!this.czech) {
  12615. p.y *= -1;
  12616. p.x *= -1;
  12617. }
  12618. return p;
  12619. }
  12620. /* calculate lat/lon from xy */
  12621. function inverse$10(p) {
  12622. var u, deltav, s, d, eps, ro, fi1;
  12623. var ok;
  12624. /* Transformation */
  12625. /* revert y, x*/
  12626. var tmp = p.x;
  12627. p.x = p.y;
  12628. p.y = tmp;
  12629. if (!this.czech) {
  12630. p.y *= -1;
  12631. p.x *= -1;
  12632. }
  12633. ro = Math.sqrt(p.x * p.x + p.y * p.y);
  12634. eps = Math.atan2(p.y, p.x);
  12635. d = eps / Math.sin(this.s0);
  12636. s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);
  12637. u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));
  12638. deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));
  12639. p.x = this.long0 - deltav / this.alfa;
  12640. fi1 = u;
  12641. ok = 0;
  12642. var iter = 0;
  12643. do {
  12644. p.y = 2 * (Math.atan(Math.pow(this.k, -1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45);
  12645. if (Math.abs(fi1 - p.y) < 0.0000000001) {
  12646. ok = 1;
  12647. }
  12648. fi1 = p.y;
  12649. iter += 1;
  12650. } while (ok === 0 && iter < 15);
  12651. if (iter >= 15) {
  12652. return null;
  12653. }
  12654. return p;
  12655. }
  12656. var names$12 = ["Krovak", "krovak"];
  12657. var krovak = {
  12658. init: init$11,
  12659. forward: forward$10,
  12660. inverse: inverse$10,
  12661. names: names$12
  12662. };
  12663. var mlfn = function mlfn(e0, e1, e2, e3, phi) {
  12664. return e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi);
  12665. };
  12666. var e0fn = function e0fn(x) {
  12667. return 1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x));
  12668. };
  12669. var e1fn = function e1fn(x) {
  12670. return 0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x));
  12671. };
  12672. var e2fn = function e2fn(x) {
  12673. return 0.05859375 * x * x * (1 + 0.75 * x);
  12674. };
  12675. var e3fn = function e3fn(x) {
  12676. return x * x * x * (35 / 3072);
  12677. };
  12678. var gN = function gN(a, e, sinphi) {
  12679. var temp = e * sinphi;
  12680. return a / Math.sqrt(1 - temp * temp);
  12681. };
  12682. var adjust_lat = function adjust_lat(x) {
  12683. return Math.abs(x) < HALF_PI ? x : x - sign(x) * Math.PI;
  12684. };
  12685. var imlfn = function imlfn(ml, e0, e1, e2, e3) {
  12686. var phi;
  12687. var dphi;
  12688. phi = ml / e0;
  12689. for (var i = 0; i < 15; i++) {
  12690. dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi));
  12691. phi += dphi;
  12692. if (Math.abs(dphi) <= 0.0000000001) {
  12693. return phi;
  12694. }
  12695. }
  12696. //..reportError("IMLFN-CONV:Latitude failed to converge after 15 iterations");
  12697. return NaN;
  12698. };
  12699. function init$12() {
  12700. if (!this.sphere) {
  12701. this.e0 = e0fn(this.es);
  12702. this.e1 = e1fn(this.es);
  12703. this.e2 = e2fn(this.es);
  12704. this.e3 = e3fn(this.es);
  12705. this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);
  12706. }
  12707. }
  12708. /* Cassini forward equations--mapping lat,long to x,y
  12709. -----------------------------------------------------------------------*/
  12710. function forward$11(p) {
  12711. /* Forward equations
  12712. -----------------*/
  12713. var x, y;
  12714. var lam = p.x;
  12715. var phi = p.y;
  12716. lam = adjust_lon(lam - this.long0);
  12717. if (this.sphere) {
  12718. x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));
  12719. y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);
  12720. } else {
  12721. //ellipsoid
  12722. var sinphi = Math.sin(phi);
  12723. var cosphi = Math.cos(phi);
  12724. var nl = gN(this.a, this.e, sinphi);
  12725. var tl = Math.tan(phi) * Math.tan(phi);
  12726. var al = lam * Math.cos(phi);
  12727. var asq = al * al;
  12728. var cl = this.es * cosphi * cosphi / (1 - this.es);
  12729. var ml = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);
  12730. x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));
  12731. y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);
  12732. }
  12733. p.x = x + this.x0;
  12734. p.y = y + this.y0;
  12735. return p;
  12736. }
  12737. /* Inverse equations
  12738. -----------------*/
  12739. function inverse$11(p) {
  12740. p.x -= this.x0;
  12741. p.y -= this.y0;
  12742. var x = p.x / this.a;
  12743. var y = p.y / this.a;
  12744. var phi, lam;
  12745. if (this.sphere) {
  12746. var dd = y + this.lat0;
  12747. phi = Math.asin(Math.sin(dd) * Math.cos(x));
  12748. lam = Math.atan2(Math.tan(x), Math.cos(dd));
  12749. } else {
  12750. /* ellipsoid */
  12751. var ml1 = this.ml0 / this.a + y;
  12752. var phi1 = imlfn(ml1, this.e0, this.e1, this.e2, this.e3);
  12753. if (Math.abs(Math.abs(phi1) - HALF_PI) <= EPSLN) {
  12754. p.x = this.long0;
  12755. p.y = HALF_PI;
  12756. if (y < 0) {
  12757. p.y *= -1;
  12758. }
  12759. return p;
  12760. }
  12761. var nl1 = gN(this.a, this.e, Math.sin(phi1));
  12762. var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);
  12763. var tl1 = Math.pow(Math.tan(phi1), 2);
  12764. var dl = x * this.a / nl1;
  12765. var dsq = dl * dl;
  12766. phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);
  12767. lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);
  12768. }
  12769. p.x = adjust_lon(lam + this.long0);
  12770. p.y = adjust_lat(phi);
  12771. return p;
  12772. }
  12773. var names$13 = ["Cassini", "Cassini_Soldner", "cass"];
  12774. var cass = {
  12775. init: init$12,
  12776. forward: forward$11,
  12777. inverse: inverse$11,
  12778. names: names$13
  12779. };
  12780. var qsfnz = function qsfnz(eccent, sinphi) {
  12781. var con;
  12782. if (eccent > 1.0e-7) {
  12783. con = eccent * sinphi;
  12784. return (1 - eccent * eccent) * (sinphi / (1 - con * con) - 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  12785. } else {
  12786. return 2 * sinphi;
  12787. }
  12788. };
  12789. /*
  12790. reference
  12791. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
  12792. The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
  12793. */
  12794. var S_POLE = 1;
  12795. var N_POLE = 2;
  12796. var EQUIT = 3;
  12797. var OBLIQ = 4;
  12798. /* Initialize the Lambert Azimuthal Equal Area projection
  12799. ------------------------------------------------------*/
  12800. function init$13() {
  12801. var t = Math.abs(this.lat0);
  12802. if (Math.abs(t - HALF_PI) < EPSLN) {
  12803. this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;
  12804. } else if (Math.abs(t) < EPSLN) {
  12805. this.mode = this.EQUIT;
  12806. } else {
  12807. this.mode = this.OBLIQ;
  12808. }
  12809. if (this.es > 0) {
  12810. var sinphi;
  12811. this.qp = qsfnz(this.e, 1);
  12812. this.mmf = 0.5 / (1 - this.es);
  12813. this.apa = authset(this.es);
  12814. switch (this.mode) {
  12815. case this.N_POLE:
  12816. this.dd = 1;
  12817. break;
  12818. case this.S_POLE:
  12819. this.dd = 1;
  12820. break;
  12821. case this.EQUIT:
  12822. this.rq = Math.sqrt(0.5 * this.qp);
  12823. this.dd = 1 / this.rq;
  12824. this.xmf = 1;
  12825. this.ymf = 0.5 * this.qp;
  12826. break;
  12827. case this.OBLIQ:
  12828. this.rq = Math.sqrt(0.5 * this.qp);
  12829. sinphi = Math.sin(this.lat0);
  12830. this.sinb1 = qsfnz(this.e, sinphi) / this.qp;
  12831. this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);
  12832. this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);
  12833. this.ymf = (this.xmf = this.rq) / this.dd;
  12834. this.xmf *= this.dd;
  12835. break;
  12836. }
  12837. } else {
  12838. if (this.mode === this.OBLIQ) {
  12839. this.sinph0 = Math.sin(this.lat0);
  12840. this.cosph0 = Math.cos(this.lat0);
  12841. }
  12842. }
  12843. }
  12844. /* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y
  12845. -----------------------------------------------------------------------*/
  12846. function forward$12(p) {
  12847. /* Forward equations
  12848. -----------------*/
  12849. var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;
  12850. var lam = p.x;
  12851. var phi = p.y;
  12852. lam = adjust_lon(lam - this.long0);
  12853. if (this.sphere) {
  12854. sinphi = Math.sin(phi);
  12855. cosphi = Math.cos(phi);
  12856. coslam = Math.cos(lam);
  12857. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  12858. y = this.mode === this.EQUIT ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;
  12859. if (y <= EPSLN) {
  12860. return null;
  12861. }
  12862. y = Math.sqrt(2 / y);
  12863. x = y * cosphi * Math.sin(lam);
  12864. y *= this.mode === this.EQUIT ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;
  12865. } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
  12866. if (this.mode === this.N_POLE) {
  12867. coslam = -coslam;
  12868. }
  12869. if (Math.abs(phi + this.lat0) < EPSLN) {
  12870. return null;
  12871. }
  12872. y = FORTPI - phi * 0.5;
  12873. y = 2 * (this.mode === this.S_POLE ? Math.cos(y) : Math.sin(y));
  12874. x = y * Math.sin(lam);
  12875. y *= coslam;
  12876. }
  12877. } else {
  12878. sinb = 0;
  12879. cosb = 0;
  12880. b = 0;
  12881. coslam = Math.cos(lam);
  12882. sinlam = Math.sin(lam);
  12883. sinphi = Math.sin(phi);
  12884. q = qsfnz(this.e, sinphi);
  12885. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  12886. sinb = q / this.qp;
  12887. cosb = Math.sqrt(1 - sinb * sinb);
  12888. }
  12889. switch (this.mode) {
  12890. case this.OBLIQ:
  12891. b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;
  12892. break;
  12893. case this.EQUIT:
  12894. b = 1 + cosb * coslam;
  12895. break;
  12896. case this.N_POLE:
  12897. b = HALF_PI + phi;
  12898. q = this.qp - q;
  12899. break;
  12900. case this.S_POLE:
  12901. b = phi - HALF_PI;
  12902. q = this.qp + q;
  12903. break;
  12904. }
  12905. if (Math.abs(b) < EPSLN) {
  12906. return null;
  12907. }
  12908. switch (this.mode) {
  12909. case this.OBLIQ:
  12910. case this.EQUIT:
  12911. b = Math.sqrt(2 / b);
  12912. if (this.mode === this.OBLIQ) {
  12913. y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);
  12914. } else {
  12915. y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;
  12916. }
  12917. x = this.xmf * b * cosb * sinlam;
  12918. break;
  12919. case this.N_POLE:
  12920. case this.S_POLE:
  12921. if (q >= 0) {
  12922. x = (b = Math.sqrt(q)) * sinlam;
  12923. y = coslam * (this.mode === this.S_POLE ? b : -b);
  12924. } else {
  12925. x = y = 0;
  12926. }
  12927. break;
  12928. }
  12929. }
  12930. p.x = this.a * x + this.x0;
  12931. p.y = this.a * y + this.y0;
  12932. return p;
  12933. }
  12934. /* Inverse equations
  12935. -----------------*/
  12936. function inverse$12(p) {
  12937. p.x -= this.x0;
  12938. p.y -= this.y0;
  12939. var x = p.x / this.a;
  12940. var y = p.y / this.a;
  12941. var lam, phi, cCe, sCe, q, rho, ab;
  12942. if (this.sphere) {
  12943. var cosz = 0,
  12944. rh,
  12945. sinz = 0;
  12946. rh = Math.sqrt(x * x + y * y);
  12947. phi = rh * 0.5;
  12948. if (phi > 1) {
  12949. return null;
  12950. }
  12951. phi = 2 * Math.asin(phi);
  12952. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  12953. sinz = Math.sin(phi);
  12954. cosz = Math.cos(phi);
  12955. }
  12956. switch (this.mode) {
  12957. case this.EQUIT:
  12958. phi = Math.abs(rh) <= EPSLN ? 0 : Math.asin(y * sinz / rh);
  12959. x *= sinz;
  12960. y = cosz * rh;
  12961. break;
  12962. case this.OBLIQ:
  12963. phi = Math.abs(rh) <= EPSLN ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);
  12964. x *= sinz * this.cosph0;
  12965. y = (cosz - Math.sin(phi) * this.sinph0) * rh;
  12966. break;
  12967. case this.N_POLE:
  12968. y = -y;
  12969. phi = HALF_PI - phi;
  12970. break;
  12971. case this.S_POLE:
  12972. phi -= HALF_PI;
  12973. break;
  12974. }
  12975. lam = y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ) ? 0 : Math.atan2(x, y);
  12976. } else {
  12977. ab = 0;
  12978. if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {
  12979. x /= this.dd;
  12980. y *= this.dd;
  12981. rho = Math.sqrt(x * x + y * y);
  12982. if (rho < EPSLN) {
  12983. p.x = this.long0;
  12984. p.y = this.lat0;
  12985. return p;
  12986. }
  12987. sCe = 2 * Math.asin(0.5 * rho / this.rq);
  12988. cCe = Math.cos(sCe);
  12989. x *= sCe = Math.sin(sCe);
  12990. if (this.mode === this.OBLIQ) {
  12991. ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;
  12992. q = this.qp * ab;
  12993. y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;
  12994. } else {
  12995. ab = y * sCe / rho;
  12996. q = this.qp * ab;
  12997. y = rho * cCe;
  12998. }
  12999. } else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {
  13000. if (this.mode === this.N_POLE) {
  13001. y = -y;
  13002. }
  13003. q = x * x + y * y;
  13004. if (!q) {
  13005. p.x = this.long0;
  13006. p.y = this.lat0;
  13007. return p;
  13008. }
  13009. ab = 1 - q / this.qp;
  13010. if (this.mode === this.S_POLE) {
  13011. ab = -ab;
  13012. }
  13013. }
  13014. lam = Math.atan2(x, y);
  13015. phi = authlat(Math.asin(ab), this.apa);
  13016. }
  13017. p.x = adjust_lon(this.long0 + lam);
  13018. p.y = phi;
  13019. return p;
  13020. }
  13021. /* determine latitude from authalic latitude */
  13022. var P00 = 0.33333333333333333333;
  13023. var P01 = 0.17222222222222222222;
  13024. var P02 = 0.10257936507936507936;
  13025. var P10 = 0.06388888888888888888;
  13026. var P11 = 0.06640211640211640211;
  13027. var P20 = 0.01641501294219154443;
  13028. function authset(es) {
  13029. var t;
  13030. var APA = [];
  13031. APA[0] = es * P00;
  13032. t = es * es;
  13033. APA[0] += t * P01;
  13034. APA[1] = t * P10;
  13035. t *= es;
  13036. APA[0] += t * P02;
  13037. APA[1] += t * P11;
  13038. APA[2] = t * P20;
  13039. return APA;
  13040. }
  13041. function authlat(beta, APA) {
  13042. var t = beta + beta;
  13043. return beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t);
  13044. }
  13045. var names$14 = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
  13046. var laea = {
  13047. init: init$13,
  13048. forward: forward$12,
  13049. inverse: inverse$12,
  13050. names: names$14,
  13051. S_POLE: S_POLE,
  13052. N_POLE: N_POLE,
  13053. EQUIT: EQUIT,
  13054. OBLIQ: OBLIQ
  13055. };
  13056. var asinz = function asinz(x) {
  13057. if (Math.abs(x) > 1) {
  13058. x = x > 1 ? 1 : -1;
  13059. }
  13060. return Math.asin(x);
  13061. };
  13062. function init$14() {
  13063. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  13064. return;
  13065. }
  13066. this.temp = this.b / this.a;
  13067. this.es = 1 - Math.pow(this.temp, 2);
  13068. this.e3 = Math.sqrt(this.es);
  13069. this.sin_po = Math.sin(this.lat1);
  13070. this.cos_po = Math.cos(this.lat1);
  13071. this.t1 = this.sin_po;
  13072. this.con = this.sin_po;
  13073. this.ms1 = msfnz(this.e3, this.sin_po, this.cos_po);
  13074. this.qs1 = qsfnz(this.e3, this.sin_po);
  13075. this.sin_po = Math.sin(this.lat2);
  13076. this.cos_po = Math.cos(this.lat2);
  13077. this.t2 = this.sin_po;
  13078. this.ms2 = msfnz(this.e3, this.sin_po, this.cos_po);
  13079. this.qs2 = qsfnz(this.e3, this.sin_po);
  13080. this.sin_po = Math.sin(this.lat0);
  13081. this.cos_po = Math.cos(this.lat0);
  13082. this.t3 = this.sin_po;
  13083. this.qs0 = qsfnz(this.e3, this.sin_po);
  13084. if (Math.abs(this.lat1 - this.lat2) > EPSLN) {
  13085. this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);
  13086. } else {
  13087. this.ns0 = this.con;
  13088. }
  13089. this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;
  13090. this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;
  13091. }
  13092. /* Albers Conical Equal Area forward equations--mapping lat,long to x,y
  13093. -------------------------------------------------------------------*/
  13094. function forward$13(p) {
  13095. var lon = p.x;
  13096. var lat = p.y;
  13097. this.sin_phi = Math.sin(lat);
  13098. this.cos_phi = Math.cos(lat);
  13099. var qs = qsfnz(this.e3, this.sin_phi);
  13100. var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;
  13101. var theta = this.ns0 * adjust_lon(lon - this.long0);
  13102. var x = rh1 * Math.sin(theta) + this.x0;
  13103. var y = this.rh - rh1 * Math.cos(theta) + this.y0;
  13104. p.x = x;
  13105. p.y = y;
  13106. return p;
  13107. }
  13108. function inverse$13(p) {
  13109. var rh1, qs, con, theta, lon, lat;
  13110. p.x -= this.x0;
  13111. p.y = this.rh - p.y + this.y0;
  13112. if (this.ns0 >= 0) {
  13113. rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
  13114. con = 1;
  13115. } else {
  13116. rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
  13117. con = -1;
  13118. }
  13119. theta = 0;
  13120. if (rh1 !== 0) {
  13121. theta = Math.atan2(con * p.x, con * p.y);
  13122. }
  13123. con = rh1 * this.ns0 / this.a;
  13124. if (this.sphere) {
  13125. lat = Math.asin((this.c - con * con) / (2 * this.ns0));
  13126. } else {
  13127. qs = (this.c - con * con) / this.ns0;
  13128. lat = this.phi1z(this.e3, qs);
  13129. }
  13130. lon = adjust_lon(theta / this.ns0 + this.long0);
  13131. p.x = lon;
  13132. p.y = lat;
  13133. return p;
  13134. }
  13135. /* Function to compute phi1, the latitude for the inverse of the
  13136. Albers Conical Equal-Area projection.
  13137. -------------------------------------------*/
  13138. function phi1z(eccent, qs) {
  13139. var sinphi, cosphi, con, com, dphi;
  13140. var phi = asinz(0.5 * qs);
  13141. if (eccent < EPSLN) {
  13142. return phi;
  13143. }
  13144. var eccnts = eccent * eccent;
  13145. for (var i = 1; i <= 25; i++) {
  13146. sinphi = Math.sin(phi);
  13147. cosphi = Math.cos(phi);
  13148. con = eccent * sinphi;
  13149. com = 1 - con * con;
  13150. dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  13151. phi = phi + dphi;
  13152. if (Math.abs(dphi) <= 1e-7) {
  13153. return phi;
  13154. }
  13155. }
  13156. return null;
  13157. }
  13158. var names$15 = ["Albers_Conic_Equal_Area", "Albers", "aea"];
  13159. var aea = {
  13160. init: init$14,
  13161. forward: forward$13,
  13162. inverse: inverse$13,
  13163. names: names$15,
  13164. phi1z: phi1z
  13165. };
  13166. /*
  13167. reference:
  13168. Wolfram Mathworld "Gnomonic Projection"
  13169. http://mathworld.wolfram.com/GnomonicProjection.html
  13170. Accessed: 12th November 2009
  13171. */
  13172. function init$15() {
  13173. /* Place parameters in static storage for common use
  13174. -------------------------------------------------*/
  13175. this.sin_p14 = Math.sin(this.lat0);
  13176. this.cos_p14 = Math.cos(this.lat0);
  13177. // Approximation for projecting points to the horizon (infinity)
  13178. this.infinity_dist = 1000 * this.a;
  13179. this.rc = 1;
  13180. }
  13181. /* Gnomonic forward equations--mapping lat,long to x,y
  13182. ---------------------------------------------------*/
  13183. function forward$14(p) {
  13184. var sinphi, cosphi; /* sin and cos value */
  13185. var dlon; /* delta longitude value */
  13186. var coslon; /* cos of longitude */
  13187. var ksp; /* scale factor */
  13188. var g;
  13189. var x, y;
  13190. var lon = p.x;
  13191. var lat = p.y;
  13192. /* Forward equations
  13193. -----------------*/
  13194. dlon = adjust_lon(lon - this.long0);
  13195. sinphi = Math.sin(lat);
  13196. cosphi = Math.cos(lat);
  13197. coslon = Math.cos(dlon);
  13198. g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
  13199. ksp = 1;
  13200. if (g > 0 || Math.abs(g) <= EPSLN) {
  13201. x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;
  13202. y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;
  13203. } else {
  13204. // Point is in the opposing hemisphere and is unprojectable
  13205. // We still need to return a reasonable point, so we project
  13206. // to infinity, on a bearing
  13207. // equivalent to the northern hemisphere equivalent
  13208. // This is a reasonable approximation for short shapes and lines that
  13209. // straddle the horizon.
  13210. x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);
  13211. y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
  13212. }
  13213. p.x = x;
  13214. p.y = y;
  13215. return p;
  13216. }
  13217. function inverse$14(p) {
  13218. var rh; /* Rho */
  13219. var sinc, cosc;
  13220. var c;
  13221. var lon, lat;
  13222. /* Inverse equations
  13223. -----------------*/
  13224. p.x = (p.x - this.x0) / this.a;
  13225. p.y = (p.y - this.y0) / this.a;
  13226. p.x /= this.k0;
  13227. p.y /= this.k0;
  13228. if (rh = Math.sqrt(p.x * p.x + p.y * p.y)) {
  13229. c = Math.atan2(rh, this.rc);
  13230. sinc = Math.sin(c);
  13231. cosc = Math.cos(c);
  13232. lat = asinz(cosc * this.sin_p14 + p.y * sinc * this.cos_p14 / rh);
  13233. lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);
  13234. lon = adjust_lon(this.long0 + lon);
  13235. } else {
  13236. lat = this.phic0;
  13237. lon = 0;
  13238. }
  13239. p.x = lon;
  13240. p.y = lat;
  13241. return p;
  13242. }
  13243. var names$16 = ["gnom"];
  13244. var gnom = {
  13245. init: init$15,
  13246. forward: forward$14,
  13247. inverse: inverse$14,
  13248. names: names$16
  13249. };
  13250. var iqsfnz = function iqsfnz(eccent, q) {
  13251. var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));
  13252. if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {
  13253. if (q < 0) {
  13254. return -1 * HALF_PI;
  13255. } else {
  13256. return HALF_PI;
  13257. }
  13258. }
  13259. //var phi = 0.5* q/(1-eccent*eccent);
  13260. var phi = Math.asin(0.5 * q);
  13261. var dphi;
  13262. var sin_phi;
  13263. var cos_phi;
  13264. var con;
  13265. for (var i = 0; i < 30; i++) {
  13266. sin_phi = Math.sin(phi);
  13267. cos_phi = Math.cos(phi);
  13268. con = eccent * sin_phi;
  13269. dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con)));
  13270. phi += dphi;
  13271. if (Math.abs(dphi) <= 0.0000000001) {
  13272. return phi;
  13273. }
  13274. }
  13275. //console.log("IQSFN-CONV:Latitude failed to converge after 30 iterations");
  13276. return NaN;
  13277. };
  13278. /*
  13279. reference:
  13280. "Cartographic Projection Procedures for the UNIX Environment-
  13281. A User's Manual" by Gerald I. Evenden,
  13282. USGS Open File Report 90-284and Release 4 Interim Reports (2003)
  13283. */
  13284. function init$16() {
  13285. //no-op
  13286. if (!this.sphere) {
  13287. this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
  13288. }
  13289. }
  13290. /* Cylindrical Equal Area forward equations--mapping lat,long to x,y
  13291. ------------------------------------------------------------*/
  13292. function forward$15(p) {
  13293. var lon = p.x;
  13294. var lat = p.y;
  13295. var x, y;
  13296. /* Forward equations
  13297. -----------------*/
  13298. var dlon = adjust_lon(lon - this.long0);
  13299. if (this.sphere) {
  13300. x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
  13301. y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
  13302. } else {
  13303. var qs = qsfnz(this.e, Math.sin(lat));
  13304. x = this.x0 + this.a * this.k0 * dlon;
  13305. y = this.y0 + this.a * qs * 0.5 / this.k0;
  13306. }
  13307. p.x = x;
  13308. p.y = y;
  13309. return p;
  13310. }
  13311. /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long
  13312. ------------------------------------------------------------*/
  13313. function inverse$15(p) {
  13314. p.x -= this.x0;
  13315. p.y -= this.y0;
  13316. var lon, lat;
  13317. if (this.sphere) {
  13318. lon = adjust_lon(this.long0 + p.x / this.a / Math.cos(this.lat_ts));
  13319. lat = Math.asin(p.y / this.a * Math.cos(this.lat_ts));
  13320. } else {
  13321. lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);
  13322. lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));
  13323. }
  13324. p.x = lon;
  13325. p.y = lat;
  13326. return p;
  13327. }
  13328. var names$17 = ["cea"];
  13329. var cea = {
  13330. init: init$16,
  13331. forward: forward$15,
  13332. inverse: inverse$15,
  13333. names: names$17
  13334. };
  13335. function init$17() {
  13336. this.x0 = this.x0 || 0;
  13337. this.y0 = this.y0 || 0;
  13338. this.lat0 = this.lat0 || 0;
  13339. this.long0 = this.long0 || 0;
  13340. this.lat_ts = this.lat_ts || 0;
  13341. this.title = this.title || "Equidistant Cylindrical (Plate Carre)";
  13342. this.rc = Math.cos(this.lat_ts);
  13343. }
  13344. // forward equations--mapping lat,long to x,y
  13345. // -----------------------------------------------------------------
  13346. function forward$16(p) {
  13347. var lon = p.x;
  13348. var lat = p.y;
  13349. var dlon = adjust_lon(lon - this.long0);
  13350. var dlat = adjust_lat(lat - this.lat0);
  13351. p.x = this.x0 + this.a * dlon * this.rc;
  13352. p.y = this.y0 + this.a * dlat;
  13353. return p;
  13354. }
  13355. // inverse equations--mapping x,y to lat/long
  13356. // -----------------------------------------------------------------
  13357. function inverse$16(p) {
  13358. var x = p.x;
  13359. var y = p.y;
  13360. p.x = adjust_lon(this.long0 + (x - this.x0) / (this.a * this.rc));
  13361. p.y = adjust_lat(this.lat0 + (y - this.y0) / this.a);
  13362. return p;
  13363. }
  13364. var names$18 = ["Equirectangular", "Equidistant_Cylindrical", "eqc"];
  13365. var eqc = {
  13366. init: init$17,
  13367. forward: forward$16,
  13368. inverse: inverse$16,
  13369. names: names$18
  13370. };
  13371. var MAX_ITER$2 = 20;
  13372. function init$18() {
  13373. /* Place parameters in static storage for common use
  13374. -------------------------------------------------*/
  13375. this.temp = this.b / this.a;
  13376. this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles
  13377. this.e = Math.sqrt(this.es);
  13378. this.e0 = e0fn(this.es);
  13379. this.e1 = e1fn(this.es);
  13380. this.e2 = e2fn(this.es);
  13381. this.e3 = e3fn(this.es);
  13382. this.ml0 = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas
  13383. }
  13384. /* Polyconic forward equations--mapping lat,long to x,y
  13385. ---------------------------------------------------*/
  13386. function forward$17(p) {
  13387. var lon = p.x;
  13388. var lat = p.y;
  13389. var x, y, el;
  13390. var dlon = adjust_lon(lon - this.long0);
  13391. el = dlon * Math.sin(lat);
  13392. if (this.sphere) {
  13393. if (Math.abs(lat) <= EPSLN) {
  13394. x = this.a * dlon;
  13395. y = -1 * this.a * this.lat0;
  13396. } else {
  13397. x = this.a * Math.sin(el) / Math.tan(lat);
  13398. y = this.a * (adjust_lat(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));
  13399. }
  13400. } else {
  13401. if (Math.abs(lat) <= EPSLN) {
  13402. x = this.a * dlon;
  13403. y = -1 * this.ml0;
  13404. } else {
  13405. var nl = gN(this.a, this.e, Math.sin(lat)) / Math.tan(lat);
  13406. x = nl * Math.sin(el);
  13407. y = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));
  13408. }
  13409. }
  13410. p.x = x + this.x0;
  13411. p.y = y + this.y0;
  13412. return p;
  13413. }
  13414. /* Inverse equations
  13415. -----------------*/
  13416. function inverse$17(p) {
  13417. var lon, lat, x, y, i;
  13418. var al, bl;
  13419. var phi, dphi;
  13420. x = p.x - this.x0;
  13421. y = p.y - this.y0;
  13422. if (this.sphere) {
  13423. if (Math.abs(y + this.a * this.lat0) <= EPSLN) {
  13424. lon = adjust_lon(x / this.a + this.long0);
  13425. lat = 0;
  13426. } else {
  13427. al = this.lat0 + y / this.a;
  13428. bl = x * x / this.a / this.a + al * al;
  13429. phi = al;
  13430. var tanphi;
  13431. for (i = MAX_ITER$2; i; --i) {
  13432. tanphi = Math.tan(phi);
  13433. dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);
  13434. phi += dphi;
  13435. if (Math.abs(dphi) <= EPSLN) {
  13436. lat = phi;
  13437. break;
  13438. }
  13439. }
  13440. lon = adjust_lon(this.long0 + Math.asin(x * Math.tan(phi) / this.a) / Math.sin(lat));
  13441. }
  13442. } else {
  13443. if (Math.abs(y + this.ml0) <= EPSLN) {
  13444. lat = 0;
  13445. lon = adjust_lon(this.long0 + x / this.a);
  13446. } else {
  13447. al = (this.ml0 + y) / this.a;
  13448. bl = x * x / this.a / this.a + al * al;
  13449. phi = al;
  13450. var cl, mln, mlnp, ma;
  13451. var con;
  13452. for (i = MAX_ITER$2; i; --i) {
  13453. con = this.e * Math.sin(phi);
  13454. cl = Math.sqrt(1 - con * con) * Math.tan(phi);
  13455. mln = this.a * mlfn(this.e0, this.e1, this.e2, this.e3, phi);
  13456. mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);
  13457. ma = mln / this.a;
  13458. dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp);
  13459. phi -= dphi;
  13460. if (Math.abs(dphi) <= EPSLN) {
  13461. lat = phi;
  13462. break;
  13463. }
  13464. }
  13465. //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);
  13466. cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);
  13467. lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));
  13468. }
  13469. }
  13470. p.x = lon;
  13471. p.y = lat;
  13472. return p;
  13473. }
  13474. var names$19 = ["Polyconic", "poly"];
  13475. var poly = {
  13476. init: init$18,
  13477. forward: forward$17,
  13478. inverse: inverse$17,
  13479. names: names$19
  13480. };
  13481. /*
  13482. reference
  13483. Department of Land and Survey Technical Circular 1973/32
  13484. http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf
  13485. OSG Technical Report 4.1
  13486. http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf
  13487. */
  13488. /**
  13489. * iterations: Number of iterations to refine inverse transform.
  13490. * 0 -> km accuracy
  13491. * 1 -> m accuracy -- suitable for most mapping applications
  13492. * 2 -> mm accuracy
  13493. */
  13494. function init$19() {
  13495. this.A = [];
  13496. this.A[1] = 0.6399175073;
  13497. this.A[2] = -0.1358797613;
  13498. this.A[3] = 0.063294409;
  13499. this.A[4] = -0.02526853;
  13500. this.A[5] = 0.0117879;
  13501. this.A[6] = -0.0055161;
  13502. this.A[7] = 0.0026906;
  13503. this.A[8] = -0.001333;
  13504. this.A[9] = 0.00067;
  13505. this.A[10] = -0.00034;
  13506. this.B_re = [];
  13507. this.B_im = [];
  13508. this.B_re[1] = 0.7557853228;
  13509. this.B_im[1] = 0;
  13510. this.B_re[2] = 0.249204646;
  13511. this.B_im[2] = 0.003371507;
  13512. this.B_re[3] = -0.001541739;
  13513. this.B_im[3] = 0.041058560;
  13514. this.B_re[4] = -0.10162907;
  13515. this.B_im[4] = 0.01727609;
  13516. this.B_re[5] = -0.26623489;
  13517. this.B_im[5] = -0.36249218;
  13518. this.B_re[6] = -0.6870983;
  13519. this.B_im[6] = -1.1651967;
  13520. this.C_re = [];
  13521. this.C_im = [];
  13522. this.C_re[1] = 1.3231270439;
  13523. this.C_im[1] = 0;
  13524. this.C_re[2] = -0.577245789;
  13525. this.C_im[2] = -0.007809598;
  13526. this.C_re[3] = 0.508307513;
  13527. this.C_im[3] = -0.112208952;
  13528. this.C_re[4] = -0.15094762;
  13529. this.C_im[4] = 0.18200602;
  13530. this.C_re[5] = 1.01418179;
  13531. this.C_im[5] = 1.64497696;
  13532. this.C_re[6] = 1.9660549;
  13533. this.C_im[6] = 2.5127645;
  13534. this.D = [];
  13535. this.D[1] = 1.5627014243;
  13536. this.D[2] = 0.5185406398;
  13537. this.D[3] = -0.03333098;
  13538. this.D[4] = -0.1052906;
  13539. this.D[5] = -0.0368594;
  13540. this.D[6] = 0.007317;
  13541. this.D[7] = 0.01220;
  13542. this.D[8] = 0.00394;
  13543. this.D[9] = -0.0013;
  13544. }
  13545. /**
  13546. New Zealand Map Grid Forward - long/lat to x/y
  13547. long/lat in radians
  13548. */
  13549. function forward$18(p) {
  13550. var n;
  13551. var lon = p.x;
  13552. var lat = p.y;
  13553. var delta_lat = lat - this.lat0;
  13554. var delta_lon = lon - this.long0;
  13555. // 1. Calculate d_phi and d_psi ... // and d_lambda
  13556. // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.
  13557. var d_phi = delta_lat / SEC_TO_RAD * 1E-5;
  13558. var d_lambda = delta_lon;
  13559. var d_phi_n = 1; // d_phi^0
  13560. var d_psi = 0;
  13561. for (n = 1; n <= 10; n++) {
  13562. d_phi_n = d_phi_n * d_phi;
  13563. d_psi = d_psi + this.A[n] * d_phi_n;
  13564. }
  13565. // 2. Calculate theta
  13566. var th_re = d_psi;
  13567. var th_im = d_lambda;
  13568. // 3. Calculate z
  13569. var th_n_re = 1;
  13570. var th_n_im = 0; // theta^0
  13571. var th_n_re1;
  13572. var th_n_im1;
  13573. var z_re = 0;
  13574. var z_im = 0;
  13575. for (n = 1; n <= 6; n++) {
  13576. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  13577. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  13578. th_n_re = th_n_re1;
  13579. th_n_im = th_n_im1;
  13580. z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;
  13581. z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;
  13582. }
  13583. // 4. Calculate easting and northing
  13584. p.x = z_im * this.a + this.x0;
  13585. p.y = z_re * this.a + this.y0;
  13586. return p;
  13587. }
  13588. /**
  13589. New Zealand Map Grid Inverse - x/y to long/lat
  13590. */
  13591. function inverse$18(p) {
  13592. var n;
  13593. var x = p.x;
  13594. var y = p.y;
  13595. var delta_x = x - this.x0;
  13596. var delta_y = y - this.y0;
  13597. // 1. Calculate z
  13598. var z_re = delta_y / this.a;
  13599. var z_im = delta_x / this.a;
  13600. // 2a. Calculate theta - first approximation gives km accuracy
  13601. var z_n_re = 1;
  13602. var z_n_im = 0; // z^0
  13603. var z_n_re1;
  13604. var z_n_im1;
  13605. var th_re = 0;
  13606. var th_im = 0;
  13607. for (n = 1; n <= 6; n++) {
  13608. z_n_re1 = z_n_re * z_re - z_n_im * z_im;
  13609. z_n_im1 = z_n_im * z_re + z_n_re * z_im;
  13610. z_n_re = z_n_re1;
  13611. z_n_im = z_n_im1;
  13612. th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;
  13613. th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;
  13614. }
  13615. // 2b. Iterate to refine the accuracy of the calculation
  13616. // 0 iterations gives km accuracy
  13617. // 1 iteration gives m accuracy -- good enough for most mapping applications
  13618. // 2 iterations bives mm accuracy
  13619. for (var i = 0; i < this.iterations; i++) {
  13620. var th_n_re = th_re;
  13621. var th_n_im = th_im;
  13622. var th_n_re1;
  13623. var th_n_im1;
  13624. var num_re = z_re;
  13625. var num_im = z_im;
  13626. for (n = 2; n <= 6; n++) {
  13627. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  13628. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  13629. th_n_re = th_n_re1;
  13630. th_n_im = th_n_im1;
  13631. num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
  13632. num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
  13633. }
  13634. th_n_re = 1;
  13635. th_n_im = 0;
  13636. var den_re = this.B_re[1];
  13637. var den_im = this.B_im[1];
  13638. for (n = 2; n <= 6; n++) {
  13639. th_n_re1 = th_n_re * th_re - th_n_im * th_im;
  13640. th_n_im1 = th_n_im * th_re + th_n_re * th_im;
  13641. th_n_re = th_n_re1;
  13642. th_n_im = th_n_im1;
  13643. den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);
  13644. den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);
  13645. }
  13646. // Complex division
  13647. var den2 = den_re * den_re + den_im * den_im;
  13648. th_re = (num_re * den_re + num_im * den_im) / den2;
  13649. th_im = (num_im * den_re - num_re * den_im) / den2;
  13650. }
  13651. // 3. Calculate d_phi ... // and d_lambda
  13652. var d_psi = th_re;
  13653. var d_lambda = th_im;
  13654. var d_psi_n = 1; // d_psi^0
  13655. var d_phi = 0;
  13656. for (n = 1; n <= 9; n++) {
  13657. d_psi_n = d_psi_n * d_psi;
  13658. d_phi = d_phi + this.D[n] * d_psi_n;
  13659. }
  13660. // 4. Calculate latitude and longitude
  13661. // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.
  13662. var lat = this.lat0 + d_phi * SEC_TO_RAD * 1E5;
  13663. var lon = this.long0 + d_lambda;
  13664. p.x = lon;
  13665. p.y = lat;
  13666. return p;
  13667. }
  13668. var names$20 = ["New_Zealand_Map_Grid", "nzmg"];
  13669. var nzmg = {
  13670. init: init$19,
  13671. forward: forward$18,
  13672. inverse: inverse$18,
  13673. names: names$20
  13674. };
  13675. /*
  13676. reference
  13677. "New Equal-Area Map Projections for Noncircular Regions", John P. Snyder,
  13678. The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.
  13679. */
  13680. /* Initialize the Miller Cylindrical projection
  13681. -------------------------------------------*/
  13682. function init$20() {
  13683. //no-op
  13684. }
  13685. /* Miller Cylindrical forward equations--mapping lat,long to x,y
  13686. ------------------------------------------------------------*/
  13687. function forward$19(p) {
  13688. var lon = p.x;
  13689. var lat = p.y;
  13690. /* Forward equations
  13691. -----------------*/
  13692. var dlon = adjust_lon(lon - this.long0);
  13693. var x = this.x0 + this.a * dlon;
  13694. var y = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + lat / 2.5)) * 1.25;
  13695. p.x = x;
  13696. p.y = y;
  13697. return p;
  13698. }
  13699. /* Miller Cylindrical inverse equations--mapping x,y to lat/long
  13700. ------------------------------------------------------------*/
  13701. function inverse$19(p) {
  13702. p.x -= this.x0;
  13703. p.y -= this.y0;
  13704. var lon = adjust_lon(this.long0 + p.x / this.a);
  13705. var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);
  13706. p.x = lon;
  13707. p.y = lat;
  13708. return p;
  13709. }
  13710. var names$21 = ["Miller_Cylindrical", "mill"];
  13711. var mill = {
  13712. init: init$20,
  13713. forward: forward$19,
  13714. inverse: inverse$19,
  13715. names: names$21
  13716. };
  13717. var MAX_ITER$3 = 20;
  13718. function init$21() {
  13719. /* Place parameters in static storage for common use
  13720. -------------------------------------------------*/
  13721. if (!this.sphere) {
  13722. this.en = pj_enfn(this.es);
  13723. } else {
  13724. this.n = 1;
  13725. this.m = 0;
  13726. this.es = 0;
  13727. this.C_y = Math.sqrt((this.m + 1) / this.n);
  13728. this.C_x = this.C_y / (this.m + 1);
  13729. }
  13730. }
  13731. /* Sinusoidal forward equations--mapping lat,long to x,y
  13732. -----------------------------------------------------*/
  13733. function forward$20(p) {
  13734. var x, y;
  13735. var lon = p.x;
  13736. var lat = p.y;
  13737. /* Forward equations
  13738. -----------------*/
  13739. lon = adjust_lon(lon - this.long0);
  13740. if (this.sphere) {
  13741. if (!this.m) {
  13742. lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;
  13743. } else {
  13744. var k = this.n * Math.sin(lat);
  13745. for (var i = MAX_ITER$3; i; --i) {
  13746. var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));
  13747. lat -= V;
  13748. if (Math.abs(V) < EPSLN) {
  13749. break;
  13750. }
  13751. }
  13752. }
  13753. x = this.a * this.C_x * lon * (this.m + Math.cos(lat));
  13754. y = this.a * this.C_y * lat;
  13755. } else {
  13756. var s = Math.sin(lat);
  13757. var c = Math.cos(lat);
  13758. y = this.a * pj_mlfn(lat, s, c, this.en);
  13759. x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);
  13760. }
  13761. p.x = x;
  13762. p.y = y;
  13763. return p;
  13764. }
  13765. function inverse$20(p) {
  13766. var lat, temp, lon, s;
  13767. p.x -= this.x0;
  13768. lon = p.x / this.a;
  13769. p.y -= this.y0;
  13770. lat = p.y / this.a;
  13771. if (this.sphere) {
  13772. lat /= this.C_y;
  13773. lon = lon / (this.C_x * (this.m + Math.cos(lat)));
  13774. if (this.m) {
  13775. lat = asinz((this.m * lat + Math.sin(lat)) / this.n);
  13776. } else if (this.n !== 1) {
  13777. lat = asinz(Math.sin(lat) / this.n);
  13778. }
  13779. lon = adjust_lon(lon + this.long0);
  13780. lat = adjust_lat(lat);
  13781. } else {
  13782. lat = pj_inv_mlfn(p.y / this.a, this.es, this.en);
  13783. s = Math.abs(lat);
  13784. if (s < HALF_PI) {
  13785. s = Math.sin(lat);
  13786. temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));
  13787. //temp = this.long0 + p.x / (this.a * Math.cos(lat));
  13788. lon = adjust_lon(temp);
  13789. } else if (s - EPSLN < HALF_PI) {
  13790. lon = this.long0;
  13791. }
  13792. }
  13793. p.x = lon;
  13794. p.y = lat;
  13795. return p;
  13796. }
  13797. var names$22 = ["Sinusoidal", "sinu"];
  13798. var sinu = {
  13799. init: init$21,
  13800. forward: forward$20,
  13801. inverse: inverse$20,
  13802. names: names$22
  13803. };
  13804. function init$22() {}
  13805. /* Mollweide forward equations--mapping lat,long to x,y
  13806. ----------------------------------------------------*/
  13807. function forward$21(p) {
  13808. /* Forward equations
  13809. -----------------*/
  13810. var lon = p.x;
  13811. var lat = p.y;
  13812. var delta_lon = adjust_lon(lon - this.long0);
  13813. var theta = lat;
  13814. var con = Math.PI * Math.sin(lat);
  13815. /* Iterate using the Newton-Raphson method to find theta
  13816. -----------------------------------------------------*/
  13817. while (true) {
  13818. var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));
  13819. theta += delta_theta;
  13820. if (Math.abs(delta_theta) < EPSLN) {
  13821. break;
  13822. }
  13823. }
  13824. theta /= 2;
  13825. /* If the latitude is 90 deg, force the x coordinate to be "0 + false easting"
  13826. this is done here because of precision problems with "cos(theta)"
  13827. --------------------------------------------------------------------------*/
  13828. if (Math.PI / 2 - Math.abs(lat) < EPSLN) {
  13829. delta_lon = 0;
  13830. }
  13831. var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;
  13832. var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;
  13833. p.x = x;
  13834. p.y = y;
  13835. return p;
  13836. }
  13837. function inverse$21(p) {
  13838. var theta;
  13839. var arg;
  13840. /* Inverse equations
  13841. -----------------*/
  13842. p.x -= this.x0;
  13843. p.y -= this.y0;
  13844. arg = p.y / (1.4142135623731 * this.a);
  13845. /* Because of division by zero problems, 'arg' can not be 1. Therefore
  13846. a number very close to one is used instead.
  13847. -------------------------------------------------------------------*/
  13848. if (Math.abs(arg) > 0.999999999999) {
  13849. arg = 0.999999999999;
  13850. }
  13851. theta = Math.asin(arg);
  13852. var lon = adjust_lon(this.long0 + p.x / (0.900316316158 * this.a * Math.cos(theta)));
  13853. if (lon < -Math.PI) {
  13854. lon = -Math.PI;
  13855. }
  13856. if (lon > Math.PI) {
  13857. lon = Math.PI;
  13858. }
  13859. arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;
  13860. if (Math.abs(arg) > 1) {
  13861. arg = 1;
  13862. }
  13863. var lat = Math.asin(arg);
  13864. p.x = lon;
  13865. p.y = lat;
  13866. return p;
  13867. }
  13868. var names$23 = ["Mollweide", "moll"];
  13869. var moll = {
  13870. init: init$22,
  13871. forward: forward$21,
  13872. inverse: inverse$21,
  13873. names: names$23
  13874. };
  13875. function init$23() {
  13876. /* Place parameters in static storage for common use
  13877. -------------------------------------------------*/
  13878. // Standard Parallels cannot be equal and on opposite sides of the equator
  13879. if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
  13880. return;
  13881. }
  13882. this.lat2 = this.lat2 || this.lat1;
  13883. this.temp = this.b / this.a;
  13884. this.es = 1 - Math.pow(this.temp, 2);
  13885. this.e = Math.sqrt(this.es);
  13886. this.e0 = e0fn(this.es);
  13887. this.e1 = e1fn(this.es);
  13888. this.e2 = e2fn(this.es);
  13889. this.e3 = e3fn(this.es);
  13890. this.sinphi = Math.sin(this.lat1);
  13891. this.cosphi = Math.cos(this.lat1);
  13892. this.ms1 = msfnz(this.e, this.sinphi, this.cosphi);
  13893. this.ml1 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat1);
  13894. if (Math.abs(this.lat1 - this.lat2) < EPSLN) {
  13895. this.ns = this.sinphi;
  13896. } else {
  13897. this.sinphi = Math.sin(this.lat2);
  13898. this.cosphi = Math.cos(this.lat2);
  13899. this.ms2 = msfnz(this.e, this.sinphi, this.cosphi);
  13900. this.ml2 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat2);
  13901. this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);
  13902. }
  13903. this.g = this.ml1 + this.ms1 / this.ns;
  13904. this.ml0 = mlfn(this.e0, this.e1, this.e2, this.e3, this.lat0);
  13905. this.rh = this.a * (this.g - this.ml0);
  13906. }
  13907. /* Equidistant Conic forward equations--mapping lat,long to x,y
  13908. -----------------------------------------------------------*/
  13909. function forward$22(p) {
  13910. var lon = p.x;
  13911. var lat = p.y;
  13912. var rh1;
  13913. /* Forward equations
  13914. -----------------*/
  13915. if (this.sphere) {
  13916. rh1 = this.a * (this.g - lat);
  13917. } else {
  13918. var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat);
  13919. rh1 = this.a * (this.g - ml);
  13920. }
  13921. var theta = this.ns * adjust_lon(lon - this.long0);
  13922. var x = this.x0 + rh1 * Math.sin(theta);
  13923. var y = this.y0 + this.rh - rh1 * Math.cos(theta);
  13924. p.x = x;
  13925. p.y = y;
  13926. return p;
  13927. }
  13928. /* Inverse equations
  13929. -----------------*/
  13930. function inverse$22(p) {
  13931. p.x -= this.x0;
  13932. p.y = this.rh - p.y + this.y0;
  13933. var con, rh1, lat, lon;
  13934. if (this.ns >= 0) {
  13935. rh1 = Math.sqrt(p.x * p.x + p.y * p.y);
  13936. con = 1;
  13937. } else {
  13938. rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);
  13939. con = -1;
  13940. }
  13941. var theta = 0;
  13942. if (rh1 !== 0) {
  13943. theta = Math.atan2(con * p.x, con * p.y);
  13944. }
  13945. if (this.sphere) {
  13946. lon = adjust_lon(this.long0 + theta / this.ns);
  13947. lat = adjust_lat(this.g - rh1 / this.a);
  13948. p.x = lon;
  13949. p.y = lat;
  13950. return p;
  13951. } else {
  13952. var ml = this.g - rh1 / this.a;
  13953. lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3);
  13954. lon = adjust_lon(this.long0 + theta / this.ns);
  13955. p.x = lon;
  13956. p.y = lat;
  13957. return p;
  13958. }
  13959. }
  13960. var names$24 = ["Equidistant_Conic", "eqdc"];
  13961. var eqdc = {
  13962. init: init$23,
  13963. forward: forward$22,
  13964. inverse: inverse$22,
  13965. names: names$24
  13966. };
  13967. /* Initialize the Van Der Grinten projection
  13968. ----------------------------------------*/
  13969. function init$24() {
  13970. //this.R = 6370997; //Radius of earth
  13971. this.R = this.a;
  13972. }
  13973. function forward$23(p) {
  13974. var lon = p.x;
  13975. var lat = p.y;
  13976. /* Forward equations
  13977. -----------------*/
  13978. var dlon = adjust_lon(lon - this.long0);
  13979. var x, y;
  13980. if (Math.abs(lat) <= EPSLN) {
  13981. x = this.x0 + this.R * dlon;
  13982. y = this.y0;
  13983. }
  13984. var theta = asinz(2 * Math.abs(lat / Math.PI));
  13985. if (Math.abs(dlon) <= EPSLN || Math.abs(Math.abs(lat) - HALF_PI) <= EPSLN) {
  13986. x = this.x0;
  13987. if (lat >= 0) {
  13988. y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);
  13989. } else {
  13990. y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);
  13991. }
  13992. // return(OK);
  13993. }
  13994. var al = 0.5 * Math.abs(Math.PI / dlon - dlon / Math.PI);
  13995. var asq = al * al;
  13996. var sinth = Math.sin(theta);
  13997. var costh = Math.cos(theta);
  13998. var g = costh / (sinth + costh - 1);
  13999. var gsq = g * g;
  14000. var m = g * (2 / sinth - 1);
  14001. var msq = m * m;
  14002. var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);
  14003. if (dlon < 0) {
  14004. con = -con;
  14005. }
  14006. x = this.x0 + con;
  14007. //con = Math.abs(con / (Math.PI * this.R));
  14008. var q = asq + g;
  14009. con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);
  14010. if (lat >= 0) {
  14011. //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);
  14012. y = this.y0 + con;
  14013. } else {
  14014. //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);
  14015. y = this.y0 - con;
  14016. }
  14017. p.x = x;
  14018. p.y = y;
  14019. return p;
  14020. }
  14021. /* Van Der Grinten inverse equations--mapping x,y to lat/long
  14022. ---------------------------------------------------------*/
  14023. function inverse$23(p) {
  14024. var lon, lat;
  14025. var xx, yy, xys, c1, c2, c3;
  14026. var a1;
  14027. var m1;
  14028. var con;
  14029. var th1;
  14030. var d;
  14031. /* inverse equations
  14032. -----------------*/
  14033. p.x -= this.x0;
  14034. p.y -= this.y0;
  14035. con = Math.PI * this.R;
  14036. xx = p.x / con;
  14037. yy = p.y / con;
  14038. xys = xx * xx + yy * yy;
  14039. c1 = -Math.abs(yy) * (1 + xys);
  14040. c2 = c1 - 2 * yy * yy + xx * xx;
  14041. c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;
  14042. d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;
  14043. a1 = (c1 - c2 * c2 / 3 / c3) / c3;
  14044. m1 = 2 * Math.sqrt(-a1 / 3);
  14045. con = 3 * d / a1 / m1;
  14046. if (Math.abs(con) > 1) {
  14047. if (con >= 0) {
  14048. con = 1;
  14049. } else {
  14050. con = -1;
  14051. }
  14052. }
  14053. th1 = Math.acos(con) / 3;
  14054. if (p.y >= 0) {
  14055. lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
  14056. } else {
  14057. lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;
  14058. }
  14059. if (Math.abs(xx) < EPSLN) {
  14060. lon = this.long0;
  14061. } else {
  14062. lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);
  14063. }
  14064. p.x = lon;
  14065. p.y = lat;
  14066. return p;
  14067. }
  14068. var names$25 = ["Van_der_Grinten_I", "VanDerGrinten", "vandg"];
  14069. var vandg = {
  14070. init: init$24,
  14071. forward: forward$23,
  14072. inverse: inverse$23,
  14073. names: names$25
  14074. };
  14075. function init$25() {
  14076. this.sin_p12 = Math.sin(this.lat0);
  14077. this.cos_p12 = Math.cos(this.lat0);
  14078. }
  14079. function forward$24(p) {
  14080. var lon = p.x;
  14081. var lat = p.y;
  14082. var sinphi = Math.sin(p.y);
  14083. var cosphi = Math.cos(p.y);
  14084. var dlon = adjust_lon(lon - this.long0);
  14085. var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5;
  14086. if (this.sphere) {
  14087. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  14088. //North Pole case
  14089. p.x = this.x0 + this.a * (HALF_PI - lat) * Math.sin(dlon);
  14090. p.y = this.y0 - this.a * (HALF_PI - lat) * Math.cos(dlon);
  14091. return p;
  14092. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  14093. //South Pole case
  14094. p.x = this.x0 + this.a * (HALF_PI + lat) * Math.sin(dlon);
  14095. p.y = this.y0 + this.a * (HALF_PI + lat) * Math.cos(dlon);
  14096. return p;
  14097. } else {
  14098. //default case
  14099. cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);
  14100. c = Math.acos(cos_c);
  14101. kp = c ? c / Math.sin(c) : 1;
  14102. p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);
  14103. p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));
  14104. return p;
  14105. }
  14106. } else {
  14107. e0 = e0fn(this.es);
  14108. e1 = e1fn(this.es);
  14109. e2 = e2fn(this.es);
  14110. e3 = e3fn(this.es);
  14111. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  14112. //North Pole case
  14113. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  14114. Ml = this.a * mlfn(e0, e1, e2, e3, lat);
  14115. p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);
  14116. p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);
  14117. return p;
  14118. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  14119. //South Pole case
  14120. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  14121. Ml = this.a * mlfn(e0, e1, e2, e3, lat);
  14122. p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);
  14123. p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);
  14124. return p;
  14125. } else {
  14126. //Default case
  14127. tanphi = sinphi / cosphi;
  14128. Nl1 = gN(this.a, this.e, this.sin_p12);
  14129. Nl = gN(this.a, this.e, sinphi);
  14130. psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));
  14131. Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));
  14132. if (Az === 0) {
  14133. s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
  14134. } else if (Math.abs(Math.abs(Az) - Math.PI) <= EPSLN) {
  14135. s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));
  14136. } else {
  14137. s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));
  14138. }
  14139. G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);
  14140. H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);
  14141. GH = G * H;
  14142. Hs = H * H;
  14143. s2 = s * s;
  14144. s3 = s2 * s;
  14145. s4 = s3 * s;
  14146. s5 = s4 * s;
  14147. c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH);
  14148. p.x = this.x0 + c * Math.sin(Az);
  14149. p.y = this.y0 + c * Math.cos(Az);
  14150. return p;
  14151. }
  14152. }
  14153. }
  14154. function inverse$24(p) {
  14155. p.x -= this.x0;
  14156. p.y -= this.y0;
  14157. var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A, B, D, Ee, F, sinpsi;
  14158. if (this.sphere) {
  14159. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  14160. if (rh > 2 * HALF_PI * this.a) {
  14161. return;
  14162. }
  14163. z = rh / this.a;
  14164. sinz = Math.sin(z);
  14165. cosz = Math.cos(z);
  14166. lon = this.long0;
  14167. if (Math.abs(rh) <= EPSLN) {
  14168. lat = this.lat0;
  14169. } else {
  14170. lat = asinz(cosz * this.sin_p12 + p.y * sinz * this.cos_p12 / rh);
  14171. con = Math.abs(this.lat0) - HALF_PI;
  14172. if (Math.abs(con) <= EPSLN) {
  14173. if (this.lat0 >= 0) {
  14174. lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
  14175. } else {
  14176. lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
  14177. }
  14178. } else {
  14179. /*con = cosz - this.sin_p12 * Math.sin(lat);
  14180. if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {
  14181. //no-op, just keep the lon value as is
  14182. } else {
  14183. var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));
  14184. lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));
  14185. }*/
  14186. lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));
  14187. }
  14188. }
  14189. p.x = lon;
  14190. p.y = lat;
  14191. return p;
  14192. } else {
  14193. e0 = e0fn(this.es);
  14194. e1 = e1fn(this.es);
  14195. e2 = e2fn(this.es);
  14196. e3 = e3fn(this.es);
  14197. if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
  14198. //North pole case
  14199. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  14200. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  14201. M = Mlp - rh;
  14202. lat = imlfn(M / this.a, e0, e1, e2, e3);
  14203. lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
  14204. p.x = lon;
  14205. p.y = lat;
  14206. return p;
  14207. } else if (Math.abs(this.sin_p12 + 1) <= EPSLN) {
  14208. //South pole case
  14209. Mlp = this.a * mlfn(e0, e1, e2, e3, HALF_PI);
  14210. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  14211. M = rh - Mlp;
  14212. lat = imlfn(M / this.a, e0, e1, e2, e3);
  14213. lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
  14214. p.x = lon;
  14215. p.y = lat;
  14216. return p;
  14217. } else {
  14218. //default case
  14219. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  14220. Az = Math.atan2(p.x, p.y);
  14221. N1 = gN(this.a, this.e, this.sin_p12);
  14222. cosAz = Math.cos(Az);
  14223. tmp = this.e * this.cos_p12 * cosAz;
  14224. A = -tmp * tmp / (1 - this.es);
  14225. B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);
  14226. D = rh / N1;
  14227. Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;
  14228. F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;
  14229. psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);
  14230. lon = adjust_lon(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));
  14231. sinpsi = Math.sin(psi);
  14232. lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));
  14233. p.x = lon;
  14234. p.y = lat;
  14235. return p;
  14236. }
  14237. }
  14238. }
  14239. var names$26 = ["Azimuthal_Equidistant", "aeqd"];
  14240. var aeqd = {
  14241. init: init$25,
  14242. forward: forward$24,
  14243. inverse: inverse$24,
  14244. names: names$26
  14245. };
  14246. function init$26() {
  14247. //double temp; /* temporary variable */
  14248. /* Place parameters in static storage for common use
  14249. -------------------------------------------------*/
  14250. this.sin_p14 = Math.sin(this.lat0);
  14251. this.cos_p14 = Math.cos(this.lat0);
  14252. }
  14253. /* Orthographic forward equations--mapping lat,long to x,y
  14254. ---------------------------------------------------*/
  14255. function forward$25(p) {
  14256. var sinphi, cosphi; /* sin and cos value */
  14257. var dlon; /* delta longitude value */
  14258. var coslon; /* cos of longitude */
  14259. var ksp; /* scale factor */
  14260. var g, x, y;
  14261. var lon = p.x;
  14262. var lat = p.y;
  14263. /* Forward equations
  14264. -----------------*/
  14265. dlon = adjust_lon(lon - this.long0);
  14266. sinphi = Math.sin(lat);
  14267. cosphi = Math.cos(lat);
  14268. coslon = Math.cos(dlon);
  14269. g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;
  14270. ksp = 1;
  14271. if (g > 0 || Math.abs(g) <= EPSLN) {
  14272. x = this.a * ksp * cosphi * Math.sin(dlon);
  14273. y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);
  14274. }
  14275. p.x = x;
  14276. p.y = y;
  14277. return p;
  14278. }
  14279. function inverse$25(p) {
  14280. var rh; /* height above ellipsoid */
  14281. var z; /* angle */
  14282. var sinz, cosz; /* sin of z and cos of z */
  14283. var con;
  14284. var lon, lat;
  14285. /* Inverse equations
  14286. -----------------*/
  14287. p.x -= this.x0;
  14288. p.y -= this.y0;
  14289. rh = Math.sqrt(p.x * p.x + p.y * p.y);
  14290. z = asinz(rh / this.a);
  14291. sinz = Math.sin(z);
  14292. cosz = Math.cos(z);
  14293. lon = this.long0;
  14294. if (Math.abs(rh) <= EPSLN) {
  14295. lat = this.lat0;
  14296. p.x = lon;
  14297. p.y = lat;
  14298. return p;
  14299. }
  14300. lat = asinz(cosz * this.sin_p14 + p.y * sinz * this.cos_p14 / rh);
  14301. con = Math.abs(this.lat0) - HALF_PI;
  14302. if (Math.abs(con) <= EPSLN) {
  14303. if (this.lat0 >= 0) {
  14304. lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
  14305. } else {
  14306. lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
  14307. }
  14308. p.x = lon;
  14309. p.y = lat;
  14310. return p;
  14311. }
  14312. lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));
  14313. p.x = lon;
  14314. p.y = lat;
  14315. return p;
  14316. }
  14317. var names$27 = ["ortho"];
  14318. var ortho = {
  14319. init: init$26,
  14320. forward: forward$25,
  14321. inverse: inverse$25,
  14322. names: names$27
  14323. };
  14324. // QSC projection rewritten from the original PROJ4
  14325. // https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c
  14326. /* constants */
  14327. var FACE_ENUM = {
  14328. FRONT: 1,
  14329. RIGHT: 2,
  14330. BACK: 3,
  14331. LEFT: 4,
  14332. TOP: 5,
  14333. BOTTOM: 6
  14334. };
  14335. var AREA_ENUM = {
  14336. AREA_0: 1,
  14337. AREA_1: 2,
  14338. AREA_2: 3,
  14339. AREA_3: 4
  14340. };
  14341. function init$27() {
  14342. this.x0 = this.x0 || 0;
  14343. this.y0 = this.y0 || 0;
  14344. this.lat0 = this.lat0 || 0;
  14345. this.long0 = this.long0 || 0;
  14346. this.lat_ts = this.lat_ts || 0;
  14347. this.title = this.title || "Quadrilateralized Spherical Cube";
  14348. /* Determine the cube face from the center of projection. */
  14349. if (this.lat0 >= HALF_PI - FORTPI / 2.0) {
  14350. this.face = FACE_ENUM.TOP;
  14351. } else if (this.lat0 <= -(HALF_PI - FORTPI / 2.0)) {
  14352. this.face = FACE_ENUM.BOTTOM;
  14353. } else if (Math.abs(this.long0) <= FORTPI) {
  14354. this.face = FACE_ENUM.FRONT;
  14355. } else if (Math.abs(this.long0) <= HALF_PI + FORTPI) {
  14356. this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;
  14357. } else {
  14358. this.face = FACE_ENUM.BACK;
  14359. }
  14360. /* Fill in useful values for the ellipsoid <-> sphere shift
  14361. * described in [LK12]. */
  14362. if (this.es !== 0) {
  14363. this.one_minus_f = 1 - (this.a - this.b) / this.a;
  14364. this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;
  14365. }
  14366. }
  14367. // QSC forward equations--mapping lat,long to x,y
  14368. // -----------------------------------------------------------------
  14369. function forward$26(p) {
  14370. var xy = {
  14371. x: 0,
  14372. y: 0
  14373. };
  14374. var lat, lon;
  14375. var theta, phi;
  14376. var t, mu;
  14377. /* nu; */
  14378. var area = {
  14379. value: 0
  14380. };
  14381. // move lon according to projection's lon
  14382. p.x -= this.long0;
  14383. /* Convert the geodetic latitude to a geocentric latitude.
  14384. * This corresponds to the shift from the ellipsoid to the sphere
  14385. * described in [LK12]. */
  14386. if (this.es !== 0) {
  14387. //if (P->es != 0) {
  14388. lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));
  14389. } else {
  14390. lat = p.y;
  14391. }
  14392. /* Convert the input lat, lon into theta, phi as used by QSC.
  14393. * This depends on the cube face and the area on it.
  14394. * For the top and bottom face, we can compute theta and phi
  14395. * directly from phi, lam. For the other faces, we must use
  14396. * unit sphere cartesian coordinates as an intermediate step. */
  14397. lon = p.x; //lon = lp.lam;
  14398. if (this.face === FACE_ENUM.TOP) {
  14399. phi = HALF_PI - lat;
  14400. if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
  14401. area.value = AREA_ENUM.AREA_0;
  14402. theta = lon - HALF_PI;
  14403. } else if (lon > HALF_PI + FORTPI || lon <= -(HALF_PI + FORTPI)) {
  14404. area.value = AREA_ENUM.AREA_1;
  14405. theta = lon > 0.0 ? lon - SPI : lon + SPI;
  14406. } else if (lon > -(HALF_PI + FORTPI) && lon <= -FORTPI) {
  14407. area.value = AREA_ENUM.AREA_2;
  14408. theta = lon + HALF_PI;
  14409. } else {
  14410. area.value = AREA_ENUM.AREA_3;
  14411. theta = lon;
  14412. }
  14413. } else if (this.face === FACE_ENUM.BOTTOM) {
  14414. phi = HALF_PI + lat;
  14415. if (lon >= FORTPI && lon <= HALF_PI + FORTPI) {
  14416. area.value = AREA_ENUM.AREA_0;
  14417. theta = -lon + HALF_PI;
  14418. } else if (lon < FORTPI && lon >= -FORTPI) {
  14419. area.value = AREA_ENUM.AREA_1;
  14420. theta = -lon;
  14421. } else if (lon < -FORTPI && lon >= -(HALF_PI + FORTPI)) {
  14422. area.value = AREA_ENUM.AREA_2;
  14423. theta = -lon - HALF_PI;
  14424. } else {
  14425. area.value = AREA_ENUM.AREA_3;
  14426. theta = lon > 0.0 ? -lon + SPI : -lon - SPI;
  14427. }
  14428. } else {
  14429. var q, r, s;
  14430. var sinlat, coslat;
  14431. var sinlon, coslon;
  14432. if (this.face === FACE_ENUM.RIGHT) {
  14433. lon = qsc_shift_lon_origin(lon, +HALF_PI);
  14434. } else if (this.face === FACE_ENUM.BACK) {
  14435. lon = qsc_shift_lon_origin(lon, +SPI);
  14436. } else if (this.face === FACE_ENUM.LEFT) {
  14437. lon = qsc_shift_lon_origin(lon, -HALF_PI);
  14438. }
  14439. sinlat = Math.sin(lat);
  14440. coslat = Math.cos(lat);
  14441. sinlon = Math.sin(lon);
  14442. coslon = Math.cos(lon);
  14443. q = coslat * coslon;
  14444. r = coslat * sinlon;
  14445. s = sinlat;
  14446. if (this.face === FACE_ENUM.FRONT) {
  14447. phi = Math.acos(q);
  14448. theta = qsc_fwd_equat_face_theta(phi, s, r, area);
  14449. } else if (this.face === FACE_ENUM.RIGHT) {
  14450. phi = Math.acos(r);
  14451. theta = qsc_fwd_equat_face_theta(phi, s, -q, area);
  14452. } else if (this.face === FACE_ENUM.BACK) {
  14453. phi = Math.acos(-q);
  14454. theta = qsc_fwd_equat_face_theta(phi, s, -r, area);
  14455. } else if (this.face === FACE_ENUM.LEFT) {
  14456. phi = Math.acos(-r);
  14457. theta = qsc_fwd_equat_face_theta(phi, s, q, area);
  14458. } else {
  14459. /* Impossible */
  14460. phi = theta = 0;
  14461. area.value = AREA_ENUM.AREA_0;
  14462. }
  14463. }
  14464. /* Compute mu and nu for the area of definition.
  14465. * For mu, see Eq. (3-21) in [OL76], but note the typos:
  14466. * compare with Eq. (3-14). For nu, see Eq. (3-38). */
  14467. mu = Math.atan(12 / SPI * (theta + Math.acos(Math.sin(theta) * Math.cos(FORTPI)) - HALF_PI));
  14468. t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));
  14469. /* Apply the result to the real area. */
  14470. if (area.value === AREA_ENUM.AREA_1) {
  14471. mu += HALF_PI;
  14472. } else if (area.value === AREA_ENUM.AREA_2) {
  14473. mu += SPI;
  14474. } else if (area.value === AREA_ENUM.AREA_3) {
  14475. mu += 1.5 * SPI;
  14476. }
  14477. /* Now compute x, y from mu and nu */
  14478. xy.x = t * Math.cos(mu);
  14479. xy.y = t * Math.sin(mu);
  14480. xy.x = xy.x * this.a + this.x0;
  14481. xy.y = xy.y * this.a + this.y0;
  14482. p.x = xy.x;
  14483. p.y = xy.y;
  14484. return p;
  14485. }
  14486. // QSC inverse equations--mapping x,y to lat/long
  14487. // -----------------------------------------------------------------
  14488. function inverse$26(p) {
  14489. var lp = {
  14490. lam: 0,
  14491. phi: 0
  14492. };
  14493. var mu, nu, cosmu, tannu;
  14494. var tantheta, theta, cosphi, phi;
  14495. var t;
  14496. var area = {
  14497. value: 0
  14498. };
  14499. /* de-offset */
  14500. p.x = (p.x - this.x0) / this.a;
  14501. p.y = (p.y - this.y0) / this.a;
  14502. /* Convert the input x, y to the mu and nu angles as used by QSC.
  14503. * This depends on the area of the cube face. */
  14504. nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));
  14505. mu = Math.atan2(p.y, p.x);
  14506. if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {
  14507. area.value = AREA_ENUM.AREA_0;
  14508. } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {
  14509. area.value = AREA_ENUM.AREA_1;
  14510. mu -= HALF_PI;
  14511. } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {
  14512. area.value = AREA_ENUM.AREA_2;
  14513. mu = mu < 0.0 ? mu + SPI : mu - SPI;
  14514. } else {
  14515. area.value = AREA_ENUM.AREA_3;
  14516. mu += HALF_PI;
  14517. }
  14518. /* Compute phi and theta for the area of definition.
  14519. * The inverse projection is not described in the original paper, but some
  14520. * good hints can be found here (as of 2011-12-14):
  14521. * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302
  14522. * (search for "Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>") */
  14523. t = SPI / 12 * Math.tan(mu);
  14524. tantheta = Math.sin(t) / (Math.cos(t) - 1 / Math.sqrt(2));
  14525. theta = Math.atan(tantheta);
  14526. cosmu = Math.cos(mu);
  14527. tannu = Math.tan(nu);
  14528. cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));
  14529. if (cosphi < -1) {
  14530. cosphi = -1;
  14531. } else if (cosphi > +1) {
  14532. cosphi = +1;
  14533. }
  14534. /* Apply the result to the real area on the cube face.
  14535. * For the top and bottom face, we can compute phi and lam directly.
  14536. * For the other faces, we must use unit sphere cartesian coordinates
  14537. * as an intermediate step. */
  14538. if (this.face === FACE_ENUM.TOP) {
  14539. phi = Math.acos(cosphi);
  14540. lp.phi = HALF_PI - phi;
  14541. if (area.value === AREA_ENUM.AREA_0) {
  14542. lp.lam = theta + HALF_PI;
  14543. } else if (area.value === AREA_ENUM.AREA_1) {
  14544. lp.lam = theta < 0.0 ? theta + SPI : theta - SPI;
  14545. } else if (area.value === AREA_ENUM.AREA_2) {
  14546. lp.lam = theta - HALF_PI;
  14547. } else /* area.value == AREA_ENUM.AREA_3 */{
  14548. lp.lam = theta;
  14549. }
  14550. } else if (this.face === FACE_ENUM.BOTTOM) {
  14551. phi = Math.acos(cosphi);
  14552. lp.phi = phi - HALF_PI;
  14553. if (area.value === AREA_ENUM.AREA_0) {
  14554. lp.lam = -theta + HALF_PI;
  14555. } else if (area.value === AREA_ENUM.AREA_1) {
  14556. lp.lam = -theta;
  14557. } else if (area.value === AREA_ENUM.AREA_2) {
  14558. lp.lam = -theta - HALF_PI;
  14559. } else /* area.value == AREA_ENUM.AREA_3 */{
  14560. lp.lam = theta < 0.0 ? -theta - SPI : -theta + SPI;
  14561. }
  14562. } else {
  14563. /* Compute phi and lam via cartesian unit sphere coordinates. */
  14564. var q, r, s;
  14565. q = cosphi;
  14566. t = q * q;
  14567. if (t >= 1) {
  14568. s = 0;
  14569. } else {
  14570. s = Math.sqrt(1 - t) * Math.sin(theta);
  14571. }
  14572. t += s * s;
  14573. if (t >= 1) {
  14574. r = 0;
  14575. } else {
  14576. r = Math.sqrt(1 - t);
  14577. }
  14578. /* Rotate q,r,s into the correct area. */
  14579. if (area.value === AREA_ENUM.AREA_1) {
  14580. t = r;
  14581. r = -s;
  14582. s = t;
  14583. } else if (area.value === AREA_ENUM.AREA_2) {
  14584. r = -r;
  14585. s = -s;
  14586. } else if (area.value === AREA_ENUM.AREA_3) {
  14587. t = r;
  14588. r = s;
  14589. s = -t;
  14590. }
  14591. /* Rotate q,r,s into the correct cube face. */
  14592. if (this.face === FACE_ENUM.RIGHT) {
  14593. t = q;
  14594. q = -r;
  14595. r = t;
  14596. } else if (this.face === FACE_ENUM.BACK) {
  14597. q = -q;
  14598. r = -r;
  14599. } else if (this.face === FACE_ENUM.LEFT) {
  14600. t = q;
  14601. q = r;
  14602. r = -t;
  14603. }
  14604. /* Now compute phi and lam from the unit sphere coordinates. */
  14605. lp.phi = Math.acos(-s) - HALF_PI;
  14606. lp.lam = Math.atan2(r, q);
  14607. if (this.face === FACE_ENUM.RIGHT) {
  14608. lp.lam = qsc_shift_lon_origin(lp.lam, -HALF_PI);
  14609. } else if (this.face === FACE_ENUM.BACK) {
  14610. lp.lam = qsc_shift_lon_origin(lp.lam, -SPI);
  14611. } else if (this.face === FACE_ENUM.LEFT) {
  14612. lp.lam = qsc_shift_lon_origin(lp.lam, +HALF_PI);
  14613. }
  14614. }
  14615. /* Apply the shift from the sphere to the ellipsoid as described
  14616. * in [LK12]. */
  14617. if (this.es !== 0) {
  14618. var invert_sign;
  14619. var tanphi, xa;
  14620. invert_sign = lp.phi < 0 ? 1 : 0;
  14621. tanphi = Math.tan(lp.phi);
  14622. xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);
  14623. lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));
  14624. if (invert_sign) {
  14625. lp.phi = -lp.phi;
  14626. }
  14627. }
  14628. lp.lam += this.long0;
  14629. p.x = lp.lam;
  14630. p.y = lp.phi;
  14631. return p;
  14632. }
  14633. /* Helper function for forward projection: compute the theta angle
  14634. * and determine the area number. */
  14635. function qsc_fwd_equat_face_theta(phi, y, x, area) {
  14636. var theta;
  14637. if (phi < EPSLN) {
  14638. area.value = AREA_ENUM.AREA_0;
  14639. theta = 0.0;
  14640. } else {
  14641. theta = Math.atan2(y, x);
  14642. if (Math.abs(theta) <= FORTPI) {
  14643. area.value = AREA_ENUM.AREA_0;
  14644. } else if (theta > FORTPI && theta <= HALF_PI + FORTPI) {
  14645. area.value = AREA_ENUM.AREA_1;
  14646. theta -= HALF_PI;
  14647. } else if (theta > HALF_PI + FORTPI || theta <= -(HALF_PI + FORTPI)) {
  14648. area.value = AREA_ENUM.AREA_2;
  14649. theta = theta >= 0.0 ? theta - SPI : theta + SPI;
  14650. } else {
  14651. area.value = AREA_ENUM.AREA_3;
  14652. theta += HALF_PI;
  14653. }
  14654. }
  14655. return theta;
  14656. }
  14657. /* Helper function: shift the longitude. */
  14658. function qsc_shift_lon_origin(lon, offset) {
  14659. var slon = lon + offset;
  14660. if (slon < -SPI) {
  14661. slon += TWO_PI;
  14662. } else if (slon > +SPI) {
  14663. slon -= TWO_PI;
  14664. }
  14665. return slon;
  14666. }
  14667. var names$28 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
  14668. var qsc = {
  14669. init: init$27,
  14670. forward: forward$26,
  14671. inverse: inverse$26,
  14672. names: names$28
  14673. };
  14674. // Robinson projection
  14675. // Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c
  14676. // Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039
  14677. var COEFS_X = [[1.0000, 2.2199e-17, -7.15515e-05, 3.1103e-06], [0.9986, -0.000482243, -2.4897e-05, -1.3309e-06], [0.9954, -0.00083103, -4.48605e-05, -9.86701e-07], [0.9900, -0.00135364, -5.9661e-05, 3.6777e-06], [0.9822, -0.00167442, -4.49547e-06, -5.72411e-06], [0.9730, -0.00214868, -9.03571e-05, 1.8736e-08], [0.9600, -0.00305085, -9.00761e-05, 1.64917e-06], [0.9427, -0.00382792, -6.53386e-05, -2.6154e-06], [0.9216, -0.00467746, -0.00010457, 4.81243e-06], [0.8962, -0.00536223, -3.23831e-05, -5.43432e-06], [0.8679, -0.00609363, -0.000113898, 3.32484e-06], [0.8350, -0.00698325, -6.40253e-05, 9.34959e-07], [0.7986, -0.00755338, -5.00009e-05, 9.35324e-07], [0.7597, -0.00798324, -3.5971e-05, -2.27626e-06], [0.7186, -0.00851367, -7.01149e-05, -8.6303e-06], [0.6732, -0.00986209, -0.000199569, 1.91974e-05], [0.6213, -0.010418, 8.83923e-05, 6.24051e-06], [0.5722, -0.00906601, 0.000182, 6.24051e-06], [0.5322, -0.00677797, 0.000275608, 6.24051e-06]];
  14678. var COEFS_Y = [[-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11], [0.0620, 0.0124, -1.26793e-09, 4.22642e-10], [0.1240, 0.0124, 5.07171e-09, -1.60604e-09], [0.1860, 0.0123999, -1.90189e-08, 6.00152e-09], [0.2480, 0.0124002, 7.10039e-08, -2.24e-08], [0.3100, 0.0123992, -2.64997e-07, 8.35986e-08], [0.3720, 0.0124029, 9.88983e-07, -3.11994e-07], [0.4340, 0.0123893, -3.69093e-06, -4.35621e-07], [0.4958, 0.0123198, -1.02252e-05, -3.45523e-07], [0.5571, 0.0121916, -1.54081e-05, -5.82288e-07], [0.6176, 0.0119938, -2.41424e-05, -5.25327e-07], [0.6769, 0.011713, -3.20223e-05, -5.16405e-07], [0.7346, 0.0113541, -3.97684e-05, -6.09052e-07], [0.7903, 0.0109107, -4.89042e-05, -1.04739e-06], [0.8435, 0.0103431, -6.4615e-05, -1.40374e-09], [0.8936, 0.00969686, -6.4636e-05, -8.547e-06], [0.9394, 0.00840947, -0.000192841, -4.2106e-06], [0.9761, 0.00616527, -0.000256, -4.2106e-06], [1.0000, 0.00328947, -0.000319159, -4.2106e-06]];
  14679. var FXC = 0.8487;
  14680. var FYC = 1.3523;
  14681. var C1 = R2D / 5; // rad to 5-degree interval
  14682. var RC1 = 1 / C1;
  14683. var NODES = 18;
  14684. var poly3_val = function poly3_val(coefs, x) {
  14685. return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));
  14686. };
  14687. var poly3_der = function poly3_der(coefs, x) {
  14688. return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);
  14689. };
  14690. function newton_rapshon(f_df, start, max_err, iters) {
  14691. var x = start;
  14692. for (; iters; --iters) {
  14693. var upd = f_df(x);
  14694. x -= upd;
  14695. if (Math.abs(upd) < max_err) {
  14696. break;
  14697. }
  14698. }
  14699. return x;
  14700. }
  14701. function init$28() {
  14702. this.x0 = this.x0 || 0;
  14703. this.y0 = this.y0 || 0;
  14704. this.long0 = this.long0 || 0;
  14705. this.es = 0;
  14706. this.title = this.title || "Robinson";
  14707. }
  14708. function forward$27(ll) {
  14709. var lon = adjust_lon(ll.x - this.long0);
  14710. var dphi = Math.abs(ll.y);
  14711. var i = Math.floor(dphi * C1);
  14712. if (i < 0) {
  14713. i = 0;
  14714. } else if (i >= NODES) {
  14715. i = NODES - 1;
  14716. }
  14717. dphi = R2D * (dphi - RC1 * i);
  14718. var xy = {
  14719. x: poly3_val(COEFS_X[i], dphi) * lon,
  14720. y: poly3_val(COEFS_Y[i], dphi)
  14721. };
  14722. if (ll.y < 0) {
  14723. xy.y = -xy.y;
  14724. }
  14725. xy.x = xy.x * this.a * FXC + this.x0;
  14726. xy.y = xy.y * this.a * FYC + this.y0;
  14727. return xy;
  14728. }
  14729. function inverse$27(xy) {
  14730. var ll = {
  14731. x: (xy.x - this.x0) / (this.a * FXC),
  14732. y: Math.abs(xy.y - this.y0) / (this.a * FYC)
  14733. };
  14734. if (ll.y >= 1) {
  14735. // pathologic case
  14736. ll.x /= COEFS_X[NODES][0];
  14737. ll.y = xy.y < 0 ? -HALF_PI : HALF_PI;
  14738. } else {
  14739. // find table interval
  14740. var i = Math.floor(ll.y * NODES);
  14741. if (i < 0) {
  14742. i = 0;
  14743. } else if (i >= NODES) {
  14744. i = NODES - 1;
  14745. }
  14746. for (;;) {
  14747. if (COEFS_Y[i][0] > ll.y) {
  14748. --i;
  14749. } else if (COEFS_Y[i + 1][0] <= ll.y) {
  14750. ++i;
  14751. } else {
  14752. break;
  14753. }
  14754. }
  14755. // linear interpolation in 5 degree interval
  14756. var coefs = COEFS_Y[i];
  14757. var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i + 1][0] - coefs[0]);
  14758. // find t so that poly3_val(coefs, t) = ll.y
  14759. t = newton_rapshon(function (x) {
  14760. return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);
  14761. }, t, EPSLN, 100);
  14762. ll.x /= poly3_val(COEFS_X[i], t);
  14763. ll.y = (5 * i + t) * D2R;
  14764. if (xy.y < 0) {
  14765. ll.y = -ll.y;
  14766. }
  14767. }
  14768. ll.x = adjust_lon(ll.x + this.long0);
  14769. return ll;
  14770. }
  14771. var names$29 = ["Robinson", "robin"];
  14772. var robin = {
  14773. init: init$28,
  14774. forward: forward$27,
  14775. inverse: inverse$27,
  14776. names: names$29
  14777. };
  14778. function init$29() {
  14779. this.name = 'geocent';
  14780. }
  14781. function forward$28(p) {
  14782. var point = geodeticToGeocentric(p, this.es, this.a);
  14783. return point;
  14784. }
  14785. function inverse$28(p) {
  14786. var point = geocentricToGeodetic(p, this.es, this.a, this.b);
  14787. return point;
  14788. }
  14789. var names$30 = ["Geocentric", 'geocentric', "geocent", "Geocent"];
  14790. var geocent = {
  14791. init: init$29,
  14792. forward: forward$28,
  14793. inverse: inverse$28,
  14794. names: names$30
  14795. };
  14796. var mode = {
  14797. N_POLE: 0,
  14798. S_POLE: 1,
  14799. EQUIT: 2,
  14800. OBLIQ: 3
  14801. };
  14802. var params = {
  14803. h: {
  14804. def: 100000,
  14805. num: true
  14806. },
  14807. // default is Karman line, no default in PROJ.7
  14808. azi: {
  14809. def: 0,
  14810. num: true,
  14811. degrees: true
  14812. },
  14813. // default is North
  14814. tilt: {
  14815. def: 0,
  14816. num: true,
  14817. degrees: true
  14818. },
  14819. // default is Nadir
  14820. long0: {
  14821. def: 0,
  14822. num: true
  14823. },
  14824. // default is Greenwich, conversion to rad is automatic
  14825. lat0: {
  14826. def: 0,
  14827. num: true
  14828. } // default is Equator, conversion to rad is automatic
  14829. };
  14830. function init$30() {
  14831. Object.keys(params).forEach(function (p) {
  14832. if (typeof this[p] === "undefined") {
  14833. this[p] = params[p].def;
  14834. } else if (params[p].num && isNaN(this[p])) {
  14835. throw new Error("Invalid parameter value, must be numeric " + p + " = " + this[p]);
  14836. } else if (params[p].num) {
  14837. this[p] = parseFloat(this[p]);
  14838. }
  14839. if (params[p].degrees) {
  14840. this[p] = this[p] * D2R;
  14841. }
  14842. }.bind(this));
  14843. if (Math.abs(Math.abs(this.lat0) - HALF_PI) < EPSLN) {
  14844. this.mode = this.lat0 < 0 ? mode.S_POLE : mode.N_POLE;
  14845. } else if (Math.abs(this.lat0) < EPSLN) {
  14846. this.mode = mode.EQUIT;
  14847. } else {
  14848. this.mode = mode.OBLIQ;
  14849. this.sinph0 = Math.sin(this.lat0);
  14850. this.cosph0 = Math.cos(this.lat0);
  14851. }
  14852. this.pn1 = this.h / this.a; // Normalize relative to the Earth's radius
  14853. if (this.pn1 <= 0 || this.pn1 > 1e10) {
  14854. throw new Error("Invalid height");
  14855. }
  14856. this.p = 1 + this.pn1;
  14857. this.rp = 1 / this.p;
  14858. this.h1 = 1 / this.pn1;
  14859. this.pfact = (this.p + 1) * this.h1;
  14860. this.es = 0;
  14861. var omega = this.tilt;
  14862. var gamma = this.azi;
  14863. this.cg = Math.cos(gamma);
  14864. this.sg = Math.sin(gamma);
  14865. this.cw = Math.cos(omega);
  14866. this.sw = Math.sin(omega);
  14867. }
  14868. function forward$29(p) {
  14869. p.x -= this.long0;
  14870. var sinphi = Math.sin(p.y);
  14871. var cosphi = Math.cos(p.y);
  14872. var coslam = Math.cos(p.x);
  14873. var x, y;
  14874. switch (this.mode) {
  14875. case mode.OBLIQ:
  14876. y = this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;
  14877. break;
  14878. case mode.EQUIT:
  14879. y = cosphi * coslam;
  14880. break;
  14881. case mode.S_POLE:
  14882. y = -sinphi;
  14883. break;
  14884. case mode.N_POLE:
  14885. y = sinphi;
  14886. break;
  14887. }
  14888. y = this.pn1 / (this.p - y);
  14889. x = y * cosphi * Math.sin(p.x);
  14890. switch (this.mode) {
  14891. case mode.OBLIQ:
  14892. y *= this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;
  14893. break;
  14894. case mode.EQUIT:
  14895. y *= sinphi;
  14896. break;
  14897. case mode.N_POLE:
  14898. y *= -(cosphi * coslam);
  14899. break;
  14900. case mode.S_POLE:
  14901. y *= cosphi * coslam;
  14902. break;
  14903. }
  14904. // Tilt
  14905. var yt, ba;
  14906. yt = y * this.cg + x * this.sg;
  14907. ba = 1 / (yt * this.sw * this.h1 + this.cw);
  14908. x = (x * this.cg - y * this.sg) * this.cw * ba;
  14909. y = yt * ba;
  14910. p.x = x * this.a;
  14911. p.y = y * this.a;
  14912. return p;
  14913. }
  14914. function inverse$29(p) {
  14915. p.x /= this.a;
  14916. p.y /= this.a;
  14917. var r = {
  14918. x: p.x,
  14919. y: p.y
  14920. };
  14921. // Un-Tilt
  14922. var bm, bq, yt;
  14923. yt = 1 / (this.pn1 - p.y * this.sw);
  14924. bm = this.pn1 * p.x * yt;
  14925. bq = this.pn1 * p.y * this.cw * yt;
  14926. p.x = bm * this.cg + bq * this.sg;
  14927. p.y = bq * this.cg - bm * this.sg;
  14928. var rh = hypot(p.x, p.y);
  14929. if (Math.abs(rh) < EPSLN) {
  14930. r.x = 0;
  14931. r.y = p.y;
  14932. } else {
  14933. var cosz, sinz;
  14934. sinz = 1 - rh * rh * this.pfact;
  14935. sinz = (this.p - Math.sqrt(sinz)) / (this.pn1 / rh + rh / this.pn1);
  14936. cosz = Math.sqrt(1 - sinz * sinz);
  14937. switch (this.mode) {
  14938. case mode.OBLIQ:
  14939. r.y = Math.asin(cosz * this.sinph0 + p.y * sinz * this.cosph0 / rh);
  14940. p.y = (cosz - this.sinph0 * Math.sin(r.y)) * rh;
  14941. p.x *= sinz * this.cosph0;
  14942. break;
  14943. case mode.EQUIT:
  14944. r.y = Math.asin(p.y * sinz / rh);
  14945. p.y = cosz * rh;
  14946. p.x *= sinz;
  14947. break;
  14948. case mode.N_POLE:
  14949. r.y = Math.asin(cosz);
  14950. p.y = -p.y;
  14951. break;
  14952. case mode.S_POLE:
  14953. r.y = -Math.asin(cosz);
  14954. break;
  14955. }
  14956. r.x = Math.atan2(p.x, p.y);
  14957. }
  14958. p.x = r.x + this.long0;
  14959. p.y = r.y;
  14960. return p;
  14961. }
  14962. var names$31 = ["Tilted_Perspective", "tpers"];
  14963. var tpers = {
  14964. init: init$30,
  14965. forward: forward$29,
  14966. inverse: inverse$29,
  14967. names: names$31
  14968. };
  14969. function init$31() {
  14970. this.flip_axis = this.sweep === 'x' ? 1 : 0;
  14971. this.h = Number(this.h);
  14972. this.radius_g_1 = this.h / this.a;
  14973. if (this.radius_g_1 <= 0 || this.radius_g_1 > 1e10) {
  14974. throw new Error();
  14975. }
  14976. this.radius_g = 1.0 + this.radius_g_1;
  14977. this.C = this.radius_g * this.radius_g - 1.0;
  14978. if (this.es !== 0.0) {
  14979. var one_es = 1.0 - this.es;
  14980. var rone_es = 1 / one_es;
  14981. this.radius_p = Math.sqrt(one_es);
  14982. this.radius_p2 = one_es;
  14983. this.radius_p_inv2 = rone_es;
  14984. this.shape = 'ellipse'; // Use as a condition in the forward and inverse functions.
  14985. } else {
  14986. this.radius_p = 1.0;
  14987. this.radius_p2 = 1.0;
  14988. this.radius_p_inv2 = 1.0;
  14989. this.shape = 'sphere'; // Use as a condition in the forward and inverse functions.
  14990. }
  14991. if (!this.title) {
  14992. this.title = "Geostationary Satellite View";
  14993. }
  14994. }
  14995. function forward$30(p) {
  14996. var lon = p.x;
  14997. var lat = p.y;
  14998. var tmp, v_x, v_y, v_z;
  14999. lon = lon - this.long0;
  15000. if (this.shape === 'ellipse') {
  15001. lat = Math.atan(this.radius_p2 * Math.tan(lat));
  15002. var r = this.radius_p / hypot(this.radius_p * Math.cos(lat), Math.sin(lat));
  15003. v_x = r * Math.cos(lon) * Math.cos(lat);
  15004. v_y = r * Math.sin(lon) * Math.cos(lat);
  15005. v_z = r * Math.sin(lat);
  15006. if ((this.radius_g - v_x) * v_x - v_y * v_y - v_z * v_z * this.radius_p_inv2 < 0.0) {
  15007. p.x = Number.NaN;
  15008. p.y = Number.NaN;
  15009. return p;
  15010. }
  15011. tmp = this.radius_g - v_x;
  15012. if (this.flip_axis) {
  15013. p.x = this.radius_g_1 * Math.atan(v_y / hypot(v_z, tmp));
  15014. p.y = this.radius_g_1 * Math.atan(v_z / tmp);
  15015. } else {
  15016. p.x = this.radius_g_1 * Math.atan(v_y / tmp);
  15017. p.y = this.radius_g_1 * Math.atan(v_z / hypot(v_y, tmp));
  15018. }
  15019. } else if (this.shape === 'sphere') {
  15020. tmp = Math.cos(lat);
  15021. v_x = Math.cos(lon) * tmp;
  15022. v_y = Math.sin(lon) * tmp;
  15023. v_z = Math.sin(lat);
  15024. tmp = this.radius_g - v_x;
  15025. if (this.flip_axis) {
  15026. p.x = this.radius_g_1 * Math.atan(v_y / hypot(v_z, tmp));
  15027. p.y = this.radius_g_1 * Math.atan(v_z / tmp);
  15028. } else {
  15029. p.x = this.radius_g_1 * Math.atan(v_y / tmp);
  15030. p.y = this.radius_g_1 * Math.atan(v_z / hypot(v_y, tmp));
  15031. }
  15032. }
  15033. p.x = p.x * this.a;
  15034. p.y = p.y * this.a;
  15035. return p;
  15036. }
  15037. function inverse$30(p) {
  15038. var v_x = -1.0;
  15039. var v_y = 0.0;
  15040. var v_z = 0.0;
  15041. var a, b, det, k;
  15042. p.x = p.x / this.a;
  15043. p.y = p.y / this.a;
  15044. if (this.shape === 'ellipse') {
  15045. if (this.flip_axis) {
  15046. v_z = Math.tan(p.y / this.radius_g_1);
  15047. v_y = Math.tan(p.x / this.radius_g_1) * hypot(1.0, v_z);
  15048. } else {
  15049. v_y = Math.tan(p.x / this.radius_g_1);
  15050. v_z = Math.tan(p.y / this.radius_g_1) * hypot(1.0, v_y);
  15051. }
  15052. var v_zp = v_z / this.radius_p;
  15053. a = v_y * v_y + v_zp * v_zp + v_x * v_x;
  15054. b = 2 * this.radius_g * v_x;
  15055. det = b * b - 4 * a * this.C;
  15056. if (det < 0.0) {
  15057. p.x = Number.NaN;
  15058. p.y = Number.NaN;
  15059. return p;
  15060. }
  15061. k = (-b - Math.sqrt(det)) / (2.0 * a);
  15062. v_x = this.radius_g + k * v_x;
  15063. v_y *= k;
  15064. v_z *= k;
  15065. p.x = Math.atan2(v_y, v_x);
  15066. p.y = Math.atan(v_z * Math.cos(p.x) / v_x);
  15067. p.y = Math.atan(this.radius_p_inv2 * Math.tan(p.y));
  15068. } else if (this.shape === 'sphere') {
  15069. if (this.flip_axis) {
  15070. v_z = Math.tan(p.y / this.radius_g_1);
  15071. v_y = Math.tan(p.x / this.radius_g_1) * Math.sqrt(1.0 + v_z * v_z);
  15072. } else {
  15073. v_y = Math.tan(p.x / this.radius_g_1);
  15074. v_z = Math.tan(p.y / this.radius_g_1) * Math.sqrt(1.0 + v_y * v_y);
  15075. }
  15076. a = v_y * v_y + v_z * v_z + v_x * v_x;
  15077. b = 2 * this.radius_g * v_x;
  15078. det = b * b - 4 * a * this.C;
  15079. if (det < 0.0) {
  15080. p.x = Number.NaN;
  15081. p.y = Number.NaN;
  15082. return p;
  15083. }
  15084. k = (-b - Math.sqrt(det)) / (2.0 * a);
  15085. v_x = this.radius_g + k * v_x;
  15086. v_y *= k;
  15087. v_z *= k;
  15088. p.x = Math.atan2(v_y, v_x);
  15089. p.y = Math.atan(v_z * Math.cos(p.x) / v_x);
  15090. }
  15091. p.x = p.x + this.long0;
  15092. return p;
  15093. }
  15094. var names$32 = ["Geostationary Satellite View", "Geostationary_Satellite", "geos"];
  15095. var geos = {
  15096. init: init$31,
  15097. forward: forward$30,
  15098. inverse: inverse$30,
  15099. names: names$32
  15100. };
  15101. var includedProjections = function includedProjections(proj4) {
  15102. proj4.Proj.projections.add(tmerc);
  15103. proj4.Proj.projections.add(etmerc);
  15104. proj4.Proj.projections.add(utm);
  15105. proj4.Proj.projections.add(sterea);
  15106. proj4.Proj.projections.add(stere);
  15107. proj4.Proj.projections.add(somerc);
  15108. proj4.Proj.projections.add(omerc);
  15109. proj4.Proj.projections.add(lcc);
  15110. proj4.Proj.projections.add(krovak);
  15111. proj4.Proj.projections.add(cass);
  15112. proj4.Proj.projections.add(laea);
  15113. proj4.Proj.projections.add(aea);
  15114. proj4.Proj.projections.add(gnom);
  15115. proj4.Proj.projections.add(cea);
  15116. proj4.Proj.projections.add(eqc);
  15117. proj4.Proj.projections.add(poly);
  15118. proj4.Proj.projections.add(nzmg);
  15119. proj4.Proj.projections.add(mill);
  15120. proj4.Proj.projections.add(sinu);
  15121. proj4.Proj.projections.add(moll);
  15122. proj4.Proj.projections.add(eqdc);
  15123. proj4.Proj.projections.add(vandg);
  15124. proj4.Proj.projections.add(aeqd);
  15125. proj4.Proj.projections.add(ortho);
  15126. proj4.Proj.projections.add(qsc);
  15127. proj4.Proj.projections.add(robin);
  15128. proj4.Proj.projections.add(geocent);
  15129. proj4.Proj.projections.add(tpers);
  15130. proj4.Proj.projections.add(geos);
  15131. };
  15132. proj4$1.defaultDatum = 'WGS84'; //default datum
  15133. proj4$1.Proj = Projection;
  15134. proj4$1.WGS84 = new proj4$1.Proj('WGS84');
  15135. proj4$1.Point = Point;
  15136. proj4$1.toPoint = toPoint;
  15137. proj4$1.defs = defs;
  15138. proj4$1.nadgrid = nadgrid;
  15139. proj4$1.transform = transform;
  15140. proj4$1.mgrs = mgrs;
  15141. proj4$1.version = '2.9.0';
  15142. includedProjections(proj4$1);
  15143. return proj4$1;
  15144. });
  15145. /***/ }),
  15146. /***/ 9957:
  15147. /***/ (function(module, exports, __webpack_require__) {
  15148. 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); }
  15149. (function (global, factory) {
  15150. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  15151. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  15152. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  15153. __WEBPACK_AMD_DEFINE_FACTORY__),
  15154. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  15155. })(this, function () {
  15156. 'use strict';
  15157. /**
  15158. * @this {Promise}
  15159. */
  15160. function finallyConstructor(callback) {
  15161. var constructor = this.constructor;
  15162. return this.then(function (value) {
  15163. // @ts-ignore
  15164. return constructor.resolve(callback()).then(function () {
  15165. return value;
  15166. });
  15167. }, function (reason) {
  15168. // @ts-ignore
  15169. return constructor.resolve(callback()).then(function () {
  15170. // @ts-ignore
  15171. return constructor.reject(reason);
  15172. });
  15173. });
  15174. }
  15175. function allSettled(arr) {
  15176. var P = this;
  15177. return new P(function (resolve, reject) {
  15178. if (!(arr && typeof arr.length !== 'undefined')) {
  15179. return reject(new TypeError(_typeof(arr) + ' ' + arr + ' is not iterable(cannot read property Symbol(Symbol.iterator))'));
  15180. }
  15181. var args = Array.prototype.slice.call(arr);
  15182. if (args.length === 0) return resolve([]);
  15183. var remaining = args.length;
  15184. function res(i, val) {
  15185. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  15186. var then = val.then;
  15187. if (typeof then === 'function') {
  15188. then.call(val, function (val) {
  15189. res(i, val);
  15190. }, function (e) {
  15191. args[i] = {
  15192. status: 'rejected',
  15193. reason: e
  15194. };
  15195. if (--remaining === 0) {
  15196. resolve(args);
  15197. }
  15198. });
  15199. return;
  15200. }
  15201. }
  15202. args[i] = {
  15203. status: 'fulfilled',
  15204. value: val
  15205. };
  15206. if (--remaining === 0) {
  15207. resolve(args);
  15208. }
  15209. }
  15210. for (var i = 0; i < args.length; i++) {
  15211. res(i, args[i]);
  15212. }
  15213. });
  15214. }
  15215. // Store setTimeout reference so promise-polyfill will be unaffected by
  15216. // other code modifying setTimeout (like sinon.useFakeTimers())
  15217. var setTimeoutFunc = setTimeout;
  15218. function isArray(x) {
  15219. return Boolean(x && typeof x.length !== 'undefined');
  15220. }
  15221. function noop() {}
  15222. // Polyfill for Function.prototype.bind
  15223. function bind(fn, thisArg) {
  15224. return function () {
  15225. fn.apply(thisArg, arguments);
  15226. };
  15227. }
  15228. /**
  15229. * @constructor
  15230. * @param {Function} fn
  15231. */
  15232. function Promise(fn) {
  15233. if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
  15234. if (typeof fn !== 'function') throw new TypeError('not a function');
  15235. /** @type {!number} */
  15236. this._state = 0;
  15237. /** @type {!boolean} */
  15238. this._handled = false;
  15239. /** @type {Promise|undefined} */
  15240. this._value = undefined;
  15241. /** @type {!Array<!Function>} */
  15242. this._deferreds = [];
  15243. doResolve(fn, this);
  15244. }
  15245. function handle(self, deferred) {
  15246. while (self._state === 3) {
  15247. self = self._value;
  15248. }
  15249. if (self._state === 0) {
  15250. self._deferreds.push(deferred);
  15251. return;
  15252. }
  15253. self._handled = true;
  15254. Promise._immediateFn(function () {
  15255. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  15256. if (cb === null) {
  15257. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  15258. return;
  15259. }
  15260. var ret;
  15261. try {
  15262. ret = cb(self._value);
  15263. } catch (e) {
  15264. reject(deferred.promise, e);
  15265. return;
  15266. }
  15267. resolve(deferred.promise, ret);
  15268. });
  15269. }
  15270. function resolve(self, newValue) {
  15271. try {
  15272. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  15273. if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
  15274. if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
  15275. var then = newValue.then;
  15276. if (newValue instanceof Promise) {
  15277. self._state = 3;
  15278. self._value = newValue;
  15279. finale(self);
  15280. return;
  15281. } else if (typeof then === 'function') {
  15282. doResolve(bind(then, newValue), self);
  15283. return;
  15284. }
  15285. }
  15286. self._state = 1;
  15287. self._value = newValue;
  15288. finale(self);
  15289. } catch (e) {
  15290. reject(self, e);
  15291. }
  15292. }
  15293. function reject(self, newValue) {
  15294. self._state = 2;
  15295. self._value = newValue;
  15296. finale(self);
  15297. }
  15298. function finale(self) {
  15299. if (self._state === 2 && self._deferreds.length === 0) {
  15300. Promise._immediateFn(function () {
  15301. if (!self._handled) {
  15302. Promise._unhandledRejectionFn(self._value);
  15303. }
  15304. });
  15305. }
  15306. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  15307. handle(self, self._deferreds[i]);
  15308. }
  15309. self._deferreds = null;
  15310. }
  15311. /**
  15312. * @constructor
  15313. */
  15314. function Handler(onFulfilled, onRejected, promise) {
  15315. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  15316. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  15317. this.promise = promise;
  15318. }
  15319. /**
  15320. * Take a potentially misbehaving resolver function and make sure
  15321. * onFulfilled and onRejected are only called once.
  15322. *
  15323. * Makes no guarantees about asynchrony.
  15324. */
  15325. function doResolve(fn, self) {
  15326. var done = false;
  15327. try {
  15328. fn(function (value) {
  15329. if (done) return;
  15330. done = true;
  15331. resolve(self, value);
  15332. }, function (reason) {
  15333. if (done) return;
  15334. done = true;
  15335. reject(self, reason);
  15336. });
  15337. } catch (ex) {
  15338. if (done) return;
  15339. done = true;
  15340. reject(self, ex);
  15341. }
  15342. }
  15343. Promise.prototype['catch'] = function (onRejected) {
  15344. return this.then(null, onRejected);
  15345. };
  15346. Promise.prototype.then = function (onFulfilled, onRejected) {
  15347. // @ts-ignore
  15348. var prom = new this.constructor(noop);
  15349. handle(this, new Handler(onFulfilled, onRejected, prom));
  15350. return prom;
  15351. };
  15352. Promise.prototype['finally'] = finallyConstructor;
  15353. Promise.all = function (arr) {
  15354. return new Promise(function (resolve, reject) {
  15355. if (!isArray(arr)) {
  15356. return reject(new TypeError('Promise.all accepts an array'));
  15357. }
  15358. var args = Array.prototype.slice.call(arr);
  15359. if (args.length === 0) return resolve([]);
  15360. var remaining = args.length;
  15361. function res(i, val) {
  15362. try {
  15363. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  15364. var then = val.then;
  15365. if (typeof then === 'function') {
  15366. then.call(val, function (val) {
  15367. res(i, val);
  15368. }, reject);
  15369. return;
  15370. }
  15371. }
  15372. args[i] = val;
  15373. if (--remaining === 0) {
  15374. resolve(args);
  15375. }
  15376. } catch (ex) {
  15377. reject(ex);
  15378. }
  15379. }
  15380. for (var i = 0; i < args.length; i++) {
  15381. res(i, args[i]);
  15382. }
  15383. });
  15384. };
  15385. Promise.allSettled = allSettled;
  15386. Promise.resolve = function (value) {
  15387. if (value && _typeof(value) === 'object' && value.constructor === Promise) {
  15388. return value;
  15389. }
  15390. return new Promise(function (resolve) {
  15391. resolve(value);
  15392. });
  15393. };
  15394. Promise.reject = function (value) {
  15395. return new Promise(function (resolve, reject) {
  15396. reject(value);
  15397. });
  15398. };
  15399. Promise.race = function (arr) {
  15400. return new Promise(function (resolve, reject) {
  15401. if (!isArray(arr)) {
  15402. return reject(new TypeError('Promise.race accepts an array'));
  15403. }
  15404. for (var i = 0, len = arr.length; i < len; i++) {
  15405. Promise.resolve(arr[i]).then(resolve, reject);
  15406. }
  15407. });
  15408. };
  15409. // Use polyfill for setImmediate for performance gains
  15410. Promise._immediateFn =
  15411. // @ts-ignore
  15412. typeof setImmediate === 'function' && function (fn) {
  15413. // @ts-ignore
  15414. setImmediate(fn);
  15415. } || function (fn) {
  15416. setTimeoutFunc(fn, 0);
  15417. };
  15418. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  15419. if (typeof console !== 'undefined' && console) {
  15420. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  15421. }
  15422. };
  15423. /** @suppress {undefinedVars} */
  15424. var globalNS = function () {
  15425. // the only reliable means to get the global object is
  15426. // `Function('return this')()`
  15427. // However, this causes CSP violations in Chrome apps.
  15428. if (typeof self !== 'undefined') {
  15429. return self;
  15430. }
  15431. if (typeof window !== 'undefined') {
  15432. return window;
  15433. }
  15434. if (typeof __webpack_require__.g !== 'undefined') {
  15435. return __webpack_require__.g;
  15436. }
  15437. throw new Error('unable to locate global object');
  15438. }();
  15439. // Expose the polyfill if Promise is undefined or set to a
  15440. // non-function value. The latter can be due to a named HTMLElement
  15441. // being exposed by browsers for legacy reasons.
  15442. // https://github.com/taylorhakes/promise-polyfill/issues/114
  15443. if (typeof globalNS['Promise'] !== 'function') {
  15444. globalNS['Promise'] = Promise;
  15445. } else {
  15446. if (!globalNS.Promise.prototype['finally']) {
  15447. globalNS.Promise.prototype['finally'] = finallyConstructor;
  15448. }
  15449. if (!globalNS.Promise.allSettled) {
  15450. globalNS.Promise.allSettled = allSettled;
  15451. }
  15452. }
  15453. });
  15454. /***/ }),
  15455. /***/ 1441:
  15456. /***/ (function(module, exports, __webpack_require__) {
  15457. 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); }
  15458. (function (global, factory) {
  15459. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  15460. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  15461. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  15462. __WEBPACK_AMD_DEFINE_FACTORY__),
  15463. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  15464. })(this, function () {
  15465. 'use strict';
  15466. function quickselect(arr, k, left, right, compare) {
  15467. quickselectStep(arr, k, left || 0, right || arr.length - 1, compare || defaultCompare);
  15468. }
  15469. function quickselectStep(arr, k, left, right, compare) {
  15470. while (right > left) {
  15471. if (right - left > 600) {
  15472. var n = right - left + 1;
  15473. var m = k - left + 1;
  15474. var z = Math.log(n);
  15475. var s = 0.5 * Math.exp(2 * z / 3);
  15476. var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
  15477. var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
  15478. var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
  15479. quickselectStep(arr, k, newLeft, newRight, compare);
  15480. }
  15481. var t = arr[k];
  15482. var i = left;
  15483. var j = right;
  15484. swap(arr, left, k);
  15485. if (compare(arr[right], t) > 0) swap(arr, left, right);
  15486. while (i < j) {
  15487. swap(arr, i, j);
  15488. i++;
  15489. j--;
  15490. while (compare(arr[i], t) < 0) i++;
  15491. while (compare(arr[j], t) > 0) j--;
  15492. }
  15493. if (compare(arr[left], t) === 0) swap(arr, left, j);else {
  15494. j++;
  15495. swap(arr, j, right);
  15496. }
  15497. if (j <= k) left = j + 1;
  15498. if (k <= j) right = j - 1;
  15499. }
  15500. }
  15501. function swap(arr, i, j) {
  15502. var tmp = arr[i];
  15503. arr[i] = arr[j];
  15504. arr[j] = tmp;
  15505. }
  15506. function defaultCompare(a, b) {
  15507. return a < b ? -1 : a > b ? 1 : 0;
  15508. }
  15509. return quickselect;
  15510. });
  15511. /***/ }),
  15512. /***/ 3861:
  15513. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  15514. "use strict";
  15515. module.exports = rbush;
  15516. module.exports["default"] = rbush;
  15517. var quickselect = __webpack_require__(1441);
  15518. function rbush(maxEntries, format) {
  15519. if (!(this instanceof rbush)) return new rbush(maxEntries, format);
  15520. // max entries in a node is 9 by default; min node fill is 40% for best performance
  15521. this._maxEntries = Math.max(4, maxEntries || 9);
  15522. this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
  15523. if (format) {
  15524. this._initFormat(format);
  15525. }
  15526. this.clear();
  15527. }
  15528. rbush.prototype = {
  15529. all: function all() {
  15530. return this._all(this.data, []);
  15531. },
  15532. search: function search(bbox) {
  15533. var node = this.data,
  15534. result = [],
  15535. toBBox = this.toBBox;
  15536. if (!intersects(bbox, node)) return result;
  15537. var nodesToSearch = [],
  15538. i,
  15539. len,
  15540. child,
  15541. childBBox;
  15542. while (node) {
  15543. for (i = 0, len = node.children.length; i < len; i++) {
  15544. child = node.children[i];
  15545. childBBox = node.leaf ? toBBox(child) : child;
  15546. if (intersects(bbox, childBBox)) {
  15547. if (node.leaf) result.push(child);else if (contains(bbox, childBBox)) this._all(child, result);else nodesToSearch.push(child);
  15548. }
  15549. }
  15550. node = nodesToSearch.pop();
  15551. }
  15552. return result;
  15553. },
  15554. collides: function collides(bbox) {
  15555. var node = this.data,
  15556. toBBox = this.toBBox;
  15557. if (!intersects(bbox, node)) return false;
  15558. var nodesToSearch = [],
  15559. i,
  15560. len,
  15561. child,
  15562. childBBox;
  15563. while (node) {
  15564. for (i = 0, len = node.children.length; i < len; i++) {
  15565. child = node.children[i];
  15566. childBBox = node.leaf ? toBBox(child) : child;
  15567. if (intersects(bbox, childBBox)) {
  15568. if (node.leaf || contains(bbox, childBBox)) return true;
  15569. nodesToSearch.push(child);
  15570. }
  15571. }
  15572. node = nodesToSearch.pop();
  15573. }
  15574. return false;
  15575. },
  15576. load: function load(data) {
  15577. if (!(data && data.length)) return this;
  15578. if (data.length < this._minEntries) {
  15579. for (var i = 0, len = data.length; i < len; i++) {
  15580. this.insert(data[i]);
  15581. }
  15582. return this;
  15583. }
  15584. // recursively build the tree with the given data from scratch using OMT algorithm
  15585. var node = this._build(data.slice(), 0, data.length - 1, 0);
  15586. if (!this.data.children.length) {
  15587. // save as is if tree is empty
  15588. this.data = node;
  15589. } else if (this.data.height === node.height) {
  15590. // split root if trees have the same height
  15591. this._splitRoot(this.data, node);
  15592. } else {
  15593. if (this.data.height < node.height) {
  15594. // swap trees if inserted one is bigger
  15595. var tmpNode = this.data;
  15596. this.data = node;
  15597. node = tmpNode;
  15598. }
  15599. // insert the small tree into the large tree at appropriate level
  15600. this._insert(node, this.data.height - node.height - 1, true);
  15601. }
  15602. return this;
  15603. },
  15604. insert: function insert(item) {
  15605. if (item) this._insert(item, this.data.height - 1);
  15606. return this;
  15607. },
  15608. clear: function clear() {
  15609. this.data = createNode([]);
  15610. return this;
  15611. },
  15612. remove: function remove(item, equalsFn) {
  15613. if (!item) return this;
  15614. var node = this.data,
  15615. bbox = this.toBBox(item),
  15616. path = [],
  15617. indexes = [],
  15618. i,
  15619. parent,
  15620. index,
  15621. goingUp;
  15622. // depth-first iterative tree traversal
  15623. while (node || path.length) {
  15624. if (!node) {
  15625. // go up
  15626. node = path.pop();
  15627. parent = path[path.length - 1];
  15628. i = indexes.pop();
  15629. goingUp = true;
  15630. }
  15631. if (node.leaf) {
  15632. // check current node
  15633. index = findItem(item, node.children, equalsFn);
  15634. if (index !== -1) {
  15635. // item found, remove the item and condense tree upwards
  15636. node.children.splice(index, 1);
  15637. path.push(node);
  15638. this._condense(path);
  15639. return this;
  15640. }
  15641. }
  15642. if (!goingUp && !node.leaf && contains(node, bbox)) {
  15643. // go down
  15644. path.push(node);
  15645. indexes.push(i);
  15646. i = 0;
  15647. parent = node;
  15648. node = node.children[0];
  15649. } else if (parent) {
  15650. // go right
  15651. i++;
  15652. node = parent.children[i];
  15653. goingUp = false;
  15654. } else node = null; // nothing found
  15655. }
  15656. return this;
  15657. },
  15658. toBBox: function toBBox(item) {
  15659. return item;
  15660. },
  15661. compareMinX: compareNodeMinX,
  15662. compareMinY: compareNodeMinY,
  15663. toJSON: function toJSON() {
  15664. return this.data;
  15665. },
  15666. fromJSON: function fromJSON(data) {
  15667. this.data = data;
  15668. return this;
  15669. },
  15670. _all: function _all(node, result) {
  15671. var nodesToSearch = [];
  15672. while (node) {
  15673. if (node.leaf) result.push.apply(result, node.children);else nodesToSearch.push.apply(nodesToSearch, node.children);
  15674. node = nodesToSearch.pop();
  15675. }
  15676. return result;
  15677. },
  15678. _build: function _build(items, left, right, height) {
  15679. var N = right - left + 1,
  15680. M = this._maxEntries,
  15681. node;
  15682. if (N <= M) {
  15683. // reached leaf level; return leaf
  15684. node = createNode(items.slice(left, right + 1));
  15685. calcBBox(node, this.toBBox);
  15686. return node;
  15687. }
  15688. if (!height) {
  15689. // target height of the bulk-loaded tree
  15690. height = Math.ceil(Math.log(N) / Math.log(M));
  15691. // target number of root entries to maximize storage utilization
  15692. M = Math.ceil(N / Math.pow(M, height - 1));
  15693. }
  15694. node = createNode([]);
  15695. node.leaf = false;
  15696. node.height = height;
  15697. // split the items into M mostly square tiles
  15698. var N2 = Math.ceil(N / M),
  15699. N1 = N2 * Math.ceil(Math.sqrt(M)),
  15700. i,
  15701. j,
  15702. right2,
  15703. right3;
  15704. multiSelect(items, left, right, N1, this.compareMinX);
  15705. for (i = left; i <= right; i += N1) {
  15706. right2 = Math.min(i + N1 - 1, right);
  15707. multiSelect(items, i, right2, N2, this.compareMinY);
  15708. for (j = i; j <= right2; j += N2) {
  15709. right3 = Math.min(j + N2 - 1, right2);
  15710. // pack each entry recursively
  15711. node.children.push(this._build(items, j, right3, height - 1));
  15712. }
  15713. }
  15714. calcBBox(node, this.toBBox);
  15715. return node;
  15716. },
  15717. _chooseSubtree: function _chooseSubtree(bbox, node, level, path) {
  15718. var i, len, child, targetNode, area, enlargement, minArea, minEnlargement;
  15719. while (true) {
  15720. path.push(node);
  15721. if (node.leaf || path.length - 1 === level) break;
  15722. minArea = minEnlargement = Infinity;
  15723. for (i = 0, len = node.children.length; i < len; i++) {
  15724. child = node.children[i];
  15725. area = bboxArea(child);
  15726. enlargement = enlargedArea(bbox, child) - area;
  15727. // choose entry with the least area enlargement
  15728. if (enlargement < minEnlargement) {
  15729. minEnlargement = enlargement;
  15730. minArea = area < minArea ? area : minArea;
  15731. targetNode = child;
  15732. } else if (enlargement === minEnlargement) {
  15733. // otherwise choose one with the smallest area
  15734. if (area < minArea) {
  15735. minArea = area;
  15736. targetNode = child;
  15737. }
  15738. }
  15739. }
  15740. node = targetNode || node.children[0];
  15741. }
  15742. return node;
  15743. },
  15744. _insert: function _insert(item, level, isNode) {
  15745. var toBBox = this.toBBox,
  15746. bbox = isNode ? item : toBBox(item),
  15747. insertPath = [];
  15748. // find the best node for accommodating the item, saving all nodes along the path too
  15749. var node = this._chooseSubtree(bbox, this.data, level, insertPath);
  15750. // put the item into the node
  15751. node.children.push(item);
  15752. extend(node, bbox);
  15753. // split on node overflow; propagate upwards if necessary
  15754. while (level >= 0) {
  15755. if (insertPath[level].children.length > this._maxEntries) {
  15756. this._split(insertPath, level);
  15757. level--;
  15758. } else break;
  15759. }
  15760. // adjust bboxes along the insertion path
  15761. this._adjustParentBBoxes(bbox, insertPath, level);
  15762. },
  15763. // split overflowed node into two
  15764. _split: function _split(insertPath, level) {
  15765. var node = insertPath[level],
  15766. M = node.children.length,
  15767. m = this._minEntries;
  15768. this._chooseSplitAxis(node, m, M);
  15769. var splitIndex = this._chooseSplitIndex(node, m, M);
  15770. var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));
  15771. newNode.height = node.height;
  15772. newNode.leaf = node.leaf;
  15773. calcBBox(node, this.toBBox);
  15774. calcBBox(newNode, this.toBBox);
  15775. if (level) insertPath[level - 1].children.push(newNode);else this._splitRoot(node, newNode);
  15776. },
  15777. _splitRoot: function _splitRoot(node, newNode) {
  15778. // split root node
  15779. this.data = createNode([node, newNode]);
  15780. this.data.height = node.height + 1;
  15781. this.data.leaf = false;
  15782. calcBBox(this.data, this.toBBox);
  15783. },
  15784. _chooseSplitIndex: function _chooseSplitIndex(node, m, M) {
  15785. var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index;
  15786. minOverlap = minArea = Infinity;
  15787. for (i = m; i <= M - m; i++) {
  15788. bbox1 = distBBox(node, 0, i, this.toBBox);
  15789. bbox2 = distBBox(node, i, M, this.toBBox);
  15790. overlap = intersectionArea(bbox1, bbox2);
  15791. area = bboxArea(bbox1) + bboxArea(bbox2);
  15792. // choose distribution with minimum overlap
  15793. if (overlap < minOverlap) {
  15794. minOverlap = overlap;
  15795. index = i;
  15796. minArea = area < minArea ? area : minArea;
  15797. } else if (overlap === minOverlap) {
  15798. // otherwise choose distribution with minimum area
  15799. if (area < minArea) {
  15800. minArea = area;
  15801. index = i;
  15802. }
  15803. }
  15804. }
  15805. return index;
  15806. },
  15807. // sorts node children by the best axis for split
  15808. _chooseSplitAxis: function _chooseSplitAxis(node, m, M) {
  15809. var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX,
  15810. compareMinY = node.leaf ? this.compareMinY : compareNodeMinY,
  15811. xMargin = this._allDistMargin(node, m, M, compareMinX),
  15812. yMargin = this._allDistMargin(node, m, M, compareMinY);
  15813. // if total distributions margin value is minimal for x, sort by minX,
  15814. // otherwise it's already sorted by minY
  15815. if (xMargin < yMargin) node.children.sort(compareMinX);
  15816. },
  15817. // total margin of all possible split distributions where each node is at least m full
  15818. _allDistMargin: function _allDistMargin(node, m, M, compare) {
  15819. node.children.sort(compare);
  15820. var toBBox = this.toBBox,
  15821. leftBBox = distBBox(node, 0, m, toBBox),
  15822. rightBBox = distBBox(node, M - m, M, toBBox),
  15823. margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),
  15824. i,
  15825. child;
  15826. for (i = m; i < M - m; i++) {
  15827. child = node.children[i];
  15828. extend(leftBBox, node.leaf ? toBBox(child) : child);
  15829. margin += bboxMargin(leftBBox);
  15830. }
  15831. for (i = M - m - 1; i >= m; i--) {
  15832. child = node.children[i];
  15833. extend(rightBBox, node.leaf ? toBBox(child) : child);
  15834. margin += bboxMargin(rightBBox);
  15835. }
  15836. return margin;
  15837. },
  15838. _adjustParentBBoxes: function _adjustParentBBoxes(bbox, path, level) {
  15839. // adjust bboxes along the given tree path
  15840. for (var i = level; i >= 0; i--) {
  15841. extend(path[i], bbox);
  15842. }
  15843. },
  15844. _condense: function _condense(path) {
  15845. // go through the path, removing empty nodes and updating bboxes
  15846. for (var i = path.length - 1, siblings; i >= 0; i--) {
  15847. if (path[i].children.length === 0) {
  15848. if (i > 0) {
  15849. siblings = path[i - 1].children;
  15850. siblings.splice(siblings.indexOf(path[i]), 1);
  15851. } else this.clear();
  15852. } else calcBBox(path[i], this.toBBox);
  15853. }
  15854. },
  15855. _initFormat: function _initFormat(format) {
  15856. // data format (minX, minY, maxX, maxY accessors)
  15857. // uses eval-type function compilation instead of just accepting a toBBox function
  15858. // because the algorithms are very sensitive to sorting functions performance,
  15859. // so they should be dead simple and without inner calls
  15860. var compareArr = ['return a', ' - b', ';'];
  15861. this.compareMinX = new Function('a', 'b', compareArr.join(format[0]));
  15862. this.compareMinY = new Function('a', 'b', compareArr.join(format[1]));
  15863. this.toBBox = new Function('a', 'return {minX: a' + format[0] + ', minY: a' + format[1] + ', maxX: a' + format[2] + ', maxY: a' + format[3] + '};');
  15864. }
  15865. };
  15866. function findItem(item, items, equalsFn) {
  15867. if (!equalsFn) return items.indexOf(item);
  15868. for (var i = 0; i < items.length; i++) {
  15869. if (equalsFn(item, items[i])) return i;
  15870. }
  15871. return -1;
  15872. }
  15873. // calculate node's bbox from bboxes of its children
  15874. function calcBBox(node, toBBox) {
  15875. distBBox(node, 0, node.children.length, toBBox, node);
  15876. }
  15877. // min bounding rectangle of node children from k to p-1
  15878. function distBBox(node, k, p, toBBox, destNode) {
  15879. if (!destNode) destNode = createNode(null);
  15880. destNode.minX = Infinity;
  15881. destNode.minY = Infinity;
  15882. destNode.maxX = -Infinity;
  15883. destNode.maxY = -Infinity;
  15884. for (var i = k, child; i < p; i++) {
  15885. child = node.children[i];
  15886. extend(destNode, node.leaf ? toBBox(child) : child);
  15887. }
  15888. return destNode;
  15889. }
  15890. function extend(a, b) {
  15891. a.minX = Math.min(a.minX, b.minX);
  15892. a.minY = Math.min(a.minY, b.minY);
  15893. a.maxX = Math.max(a.maxX, b.maxX);
  15894. a.maxY = Math.max(a.maxY, b.maxY);
  15895. return a;
  15896. }
  15897. function compareNodeMinX(a, b) {
  15898. return a.minX - b.minX;
  15899. }
  15900. function compareNodeMinY(a, b) {
  15901. return a.minY - b.minY;
  15902. }
  15903. function bboxArea(a) {
  15904. return (a.maxX - a.minX) * (a.maxY - a.minY);
  15905. }
  15906. function bboxMargin(a) {
  15907. return a.maxX - a.minX + (a.maxY - a.minY);
  15908. }
  15909. function enlargedArea(a, b) {
  15910. 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));
  15911. }
  15912. function intersectionArea(a, b) {
  15913. var minX = Math.max(a.minX, b.minX),
  15914. minY = Math.max(a.minY, b.minY),
  15915. maxX = Math.min(a.maxX, b.maxX),
  15916. maxY = Math.min(a.maxY, b.maxY);
  15917. return Math.max(0, maxX - minX) * Math.max(0, maxY - minY);
  15918. }
  15919. function contains(a, b) {
  15920. return a.minX <= b.minX && a.minY <= b.minY && b.maxX <= a.maxX && b.maxY <= a.maxY;
  15921. }
  15922. function intersects(a, b) {
  15923. return b.minX <= a.maxX && b.minY <= a.maxY && b.maxX >= a.minX && b.maxY >= a.minY;
  15924. }
  15925. function createNode(children) {
  15926. return {
  15927. children: children,
  15928. height: 1,
  15929. leaf: true,
  15930. minX: Infinity,
  15931. minY: Infinity,
  15932. maxX: -Infinity,
  15933. maxY: -Infinity
  15934. };
  15935. }
  15936. // sort an array so that items come in groups of n unsorted items, with groups sorted between each other;
  15937. // combines selection algorithm with binary divide & conquer approach
  15938. function multiSelect(arr, left, right, n, compare) {
  15939. var stack = [left, right],
  15940. mid;
  15941. while (stack.length) {
  15942. right = stack.pop();
  15943. left = stack.pop();
  15944. if (right - left <= n) continue;
  15945. mid = left + Math.ceil((right - left) / n / 2) * n;
  15946. quickselect(arr, mid, left, right, compare);
  15947. stack.push(left, mid, mid, right);
  15948. }
  15949. }
  15950. /***/ }),
  15951. /***/ 3425:
  15952. /***/ (function(module, exports, __webpack_require__) {
  15953. 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); }
  15954. // https://github.com/mbostock/slice-source Version 0.4.1. Copyright 2016 Mike Bostock.
  15955. (function (global, factory) {
  15956. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  15957. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  15958. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  15959. __WEBPACK_AMD_DEFINE_FACTORY__),
  15960. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : (0);
  15961. })(this, function () {
  15962. 'use strict';
  15963. var empty = new Uint8Array(0);
  15964. function slice_cancel() {
  15965. return this._source.cancel();
  15966. }
  15967. function concat(a, b) {
  15968. if (!a.length) return b;
  15969. if (!b.length) return a;
  15970. var c = new Uint8Array(a.length + b.length);
  15971. c.set(a);
  15972. c.set(b, a.length);
  15973. return c;
  15974. }
  15975. function slice_read() {
  15976. var that = this,
  15977. array = that._array.subarray(that._index);
  15978. return that._source.read().then(function (result) {
  15979. that._array = empty;
  15980. that._index = 0;
  15981. return result.done ? array.length > 0 ? {
  15982. done: false,
  15983. value: array
  15984. } : {
  15985. done: true,
  15986. value: undefined
  15987. } : {
  15988. done: false,
  15989. value: concat(array, result.value)
  15990. };
  15991. });
  15992. }
  15993. function slice_slice(length) {
  15994. if ((length |= 0) < 0) throw new Error("invalid length");
  15995. var that = this,
  15996. index = this._array.length - this._index;
  15997. // If the request fits within the remaining buffer, resolve it immediately.
  15998. if (this._index + length <= this._array.length) {
  15999. return Promise.resolve(this._array.subarray(this._index, this._index += length));
  16000. }
  16001. // Otherwise, read chunks repeatedly until the request is fulfilled.
  16002. var array = new Uint8Array(length);
  16003. array.set(this._array.subarray(this._index));
  16004. return function read() {
  16005. return that._source.read().then(function (result) {
  16006. // When done, it’s possible the request wasn’t fully fullfilled!
  16007. // If so, the pre-allocated array is too big and needs slicing.
  16008. if (result.done) {
  16009. that._array = empty;
  16010. that._index = 0;
  16011. return index > 0 ? array.subarray(0, index) : null;
  16012. }
  16013. // If this chunk fulfills the request, return the resulting array.
  16014. if (index + result.value.length >= length) {
  16015. that._array = result.value;
  16016. that._index = length - index;
  16017. array.set(result.value.subarray(0, length - index), index);
  16018. return array;
  16019. }
  16020. // Otherwise copy this chunk into the array, then read the next chunk.
  16021. array.set(result.value, index);
  16022. index += result.value.length;
  16023. return read();
  16024. });
  16025. }();
  16026. }
  16027. function slice(source) {
  16028. return typeof source.slice === "function" ? source : new SliceSource(typeof source.read === "function" ? source : source.getReader());
  16029. }
  16030. function SliceSource(source) {
  16031. this._source = source;
  16032. this._array = empty;
  16033. this._index = 0;
  16034. }
  16035. SliceSource.prototype.read = slice_read;
  16036. SliceSource.prototype.slice = slice_slice;
  16037. SliceSource.prototype.cancel = slice_cancel;
  16038. return slice;
  16039. });
  16040. /***/ }),
  16041. /***/ 8975:
  16042. /***/ (function() {
  16043. "use strict";
  16044. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  16045. * This program are made available under the terms of the Apache License, Version 2.0
  16046. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16047. /***/ }),
  16048. /***/ 5494:
  16049. /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
  16050. "use strict";
  16051. // UNUSED EXPORTS: AddressMatchService, AggregationParameter, AggregationTypes, AlongLineDirection, AnalystAreaUnit, AnalystSizeUnit, AreaSolarRadiationParameters, ArrayStatistic, AttributesPopContainer, BaiduCRS, BaiduTileLayer, Bounds, Browser, BucketAggParameter, BucketAggType, BufferAnalystParameters, BufferDistance, BufferEndType, BufferRadiusUnit, BufferSetting, BuffersAnalystJobsParameter, BurstPipelineAnalystParameters, CRS, CartoCSS, ChangeTileVersion, ChartQueryFilterParameter, ChartQueryParameters, ChartService, ChartType, ChartView, ChartViewModel, CircleStyle, CityTabsPage, ClientComputationLayer, ClientComputationView, ClientComputationViewModel, ClientType, ClipAnalystMode, ClipParameter, CloudTileLayer, CloverStyle, ColorDictionary, ColorGradientType, ColorSpaceType, ColorsPickerUtil, CommonContainer, CommonServiceBase, CommonTheme, CommonUtil, CommontypesConversion, ComponentsUtil, ComponentsViewBase, ComputeWeightMatrixParameters, CreateDatasetParameters, Credential, DataFlowLayer, DataFlowService, DataFlowView, DataFlowViewModel, DataFormat, DataItemOrderBy, DataItemType, DataReturnMode, DataReturnOption, DataServiceQueryView, DataServiceQueryViewModel, DatasetBufferAnalystParameters, DatasetInfo, DatasetOverlayAnalystParameters, DatasetService, DatasetSurfaceAnalystParameters, DatasetThiessenAnalystParameters, DatasourceConnectionInfo, DatasourceService, DensityKernelAnalystParameters, DirectionType, DistributedAnalysisView, DistributedAnalysisViewModel, DropDownBox, EchartsLayer, 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, GeoFeatureThemeLayer, GeoHashGridAggParameter, GeoJSONFormat, GeoJSONLayerWithName, GeoJsonLayerDataModel, 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, GetResolutionFromScaleDpi, GraduatedMode, GraphAxesTextDisplayMode, GraphMap, GraphThemeLayer, Graphic, GraphicLayer, Grid, GridCellInfosService, GridType, HeatMapFeature, HeatMapLayer, HillshadeParameter, IManager, IManagerCreateNodeParam, IManagerServiceBase, IPortal, IPortalAddDataParam, IPortalAddResourceParam, IPortalDataConnectionInfoParam, IPortalDataMetaInfoParam, IPortalDataStoreInfoParam, IPortalQueryParam, IPortalQueryResult, IPortalRegisterServiceParam, IPortalResource, IPortalServiceBase, IPortalShareEntity, IPortalShareParam, IPortalUser, ImageCollectionService, ImageGFAspect, ImageGFHillShade, ImageGFOrtho, ImageGFSlope, ImageMapLayer, ImageRenderingRule, ImageSearchParameter, ImageService, ImageStretchOption, ImageStyle, ImageTileLayer, IndexTabsPageContainer, InterpolationAlgorithmType, InterpolationAnalystParameters, InterpolationDensityAnalystParameters, InterpolationIDWAnalystParameters, InterpolationKrigingAnalystParameters, InterpolationRBFAnalystParameters, JSONFormat, JoinItem, JoinType, KernelDensityJobParameter, KeyServiceParameter, KnowledgeGraph, KnowledgeGraphService, LabelBackShape, LabelImageCell, LabelMatrixCell, LabelMixedTextStyle, LabelOverLengthMode, LabelSymbolCell, LabelThemeCell, LabelThemeLayer, Lang, LayerInfoService, LayerStatus, LayerType, LinkItem, Logo, LonLat, MapService, MapVLayer, MapVRenderer, MappingParameters, MapvRenderer, MathExpressionAnalysisParameters, MeasureMode, MeasureParameters, MeasureService, MessageBox, MetricsAggParameter, MetricsAggType, NDVIParameter, NavTabsPage, NetworkAnalyst3DService, NetworkAnalystService, NetworkAnalystServiceBase, NonEarthCRS, NormalRenderer, NormalizeScale, Online, OnlineData, OnlineQueryDatasParameter, OnlineServiceBase, OpenFileView, OpenFileViewModel, OrderBy, OrderType, OutputSetting, OutputType, OverlapDisplayedOptions, OverlayAnalystParameters, OverlayGeoJobParameter, OverlayOperationType, PaginationContainer, PermissionType, Pixel, PixelFormat, PointWithMeasure, PopContainer, ProcessingService, ProcessingServiceBase, QueryByBoundsParameters, QueryByDistanceParameters, QueryByGeometryParameters, QueryBySQLParameters, QueryOption, QueryParameters, QueryService, RangeMode, RangeThemeLayer, RankSymbolThemeLayer, RasterFunctionParameter, RasterFunctionType, ResourceType, Route, RouteCalculateMeasureParameters, RouteLocatorParameters, SVGRenderer, SearchMode, SearchType, SearchView, SearchViewModel, 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, ThemeFeature, ThemeGraduatedSymbol, ThemeGraduatedSymbolStyle, ThemeGraph, ThemeGraphAxes, ThemeGraphItem, ThemeGraphSize, ThemeGraphText, ThemeGraphTextFormat, ThemeGraphType, ThemeGridRange, ThemeGridRangeItem, ThemeGridUnique, ThemeGridUniqueItem, ThemeLabel, ThemeLabelAlongLine, ThemeLabelBackground, ThemeLabelItem, ThemeLabelText, ThemeLabelUniqueItem, ThemeLayer, ThemeMemoryData, ThemeOffset, ThemeParameters, ThemeRange, ThemeRangeItem, ThemeService, ThemeStyle, ThemeType, ThemeUnique, ThemeUniqueItem, ThiessenAnalystParameters, TianDiTu_MercatorCRS, TianDiTu_WGS84CRS, TiandituTileLayer, TileVectorLayer, TiledMapLayer, TiledVectorLayer, TimeControlBase, TimeFlowControl, TokenServiceParameter, TopologyValidatorJobsParameter, TopologyValidatorRule, TrafficTransferAnalystService, TransferLine, TransferPathParameters, TransferPreference, TransferSolutionParameters, TransferTactic, Transform, TransportationAnalystParameter, TransportationAnalystResultSetting, TurfLayer, TurnType, UGCLayer, UGCLayerType, UGCMapLayer, UGCSubLayer, UnicodeMarker, UniqueThemeLayer, Unit, UpdateDatasetParameters, UpdateEdgeWeightParameters, UpdateTurnNodeWeightParameters, VariogramMode, Vector, VectorClipJobsParameter, VectorGrid, VectorTileFormat, WKTFormat, WMTSLayer, WebExportFormatType, WebMap, WebPrintingJobContent, WebPrintingJobCustomItems, WebPrintingJobExportOptions, WebPrintingJobImage, WebPrintingJobLayers, WebPrintingJobLayoutOptions, WebPrintingJobLegendOptions, WebPrintingJobLittleMapOptions, WebPrintingJobNorthArrowOptions, WebPrintingJobParameters, WebPrintingJobScaleBarOptions, WebPrintingJobService, WebScaleOrientationType, WebScaleType, WebScaleUnit, addressMatchService, baiduTileLayer, changeTileVersion, chartService, circleStyle, clientComputationLayer, clientComputationView, cloudTileLayer, cloverStyle, componentsViewBase, conversionDegree, crs, crsFromMapJSON, dataFlowLayer, dataFlowService, dataFlowView, dataFlowViewModel, dataServiceQueryView, dataServiceQueryViewModel, datasetService, datasourceService, distributedAnalysisView, echartsLayer, featureService, fgbLayer, fieldService, geoJSONLayerWithName, geoprocessingService, getMeterPerMapUnit, getResolutionFromScaleDpi, getWrapNum, graphThemeLayer, graphic, graphicLayer, gridCellInfosService, heatMapFeature, heatMapLayer, imageMapLayer, imageStyle, imageTileLayer, initMap, isCORS, labelThemeLayer, layerInfoService, logo, mapService, mapVLayer, measureService, networkAnalyst3DService, networkAnalystService, nonEarthCRS, normalizeScale, openFileView, openFileViewModel, processingService, queryService, rangeThemeLayer, rankSymbolThemeLayer, resolutionToScale, scaleToResolution, searchView, searchViewModel, setCORS, spatialAnalystService, themeFeature, themeService, tiandituTileLayer, tiledMapLayer, tiledVectorLayer, toGeoJSON, toSuperMapGeometry, trafficTransferAnalystService, transform, turfLayer, unicodeMarker, uniqueThemeLayer, webMap, webPrintingJobService, wmtsLayer
  16052. ;// CONCATENATED MODULE: ./src/common/SuperMap.js
  16053. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  16054. * This program are made available under the terms of the Apache License, Version 2.0
  16055. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16056. var SuperMap = window.SuperMap = window.SuperMap || {};
  16057. SuperMap.Components = window.SuperMap.Components || {};
  16058. ;// CONCATENATED MODULE: ./src/common/REST.js
  16059. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  16060. * This program are made available under the terms of the Apache License, Version 2.0
  16061. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16062. /**
  16063. * @enum DataFormat
  16064. * @description 服务请求返回结果数据类型
  16065. * @category BaseTypes Constant
  16066. * @type {string}
  16067. * @usage
  16068. * ```
  16069. * // 浏览器
  16070. * <script type="text/javascript" src="{cdn}"></script>
  16071. * <script>
  16072. * const result = {namespace}.DataFormat.GEOJSON;
  16073. *
  16074. * </script>
  16075. * // ES6 Import
  16076. * import { DataFormat } from '{npm}';
  16077. *
  16078. * const result = DataFormat.GEOJSON;
  16079. * ```
  16080. */
  16081. var DataFormat = {
  16082. /** GEOJSON */
  16083. GEOJSON: "GEOJSON",
  16084. /** ISERVER */
  16085. ISERVER: "ISERVER",
  16086. /** FGB */
  16087. FGB: "FGB"
  16088. };
  16089. /**
  16090. * @enum ServerType
  16091. * @description 服务器类型
  16092. * @category BaseTypes Constant
  16093. * @type {string}
  16094. * @usage
  16095. * ```
  16096. * // 浏览器
  16097. * <script type="text/javascript" src="{cdn}"></script>
  16098. * <script>
  16099. * const result = {namespace}.ServerType.ISERVER;
  16100. *
  16101. * </script>
  16102. * // ES6 Import
  16103. * import { ServerType } from '{npm}';
  16104. *
  16105. * const result = ServerType.ISERVER;
  16106. * ```
  16107. */
  16108. var ServerType = {
  16109. /** ISERVER */
  16110. ISERVER: "ISERVER",
  16111. /** IPORTAL */
  16112. IPORTAL: "IPORTAL",
  16113. /** ONLINE */
  16114. ONLINE: "ONLINE"
  16115. };
  16116. /**
  16117. * @enum GeometryType
  16118. * @description 几何对象枚举,定义了一系列几何对象类型。
  16119. * @category BaseTypes Constant
  16120. * @type {string}
  16121. * @usage
  16122. * ```
  16123. * // 浏览器
  16124. * <script type="text/javascript" src="{cdn}"></script>
  16125. * <script>
  16126. * const result = {namespace}.GeometryType.LINE;
  16127. *
  16128. * </script>
  16129. * // ES6 Import
  16130. * import { GeometryType } from '{npm}';
  16131. *
  16132. * const result = GeometryType.LINE;
  16133. * ```
  16134. */
  16135. var REST_GeometryType = {
  16136. /** 线几何对象类型。 */
  16137. LINE: "LINE",
  16138. /** 路由对象。 */
  16139. LINEM: "LINEM",
  16140. /** 点几何对象类型。 */
  16141. POINT: "POINT",
  16142. /** 面几何对象类型。 */
  16143. REGION: "REGION",
  16144. /** EPS点几何对象。 */
  16145. POINTEPS: "POINTEPS",
  16146. /** EPS线几何对象。 */
  16147. LINEEPS: "LINEEPS",
  16148. /** EPS面几何对象。 */
  16149. REGIONEPS: "REGIONEPS",
  16150. /** 椭圆。 */
  16151. ELLIPSE: "ELLIPSE",
  16152. /** 圆。 */
  16153. CIRCLE: "CIRCLE",
  16154. /** 文本几何对象类型。 */
  16155. TEXT: "TEXT",
  16156. /** 矩形。 */
  16157. RECTANGLE: "RECTANGLE",
  16158. /** 未定义。 */
  16159. UNKNOWN: "UNKNOWN",
  16160. /** 复合几何对象类型。 */
  16161. GEOCOMPOUND: "GEOCOMPOUND"
  16162. };
  16163. /**
  16164. * @enum QueryOption
  16165. * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
  16166. * @category BaseTypes Constant
  16167. * @type {string}
  16168. * @usage
  16169. * ```
  16170. * // 浏览器
  16171. * <script type="text/javascript" src="{cdn}"></script>
  16172. * <script>
  16173. * const result = {namespace}.QueryOption.ATTRIBUTE;
  16174. *
  16175. * </script>
  16176. * // ES6 Import
  16177. * import { QueryOption } from '{npm}';
  16178. *
  16179. * const result = QueryOption.ATTRIBUTE;
  16180. * ```
  16181. */
  16182. var QueryOption = {
  16183. /** 属性。 */
  16184. ATTRIBUTE: "ATTRIBUTE",
  16185. /** 属性和几何对象。 */
  16186. ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
  16187. /** 几何对象。 */
  16188. GEOMETRY: "GEOMETRY"
  16189. };
  16190. /**
  16191. * @enum JoinType
  16192. * @description 关联查询时的关联类型常量。
  16193. * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
  16194. * @category BaseTypes Constant
  16195. * @type {string}
  16196. * @usage
  16197. * ```
  16198. * // 浏览器
  16199. * <script type="text/javascript" src="{cdn}"></script>
  16200. * <script>
  16201. * const result = {namespace}.JoinType.INNERJOIN;
  16202. *
  16203. * </script>
  16204. * // ES6 Import
  16205. * import { JoinType } from '{npm}';
  16206. *
  16207. * const result = JoinType.INNERJOIN;
  16208. * ```
  16209. */
  16210. var JoinType = {
  16211. /** 内连接。 */
  16212. INNERJOIN: "INNERJOIN",
  16213. /** 左连接。 */
  16214. LEFTJOIN: "LEFTJOIN"
  16215. };
  16216. /**
  16217. * @enum SpatialQueryMode
  16218. * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
  16219. * @category BaseTypes Constant
  16220. * @type {string}
  16221. * @usage
  16222. * ```
  16223. * // 浏览器
  16224. * <script type="text/javascript" src="{cdn}"></script>
  16225. * <script>
  16226. * const result = {namespace}.SpatialQueryMode.CONTAIN;
  16227. *
  16228. * </script>
  16229. * // ES6 Import
  16230. * import { SpatialQueryMode } from '{npm}';
  16231. *
  16232. * const result = SpatialQueryMode.CONTAIN;
  16233. * ```
  16234. */
  16235. var SpatialQueryMode = {
  16236. /** 包含空间查询模式。 */
  16237. CONTAIN: "CONTAIN",
  16238. /** 交叉空间查询模式。 */
  16239. CROSS: "CROSS",
  16240. /** 分离空间查询模式。 */
  16241. DISJOINT: "DISJOINT",
  16242. /** 重合空间查询模式。 */
  16243. IDENTITY: "IDENTITY",
  16244. /** 相交空间查询模式。 */
  16245. INTERSECT: "INTERSECT",
  16246. /** 无空间查询。 */
  16247. NONE: "NONE",
  16248. /** 叠加空间查询模式。 */
  16249. OVERLAP: "OVERLAP",
  16250. /** 邻接空间查询模式。 */
  16251. TOUCH: "TOUCH",
  16252. /** 被包含空间查询模式。 */
  16253. WITHIN: "WITHIN"
  16254. };
  16255. /**
  16256. * @enum SpatialRelationType
  16257. * @description 数据集对象间的空间关系枚举。
  16258. * 该类定义了数据集对象间的空间关系类型常量。
  16259. * @category BaseTypes Constant
  16260. * @type {string}
  16261. * @usage
  16262. * ```
  16263. * // 浏览器
  16264. * <script type="text/javascript" src="{cdn}"></script>
  16265. * <script>
  16266. * const result = {namespace}.SpatialRelationType.CONTAIN;
  16267. *
  16268. * </script>
  16269. * // ES6 Import
  16270. * import { SpatialRelationType } from '{npm}';
  16271. *
  16272. * const result = {namespace}.SpatialRelationType.CONTAIN;
  16273. * ```
  16274. */
  16275. var SpatialRelationType = {
  16276. /** 包含关系。 */
  16277. CONTAIN: "CONTAIN",
  16278. /** 相交关系。 */
  16279. INTERSECT: "INTERSECT",
  16280. /** 被包含关系。 */
  16281. WITHIN: "WITHIN"
  16282. };
  16283. /**
  16284. * @enum MeasureMode
  16285. * @type {string}
  16286. * @description 量算模式枚举。
  16287. * @category BaseTypes Constant
  16288. * 该类定义了两种测量模式:距离测量和面积测量。
  16289. * @usage
  16290. * ```
  16291. * // 浏览器
  16292. * <script type="text/javascript" src="{cdn}"></script>
  16293. * <script>
  16294. * const result = {namespace}.MeasureMode.DISTANCE;
  16295. *
  16296. * </script>
  16297. * // ES6 Import
  16298. * import { MeasureMode } from '{npm}';
  16299. *
  16300. * const result = MeasureMode.DISTANCE;
  16301. * ```
  16302. */
  16303. var MeasureMode = {
  16304. /** 距离测量。 */
  16305. DISTANCE: "DISTANCE",
  16306. /** 面积测量。 */
  16307. AREA: "AREA"
  16308. };
  16309. /**
  16310. * @enum Unit
  16311. * @description 距离单位枚举。
  16312. * 该类定义了一系列距离单位类型。
  16313. * @category BaseTypes Constant
  16314. * @type {string}
  16315. * @usage
  16316. * ```
  16317. * // 浏览器
  16318. * <script type="text/javascript" src="{cdn}"></script>
  16319. * <script>
  16320. * const result = {namespace}.Unit.METER;
  16321. *
  16322. * </script>
  16323. * // ES6 Import
  16324. * import { Unit } from '{npm}';
  16325. *
  16326. * const result = Unit.METER;
  16327. * ```
  16328. */
  16329. var Unit = {
  16330. /** 米。 */
  16331. METER: "METER",
  16332. /** 千米。 */
  16333. KILOMETER: "KILOMETER",
  16334. /** 英里。 */
  16335. MILE: "MILE",
  16336. /** 码。 */
  16337. YARD: "YARD",
  16338. /** 度。 */
  16339. DEGREE: "DEGREE",
  16340. /** 毫米。 */
  16341. MILLIMETER: "MILLIMETER",
  16342. /** 厘米。 */
  16343. CENTIMETER: "CENTIMETER",
  16344. /** 英寸。 */
  16345. INCH: "INCH",
  16346. /** 分米。 */
  16347. DECIMETER: "DECIMETER",
  16348. /** 英尺。 */
  16349. FOOT: "FOOT",
  16350. /** 秒。 */
  16351. SECOND: "SECOND",
  16352. /** 分。 */
  16353. MINUTE: "MINUTE",
  16354. /** 弧度。 */
  16355. RADIAN: "RADIAN"
  16356. };
  16357. /**
  16358. * @enum BufferRadiusUnit
  16359. * @description 缓冲区距离单位枚举。该类定义了一系列缓冲距离单位类型。
  16360. * @category BaseTypes Constant
  16361. * @type {string}
  16362. * @usage
  16363. * ```
  16364. * // 浏览器
  16365. * <script type="text/javascript" src="{cdn}"></script>
  16366. * <script>
  16367. * const result = {namespace}.BufferRadiusUnit.CENTIMETER;
  16368. *
  16369. * </script>
  16370. * // ES6 Import
  16371. * import { BufferRadiusUnit } from '{npm}';
  16372. *
  16373. * const result = BufferRadiusUnit.CENTIMETER;
  16374. * ```
  16375. */
  16376. var BufferRadiusUnit = {
  16377. /** 厘米。 */
  16378. CENTIMETER: "CENTIMETER",
  16379. /** 分米。 */
  16380. DECIMETER: "DECIMETER",
  16381. /** 英尺。 */
  16382. FOOT: "FOOT",
  16383. /** 英寸。 */
  16384. INCH: "INCH",
  16385. /** 千米。 */
  16386. KILOMETER: "KILOMETER",
  16387. /** 米。 */
  16388. METER: "METER",
  16389. /** 英里。 */
  16390. MILE: "MILE",
  16391. /** 毫米。 */
  16392. MILLIMETER: "MILLIMETER",
  16393. /** 码。 */
  16394. YARD: "YARD"
  16395. };
  16396. /**
  16397. * @enum EngineType
  16398. * @description 数据源引擎类型枚举。
  16399. * @category BaseTypes Constant
  16400. * @type {string}
  16401. * @usage
  16402. * ```
  16403. * // 浏览器
  16404. * <script type="text/javascript" src="{cdn}"></script>
  16405. * <script>
  16406. * const result = {namespace}.EngineType.IMAGEPLUGINS;
  16407. *
  16408. * </script>
  16409. * // ES6 Import
  16410. * import { EngineType } from '{npm}';
  16411. *
  16412. * const result = EngineType.IMAGEPLUGINS;
  16413. * ```
  16414. */
  16415. var EngineType = {
  16416. /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
  16417. IMAGEPLUGINS: "IMAGEPLUGINS",
  16418. /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
  16419. OGC: "OGC",
  16420. /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
  16421. ORACLEPLUS: "ORACLEPLUS",
  16422. /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
  16423. SDBPLUS: "SDBPLUS",
  16424. /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎。 */
  16425. SQLPLUS: "SQLPLUS",
  16426. /** UDB 引擎类型,文件引擎。 */
  16427. UDB: "UDB"
  16428. };
  16429. /**
  16430. * @enum ThemeGraphTextFormat
  16431. * @description 统计专题图文本显示格式枚举。
  16432. * @category BaseTypes Constant
  16433. * @type {string}
  16434. * @usage
  16435. * ```
  16436. * // 浏览器
  16437. * <script type="text/javascript" src="{cdn}"></script>
  16438. * <script>
  16439. * const result = {namespace}.ThemeGraphTextFormat.CAPTION;
  16440. *
  16441. * </script>
  16442. * // ES6 Import
  16443. * import { ThemeGraphTextFormat } from '{npm}';
  16444. *
  16445. * const result = ThemeGraphTextFormat.CAPTION;
  16446. * ```
  16447. */
  16448. var ThemeGraphTextFormat = {
  16449. /** 标题。以各子项的标题来进行标注。 */
  16450. CAPTION: "CAPTION",
  16451. /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
  16452. CAPTION_PERCENT: "CAPTION_PERCENT",
  16453. /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
  16454. CAPTION_VALUE: "CAPTION_VALUE",
  16455. /** 百分数。以各子项所占的百分比来进行标注。 */
  16456. PERCENT: "PERCENT",
  16457. /** 实际数值。以各子项的真实数值来进行标注。 */
  16458. VALUE: "VALUE"
  16459. };
  16460. /**
  16461. * @enum ThemeGraphType
  16462. * @description 统计专题图类型枚举。
  16463. * @category BaseTypes Constant
  16464. * @type {string}
  16465. * @usage
  16466. * ```
  16467. * // 浏览器
  16468. * <script type="text/javascript" src="{cdn}"></script>
  16469. * <script>
  16470. * const result = {namespace}.ThemeGraphType.AREA;
  16471. *
  16472. * </script>
  16473. * // ES6 Import
  16474. * import { ThemeGraphType } from '{npm}';
  16475. *
  16476. * const result = ThemeGraphType.AREA;
  16477. * ```
  16478. */
  16479. var ThemeGraphType = {
  16480. /** 面积图。 */
  16481. AREA: "AREA",
  16482. /** 柱状图。 */
  16483. BAR: "BAR",
  16484. /** 三维柱状图。 */
  16485. BAR3D: "BAR3D",
  16486. /** 折线图。 */
  16487. LINE: "LINE",
  16488. /** 饼图。 */
  16489. PIE: "PIE",
  16490. /** 三维饼图。 */
  16491. PIE3D: "PIE3D",
  16492. /** 点状图。 */
  16493. POINT: "POINT",
  16494. /** 环状图。 */
  16495. RING: "RING",
  16496. /** 玫瑰图。 */
  16497. ROSE: "ROSE",
  16498. /** 三维玫瑰图。 */
  16499. ROSE3D: "ROSE3D",
  16500. /** 堆叠柱状图。 */
  16501. STACK_BAR: "STACK_BAR",
  16502. /** 三维堆叠柱状图。 */
  16503. STACK_BAR3D: "STACK_BAR3D",
  16504. /** 阶梯图。 */
  16505. STEP: "STEP"
  16506. };
  16507. /**
  16508. * @enum GraphAxesTextDisplayMode
  16509. * @description 统计专题图坐标轴文本显示模式。
  16510. * @category BaseTypes Constant
  16511. * @type {string}
  16512. * @usage
  16513. * ```
  16514. * // 浏览器
  16515. * <script type="text/javascript" src="{cdn}"></script>
  16516. * <script>
  16517. * const result = {namespace}.GraphAxesTextDisplayMode.ALL;
  16518. *
  16519. * </script>
  16520. * // ES6 Import
  16521. * import { GraphAxesTextDisplayMode } from '{npm}';
  16522. *
  16523. * const result = GraphAxesTextDisplayMode.ALL;
  16524. * ```
  16525. */
  16526. var GraphAxesTextDisplayMode = {
  16527. /** 显示全部文本。 */
  16528. ALL: "ALL",
  16529. /** 不显示。 */
  16530. NONE: "NONE",
  16531. /** 显示Y轴的文本。 */
  16532. YAXES: "YAXES"
  16533. };
  16534. /**
  16535. * @enum GraduatedMode
  16536. * @description 专题图分级模式枚举。
  16537. * @category BaseTypes Constant
  16538. * @type {string}
  16539. * @usage
  16540. * ```
  16541. * // 浏览器
  16542. * <script type="text/javascript" src="{cdn}"></script>
  16543. * <script>
  16544. * const result = {namespace}.GraduatedMode.CONSTANT;
  16545. *
  16546. * </script>
  16547. * // ES6 Import
  16548. * import { GraduatedMode } from '{npm}';
  16549. *
  16550. * const result = GraduatedMode.CONSTANT;
  16551. * ```
  16552. */
  16553. var GraduatedMode = {
  16554. /** 常量分级模式。 */
  16555. CONSTANT: "CONSTANT",
  16556. /** 对数分级模式。 */
  16557. LOGARITHM: "LOGARITHM",
  16558. /** 平方根分级模式。 */
  16559. SQUAREROOT: "SQUAREROOT"
  16560. };
  16561. /**
  16562. * @enum RangeMode
  16563. * @description 范围分段专题图分段方式枚举。
  16564. * @category BaseTypes Constant
  16565. * @type {string}
  16566. * @usage
  16567. * ```
  16568. * // 浏览器
  16569. * <script type="text/javascript" src="{cdn}"></script>
  16570. * <script>
  16571. * const result = {namespace}.RangeMode.CUSTOMINTERVAL;
  16572. *
  16573. * </script>
  16574. * // ES6 Import
  16575. * import { RangeMode } from '{npm}';
  16576. *
  16577. * const result = RangeMode.CUSTOMINTERVAL;
  16578. * ```
  16579. */
  16580. var RangeMode = {
  16581. /** 自定义分段法。 */
  16582. CUSTOMINTERVAL: "CUSTOMINTERVAL",
  16583. /** 等距离分段法。 */
  16584. EQUALINTERVAL: "EQUALINTERVAL",
  16585. /** 对数分段法。 */
  16586. LOGARITHM: "LOGARITHM",
  16587. /** 等计数分段法。 */
  16588. QUANTILE: "QUANTILE",
  16589. /** 平方根分段法。 */
  16590. SQUAREROOT: "SQUAREROOT",
  16591. /** 标准差分段法。 */
  16592. STDDEVIATION: "STDDEVIATION"
  16593. };
  16594. /**
  16595. * @enum ThemeType
  16596. * @description 专题图类型枚举。
  16597. * @category BaseTypes Constant
  16598. * @type {string}
  16599. * @usage
  16600. * ```
  16601. * // 浏览器
  16602. * <script type="text/javascript" src="{cdn}"></script>
  16603. * <script>
  16604. * const result = {namespace}.ThemeType.DOTDENSITY;
  16605. *
  16606. * </script>
  16607. * // ES6 Import
  16608. * import { ThemeType } from '{npm}';
  16609. *
  16610. * const result = ThemeType.DOTDENSITY;
  16611. * ```
  16612. */
  16613. var ThemeType = {
  16614. /** 点密度专题图。 */
  16615. DOTDENSITY: "DOTDENSITY",
  16616. /** 等级符号专题图。 */
  16617. GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
  16618. /** 统计专题图。 */
  16619. GRAPH: "GRAPH",
  16620. /** 标签专题图。 */
  16621. LABEL: "LABEL",
  16622. /** 分段专题图。 */
  16623. RANGE: "RANGE",
  16624. /** 単值专题图。 */
  16625. UNIQUE: "UNIQUE"
  16626. };
  16627. /**
  16628. * @enum ColorGradientType
  16629. * @description 渐变颜色枚举。
  16630. * @category BaseTypes Constant
  16631. * @type {string}
  16632. * @usage
  16633. * ```
  16634. * // 浏览器
  16635. * <script type="text/javascript" src="{cdn}"></script>
  16636. * <script>
  16637. * const result = {namespace}.ColorGradientType.BLACK_WHITE;
  16638. *
  16639. * </script>
  16640. * // ES6 Import
  16641. * import { ColorGradientType } from '{npm}';
  16642. *
  16643. * const result = ColorGradientType.BLACK_WHITE;
  16644. * ```
  16645. */
  16646. var ColorGradientType = {
  16647. /** 黑白渐变色。 */
  16648. BLACK_WHITE: "BLACKWHITE",
  16649. /** 蓝黑渐变色。 */
  16650. BLUE_BLACK: "BLUEBLACK",
  16651. /** 蓝红渐变色。 */
  16652. BLUE_RED: "BLUERED",
  16653. /** 蓝白渐变色。 */
  16654. BLUE_WHITE: "BLUEWHITE",
  16655. /** 青黑渐变色。 */
  16656. CYAN_BLACK: "CYANBLACK",
  16657. /** 青蓝渐变色。 */
  16658. CYAN_BLUE: "CYANBLUE",
  16659. /** 青绿渐变色。 */
  16660. CYAN_GREEN: "CYANGREEN",
  16661. /** 青白渐变色。 */
  16662. CYAN_WHITE: "CYANWHITE",
  16663. /** 绿黑渐变色。 */
  16664. GREEN_BLACK: "GREENBLACK",
  16665. /** 绿蓝渐变色。 */
  16666. GREEN_BLUE: "GREENBLUE",
  16667. /** 绿橙紫渐变色。 */
  16668. GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
  16669. /** 绿红渐变色。 */
  16670. GREEN_RED: "GREENRED",
  16671. /** 蓝红渐变色。 */
  16672. GREEN_WHITE: "GREENWHITE",
  16673. /** 粉黑渐变色。 */
  16674. PINK_BLACK: "PINKBLACK",
  16675. /** 粉蓝渐变色。 */
  16676. PINK_BLUE: "PINKBLUE",
  16677. /** 粉红渐变色。 */
  16678. PINK_RED: "PINKRED",
  16679. /** 粉白渐变色。 */
  16680. PINK_WHITE: "PINKWHITE",
  16681. /** 彩虹色。 */
  16682. RAIN_BOW: "RAINBOW",
  16683. /** 红黑渐变色。 */
  16684. RED_BLACK: "REDBLACK",
  16685. /** 红白渐变色。 */
  16686. RED_WHITE: "REDWHITE",
  16687. /** 光谱渐变。 */
  16688. SPECTRUM: "SPECTRUM",
  16689. /** 地形渐变,用于三维显示效果较好。 */
  16690. TERRAIN: "TERRAIN",
  16691. /** 黄黑渐变色。 */
  16692. YELLOW_BLACK: "YELLOWBLACK",
  16693. /** 黄蓝渐变色。 */
  16694. YELLOW_BLUE: "YELLOWBLUE",
  16695. /** 黄绿渐变色。 */
  16696. YELLOW_GREEN: "YELLOWGREEN",
  16697. /** 黄红渐变色。 */
  16698. YELLOW_RED: "YELLOWRED",
  16699. /** 黄白渐变色。 */
  16700. YELLOW_WHITE: "YELLOWWHITE"
  16701. };
  16702. /**
  16703. * @enum TextAlignment
  16704. * @description 文本对齐枚举。
  16705. * @category BaseTypes Constant
  16706. * @type {string}
  16707. * @usage
  16708. * ```
  16709. * // 浏览器
  16710. * <script type="text/javascript" src="{cdn}"></script>
  16711. * <script>
  16712. * const result = {namespace}.TextAlignment.TOPLEFT;
  16713. *
  16714. * </script>
  16715. * // ES6 Import
  16716. * import { TextAlignment } from '{npm}';
  16717. *
  16718. * const result = TextAlignment.TOPLEFT;
  16719. * ```
  16720. */
  16721. var TextAlignment = {
  16722. /** 左上角对齐。 */
  16723. TOPLEFT: "TOPLEFT",
  16724. /** 顶部居中对齐。 */
  16725. TOPCENTER: "TOPCENTER",
  16726. /** 右上角对齐。 */
  16727. TOPRIGHT: "TOPRIGHT",
  16728. /** 基准线左对齐。 */
  16729. BASELINELEFT: "BASELINELEFT",
  16730. /** 基准线居中对齐。 */
  16731. BASELINECENTER: "BASELINECENTER",
  16732. /** 基准线右对齐。 */
  16733. BASELINERIGHT: "BASELINERIGHT",
  16734. /** 左下角对齐。 */
  16735. BOTTOMLEFT: "BOTTOMLEFT",
  16736. /** 底部居中对齐。 */
  16737. BOTTOMCENTER: "BOTTOMCENTER",
  16738. /** 右下角对齐。 */
  16739. BOTTOMRIGHT: "BOTTOMRIGHT",
  16740. /** 左中对齐。 */
  16741. MIDDLELEFT: "MIDDLELEFT",
  16742. /** 中心对齐。 */
  16743. MIDDLECENTER: "MIDDLECENTER",
  16744. /** 右中对齐。 */
  16745. MIDDLERIGHT: "MIDDLERIGHT"
  16746. };
  16747. /**
  16748. * @enum FillGradientMode
  16749. * @description 渐变填充风格的渐变类型枚举。
  16750. * @category BaseTypes Constant
  16751. * @type {string}
  16752. * @usage
  16753. * ```
  16754. * // 浏览器
  16755. * <script type="text/javascript" src="{cdn}"></script>
  16756. * <script>
  16757. * const result = {namespace}.FillGradientMode.NONE;
  16758. *
  16759. * </script>
  16760. * // ES6 Import
  16761. * import { FillGradientMode } from '{npm}';
  16762. *
  16763. * const result = FillGradientMode.NONE;
  16764. * ```
  16765. */
  16766. var FillGradientMode = {
  16767. /** 无渐变。 */
  16768. NONE: "NONE",
  16769. /** 线性渐变填充。 */
  16770. LINEAR: "LINEAR",
  16771. /** 辐射渐变填充。 */
  16772. RADIAL: "RADIAL",
  16773. /** 圆锥渐变填充。 */
  16774. CONICAL: "CONICAL",
  16775. /** 四角渐变填充。 */
  16776. SQUARE: "SQUARE"
  16777. };
  16778. /**
  16779. * @enum AlongLineDirection
  16780. * @description 标签沿线标注方向枚举。
  16781. * @category BaseTypes Constant
  16782. * @type {string}
  16783. * @usage
  16784. * ```
  16785. * // 浏览器
  16786. * <script type="text/javascript" src="{cdn}"></script>
  16787. * <script>
  16788. * const result = {namespace}.AlongLineDirection.NORMAL;
  16789. *
  16790. * </script>
  16791. * // ES6 Import
  16792. * import { AlongLineDirection } from '{npm}';
  16793. *
  16794. * const result = AlongLineDirection.NORMAL;
  16795. * ```
  16796. */
  16797. var AlongLineDirection = {
  16798. /** 沿线的法线方向放置标签。 */
  16799. NORMAL: "ALONG_LINE_NORMAL",
  16800. /** 从下到上,从左到右放置。 */
  16801. LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
  16802. /** 从上到下,从左到右放置。 */
  16803. LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
  16804. /** 从下到上,从右到左放置。 */
  16805. RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
  16806. /** 从上到下,从右到左放置。 */
  16807. RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
  16808. };
  16809. /**
  16810. * @enum LabelBackShape
  16811. * @description 标签专题图中标签背景的形状枚举。
  16812. * @category BaseTypes Constant
  16813. * @type {string}
  16814. * @usage
  16815. * ```
  16816. * // 浏览器
  16817. * <script type="text/javascript" src="{cdn}"></script>
  16818. * <script>
  16819. * const result = {namespace}.LabelBackShape.DIAMOND;
  16820. *
  16821. * </script>
  16822. * // ES6 Import
  16823. * import { LabelBackShape } from '{npm}';
  16824. *
  16825. * const result = LabelBackShape.DIAMOND;
  16826. * ```
  16827. */
  16828. var LabelBackShape = {
  16829. /** 菱形背景,即标签背景的形状为菱形。 */
  16830. DIAMOND: "DIAMOND",
  16831. /** 椭圆形背景,即标签背景的行状为椭圆形。 */
  16832. ELLIPSE: "ELLIPSE",
  16833. /** 符号背景,即标签背景的形状为设定的符号。 */
  16834. MARKER: "MARKER",
  16835. /** 空背景,即不使用任何形状作为标签的背景。 */
  16836. NONE: "NONE",
  16837. /** 矩形背景,即标签背景的形状为矩形。 */
  16838. RECT: "RECT",
  16839. /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
  16840. ROUNDRECT: "ROUNDRECT",
  16841. /** 三角形背景,即标签背景的形状为三角形。 */
  16842. TRIANGLE: "TRIANGLE"
  16843. };
  16844. /**
  16845. * @enum LabelOverLengthMode
  16846. * @description 标签专题图中超长标签的处理模式枚举。
  16847. * @category BaseTypes Constant
  16848. * @type {string}
  16849. * @usage
  16850. * ```
  16851. * // 浏览器
  16852. * <script type="text/javascript" src="{cdn}"></script>
  16853. * <script>
  16854. * const result = {namespace}.LabelOverLengthMode.NEWLINE;
  16855. *
  16856. * </script>
  16857. * // ES6 Import
  16858. * import { LabelOverLengthMode } from '{npm}';
  16859. *
  16860. * const result = LabelOverLengthMode.NEWLINE;
  16861. * ```
  16862. */
  16863. var LabelOverLengthMode = {
  16864. /** 换行显示。 */
  16865. NEWLINE: "NEWLINE",
  16866. /** 对超长标签不进行处理。 */
  16867. NONE: "NONE",
  16868. /** 省略超出部分。 */
  16869. OMIT: "OMIT"
  16870. };
  16871. /**
  16872. * @enum DirectionType
  16873. * @description 网络分析中方向枚举。
  16874. * 在行驶引导子项中使用。
  16875. * @category BaseTypes Constant
  16876. * @type {string}
  16877. * @usage
  16878. * ```
  16879. * // 浏览器
  16880. * <script type="text/javascript" src="{cdn}"></script>
  16881. * <script>
  16882. * const result = {namespace}.DirectionType.EAST;
  16883. *
  16884. * </script>
  16885. * // ES6 Import
  16886. * import { DirectionType } from '{npm}';
  16887. *
  16888. * const result = DirectionType.EAST;
  16889. * ```
  16890. */
  16891. var DirectionType = {
  16892. /** 东。 */
  16893. EAST: "EAST",
  16894. /** 无方向。 */
  16895. NONE: "NONE",
  16896. /** 北。 */
  16897. NORTH: "NORTH",
  16898. /** 南。 */
  16899. SOURTH: "SOURTH",
  16900. /** 西。 */
  16901. WEST: "WEST"
  16902. };
  16903. /**
  16904. * @enum SideType
  16905. * @description 行驶位置枚举。
  16906. * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
  16907. * @category BaseTypes Constant
  16908. * @type {string}
  16909. * @usage
  16910. * ```
  16911. * // 浏览器
  16912. * <script type="text/javascript" src="{cdn}"></script>
  16913. * <script>
  16914. * const result = {namespace}.SideType.LEFT;
  16915. *
  16916. * </script>
  16917. * // ES6 Import
  16918. * import { SideType } from '{npm}';
  16919. *
  16920. * const result = SideType.LEFT;
  16921. * ```
  16922. */
  16923. var SideType = {
  16924. /** 路的左侧。 */
  16925. LEFT: "LEFT",
  16926. /** 在路上(即路的中间)。 */
  16927. MIDDLE: "MIDDLE",
  16928. /** 无效值。 */
  16929. NONE: "NONE",
  16930. /** 路的右侧。 */
  16931. RIGHT: "RIGHT"
  16932. };
  16933. /**
  16934. * @enum SupplyCenterType
  16935. * @description 资源供给中心类型枚举。
  16936. * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
  16937. * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  16938. * @category BaseTypes Constant
  16939. * @type {string}
  16940. * @usage
  16941. * ```
  16942. * // 浏览器
  16943. * <script type="text/javascript" src="{cdn}"></script>
  16944. * <script>
  16945. * const result = {namespace}.SupplyCenterType.FIXEDCENTER;
  16946. *
  16947. * </script>
  16948. * // ES6 Import
  16949. * import { SupplyCenterType } from '{npm}';
  16950. *
  16951. * const result = SupplyCenterType.FIXEDCENTER;
  16952. * ```
  16953. */
  16954. var SupplyCenterType = {
  16955. /** 固定中心点。 */
  16956. FIXEDCENTER: "FIXEDCENTER",
  16957. /** 非中心点。 */
  16958. NULL: "NULL",
  16959. /** 可选中心点。 */
  16960. OPTIONALCENTER: "OPTIONALCENTER"
  16961. };
  16962. /**
  16963. * @enum TurnType
  16964. * @description 转弯方向枚举。
  16965. * 用在行驶引导子项类中,表示转弯的方向。
  16966. * @category BaseTypes Constant
  16967. * @type {string}
  16968. * @usage
  16969. * ```
  16970. * // 浏览器
  16971. * <script type="text/javascript" src="{cdn}"></script>
  16972. * <script>
  16973. * const result = {namespace}.TurnType.AHEAD;
  16974. *
  16975. * </script>
  16976. * // ES6 Import
  16977. * import { TurnType } from '{npm}';
  16978. *
  16979. * const result = TurnType.AHEAD;
  16980. * ```
  16981. */
  16982. var TurnType = {
  16983. /** 向前直行。 */
  16984. AHEAD: "AHEAD",
  16985. /** 掉头。 */
  16986. BACK: "BACK",
  16987. /** 终点,不拐弯。 */
  16988. END: "END",
  16989. /** 左转弯。 */
  16990. LEFT: "LEFT",
  16991. /** 无效值。 */
  16992. NONE: "NONE",
  16993. /** 右转弯。 */
  16994. RIGHT: "RIGHT"
  16995. };
  16996. /**
  16997. * @enum BufferEndType
  16998. * @description 缓冲区分析BufferEnd类型。
  16999. * @category BaseTypes Constant
  17000. * @type {string}
  17001. * @usage
  17002. * ```
  17003. * // 浏览器
  17004. * <script type="text/javascript" src="{cdn}"></script>
  17005. * <script>
  17006. * const result = {namespace}.BufferEndType.FLAT;
  17007. *
  17008. * </script>
  17009. * // ES6 Import
  17010. * import { BufferEndType } from '{npm}';
  17011. *
  17012. * const result = BufferEndType.FLAT;
  17013. * ```
  17014. */
  17015. var BufferEndType = {
  17016. /** 平头缓冲。 */
  17017. FLAT: "FLAT",
  17018. /** 圆头缓冲。 */
  17019. ROUND: "ROUND"
  17020. };
  17021. /**
  17022. * @enum OverlayOperationType
  17023. * @description 叠加分析类型枚举。
  17024. * @category BaseTypes Constant
  17025. * @type {string}
  17026. * @usage
  17027. * ```
  17028. * // 浏览器
  17029. * <script type="text/javascript" src="{cdn}"></script>
  17030. * <script>
  17031. * const result = {namespace}.OverlayOperationType.CLIP;
  17032. *
  17033. * </script>
  17034. * // ES6 Import
  17035. * import { OverlayOperationType } from '{npm}';
  17036. *
  17037. * const result = OverlayOperationType.CLIP;
  17038. * ```
  17039. */
  17040. var OverlayOperationType = {
  17041. /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
  17042. CLIP: "CLIP",
  17043. /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
  17044. ERASE: "ERASE",
  17045. /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
  17046. IDENTITY: "IDENTITY",
  17047. /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
  17048. INTERSECT: "INTERSECT",
  17049. /** 对两个面数据集(几何对象)进行合并操作。 */
  17050. UNION: "UNION",
  17051. /** 对两个面数据集(几何对象)进行更新操作。 */
  17052. UPDATE: "UPDATE",
  17053. /** 对两个面数据集(几何对象)进行对称差操作。 */
  17054. XOR: "XOR"
  17055. };
  17056. /**
  17057. * @enum OutputType
  17058. * @description 分布式分析输出类型枚举。
  17059. * @category BaseTypes Constant
  17060. * @type {string}
  17061. * @usage
  17062. * ```
  17063. * // 浏览器
  17064. * <script type="text/javascript" src="{cdn}"></script>
  17065. * <script>
  17066. * const result = {namespace}.OutputType.INDEXEDHDFS;
  17067. *
  17068. * </script>
  17069. * // ES6 Import
  17070. * import { OutputType } from '{npm}';
  17071. *
  17072. * const result = OutputType.INDEXEDHDFS;
  17073. * ```
  17074. */
  17075. var OutputType = {
  17076. /** INDEXEDHDFS */
  17077. INDEXEDHDFS: "INDEXEDHDFS",
  17078. /** UDB */
  17079. UDB: "UDB",
  17080. /** MONGODB */
  17081. MONGODB: "MONGODB",
  17082. /** PG */
  17083. PG: "PG"
  17084. };
  17085. /**
  17086. * @enum SmoothMethod
  17087. * @description 光滑方法枚举。
  17088. * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
  17089. * @category BaseTypes Constant
  17090. * @type {string}
  17091. * @usage
  17092. * ```
  17093. * // 浏览器
  17094. * <script type="text/javascript" src="{cdn}"></script>
  17095. * <script>
  17096. * const result = {namespace}.SmoothMethod.BSPLINE;
  17097. *
  17098. * </script>
  17099. * // ES6 Import
  17100. * import { SmoothMethod } from '{npm}';
  17101. *
  17102. * const result = SmoothMethod.BSPLINE;
  17103. * ```
  17104. */
  17105. var SmoothMethod = {
  17106. /** B 样条法。 */
  17107. BSPLINE: "BSPLINE",
  17108. /** 磨角法。 */
  17109. POLISH: "POLISH"
  17110. };
  17111. /**
  17112. * @enum SurfaceAnalystMethod
  17113. * @description 表面分析方法枚举。
  17114. * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
  17115. * @category BaseTypes Constant
  17116. * @type {string}
  17117. * @usage
  17118. * ```
  17119. * // 浏览器
  17120. * <script type="text/javascript" src="{cdn}"></script>
  17121. * <script>
  17122. * const result = {namespace}.SurfaceAnalystMethod.ISOLINE;
  17123. *
  17124. * </script>
  17125. * // ES6 Import
  17126. * import { SurfaceAnalystMethod } from '{npm}';
  17127. *
  17128. * const result = SurfaceAnalystMethod.ISOLINE;
  17129. * ```
  17130. */
  17131. var SurfaceAnalystMethod = {
  17132. /** 等值线提取。 */
  17133. ISOLINE: "ISOLINE",
  17134. /** 等值面提取。 */
  17135. ISOREGION: "ISOREGION"
  17136. };
  17137. /**
  17138. * @enum DataReturnMode
  17139. * @description 数据返回模式枚举。
  17140. * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
  17141. * @category BaseTypes Constant
  17142. * @type {string}
  17143. * @usage
  17144. * ```
  17145. * // 浏览器
  17146. * <script type="text/javascript" src="{cdn}"></script>
  17147. * <script>
  17148. * const result = {namespace}.DataReturnMode.DATASET_AND_RECORDSET;
  17149. *
  17150. * </script>
  17151. * // ES6 Import
  17152. * import { DataReturnMode } from '{npm}';
  17153. *
  17154. * const result = DataReturnMode.DATASET_AND_RECORDSET;
  17155. * ```
  17156. */
  17157. var DataReturnMode = {
  17158. /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
  17159. DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
  17160. /** 只返回数据集标识(数据集名称@数据源名称)。 */
  17161. DATASET_ONLY: "DATASET_ONLY",
  17162. /** 只返回记录集(RecordSet)。 */
  17163. RECORDSET_ONLY: "RECORDSET_ONLY"
  17164. };
  17165. /**
  17166. * @enum EditType
  17167. * @description 要素集更新模式枚举。
  17168. * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  17169. * @category BaseTypes Constant
  17170. * @type {string}
  17171. * @usage
  17172. * ```
  17173. * // 浏览器
  17174. * <script type="text/javascript" src="{cdn}"></script>
  17175. * <script>
  17176. * const result = {namespace}.EditType.ADD;
  17177. *
  17178. * </script>
  17179. * // ES6 Import
  17180. * import { EditType } from '{npm}';
  17181. *
  17182. * const result = {namespace}.EditType.ADD;
  17183. * ```
  17184. */
  17185. var EditType = {
  17186. /** 增加操作。 */
  17187. ADD: "add",
  17188. /** 修改操作。 */
  17189. UPDATE: "update",
  17190. /** 删除操作。 */
  17191. DELETE: "delete"
  17192. };
  17193. /**
  17194. * @enum TransferTactic
  17195. * @description 公交换乘策略枚举。
  17196. * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  17197. * @category BaseTypes Constant
  17198. * @type {string}
  17199. * @usage
  17200. * ```
  17201. * // 浏览器
  17202. * <script type="text/javascript" src="{cdn}"></script>
  17203. * <script>
  17204. * const result = {namespace}.TransferTactic.LESS_TIME;
  17205. *
  17206. * </script>
  17207. * // ES6 Import
  17208. * import { TransferTactic } from '{npm}';
  17209. *
  17210. * const result = TransferTactic.LESS_TIME;
  17211. * ```
  17212. */
  17213. var TransferTactic = {
  17214. /** 时间短。 */
  17215. LESS_TIME: "LESS_TIME",
  17216. /** 少换乘。 */
  17217. LESS_TRANSFER: "LESS_TRANSFER",
  17218. /** 少步行。 */
  17219. LESS_WALK: "LESS_WALK",
  17220. /** 距离最短。 */
  17221. MIN_DISTANCE: "MIN_DISTANCE"
  17222. };
  17223. /**
  17224. * @enum TransferPreference
  17225. * @description 公交换乘策略枚举。
  17226. * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
  17227. * @category BaseTypes Constant
  17228. * @type {string}
  17229. * @usage
  17230. * ```
  17231. * // 浏览器
  17232. * <script type="text/javascript" src="{cdn}"></script>
  17233. * <script>
  17234. * const result = {namespace}.TransferPreference.BUS;
  17235. *
  17236. * </script>
  17237. * // ES6 Import
  17238. * import { TransferPreference } from '{npm}';
  17239. *
  17240. * const result = TransferPreference.BUS;
  17241. * ```
  17242. */
  17243. var TransferPreference = {
  17244. /** 公交汽车优先。 */
  17245. BUS: "BUS",
  17246. /** 地铁优先。 */
  17247. SUBWAY: "SUBWAY",
  17248. /** 不乘坐地铁。 */
  17249. NO_SUBWAY: "NO_SUBWAY",
  17250. /** 无乘车偏好。 */
  17251. NONE: "NONE"
  17252. };
  17253. /**
  17254. * @enum GridType
  17255. * @description 地图背景格网类型枚举。
  17256. * @category BaseTypes Constant
  17257. * @type {string}
  17258. * @usage
  17259. * ```
  17260. * // 浏览器
  17261. * <script type="text/javascript" src="{cdn}"></script>
  17262. * <script>
  17263. * const result = {namespace}.GridType.CROSS;
  17264. *
  17265. * </script>
  17266. * // ES6 Import
  17267. * import { GridType } from '{npm}';
  17268. *
  17269. * const result = GridType.CROSS;
  17270. * ```
  17271. */
  17272. var GridType = {
  17273. /** 十字叉丝。 */
  17274. CROSS: "CROSS",
  17275. /** 网格线。 */
  17276. GRID: "GRID",
  17277. /** 点。 */
  17278. POINT: "POINT"
  17279. };
  17280. /**
  17281. * @enum ColorSpaceType
  17282. * @description 色彩空间枚举。
  17283. * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
  17284. * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
  17285. * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
  17286. * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
  17287. * @category BaseTypes Constant
  17288. * @type {string}
  17289. * @usage
  17290. * ```
  17291. * // 浏览器
  17292. * <script type="text/javascript" src="{cdn}"></script>
  17293. * <script>
  17294. * const result = {namespace}.ColorSpaceType.CMYK;
  17295. *
  17296. * </script>
  17297. * // ES6 Import
  17298. * import { ColorSpaceType } from '{npm}';
  17299. *
  17300. * const result = ColorSpaceType.CMYK;
  17301. * ```
  17302. */
  17303. var ColorSpaceType = {
  17304. /** 该类型主要在印刷系统使用。 */
  17305. CMYK: "CMYK",
  17306. /** 该类型主要在显示系统中使用。 */
  17307. RGB: "RGB"
  17308. };
  17309. /**
  17310. * @enum LayerType
  17311. * @description 图层类型。
  17312. * @category BaseTypes Constant
  17313. * @type {string}
  17314. * @usage
  17315. * ```
  17316. * // 浏览器
  17317. * <script type="text/javascript" src="{cdn}"></script>
  17318. * <script>
  17319. * const result = {namespace}.LayerType.UGC;
  17320. *
  17321. * </script>
  17322. * // ES6 Import
  17323. * import { LayerType } from '{npm}';
  17324. *
  17325. * const result = LayerType.UGC;
  17326. * ```
  17327. */
  17328. var LayerType = {
  17329. /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
  17330. UGC: "UGC",
  17331. /** WMS 图层。 */
  17332. WMS: "WMS",
  17333. /** WFS 图层。 */
  17334. WFS: "WFS",
  17335. /** 自定义图层。 */
  17336. CUSTOM: "CUSTOM"
  17337. };
  17338. /**
  17339. * @enum UGCLayerType
  17340. * @description SuperMap 图层类型。
  17341. * @category BaseTypes Constant
  17342. * @type {string}
  17343. * @usage
  17344. * ```
  17345. * // 浏览器
  17346. * <script type="text/javascript" src="{cdn}"></script>
  17347. * <script>
  17348. * const result = {namespace}.UGCLayerType.THEME;
  17349. *
  17350. * </script>
  17351. * // ES6 Import
  17352. * import { UGCLayerType } from '{npm}';
  17353. *
  17354. * const result = UGCLayerType.THEME;
  17355. * ```
  17356. */
  17357. var UGCLayerType = {
  17358. /** 专题图层。 */
  17359. THEME: "THEME",
  17360. /** 矢量图层。 */
  17361. VECTOR: "VECTOR",
  17362. /** 栅格图层。 */
  17363. GRID: "GRID",
  17364. /** 影像图层。 */
  17365. IMAGE: "IMAGE"
  17366. };
  17367. /**
  17368. * @enum StatisticMode
  17369. * @description 字段统计方法类型。
  17370. * @category BaseTypes Constant
  17371. * @type {string}
  17372. * @usage
  17373. * ```
  17374. * // 浏览器
  17375. * <script type="text/javascript" src="{cdn}"></script>
  17376. * <script>
  17377. * const result = {namespace}.StatisticMode.AVERAGE;
  17378. *
  17379. * </script>
  17380. * // ES6 Import
  17381. * import { StatisticMode } from '{npm}';
  17382. *
  17383. * const result = StatisticMode.AVERAGE;
  17384. * ```
  17385. */
  17386. var StatisticMode = {
  17387. /** 统计所选字段的平均值。 */
  17388. AVERAGE: "AVERAGE",
  17389. /** 统计所选字段的最大值。 */
  17390. MAX: "MAX",
  17391. /** 统计所选字段的最小值。 */
  17392. MIN: "MIN",
  17393. /** 统计所选字段的标准差 */
  17394. STDDEVIATION: "STDDEVIATION",
  17395. /** 统计所选字段的总和。 */
  17396. SUM: "SUM",
  17397. /** 统计所选字段的方差。 */
  17398. VARIANCE: "VARIANCE"
  17399. };
  17400. /**
  17401. * @enum PixelFormat
  17402. * @description 栅格与影像数据存储的像素格式枚举。
  17403. * @category BaseTypes Constant
  17404. * @type {string}
  17405. * @usage
  17406. * ```
  17407. * // 浏览器
  17408. * <script type="text/javascript" src="{cdn}"></script>
  17409. * <script>
  17410. * const result = {namespace}.PixelFormat.BIT16;
  17411. *
  17412. * </script>
  17413. * // ES6 Import
  17414. * import { PixelFormat } from '{npm}';
  17415. *
  17416. * const result = PixelFormat.BIT16;
  17417. * ```
  17418. */
  17419. var PixelFormat = {
  17420. /** 每个像元用16个比特(即2个字节)表示。 */
  17421. BIT16: "BIT16",
  17422. /** 每个像元用32个比特(即4个字节)表示。 */
  17423. BIT32: "BIT32",
  17424. /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
  17425. BIT64: "BIT64",
  17426. /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
  17427. SINGLE: "SINGLE",
  17428. /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
  17429. DOUBLE: "DOUBLE",
  17430. /** 每个像元用1个比特表示。 */
  17431. UBIT1: "UBIT1",
  17432. /** 每个像元用4个比特来表示。 */
  17433. UBIT4: "UBIT4",
  17434. /** 每个像元用8个比特(即1个字节)来表示。 */
  17435. UBIT8: "UBIT8",
  17436. /** 每个像元用24个比特(即3个字节)来表示。 */
  17437. UBIT24: "UBIT24",
  17438. /** 每个像元用32个比特(即4个字节)来表示。 */
  17439. UBIT32: "UBIT32"
  17440. };
  17441. /**
  17442. * @enum SearchMode
  17443. * @description 内插时使用的样本点的查找方式枚举。
  17444. * @category BaseTypes Constant
  17445. * @type {string}
  17446. * @usage
  17447. * ```
  17448. * // 浏览器
  17449. * <script type="text/javascript" src="{cdn}"></script>
  17450. * <script>
  17451. * const result = {namespace}.SearchMode.KDTREE_FIXED_COUNT;
  17452. *
  17453. * </script>
  17454. * // ES6 Import
  17455. * import { SearchMode } from '{npm}';
  17456. *
  17457. * const result = SearchMode.KDTREE_FIXED_COUNT;
  17458. * ```
  17459. */
  17460. var SearchMode = {
  17461. /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
  17462. KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
  17463. /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
  17464. KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
  17465. /** 不进行查找,使用所有的输入点进行内插分析。 */
  17466. NONE: "NONE",
  17467. /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
  17468. QUADTREE: "QUADTREE"
  17469. };
  17470. /**
  17471. * @enum InterpolationAlgorithmType
  17472. * @description 插值分析的算法的类型。
  17473. * @category BaseTypes Constant
  17474. * @type {string}
  17475. * @usage
  17476. * ```
  17477. * // 浏览器
  17478. * <script type="text/javascript" src="{cdn}"></script>
  17479. * <script>
  17480. * const result = {namespace}.InterpolationAlgorithmType.KRIGING;
  17481. *
  17482. * </script>
  17483. * // ES6 Import
  17484. * import { InterpolationAlgorithmType } from '{npm}';
  17485. *
  17486. * const result = InterpolationAlgorithmType.KRIGING;
  17487. * ```
  17488. */
  17489. var InterpolationAlgorithmType = {
  17490. /** 普通克吕金插值法。 */
  17491. KRIGING: "KRIGING",
  17492. /** 简单克吕金插值法。 */
  17493. SimpleKriging: "SimpleKriging",
  17494. /** 泛克吕金插值法。 */
  17495. UniversalKriging: "UniversalKriging"
  17496. };
  17497. /**
  17498. * @enum VariogramMode
  17499. * @description 克吕金(Kriging)插值时的半变函数类型枚举。
  17500. * @category BaseTypes Constant
  17501. * @type {string}
  17502. * @usage
  17503. * ```
  17504. * // 浏览器
  17505. * <script type="text/javascript" src="{cdn}"></script>
  17506. * <script>
  17507. * const result = {namespace}.VariogramMode.EXPONENTIAL;
  17508. *
  17509. * </script>
  17510. * // ES6 Import
  17511. * import { VariogramMode } from '{npm}';
  17512. *
  17513. * const result = VariogramMode.EXPONENTIAL;
  17514. * ```
  17515. */
  17516. var VariogramMode = {
  17517. /** 指数函数。 */
  17518. EXPONENTIAL: "EXPONENTIAL",
  17519. /** 高斯函数。 */
  17520. GAUSSIAN: "GAUSSIAN",
  17521. /** 球型函数。 */
  17522. SPHERICAL: "SPHERICAL"
  17523. };
  17524. /**
  17525. * @enum Exponent
  17526. * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数。
  17527. * @category BaseTypes Constant
  17528. * @type {string}
  17529. * @usage
  17530. * ```
  17531. * // 浏览器
  17532. * <script type="text/javascript" src="{cdn}"></script>
  17533. * <script>
  17534. * const result = {namespace}.Exponent.EXP1;
  17535. *
  17536. * </script>
  17537. * // ES6 Import
  17538. * import { Exponent } from '{npm}';
  17539. *
  17540. * const result = Exponent.EXP1;
  17541. * ```
  17542. */
  17543. var Exponent = {
  17544. /** 阶数为1。 */
  17545. EXP1: "EXP1",
  17546. /** 阶数为2。 */
  17547. EXP2: "EXP2"
  17548. };
  17549. /**
  17550. * @enum ClientType
  17551. * @description token申请的客户端标识类型。
  17552. * @category BaseTypes Constant
  17553. * @type {string}
  17554. * @usage
  17555. * ```
  17556. * // 浏览器
  17557. * <script type="text/javascript" src="{cdn}"></script>
  17558. * <script>
  17559. * const result = {namespace}.ClientType.IP;
  17560. *
  17561. * </script>
  17562. * // ES6 Import
  17563. * import { ClientType } from '{npm}';
  17564. *
  17565. * const result = ClientType.IP;
  17566. * ```
  17567. */
  17568. var ClientType = {
  17569. /** 指定的 IP 地址。 */
  17570. IP: "IP",
  17571. /** 指定的 URL。 */
  17572. REFERER: "Referer",
  17573. /** 发送申请令牌请求的客户端 IP。 */
  17574. REQUESTIP: "RequestIP",
  17575. /** 不做任何验证。 */
  17576. NONE: "NONE",
  17577. /** SERVER。 */
  17578. SERVER: "SERVER",
  17579. /** WEB。 */
  17580. WEB: "WEB"
  17581. };
  17582. /**
  17583. * @enum ChartType
  17584. * @description 客户端专题图图表类型。
  17585. * @category BaseTypes Constant
  17586. * @type {string}
  17587. * @usage
  17588. * ```
  17589. * // 浏览器
  17590. * <script type="text/javascript" src="{cdn}"></script>
  17591. * <script>
  17592. * const result = {namespace}.ChartType.BAR;
  17593. *
  17594. * </script>
  17595. * // ES6 Import
  17596. * import { ChartType } from '{npm}';
  17597. *
  17598. * const result = ChartType.BAR;
  17599. * ```
  17600. */
  17601. var ChartType = {
  17602. /** 柱状图。 */
  17603. BAR: "Bar",
  17604. /** 三维柱状图。 */
  17605. BAR3D: "Bar3D",
  17606. /** 圆形图。 */
  17607. CIRCLE: "Circle",
  17608. /** 饼图。 */
  17609. PIE: "Pie",
  17610. /** 散点图。 */
  17611. POINT: "Point",
  17612. /** 折线图。 */
  17613. LINE: "Line",
  17614. /** 环状图。 */
  17615. RING: "Ring"
  17616. };
  17617. /**
  17618. * @enum ClipAnalystMode
  17619. * @description 裁剪分析模式
  17620. * @category BaseTypes Constant
  17621. * @type {string}
  17622. * @usage
  17623. * ```
  17624. * // 浏览器
  17625. * <script type="text/javascript" src="{cdn}"></script>
  17626. * <script>
  17627. * const result = {namespace}.ClipAnalystMode.CLIP;
  17628. *
  17629. * </script>
  17630. * // ES6 Import
  17631. * import { ClipAnalystMode } from '{npm}';
  17632. *
  17633. * const result = ClipAnalystMode.CLIP;
  17634. * ```
  17635. */
  17636. var ClipAnalystMode = {
  17637. /** CLIP。 */
  17638. CLIP: "clip",
  17639. /** INTERSECT。 */
  17640. INTERSECT: "intersect"
  17641. };
  17642. /**
  17643. * @enum AnalystAreaUnit
  17644. * @description 分布式分析面积单位。
  17645. * @category BaseTypes Constant
  17646. * @type {string}
  17647. * @usage
  17648. * ```
  17649. * // 浏览器
  17650. * <script type="text/javascript" src="{cdn}"></script>
  17651. * <script>
  17652. * const result = {namespace}.AnalystAreaUnit.SQUAREMETER;
  17653. *
  17654. * </script>
  17655. * // ES6 Import
  17656. * import { AnalystAreaUnit } from '{npm}';
  17657. *
  17658. * const result = AnalystAreaUnit.SQUAREMETER;
  17659. * ```
  17660. */
  17661. var AnalystAreaUnit = {
  17662. /** 平方米。 */
  17663. "SQUAREMETER": "SquareMeter",
  17664. /** 平方千米。 */
  17665. "SQUAREKILOMETER": "SquareKiloMeter",
  17666. /** 公顷。 */
  17667. "HECTARE": "Hectare",
  17668. /** 公亩。 */
  17669. "ARE": "Are",
  17670. /** 英亩。 */
  17671. "ACRE": "Acre",
  17672. /** 平方英尺。 */
  17673. "SQUAREFOOT": "SquareFoot",
  17674. /** 平方码。 */
  17675. "SQUAREYARD": "SquareYard",
  17676. /** 平方英里。 */
  17677. "SQUAREMILE": "SquareMile"
  17678. };
  17679. /**
  17680. * @enum AnalystSizeUnit
  17681. * @description 分布式分析单位。
  17682. * @category BaseTypes Constant
  17683. * @type {string}
  17684. * @usage
  17685. * ```
  17686. * // 浏览器
  17687. * <script type="text/javascript" src="{cdn}"></script>
  17688. * <script>
  17689. * const result = {namespace}.AnalystSizeUnit.METER;
  17690. *
  17691. * </script>
  17692. * // ES6 Import
  17693. * import { AnalystSizeUnit } from '{npm}';
  17694. *
  17695. * const result = AnalystSizeUnit.METER;
  17696. * ```
  17697. */
  17698. var AnalystSizeUnit = {
  17699. /** 米。 */
  17700. "METER": "Meter",
  17701. /** 千米。 */
  17702. "KILOMETER": "Kilometer",
  17703. /** 码。 */
  17704. "YARD": "Yard",
  17705. /** 英尺。 */
  17706. "FOOT": "Foot",
  17707. /** 英里。 */
  17708. "MILE": "Mile"
  17709. };
  17710. /**
  17711. * @enum StatisticAnalystMode
  17712. * @description 分布式分析统计模式。
  17713. * @category BaseTypes Constant
  17714. * @type {string}
  17715. * @usage
  17716. * ```
  17717. * // 浏览器
  17718. * <script type="text/javascript" src="{cdn}"></script>
  17719. * <script>
  17720. * const result = {namespace}.StatisticAnalystMode.MAX;
  17721. *
  17722. * </script>
  17723. * // ES6 Import
  17724. * import { StatisticAnalystMode } from '{npm}';
  17725. *
  17726. * const result = StatisticAnalystMode.MAX;
  17727. * ```
  17728. */
  17729. var StatisticAnalystMode = {
  17730. /** 统计所选字段的最大值。 */
  17731. "MAX": "max",
  17732. /** 统计所选字段的最小值。 */
  17733. "MIN": "min",
  17734. /** 统计所选字段的平均值。 */
  17735. "AVERAGE": "average",
  17736. /** 统计所选字段的总和。 */
  17737. "SUM": "sum",
  17738. /** 统计所选字段的方差。 */
  17739. "VARIANCE": "variance",
  17740. /** 统计所选字段的标准差。 */
  17741. "STDDEVIATION": "stdDeviation"
  17742. };
  17743. /**
  17744. * @enum SummaryType
  17745. * @description 分布式分析聚合类型。
  17746. * @category BaseTypes Constant
  17747. * @type {string}
  17748. * @usage
  17749. * ```
  17750. * // 浏览器
  17751. * <script type="text/javascript" src="{cdn}"></script>
  17752. * <script>
  17753. * const result = {namespace}.SummaryType.SUMMARYMESH;
  17754. *
  17755. * </script>
  17756. * // ES6 Import
  17757. * import { SummaryType } from '{npm}';
  17758. *
  17759. * const result = SummaryType.SUMMARYMESH;
  17760. * ```
  17761. */
  17762. var SummaryType = {
  17763. /** 格网聚合。 */
  17764. "SUMMARYMESH": "SUMMARYMESH",
  17765. /** 多边形聚合。 */
  17766. "SUMMARYREGION": "SUMMARYREGION"
  17767. };
  17768. /**
  17769. * @enum TopologyValidatorRule
  17770. * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
  17771. * @category BaseTypes Constant
  17772. * @type {string}
  17773. * @usage
  17774. * ```
  17775. * // 浏览器
  17776. * <script type="text/javascript" src="{cdn}"></script>
  17777. * <script>
  17778. * const result = {namespace}.TopologyValidatorRule.REGIONNOOVERLAP;
  17779. *
  17780. * </script>
  17781. * // ES6 Import
  17782. * import { TopologyValidatorRule } from '{npm}';
  17783. *
  17784. * const result = TopologyValidatorRule.REGIONNOOVERLAP;
  17785. * ```
  17786. */
  17787. var TopologyValidatorRule = {
  17788. /** 面内无重叠,用于对面数据进行拓扑检查。 */
  17789. REGIONNOOVERLAP: "REGIONNOOVERLAP",
  17790. /** 面与面无重叠,用于对面数据进行拓扑检查。 */
  17791. REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
  17792. /** 面被面包含,用于对面数据进行拓扑检查。 */
  17793. REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
  17794. /** 面被面覆盖,用于对面数据进行拓扑检查。 */
  17795. REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
  17796. /** 线与线无重叠,用于对线数据进行拓扑检查。 */
  17797. LINENOOVERLAP: "LINENOOVERLAP",
  17798. /** 线内无重叠,用于对线数据进行拓扑检查。 */
  17799. LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
  17800. /** 点不相同,用于对点数据进行拓扑检查。 */
  17801. POINTNOIDENTICAL: "POINTNOIDENTICAL"
  17802. };
  17803. /**
  17804. * @enum BucketAggType
  17805. * @description 格网聚合查询枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量
  17806. * @category BaseTypes Constant
  17807. * @type {string}
  17808. * @usage
  17809. * ```
  17810. * // 浏览器
  17811. * <script type="text/javascript" src="{cdn}"></script>
  17812. * <script>
  17813. * const result = {namespace}.BucketAggType.GEOHASH_GRID;
  17814. *
  17815. * </script>
  17816. * // ES6 Import
  17817. * import { BucketAggType } from '{npm}';
  17818. *
  17819. * const result = BucketAggType.GEOHASH_GRID;
  17820. * ```
  17821. */
  17822. var BucketAggType = {
  17823. /** 格网聚合类型。 */
  17824. GEOHASH_GRID: "geohash_grid"
  17825. };
  17826. /**
  17827. * @enum MetricsAggType
  17828. * @description 指标聚合类型枚举类,该类定义了Elasticsearch数据服务中聚合查询模式常量。
  17829. * @category BaseTypes Constant
  17830. * @type {string}
  17831. * @usage
  17832. * ```
  17833. * // 浏览器
  17834. * <script type="text/javascript" src="{cdn}"></script>
  17835. * <script>
  17836. * const result = {namespace}.MetricsAggType.AVG;
  17837. *
  17838. * </script>
  17839. * // ES6 Import
  17840. * import { MetricsAggType } from '{npm}';
  17841. *
  17842. * const result = MetricsAggType.AVG;
  17843. * ```
  17844. */
  17845. var MetricsAggType = {
  17846. /** 平均值聚合类型。 */
  17847. AVG: 'avg',
  17848. /** 最大值聚合类型。 */
  17849. MAX: 'max',
  17850. /** 最小值聚合类型。 */
  17851. MIN: 'min',
  17852. /** 求和聚合类型。 */
  17853. SUM: 'sum'
  17854. };
  17855. /**
  17856. * @enum GetFeatureMode
  17857. * @description feature 查询方式。
  17858. * @category BaseTypes Constant
  17859. * @type {string}
  17860. * @usage
  17861. * ```
  17862. * // 浏览器
  17863. * <script type="text/javascript" src="{cdn}"></script>
  17864. * <script>
  17865. * const result = {namespace}.GetFeatureMode.BOUNDS;
  17866. *
  17867. * </script>
  17868. * // ES6 Import
  17869. * import { GetFeatureMode } from '{npm}';
  17870. *
  17871. * const result = GetFeatureMode.BOUNDS;
  17872. * ```
  17873. */
  17874. var GetFeatureMode = {
  17875. /** 通过范围查询来获取要素。 */
  17876. BOUNDS: "BOUNDS",
  17877. /** 通过几何对象的缓冲区来获取要素。 */
  17878. BUFFER: "BUFFER",
  17879. /** 通过 ID 来获取要素。 */
  17880. ID: "ID",
  17881. /** 通过空间查询模式来获取要素。 */
  17882. SPATIAL: "SPATIAL",
  17883. /** 通过 SQL 查询来获取要素。 */
  17884. SQL: 'SQL'
  17885. };
  17886. /**
  17887. * @enum RasterFunctionType
  17888. * @description 栅格分析方法。
  17889. * @category BaseTypes Constant
  17890. * @type {string}
  17891. * @usage
  17892. * ```
  17893. * // 浏览器
  17894. * <script type="text/javascript" src="{cdn}"></script>
  17895. * <script>
  17896. * const result = {namespace}.GetFeatureMode.NDVI;
  17897. *
  17898. * </script>
  17899. * // ES6 Import
  17900. * import { GetFeatureMode } from '{npm}';
  17901. *
  17902. * const result = GetFeatureMode.NDVI;
  17903. * ```
  17904. */
  17905. var RasterFunctionType = {
  17906. /** 归一化植被指数。 */
  17907. NDVI: "NDVI",
  17908. /** 阴影面分析。 */
  17909. HILLSHADE: "HILLSHADE"
  17910. };
  17911. /**
  17912. * @enum ResourceType
  17913. * @description iportal资源类型。
  17914. * @category BaseTypes Constant
  17915. * @version 10.0.1
  17916. * @type {string}
  17917. * @usage
  17918. * ```
  17919. * // 浏览器
  17920. * <script type="text/javascript" src="{cdn}"></script>
  17921. * <script>
  17922. * const result = {namespace}.GetFeatureMode.MAP;
  17923. *
  17924. * </script>
  17925. * // ES6 Import
  17926. * import { GetFeatureMode } from '{npm}';
  17927. *
  17928. * const result = GetFeatureMode.MAP;
  17929. * ```
  17930. */
  17931. var ResourceType = {
  17932. /** 地图。 */
  17933. MAP: "MAP",
  17934. /** 服务。 */
  17935. SERVICE: "SERVICE",
  17936. /** 场景。 */
  17937. SCENE: "SCENE",
  17938. /** 数据。 */
  17939. DATA: "DATA",
  17940. /** 洞察。 */
  17941. INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
  17942. /** 大屏。 */
  17943. MAP_DASHBOARD: "MAP_DASHBOARD"
  17944. };
  17945. /**
  17946. * @enum OrderBy
  17947. * @description iportal资源排序字段。
  17948. * @category BaseTypes Constant
  17949. * @version 10.0.1
  17950. * @type {string}
  17951. * @usage
  17952. * ```
  17953. * // 浏览器
  17954. * <script type="text/javascript" src="{cdn}"></script>
  17955. * <script>
  17956. * const result = {namespace}.OrderBy.UPDATETIME;
  17957. *
  17958. * </script>
  17959. * // ES6 Import
  17960. * import { OrderBy } from '{npm}';
  17961. *
  17962. * const result = OrderBy.UPDATETIME;
  17963. * ```
  17964. */
  17965. var OrderBy = {
  17966. /** 按更新时间排序。 */
  17967. UPDATETIME: "UPDATETIME",
  17968. /** 按热度(可能是访问量、下载量)排序。 */
  17969. HEATLEVEL: "HEATLEVEL",
  17970. /** 按相关性排序。 */
  17971. RELEVANCE: "RELEVANCE"
  17972. };
  17973. /**
  17974. * @enum OrderType
  17975. * @description iportal资源升序还是降序过滤。
  17976. * @category BaseTypes Constant
  17977. * @version 10.0.1
  17978. * @type {string}
  17979. * @usage
  17980. * ```
  17981. * // 浏览器
  17982. * <script type="text/javascript" src="{cdn}"></script>
  17983. * <script>
  17984. * const result = {namespace}.OrderType.ASC;
  17985. *
  17986. * </script>
  17987. * // ES6 Import
  17988. * import { OrderType } from '{npm}';
  17989. *
  17990. * const result = OrderType.ASC;
  17991. * ```
  17992. */
  17993. var OrderType = {
  17994. /** 升序。 */
  17995. ASC: "ASC",
  17996. /** 降序。 */
  17997. DESC: "DESC"
  17998. };
  17999. /**
  18000. * @enum SearchType
  18001. * @description iportal资源查询的范围进行过滤。
  18002. * @category BaseTypes Constant
  18003. * @version 10.0.1
  18004. * @type {string}
  18005. * @usage
  18006. * ```
  18007. * // 浏览器
  18008. * <script type="text/javascript" src="{cdn}"></script>
  18009. * <script>
  18010. * const result = {namespace}.SearchType.PUBLIC;
  18011. *
  18012. * </script>
  18013. * // ES6 Import
  18014. * import { SearchType } from '{npm}';
  18015. *
  18016. * const result = SearchType.PUBLIC;
  18017. * ```
  18018. */
  18019. var SearchType = {
  18020. /** 公开资源。 */
  18021. PUBLIC: "PUBLIC",
  18022. /** 我的资源。 */
  18023. MY_RES: "MY_RES",
  18024. /** 我的群组资源。 */
  18025. MYGROUP_RES: "MYGROUP_RES",
  18026. /** 我的部门资源。 */
  18027. MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
  18028. /** 分享给我的资源。 */
  18029. SHARETOME_RES: "SHARETOME_RES"
  18030. };
  18031. /**
  18032. * @enum AggregationTypes
  18033. * @description iportal资源聚合查询的类型。
  18034. * @category BaseTypes Constant
  18035. * @version 10.0.1
  18036. * @type {string}
  18037. * @usage
  18038. * ```
  18039. * // 浏览器
  18040. * <script type="text/javascript" src="{cdn}"></script>
  18041. * <script>
  18042. * const result = {namespace}.AggregationTypes.TAG;
  18043. *
  18044. * </script>
  18045. * // ES6 Import
  18046. * import { AggregationTypes } from '{npm}';
  18047. *
  18048. * const result = AggregationTypes.TAG;
  18049. * ```
  18050. */
  18051. var AggregationTypes = {
  18052. /** 标签。 */
  18053. TAG: "TAG",
  18054. /** 资源类型。 */
  18055. TYPE: "TYPE"
  18056. };
  18057. /**
  18058. * @enum PermissionType
  18059. * @description iportal资源权限类型。
  18060. * @category BaseTypes Constant
  18061. * @version 10.0.1
  18062. * @type {string}
  18063. * @usage
  18064. * ```
  18065. * // 浏览器
  18066. * <script type="text/javascript" src="{cdn}"></script>
  18067. * <script>
  18068. * const result = {namespace}.PermissionType.SEARCH;
  18069. *
  18070. * </script>
  18071. * // ES6 Import
  18072. * import { PermissionType } from '{npm}';
  18073. *
  18074. * const result = PermissionType.SEARCH;
  18075. * ```
  18076. */
  18077. var PermissionType = {
  18078. /** 可检索。 */
  18079. SEARCH: "SEARCH",
  18080. /** 可查看。 */
  18081. READ: "READ",
  18082. /** 可编辑。 */
  18083. READWRITE: "READWRITE",
  18084. /** 可删除。 */
  18085. DELETE: "DELETE",
  18086. /** 可下载,包括可读、可检索。 */
  18087. DOWNLOAD: "DOWNLOAD"
  18088. };
  18089. /**
  18090. * @enum EntityType
  18091. * @description iportal资源实体类型。
  18092. * @category BaseTypes Constant
  18093. * @version 10.0.1
  18094. * @type {string}
  18095. * @usage
  18096. * ```
  18097. * // 浏览器
  18098. * <script type="text/javascript" src="{cdn}"></script>
  18099. * <script>
  18100. * const result = {namespace}.EntityType.DEPARTMENT;
  18101. *
  18102. * </script>
  18103. * // ES6 Import
  18104. * import { EntityType } from '{npm}';
  18105. *
  18106. * const result = EntityType.DEPARTMENT;
  18107. * ```
  18108. */
  18109. var EntityType = {
  18110. /** 部门。 */
  18111. DEPARTMENT: "DEPARTMENT",
  18112. /** 用户组。 */
  18113. GROUP: "GROUP",
  18114. /** 群组。 */
  18115. IPORTALGROUP: "IPORTALGROUP",
  18116. /** 角色。 */
  18117. ROLE: "ROLE",
  18118. /** 用户。 */
  18119. USER: "USER"
  18120. };
  18121. /**
  18122. * @enum DataItemType
  18123. * @description iportal数据类型。
  18124. * @category BaseTypes Constant
  18125. * @version 10.0.1
  18126. * @type {string}
  18127. * @usage
  18128. * ```
  18129. * // 浏览器
  18130. * <script type="text/javascript" src="{cdn}"></script>
  18131. * <script>
  18132. * const result = {namespace}.DataItemType.GEOJSON;
  18133. *
  18134. * </script>
  18135. * // ES6 Import
  18136. * import { DataItemType } from '{npm}';
  18137. *
  18138. * const result = DataItemType.GEOJSON;
  18139. * ```
  18140. */
  18141. var DataItemType = {
  18142. /** geojson 数据。 */
  18143. GEOJSON: "GEOJSON",
  18144. /** UGCV5_MVT。 */
  18145. UGCV5_MVT: "UGCV5_MVT",
  18146. /** json数据。 */
  18147. JSON: "JSON",
  18148. /** 音频文件。 */
  18149. AUDIO: "AUDIO",
  18150. /** Color 颜色。 */
  18151. COLOR: "COLOR",
  18152. /** ColorScheme 颜色方案。 */
  18153. COLORSCHEME: "COLORSCHEME",
  18154. /** CSV 数据。 */
  18155. CSV: "CSV",
  18156. /** EXCEL 数据。 */
  18157. EXCEL: "EXCEL",
  18158. /** FillSymbol 填充符号库。 */
  18159. FILLSYMBOL: "FILLSYMBOL",
  18160. /** 图片类型。 */
  18161. IMAGE: "IMAGE",
  18162. /** LayerTemplate 图层模板。 */
  18163. LAYERTEMPLATE: "LAYERTEMPLATE",
  18164. /** LayoutTemplate 布局模板。 */
  18165. LAYOUTTEMPLATE: "LAYOUTTEMPLATE",
  18166. /** LineSymbol 线符号库。 */
  18167. LINESYMBOL: "LINESYMBOL",
  18168. /** MapTemplate 地图模板。 */
  18169. MAPTEMPLATE: "MAPTEMPLATE",
  18170. /** MarkerSymbol 点符号库。 */
  18171. MARKERSYMBOL: "MARKERSYMBOL",
  18172. /** MBTILES。 */
  18173. MBTILES: "MBTILES",
  18174. /** 照片。 */
  18175. PHOTOS: "PHOTOS",
  18176. /** SHP 空间数据。 */
  18177. SHP: "SHP",
  18178. /** SMTILES。 */
  18179. SMTILES: "SMTILES",
  18180. /** SVTILES。 */
  18181. SVTILES: "SVTILES",
  18182. /** ThemeTemplate 专题图模板。 */
  18183. THEMETEMPLATE: "THEMETEMPLATE",
  18184. /** TPK。 */
  18185. TPK: "TPK",
  18186. /** UDB 数据源。 */
  18187. UDB: "UDB",
  18188. /** UGCV5。 */
  18189. UGCV5: "UGCV5",
  18190. /** 其他类型(普通文件)。 */
  18191. UNKNOWN: "UNKNOWN",
  18192. /** 视频文件。 */
  18193. VIDEO: "VIDEO",
  18194. /** WorkEnviroment 工作环境。 */
  18195. WORKENVIRONMENT: "WORKENVIRONMENT",
  18196. /** 工作空间。 */
  18197. WORKSPACE: "WORKSPACE"
  18198. };
  18199. /**
  18200. * @enum WebExportFormatType
  18201. * @description Web 打印输出的格式。
  18202. * @category BaseTypes Constant
  18203. * @version 10.0.1
  18204. * @type {string}
  18205. * @usage
  18206. * ```
  18207. * // 浏览器
  18208. * <script type="text/javascript" src="{cdn}"></script>
  18209. * <script>
  18210. * const result = {namespace}.WebExportFormatType.PNG;
  18211. *
  18212. * </script>
  18213. * // ES6 Import
  18214. * import { WebExportFormatType } from '{npm}';
  18215. *
  18216. * const result = WebExportFormatType.PNG;
  18217. * ```
  18218. */
  18219. var WebExportFormatType = {
  18220. /** PNG */
  18221. PNG: "PNG",
  18222. /** PDF */
  18223. PDF: "PDF"
  18224. };
  18225. /**
  18226. * @enum WebScaleOrientationType
  18227. * @description Web 比例尺的方位样式。
  18228. * @category BaseTypes Constant
  18229. * @version 10.0.1
  18230. * @type {string}
  18231. * @usage
  18232. * ```
  18233. * // 浏览器
  18234. * <script type="text/javascript" src="{cdn}"></script>
  18235. * <script>
  18236. * const result = {namespace}.WebScaleOrientationType.HORIZONTALLABELSBELOW;
  18237. *
  18238. * </script>
  18239. * // ES6 Import
  18240. * import { WebScaleOrientationType } from '{npm}';
  18241. *
  18242. * const result = WebScaleOrientationType.HORIZONTALLABELSBELOW;
  18243. * ```
  18244. */
  18245. var WebScaleOrientationType = {
  18246. /** horizontal labels below. */
  18247. HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
  18248. /** horizontal labels above. */
  18249. HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
  18250. /** vertical labels left. */
  18251. VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
  18252. /** vertical labels right. */
  18253. VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
  18254. };
  18255. /**
  18256. * @enum WebScaleType
  18257. * @description Web 比例尺的样式。
  18258. * @category BaseTypes Constant
  18259. * @version 10.0.1
  18260. * @type {string}
  18261. * @usage
  18262. * ```
  18263. * // 浏览器
  18264. * <script type="text/javascript" src="{cdn}"></script>
  18265. * <script>
  18266. * const result = {namespace}.WebScaleType.LINE;
  18267. *
  18268. * </script>
  18269. * // ES6 Import
  18270. * import { WebScaleType } from '{npm}';
  18271. *
  18272. * const result = WebScaleType.LINE;
  18273. * ```
  18274. */
  18275. var WebScaleType = {
  18276. /** line. */
  18277. LINE: "LINE",
  18278. /** bar. */
  18279. BAR: "BAR",
  18280. /** bar sub. */
  18281. BAR_SUB: "BAR_SUB"
  18282. };
  18283. /**
  18284. * @enum WebScaleUnit
  18285. * @description Web 比例尺的单位制。
  18286. * @category BaseTypes Constant
  18287. * @version 10.0.1
  18288. * @type {string}
  18289. * @usage
  18290. * ```
  18291. * // 浏览器
  18292. * <script type="text/javascript" src="{cdn}"></script>
  18293. * <script>
  18294. * const result = {namespace}.WebScaleUnit.METER;
  18295. *
  18296. * </script>
  18297. * // ES6 Import
  18298. * import { WebScaleUnit } from '{npm}';
  18299. *
  18300. * const result = WebScaleUnit.METER;
  18301. * ```
  18302. */
  18303. var WebScaleUnit = {
  18304. /** 米。 */
  18305. METER: "METER",
  18306. /** 英尺。 */
  18307. FOOT: "FOOT",
  18308. /** 度。 */
  18309. DEGREES: "DEGREES"
  18310. };
  18311. ;// CONCATENATED MODULE: ./src/common/commontypes/Size.js
  18312. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18313. 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); } }
  18314. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  18315. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  18316. * This program are made available under the terms of the Apache License, Version 2.0
  18317. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18318. /**
  18319. * @class Size
  18320. * @deprecatedclass SuperMap.Size
  18321. * @category BaseTypes Style
  18322. * @classdesc 此类描绘一对高宽值的实例。
  18323. * @param {number} [w=0.0] - 宽度。
  18324. * @param {number} [h=0.0] - 高度。
  18325. *
  18326. * @example
  18327. * var size = new Size(31,46);
  18328. * @usage
  18329. */
  18330. var Size = /*#__PURE__*/function () {
  18331. function Size(w, h) {
  18332. _classCallCheck(this, Size);
  18333. /**
  18334. * @member {number} [Size.prototype.w=0.0]
  18335. * @description 宽度。
  18336. */
  18337. this.w = w ? parseFloat(w) : 0.0;
  18338. /**
  18339. * @member {number} [Size.prototype.h=0.0]
  18340. * @description 高度。
  18341. */
  18342. this.h = w ? parseFloat(h) : 0.0;
  18343. this.CLASS_NAME = "SuperMap.Size";
  18344. }
  18345. /**
  18346. * @function Size.prototype.toString
  18347. * @description 返回字符串形式。
  18348. * @example
  18349. * var size = new Size(10,5);
  18350. * var str = size.toString();
  18351. * @returns {string} 例如:"w=10,h=5"。
  18352. */
  18353. _createClass(Size, [{
  18354. key: "toString",
  18355. value: function toString() {
  18356. return "w=" + this.w + ",h=" + this.h;
  18357. }
  18358. /**
  18359. * @function Size.prototype.clone
  18360. * @description 克隆当前size对象。
  18361. * @example
  18362. * var size = new Size(31,46);
  18363. * var size2 = size.clone();
  18364. * @returns {Size} 新的与当前 size 对象有相同宽、高的 Size 对象。
  18365. */
  18366. }, {
  18367. key: "clone",
  18368. value: function clone() {
  18369. return new Size(this.w, this.h);
  18370. }
  18371. /**
  18372. *
  18373. * @function Size.prototype.equals
  18374. * @description 比较两个 size 对象是否相等。
  18375. * @example
  18376. * var size = new Size(31,46);
  18377. * var size2 = new Size(31,46);
  18378. * var isEquals = size.equals(size2);
  18379. *
  18380. * @param {Size} sz - 用于比较相等的 Size 对象。
  18381. * @returns {boolean} 传入的 size 和当前 size 高宽相等,注意:如果传入的 size 为空则返回 false。
  18382. *
  18383. */
  18384. }, {
  18385. key: "equals",
  18386. value: function equals(sz) {
  18387. var equals = false;
  18388. if (sz != null) {
  18389. equals = this.w === sz.w && this.h === sz.h || isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h);
  18390. }
  18391. return equals;
  18392. }
  18393. /**
  18394. *
  18395. * @function Size.prototype.destroy
  18396. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  18397. * @example
  18398. * var size = new Size(31,46);
  18399. * size.destroy();
  18400. */
  18401. }, {
  18402. key: "destroy",
  18403. value: function destroy() {
  18404. this.w = null;
  18405. this.h = null;
  18406. }
  18407. }]);
  18408. return Size;
  18409. }();
  18410. ;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
  18411. function Pixel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18412. 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); } }
  18413. 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; }
  18414. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  18415. * This program are made available under the terms of the Apache License, Version 2.0
  18416. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18417. /**
  18418. * @class Pixel
  18419. * @deprecatedclass SuperMap.Pixel
  18420. * @category BaseTypes Geometry
  18421. * @classdesc 用 x,y 坐标描绘屏幕坐标(像素点)。
  18422. * @param {number} [x=0.0] - x 坐标。
  18423. * @param {number} [y=0.0] - y 坐标。
  18424. * @param {Pixel.Mode} [mode=Pixel.Mode.LeftTop] - 坐标模式。
  18425. *
  18426. * @example
  18427. * //单独创建一个对象
  18428. * var pixcel = new Pixel(100,50);
  18429. *
  18430. * //依据 size 创建
  18431. * var size = new Size(21,25);
  18432. * var offset = new Pixel(-(size.w/2), -size.h);
  18433. * @usage
  18434. */
  18435. var Pixel = /*#__PURE__*/function () {
  18436. function Pixel(x, y, mode) {
  18437. Pixel_classCallCheck(this, Pixel);
  18438. /**
  18439. * @member {number} [Pixel.prototype.x=0.0]
  18440. * @description x 坐标。
  18441. */
  18442. this.x = x ? parseFloat(x) : 0.0;
  18443. /**
  18444. * @member {number} [Pixel.prototype.y=0.0]
  18445. * @description y 坐标。
  18446. */
  18447. this.y = y ? parseFloat(y) : 0.0;
  18448. /**
  18449. * @member {Pixel.Mode} [Pixel.prototype.mode=Pixel.Mode.LeftTop]
  18450. * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
  18451. */
  18452. this.mode = mode;
  18453. this.CLASS_NAME = 'SuperMap.Pixel';
  18454. }
  18455. /**
  18456. * @function Pixel.prototype.toString
  18457. * @description 返回此对象的字符串形式。
  18458. * @example
  18459. *
  18460. * var pixcel = new Pixel(100,50);
  18461. * var str = pixcel.toString();
  18462. *
  18463. * @returns {string} 例如: "x=200.4,y=242.2"
  18464. */
  18465. Pixel_createClass(Pixel, [{
  18466. key: "toString",
  18467. value: function toString() {
  18468. return 'x=' + this.x + ',y=' + this.y;
  18469. }
  18470. /**
  18471. * @function Pixel.prototype.clone
  18472. * @description 克隆当前的 pixel 对象。
  18473. * @example
  18474. * var pixcel = new Pixel(100,50);
  18475. * var pixcel2 = pixcel.clone();
  18476. * @returns {Pixel} 新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
  18477. */
  18478. }, {
  18479. key: "clone",
  18480. value: function clone() {
  18481. return new Pixel(this.x, this.y, this.mode);
  18482. }
  18483. /**
  18484. * @function Pixel.prototype.equals
  18485. * @description 比较两 pixel 是否相等。
  18486. * @example
  18487. * var pixcel = new Pixel(100,50);
  18488. * var pixcel2 = new Pixel(100,50);
  18489. * var isEquals = pixcel.equals(pixcel2);
  18490. *
  18491. * @param {Pixel} px - 用于比较相等的 pixel 对象。
  18492. * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
  18493. */
  18494. }, {
  18495. key: "equals",
  18496. value: function equals(px) {
  18497. var equals = false;
  18498. if (px != null) {
  18499. equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
  18500. }
  18501. return equals;
  18502. }
  18503. /**
  18504. * @function Pixel.prototype.distanceTo
  18505. * @description 返回两个 pixel 的距离。
  18506. * @example
  18507. * var pixcel = new Pixel(100,50);
  18508. * var pixcel2 = new Pixel(110,30);
  18509. * var distance = pixcel.distanceTo(pixcel2);
  18510. *
  18511. * @param {Pixel} px - 需要计算的 pixel。
  18512. * @returns {number} 作为参数传入的像素与当前像素点的距离。
  18513. */
  18514. }, {
  18515. key: "distanceTo",
  18516. value: function distanceTo(px) {
  18517. return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
  18518. }
  18519. /**
  18520. * @function Pixel.prototype.add
  18521. * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
  18522. * @example
  18523. * var pixcel = new Pixel(100,50);
  18524. * //pixcel2是新的对象
  18525. * var pixcel2 = pixcel.add(20,30);
  18526. *
  18527. * @param {number} x - 传入的 x 值。
  18528. * @param {number} y - 传入的 y 值。
  18529. * @returns {Pixel} 新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
  18530. */
  18531. }, {
  18532. key: "add",
  18533. value: function add(x, y) {
  18534. if (x == null || y == null) {
  18535. throw new TypeError('Pixel.add cannot receive null values');
  18536. }
  18537. return new Pixel(this.x + x, this.y + y);
  18538. }
  18539. /**
  18540. * @function Pixel.prototype.offset
  18541. * @description 通过传入的 {@link Pixel} 参数对原屏幕坐标进行偏移。
  18542. * @example
  18543. * var pixcel = new Pixel(100,50);
  18544. * var pixcel2 = new Pixel(130,20);
  18545. * //pixcel3 是新的对象
  18546. * var pixcel3 = pixcel.offset(pixcel2);
  18547. *
  18548. * @param {Pixel} px - 传入的 {@link Pixel} 对象。
  18549. * @returns {Pixel} 新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
  18550. */
  18551. }, {
  18552. key: "offset",
  18553. value: function offset(px) {
  18554. var newPx = this.clone();
  18555. if (px) {
  18556. newPx = this.add(px.x, px.y);
  18557. }
  18558. return newPx;
  18559. }
  18560. /**
  18561. *
  18562. * @function Pixel.prototype.destroy
  18563. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  18564. * @example
  18565. * var pixcel = new Pixel(100,50);
  18566. * pixcel.destroy();
  18567. */
  18568. }, {
  18569. key: "destroy",
  18570. value: function destroy() {
  18571. this.x = null;
  18572. this.y = null;
  18573. this.mode = null;
  18574. }
  18575. }]);
  18576. return Pixel;
  18577. }();
  18578. /**
  18579. * @enum Mode
  18580. * @memberOf Pixel
  18581. * @readonly
  18582. * @description 模式。
  18583. * @type {string}
  18584. */
  18585. Pixel.Mode = {
  18586. /** 左上模式。*/
  18587. LeftTop: 'lefttop',
  18588. /** 右上模式。 */
  18589. RightTop: 'righttop',
  18590. /** 右下模式。 */
  18591. RightBottom: 'rightbottom',
  18592. /** 左下模式。 */
  18593. LeftBottom: 'leftbottom'
  18594. };
  18595. ;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
  18596. 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); } }
  18597. 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; }
  18598. function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18599. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  18600. * This program are made available under the terms of the Apache License, Version 2.0
  18601. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18602. /**
  18603. * @function inherit
  18604. * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
  18605. * @param {Object} C - 继承的类。
  18606. * @param {Object} P - 被继承的父类。
  18607. * @private
  18608. */
  18609. var inheritExt = function inheritExt(C, P) {
  18610. var F = function F() {};
  18611. F.prototype = P.prototype;
  18612. C.prototype = new F();
  18613. var i, l, o;
  18614. for (i = 2, l = arguments.length; i < l; i++) {
  18615. o = arguments[i];
  18616. if (typeof o === "function") {
  18617. o = o.prototype;
  18618. }
  18619. Util_Util.extend(C.prototype, o);
  18620. }
  18621. };
  18622. /**
  18623. * @function mixinExt
  18624. * @description 实现多重继承。
  18625. * @param {Class|Object} ...mixins - 继承的类。
  18626. * @private
  18627. */
  18628. var mixinExt = function mixinExt() {
  18629. for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
  18630. mixins[_key] = arguments[_key];
  18631. }
  18632. var Mix = /*#__PURE__*/BaseTypes_createClass(function Mix(options) {
  18633. BaseTypes_classCallCheck(this, Mix);
  18634. for (var index = 0; index < mixins.length; index++) {
  18635. copyProperties(this, new mixins[index](options));
  18636. }
  18637. });
  18638. for (var index = 0; index < mixins.length; index++) {
  18639. var mixin = mixins[index];
  18640. copyProperties(Mix, mixin);
  18641. copyProperties(Mix.prototype, mixin.prototype);
  18642. copyProperties(Mix.prototype, new mixin());
  18643. }
  18644. return Mix;
  18645. function copyProperties(target, source) {
  18646. var ownKeys = Object.getOwnPropertyNames(source);
  18647. if (Object.getOwnPropertySymbols) {
  18648. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
  18649. }
  18650. for (var index = 0; index < ownKeys.length; index++) {
  18651. var key = ownKeys[index];
  18652. if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
  18653. var desc = Object.getOwnPropertyDescriptor(source, key);
  18654. if (window["ActiveXObject"]) {
  18655. Object.defineProperty(target, key, desc || {});
  18656. } else {
  18657. Object.defineProperty(target, key, desc);
  18658. }
  18659. }
  18660. }
  18661. }
  18662. };
  18663. /**
  18664. * @name String
  18665. * @namespace
  18666. * @category BaseTypes Util
  18667. * @description 字符串操作的一系列常用扩展函数。
  18668. * @private
  18669. */
  18670. var StringExt = {
  18671. /**
  18672. * @function StringExt.startsWith
  18673. * @description 判断目标字符串是否以指定的子字符串开头。
  18674. * @param {string} str - 目标字符串。
  18675. * @param {string} sub - 查找的子字符串。
  18676. * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
  18677. */
  18678. startsWith: function startsWith(str, sub) {
  18679. return str.indexOf(sub) == 0;
  18680. },
  18681. /**
  18682. * @function StringExt.contains
  18683. * @description 判断目标字符串是否包含指定的子字符串。
  18684. * @param {string} str - 目标字符串。
  18685. * @param {string} sub - 查找的子字符串。
  18686. * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
  18687. */
  18688. contains: function contains(str, sub) {
  18689. return str.indexOf(sub) != -1;
  18690. },
  18691. /**
  18692. * @function StringExt.trim
  18693. * @description 删除一个字符串的开头和结尾处的所有空白字符。
  18694. * @param {string} str - (可能)存在空白字符填塞的字符串。
  18695. * @returns {string} 删除开头和结尾处空白字符后的字符串。
  18696. */
  18697. trim: function trim(str) {
  18698. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  18699. },
  18700. /**
  18701. * @function StringExt.camelize
  18702. * @description 骆驼式("-")连字符的字符串处理。
  18703. * 例如:"chicken-head" becomes "chickenHead",
  18704. * "-chicken-head" becomes "ChickenHead"。
  18705. * @param {string} str - 要处理的字符串,原始内容不应被修改。
  18706. * @returns {string}
  18707. */
  18708. camelize: function camelize(str) {
  18709. var oStringList = str.split('-');
  18710. var camelizedString = oStringList[0];
  18711. for (var i = 1, len = oStringList.length; i < len; i++) {
  18712. var s = oStringList[i];
  18713. camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
  18714. }
  18715. return camelizedString;
  18716. },
  18717. /**
  18718. * @function StringExt.format
  18719. * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
  18720. * @example
  18721. * 示例:
  18722. * (code)
  18723. * 1、template = "${value,getValue}";
  18724. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  18725. * args = [2,23,12,36,21];
  18726. * 返回值:36
  18727. * (end)
  18728. * 示例:
  18729. * (code)
  18730. * 2、template = "$${{value,getValue}}";
  18731. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  18732. * args = [2,23,12,36,21];
  18733. * 返回值:"${36}"
  18734. * (end)
  18735. * 示例:
  18736. * (code)
  18737. * 3、template = "${a,b}";
  18738. * context = {a: {b:"format"}};
  18739. * args = null;
  18740. * 返回值:"format"
  18741. * (end)
  18742. * 示例:
  18743. * (code)
  18744. * 3、template = "${a,b}";
  18745. * context = null;
  18746. * args = null;
  18747. * 返回值:"${a.b}"
  18748. * (end)
  18749. * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
  18750. * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
  18751. * @param {Array.<number>} [args] - 可选参数传递给在 context 对象上找到的函数。
  18752. * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
  18753. */
  18754. format: function format(template, context, args) {
  18755. if (!context) {
  18756. context = window;
  18757. }
  18758. // Example matching:
  18759. // str = ${foo.bar}
  18760. // match = foo.bar
  18761. var replacer = function replacer(str, match) {
  18762. var replacement;
  18763. // Loop through all subs. Example: ${a.b.c}
  18764. // 0 -> replacement = context[a];
  18765. // 1 -> replacement = context[a][b];
  18766. // 2 -> replacement = context[a][b][c];
  18767. var subs = match.split(/\.+/);
  18768. for (var i = 0; i < subs.length; i++) {
  18769. if (i == 0) {
  18770. replacement = context;
  18771. }
  18772. replacement = replacement[subs[i]];
  18773. }
  18774. if (typeof replacement === "function") {
  18775. replacement = args ? replacement.apply(null, args) : replacement();
  18776. }
  18777. // If replacement is undefined, return the string 'undefined'.
  18778. // This is a workaround for a bugs in browsers not properly
  18779. // dealing with non-participating groups in regular expressions:
  18780. // http://blog.stevenlevithan.com/archives/npcg-javascript
  18781. if (typeof replacement == 'undefined') {
  18782. return 'undefined';
  18783. } else {
  18784. return replacement;
  18785. }
  18786. };
  18787. return template.replace(StringExt.tokenRegEx, replacer);
  18788. },
  18789. /**
  18790. * @member {RegExp} [StringExt.tokenRegEx]
  18791. * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
  18792. * @example
  18793. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
  18794. */
  18795. tokenRegEx: /\$\{([\w.]+?)\}/g,
  18796. /**
  18797. * @member {RegExp} [StringExt.numberRegEx]
  18798. * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
  18799. */
  18800. numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
  18801. /**
  18802. * @function StringExt.isNumeric
  18803. * @description 判断一个字符串是否只包含一个数值。
  18804. * @example
  18805. * (code)
  18806. * StringExt.isNumeric("6.02e23") // true
  18807. * StringExt.isNumeric("12 dozen") // false
  18808. * StringExt.isNumeric("4") // true
  18809. * StringExt.isNumeric(" 4 ") // false
  18810. * (end)
  18811. * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
  18812. */
  18813. isNumeric: function isNumeric(value) {
  18814. return StringExt.numberRegEx.test(value);
  18815. },
  18816. /**
  18817. * @function StringExt.numericIf
  18818. * @description 把一个看似数值型的字符串转化为一个数值。
  18819. * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
  18820. */
  18821. numericIf: function numericIf(value) {
  18822. return StringExt.isNumeric(value) ? parseFloat(value) : value;
  18823. }
  18824. };
  18825. /**
  18826. * @name Number
  18827. * @namespace
  18828. * @category BaseTypes Util
  18829. * @description 数值操作的一系列常用扩展函数。
  18830. * @private
  18831. */
  18832. var NumberExt = {
  18833. /**
  18834. * @member {string} [NumberExt.decimalSeparator='.']
  18835. * @description 格式化数字时默认的小数点分隔符。
  18836. * @constant
  18837. */
  18838. decimalSeparator: ".",
  18839. /**
  18840. * @member {string} [NumberExt.thousandsSeparator=',']
  18841. * @description 格式化数字时默认的千位分隔符。
  18842. * @constant
  18843. */
  18844. thousandsSeparator: ",",
  18845. /**
  18846. * @function NumberExt.limitSigDigs
  18847. * @description 限制浮点数的有效数字位数。
  18848. * @param {number} num - 浮点数。
  18849. * @param {number} sig - 有效位数。
  18850. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  18851. */
  18852. limitSigDigs: function limitSigDigs(num, sig) {
  18853. var fig = 0;
  18854. if (sig > 0) {
  18855. fig = parseFloat(num.toPrecision(sig));
  18856. }
  18857. return fig;
  18858. },
  18859. /**
  18860. * @function NumberExt.format
  18861. * @description 数字格式化输出。
  18862. * @param {number} num - 数字。
  18863. * @param {number} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
  18864. * @param {string} [tsep=','] - 千位分隔符。
  18865. * @param {string} [dsep='.'] - 小数点分隔符。
  18866. * @returns {string} 数字格式化后的字符串。
  18867. */
  18868. format: function format(num, dec, tsep, dsep) {
  18869. dec = typeof dec != "undefined" ? dec : 0;
  18870. tsep = typeof tsep != "undefined" ? tsep : NumberExt.thousandsSeparator;
  18871. dsep = typeof dsep != "undefined" ? dsep : NumberExt.decimalSeparator;
  18872. if (dec != null) {
  18873. num = parseFloat(num.toFixed(dec));
  18874. }
  18875. var parts = num.toString().split(".");
  18876. if (parts.length === 1 && dec == null) {
  18877. // integer where we do not want to touch the decimals
  18878. dec = 0;
  18879. }
  18880. var integer = parts[0];
  18881. if (tsep) {
  18882. var thousands = /(-?[0-9]+)([0-9]{3})/;
  18883. while (thousands.test(integer)) {
  18884. integer = integer.replace(thousands, "$1" + tsep + "$2");
  18885. }
  18886. }
  18887. var str;
  18888. if (dec == 0) {
  18889. str = integer;
  18890. } else {
  18891. var rem = parts.length > 1 ? parts[1] : "0";
  18892. if (dec != null) {
  18893. rem = rem + new Array(dec - rem.length + 1).join("0");
  18894. }
  18895. str = integer + dsep + rem;
  18896. }
  18897. return str;
  18898. }
  18899. };
  18900. if (!Number.prototype.limitSigDigs) {
  18901. /**
  18902. * APIMethod: Number.limitSigDigs
  18903. * 限制浮点数的有效数字位数.
  18904. * @param {number} sig -有效位数。
  18905. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  18906. * 如果传入值 为 null、0、或者是负数, 返回值 0。
  18907. */
  18908. Number.prototype.limitSigDigs = function (sig) {
  18909. return NumberExt.limitSigDigs(this, sig);
  18910. };
  18911. }
  18912. /**
  18913. * @name Function
  18914. * @namespace
  18915. * @category BaseTypes Util
  18916. * @description 函数操作的一系列常用扩展函数。
  18917. * @private
  18918. */
  18919. var FunctionExt = {
  18920. /**
  18921. * @function FunctionExt.bind
  18922. * @description 绑定函数到对象。方便创建 this 的作用域。
  18923. * @param {function} func - 输入函数。
  18924. * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
  18925. * @returns {function} object 参数作为 func 函数的 this 对象。
  18926. */
  18927. bind: function bind(func, object) {
  18928. // create a reference to all arguments past the second one
  18929. var args = Array.prototype.slice.apply(arguments, [2]);
  18930. return function () {
  18931. // Push on any additional arguments from the actual function call.
  18932. // These will come after those sent to the bind call.
  18933. var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
  18934. return func.apply(object, newArgs);
  18935. };
  18936. },
  18937. /**
  18938. * @function FunctionExt.bindAsEventListener
  18939. * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
  18940. * @param {function} func - 用于监听事件的函数。
  18941. * @param {Object} object - this 对象的引用。
  18942. * @returns {function}
  18943. */
  18944. bindAsEventListener: function bindAsEventListener(func, object) {
  18945. return function (event) {
  18946. return func.call(object, event || window.event);
  18947. };
  18948. },
  18949. /**
  18950. * @function FunctionExt.False
  18951. * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  18952. * @example
  18953. * document.onclick = FunctionExt.False;
  18954. * @returns {boolean}
  18955. */
  18956. False: function False() {
  18957. return false;
  18958. },
  18959. /**
  18960. * @function FunctionExt.True
  18961. * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  18962. * @example
  18963. * document.onclick = FunctionExt.True;
  18964. * @returns {boolean}
  18965. */
  18966. True: function True() {
  18967. return true;
  18968. },
  18969. /**
  18970. * @function FunctionExt.Void
  18971. * @description 可重用函数,仅仅返回 "undefined"。
  18972. * @returns {undefined}
  18973. */
  18974. Void: function Void() {}
  18975. };
  18976. /**
  18977. * @name Array
  18978. * @namespace
  18979. * @category BaseTypes Util
  18980. * @description 数组操作的一系列常用扩展函数。
  18981. * @private
  18982. */
  18983. var ArrayExt = {
  18984. /**
  18985. * @function ArrayExt.filter
  18986. * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
  18987. * @param {Array} array - 要过滤的数组。
  18988. * @param {function} callback - 数组中的每一个元素调用该函数。</br>
  18989. * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
  18990. * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
  18991. * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
  18992. * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
  18993. */
  18994. filter: function filter(array, callback, caller) {
  18995. var selected = [];
  18996. if (Array.prototype.filter) {
  18997. selected = array.filter(callback, caller);
  18998. } else {
  18999. var len = array.length;
  19000. if (typeof callback != "function") {
  19001. throw new TypeError();
  19002. }
  19003. for (var i = 0; i < len; i++) {
  19004. if (i in array) {
  19005. var val = array[i];
  19006. if (callback.call(caller, val, i, array)) {
  19007. selected.push(val);
  19008. }
  19009. }
  19010. }
  19011. }
  19012. return selected;
  19013. }
  19014. };
  19015. ;// CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
  19016. function Geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19017. 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); } }
  19018. 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; }
  19019. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19020. * This program are made available under the terms of the Apache License, Version 2.0
  19021. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19022. // import {WKT} from '../format/WKT';
  19023. // import {Vector} from './Vector';
  19024. /**
  19025. * @class Geometry
  19026. * @deprecatedclass SuperMap.Geometry
  19027. * @category BaseTypes Geometry
  19028. * @classdesc 几何对象类,描述地理对象的几何图形。
  19029. * @usage
  19030. */
  19031. var Geometry_Geometry = /*#__PURE__*/function () {
  19032. function Geometry() {
  19033. Geometry_classCallCheck(this, Geometry);
  19034. this.CLASS_NAME = "SuperMap.Geometry";
  19035. /**
  19036. * @member {string} Geometry.prototype.id
  19037. * @description 几何对象的唯一标识符。
  19038. *
  19039. */
  19040. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  19041. /**
  19042. * @member {Geometry} Geometry.prototype.parent
  19043. * @description 父类几何对象。
  19044. */
  19045. this.parent = null;
  19046. /**
  19047. * @member {Bounds} Geometry.prototype.bounds
  19048. * @description 几何对象的范围。
  19049. *
  19050. */
  19051. this.bounds = null;
  19052. /**
  19053. * @member {number} Geometry.prototype.SRID
  19054. * @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
  19055. * @example
  19056. * var geometry= new Geometry();
  19057. * geometry. SRID=4326;
  19058. *
  19059. */
  19060. this.SRID = null;
  19061. }
  19062. /**
  19063. * @function Geometry.prototype.destroy
  19064. * @description 解构 Geometry 类,释放资源。
  19065. */
  19066. Geometry_createClass(Geometry, [{
  19067. key: "destroy",
  19068. value: function destroy() {
  19069. this.id = null;
  19070. this.bounds = null;
  19071. this.SRID = null;
  19072. }
  19073. /**
  19074. * @function Geometry.prototype.clone
  19075. * @description 克隆几何图形。克隆的几何图形不设置非标准的属性。
  19076. * @returns {Geometry} 克隆的几何图形。
  19077. */
  19078. }, {
  19079. key: "clone",
  19080. value: function clone() {
  19081. return new Geometry();
  19082. }
  19083. /**
  19084. * @function Geometry.prototype.setBounds
  19085. * @description 设置几何对象的 bounds。
  19086. * @param {Bounds} bounds - 范围。
  19087. */
  19088. }, {
  19089. key: "setBounds",
  19090. value: function setBounds(bounds) {
  19091. if (bounds) {
  19092. this.bounds = bounds.clone();
  19093. }
  19094. }
  19095. /**
  19096. * @function Geometry.prototype.clearBounds
  19097. * @description 清除几何对象的 bounds。
  19098. * 如果该对象有父类,也会清除父类几何对象的 bounds。
  19099. */
  19100. }, {
  19101. key: "clearBounds",
  19102. value: function clearBounds() {
  19103. this.bounds = null;
  19104. if (this.parent) {
  19105. this.parent.clearBounds();
  19106. }
  19107. }
  19108. /**
  19109. * @function Geometry.prototype.extendBounds
  19110. * @description 扩展现有边界以包含新边界。如果尚未设置几何边界,则设置新边界。
  19111. * @param {Bounds} newBounds - 几何对象的 bounds。
  19112. */
  19113. }, {
  19114. key: "extendBounds",
  19115. value: function extendBounds(newBounds) {
  19116. var bounds = this.getBounds();
  19117. if (!bounds) {
  19118. this.setBounds(newBounds);
  19119. } else {
  19120. this.bounds.extend(newBounds);
  19121. }
  19122. }
  19123. /**
  19124. * @function Geometry.prototype.getBounds
  19125. * @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
  19126. * @returns {Bounds} 几何对象的边界。
  19127. */
  19128. }, {
  19129. key: "getBounds",
  19130. value: function getBounds() {
  19131. if (this.bounds == null) {
  19132. this.calculateBounds();
  19133. }
  19134. return this.bounds;
  19135. }
  19136. /**
  19137. * @function Geometry.prototype.calculateBounds
  19138. * @description 重新计算几何图形的边界(需要在子类中实现此方法)。
  19139. */
  19140. }, {
  19141. key: "calculateBounds",
  19142. value: function calculateBounds() {
  19143. //
  19144. // This should be overridden by subclasses.
  19145. //
  19146. }
  19147. /**
  19148. * @function Geometry.prototype.getVertices
  19149. * @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
  19150. * @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
  19151. * @returns {Array} 几何图形的顶点列表。
  19152. */
  19153. }, {
  19154. key: "getVertices",
  19155. value: function getVertices(nodes) {// eslint-disable-line no-unused-vars
  19156. }
  19157. /**
  19158. * @function Geometry.prototype.getArea
  19159. * @description 计算几何对象的面积 ,此方法需要在子类中定义。
  19160. * @returns {number} 计算后的对象面积。
  19161. */
  19162. }, {
  19163. key: "getArea",
  19164. value: function getArea() {
  19165. //to be overridden by geometries that actually have an area
  19166. //
  19167. return 0.0;
  19168. }
  19169. // /**
  19170. // * @function Geometry.prototype.toString
  19171. // * @description 返回geometry对象的字符串表述,需要引入{@link WKTFormat}。此方法只能在子类实现,在父类使用会报错。
  19172. // * @returns {string} geometry对象的字符串表述(Well-Known Text)
  19173. // */
  19174. // toString() {
  19175. // var string;
  19176. // if (WKT) {
  19177. // var wkt = new WKT();
  19178. // string = wkt.write(new Vector(this));
  19179. // } else {
  19180. // string = Object.prototype.toString.call(this);
  19181. // }
  19182. // return string;
  19183. // }
  19184. }]);
  19185. return Geometry;
  19186. }();
  19187. ;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
  19188. 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); }
  19189. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  19190. * This program are made available under the terms of the Apache License, Version 2.0
  19191. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19192. /**
  19193. * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
  19194. * * "opera" -- Opera
  19195. * * "msie" -- Internet Explorer
  19196. * * "safari" -- Safari
  19197. * * "firefox" -- Firefox
  19198. * * "mozilla" -- Mozilla
  19199. * @category BaseTypes Constant
  19200. * @constant {Object}
  19201. * @usage
  19202. * ```
  19203. * // 浏览器
  19204. * <script type="text/javascript" src="{cdn}"></script>
  19205. * <script>
  19206. * const result = {namespace}.Browser.name;
  19207. *
  19208. * </script>
  19209. * // ES6 Import
  19210. * import { Browser } from '{npm}';
  19211. *
  19212. * const result = Browser.name;
  19213. * ```
  19214. */
  19215. var Browser = function () {
  19216. var name = '',
  19217. version = '',
  19218. device = 'pc',
  19219. uaMatch;
  19220. //以下进行测试
  19221. var ua = navigator.userAgent.toLowerCase();
  19222. if (ua.indexOf('msie') > -1 || ua.indexOf('trident') > -1 && ua.indexOf('rv') > -1) {
  19223. name = 'msie';
  19224. uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
  19225. } else if (ua.indexOf('chrome') > -1) {
  19226. name = 'chrome';
  19227. uaMatch = ua.match(/chrome\/([\d.]+)/);
  19228. } else if (ua.indexOf('firefox') > -1) {
  19229. name = 'firefox';
  19230. uaMatch = ua.match(/firefox\/([\d.]+)/);
  19231. } else if (ua.indexOf('opera') > -1) {
  19232. name = 'opera';
  19233. uaMatch = ua.match(/version\/([\d.]+)/);
  19234. } else if (ua.indexOf('safari') > -1) {
  19235. name = 'safari';
  19236. uaMatch = ua.match(/version\/([\d.]+)/);
  19237. }
  19238. version = uaMatch ? uaMatch[1] : '';
  19239. if (ua.indexOf('ipad') > -1 || ua.indexOf('ipod') > -1 || ua.indexOf('iphone') > -1) {
  19240. device = 'apple';
  19241. } else if (ua.indexOf('android') > -1) {
  19242. uaMatch = ua.match(/version\/([\d.]+)/);
  19243. version = uaMatch ? uaMatch[1] : '';
  19244. device = 'android';
  19245. }
  19246. return {
  19247. name: name,
  19248. version: version,
  19249. device: device
  19250. };
  19251. }();
  19252. var isSupportCanvas = function () {
  19253. var checkRes = true,
  19254. broz = Browser;
  19255. if (document.createElement('canvas').getContext) {
  19256. if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
  19257. checkRes = false;
  19258. }
  19259. if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
  19260. checkRes = false;
  19261. }
  19262. if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
  19263. checkRes = false;
  19264. }
  19265. if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
  19266. checkRes = false;
  19267. }
  19268. } else {
  19269. checkRes = false;
  19270. }
  19271. return checkRes;
  19272. }();
  19273. /**
  19274. * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
  19275. * @constant {number}
  19276. * @private
  19277. */
  19278. var IS_GECKO = function () {
  19279. var ua = navigator.userAgent.toLowerCase();
  19280. return ua.indexOf('webkit') === -1 && ua.indexOf('gecko') !== -1;
  19281. }();
  19282. /**
  19283. * @constant {number}
  19284. * @default
  19285. * @description 分辨率与比例尺之间转换的常量。
  19286. * @private
  19287. */
  19288. var DOTS_PER_INCH = 96;
  19289. /**
  19290. * @name CommonUtil
  19291. * @namespace
  19292. * @category BaseTypes Util
  19293. * @description common 工具类。
  19294. * @usage
  19295. * ```
  19296. * // 浏览器
  19297. * <script type="text/javascript" src="{cdn}"></script>
  19298. * <script>
  19299. * const result = {namespace}.CommonUtil.getElement();
  19300. *
  19301. * // 弃用的写法
  19302. * const result = SuperMap.Util.getElement();
  19303. *
  19304. * </script>
  19305. *
  19306. * // ES6 Import
  19307. * import { CommonUtil } from '{npm}';
  19308. *
  19309. * const result = CommonUtil.getElement();
  19310. * ```
  19311. */
  19312. var Util_Util = {
  19313. /**
  19314. * @function Util.extend
  19315. * @description 对象拷贝赋值。
  19316. * @param {Object} dest - 目标对象。
  19317. * @param {Object} arguments - 待拷贝的对象。
  19318. * @returns {Object} 赋值后的目标对象。
  19319. */
  19320. assign: function assign(dest) {
  19321. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  19322. var arg = Object.getOwnPropertyNames(arguments)[index];
  19323. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  19324. continue;
  19325. }
  19326. var obj = arguments[arg];
  19327. if (obj) {
  19328. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  19329. var key = Object.getOwnPropertyNames(obj)[j];
  19330. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  19331. continue;
  19332. }
  19333. dest[key] = obj[key];
  19334. }
  19335. }
  19336. }
  19337. return dest;
  19338. },
  19339. /**
  19340. * @memberOf CommonUtil
  19341. * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
  19342. * @example
  19343. * 要复制 Size 对象的所有属性到自定义对象上,使用方法如下:
  19344. * var size = new Size(100, 100);
  19345. * var obj = {};
  19346. * CommonUtil.extend(obj, size);
  19347. * @param {Object} [destination] - 目标对象。
  19348. * @param {Object} source - 源对象,其属性将被设置到目标对象上。
  19349. * @returns {Object} 目标对象。
  19350. */
  19351. extend: function extend(destination, source) {
  19352. destination = destination || {};
  19353. if (source) {
  19354. for (var property in source) {
  19355. var value = source[property];
  19356. if (value !== undefined) {
  19357. destination[property] = value;
  19358. }
  19359. }
  19360. /**
  19361. * IE doesn't include the toString property when iterating over an object's
  19362. * properties with the for(property in object) syntax. Explicitly check if
  19363. * the source has its own toString property.
  19364. */
  19365. /*
  19366. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  19367. * prototype object" when calling hawOwnProperty if the source object
  19368. * is an instance of window.Event.
  19369. */
  19370. var sourceIsEvt = typeof window.Event === 'function' && source instanceof window.Event;
  19371. if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty('toString')) {
  19372. destination.toString = source.toString;
  19373. }
  19374. }
  19375. return destination;
  19376. },
  19377. /**
  19378. * @memberOf CommonUtil
  19379. * @description 对象拷贝。
  19380. * @param {Object} [des] - 目标对象。
  19381. * @param {Object} soc - 源对象。
  19382. */
  19383. copy: function copy(des, soc) {
  19384. des = des || {};
  19385. var v;
  19386. if (soc) {
  19387. for (var p in des) {
  19388. v = soc[p];
  19389. if (typeof v !== 'undefined') {
  19390. des[p] = v;
  19391. }
  19392. }
  19393. }
  19394. },
  19395. /**
  19396. * @memberOf CommonUtil
  19397. * @description 销毁对象,将其属性置空。
  19398. * @param {Object} [obj] - 目标对象。
  19399. */
  19400. reset: function reset(obj) {
  19401. obj = obj || {};
  19402. for (var p in obj) {
  19403. if (obj.hasOwnProperty(p)) {
  19404. if (_typeof(obj[p]) === 'object' && obj[p] instanceof Array) {
  19405. for (var i in obj[p]) {
  19406. if (obj[p][i].destroy) {
  19407. obj[p][i].destroy();
  19408. }
  19409. }
  19410. obj[p].length = 0;
  19411. } else if (_typeof(obj[p]) === 'object' && obj[p] instanceof Object) {
  19412. if (obj[p].destroy) {
  19413. obj[p].destroy();
  19414. }
  19415. }
  19416. obj[p] = null;
  19417. }
  19418. }
  19419. },
  19420. /**
  19421. * @memberOf CommonUtil
  19422. * @description 获取 HTML 元素数组。
  19423. * @returns {Array.<HTMLElement>} HTML 元素数组。
  19424. */
  19425. getElement: function getElement() {
  19426. var elements = [];
  19427. for (var i = 0, len = arguments.length; i < len; i++) {
  19428. var element = arguments[i];
  19429. if (typeof element === 'string') {
  19430. element = document.getElementById(element);
  19431. }
  19432. if (arguments.length === 1) {
  19433. return element;
  19434. }
  19435. elements.push(element);
  19436. }
  19437. return elements;
  19438. },
  19439. /**
  19440. * @memberOf CommonUtil
  19441. * @description instance of 的跨浏览器实现。
  19442. * @param {Object} o - 对象。
  19443. * @returns {boolean} 是否是页面元素。
  19444. */
  19445. isElement: function isElement(o) {
  19446. return !!(o && o.nodeType === 1);
  19447. },
  19448. /**
  19449. * @memberOf CommonUtil
  19450. * @description 判断一个对象是否是数组。
  19451. * @param {Object} a - 对象。
  19452. * @returns {boolean} 是否是数组。
  19453. */
  19454. isArray: function isArray(a) {
  19455. return Object.prototype.toString.call(a) === '[object Array]';
  19456. },
  19457. /**
  19458. * @memberOf CommonUtil
  19459. * @description 从数组中删除某一项。
  19460. * @param {Array} array - 数组。
  19461. * @param {Object} item - 数组中要删除的一项。
  19462. * @returns {Array} 执行删除操作后的数组。
  19463. */
  19464. removeItem: function removeItem(array, item) {
  19465. for (var i = array.length - 1; i >= 0; i--) {
  19466. if (array[i] === item) {
  19467. array.splice(i, 1);
  19468. //break;more than once??
  19469. }
  19470. }
  19471. return array;
  19472. },
  19473. /**
  19474. * @memberOf CommonUtil
  19475. * @description 获取某对象在数组中的索引值。
  19476. * @param {Array.<Object>} array - 数组。
  19477. * @param {Object} obj - 对象。
  19478. * @returns {number} 某对象在数组中的索引值。
  19479. */
  19480. indexOf: function indexOf(array, obj) {
  19481. if (array == null) {
  19482. return -1;
  19483. } else {
  19484. // use the build-in function if available.
  19485. if (typeof array.indexOf === 'function') {
  19486. return array.indexOf(obj);
  19487. } else {
  19488. for (var i = 0, len = array.length; i < len; i++) {
  19489. if (array[i] === obj) {
  19490. return i;
  19491. }
  19492. }
  19493. return -1;
  19494. }
  19495. }
  19496. },
  19497. /**
  19498. * @memberOf CommonUtil
  19499. * @description 修改某 DOM 元素的许多属性。
  19500. * @param {HTMLElement} element - 待修改的 DOM 元素。
  19501. * @param {string} [id] - DOM 元素的 ID。
  19502. * @param {Pixel} [px] - DOM 元素的 style 属性的 left 和 top 属性。
  19503. * @param {Size} [sz] - DOM 元素的 width 和 height 属性。
  19504. * @param {string} [position] - DOM 元素的 position 属性。
  19505. * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
  19506. * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
  19507. * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
  19508. */
  19509. modifyDOMElement: function modifyDOMElement(element, id, px, sz, position, border, overflow, opacity) {
  19510. if (id) {
  19511. element.id = id;
  19512. }
  19513. if (px) {
  19514. element.style.left = px.x + 'px';
  19515. element.style.top = px.y + 'px';
  19516. }
  19517. if (sz) {
  19518. element.style.width = sz.w + 'px';
  19519. element.style.height = sz.h + 'px';
  19520. }
  19521. if (position) {
  19522. element.style.position = position;
  19523. }
  19524. if (border) {
  19525. element.style.border = border;
  19526. }
  19527. if (overflow) {
  19528. element.style.overflow = overflow;
  19529. }
  19530. if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
  19531. element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
  19532. element.style.opacity = opacity;
  19533. } else if (parseFloat(opacity) === 1.0) {
  19534. element.style.filter = '';
  19535. element.style.opacity = '';
  19536. }
  19537. },
  19538. /**
  19539. * @memberOf CommonUtil
  19540. * @description 比较两个对象并合并。
  19541. * @param {Object} [to] - 目标对象。
  19542. * @param {Object} from - 源对象。
  19543. * @returns {Object} 返回合并后的对象。
  19544. */
  19545. applyDefaults: function applyDefaults(to, from) {
  19546. to = to || {};
  19547. /*
  19548. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  19549. * prototype object" when calling hawOwnProperty if the source object is an
  19550. * instance of window.Event.
  19551. */
  19552. var fromIsEvt = typeof window.Event === 'function' && from instanceof window.Event;
  19553. for (var key in from) {
  19554. if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
  19555. to[key] = from[key];
  19556. }
  19557. }
  19558. /**
  19559. * IE doesn't include the toString property when iterating over an object's
  19560. * properties with the for(property in object) syntax. Explicitly check if
  19561. * the source has its own toString property.
  19562. */
  19563. if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
  19564. to.toString = from.toString;
  19565. }
  19566. return to;
  19567. },
  19568. /**
  19569. * @memberOf CommonUtil
  19570. * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
  19571. * @param {Object} params - 参数对象。
  19572. * @returns {string} HTTP 的 GET 请求中的参数字符串。
  19573. */
  19574. getParameterString: function getParameterString(params) {
  19575. var paramsArray = [];
  19576. for (var key in params) {
  19577. var value = params[key];
  19578. if (value != null && typeof value !== 'function') {
  19579. var encodedValue;
  19580. if (Array.isArray(value) || value.toString() === '[object Object]') {
  19581. encodedValue = encodeURIComponent(JSON.stringify(value));
  19582. } else {
  19583. /* value is a string; simply encode */
  19584. encodedValue = encodeURIComponent(value);
  19585. }
  19586. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  19587. }
  19588. }
  19589. return paramsArray.join('&');
  19590. },
  19591. /**
  19592. * @memberOf CommonUtil
  19593. * @description 给 URL 追加查询参数。
  19594. * @param {string} url - 待追加参数的 URL 字符串。
  19595. * @param {string} paramStr - 待追加的查询参数。
  19596. * @returns {string} 新的 URL。
  19597. */
  19598. urlAppend: function urlAppend(url, paramStr) {
  19599. var newUrl = url;
  19600. if (paramStr) {
  19601. if (paramStr.indexOf('?') === 0) {
  19602. paramStr = paramStr.substring(1);
  19603. }
  19604. var parts = (url + ' ').split(/[?&]/);
  19605. newUrl += parts.pop() === ' ' ? paramStr : parts.length ? '&' + paramStr : '?' + paramStr;
  19606. }
  19607. return newUrl;
  19608. },
  19609. /**
  19610. * @memberOf CommonUtil
  19611. * @description 给 URL 追加 path 参数。
  19612. * @param {string} url - 待追加参数的 URL 字符串。
  19613. * @param {string} paramStr - 待追加的path参数。
  19614. * @returns {string} 新的 URL。
  19615. */
  19616. urlPathAppend: function urlPathAppend(url, pathStr) {
  19617. var newUrl = url;
  19618. if (!pathStr) {
  19619. return newUrl;
  19620. }
  19621. if (pathStr.indexOf('/') === 0) {
  19622. pathStr = pathStr.substring(1);
  19623. }
  19624. var parts = url.split('?');
  19625. if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
  19626. parts[0] += '/';
  19627. }
  19628. newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
  19629. return newUrl;
  19630. },
  19631. /**
  19632. * @memberOf CommonUtil
  19633. * @description 为了避免浮点精度错误而保留的有效位数。
  19634. * @type {number}
  19635. * @default 14
  19636. */
  19637. DEFAULT_PRECISION: 14,
  19638. /**
  19639. * @memberOf CommonUtil
  19640. * @description 将字符串以接近的精度转换为数字。
  19641. * @param {string} number - 字符串。
  19642. * @param {number} [precision=14] - 精度。
  19643. * @returns {number} 转化后的数字。
  19644. */
  19645. toFloat: function toFloat(number, precision) {
  19646. if (precision == null) {
  19647. precision = Util_Util.DEFAULT_PRECISION;
  19648. }
  19649. if (typeof number !== 'number') {
  19650. number = parseFloat(number);
  19651. }
  19652. return precision === 0 ? number : parseFloat(number.toPrecision(precision));
  19653. },
  19654. /**
  19655. * @memberOf CommonUtil
  19656. * @description 角度转弧度。
  19657. * @param {number} x - 角度。
  19658. * @returns {number} 转化后的弧度。
  19659. */
  19660. rad: function rad(x) {
  19661. return x * Math.PI / 180;
  19662. },
  19663. /**
  19664. * @memberOf CommonUtil
  19665. * @description 从 URL 字符串中解析出参数对象。
  19666. * @param {string} url - URL。
  19667. * @returns {Object} 解析出的参数对象。
  19668. */
  19669. getParameters: function getParameters(url) {
  19670. // if no url specified, take it from the location bar
  19671. url = url === null || url === undefined ? window.location.href : url;
  19672. //parse out parameters portion of url string
  19673. var paramsString = '';
  19674. if (StringExt.contains(url, '?')) {
  19675. var start = url.indexOf('?') + 1;
  19676. var end = StringExt.contains(url, '#') ? url.indexOf('#') : url.length;
  19677. paramsString = url.substring(start, end);
  19678. }
  19679. var parameters = {};
  19680. var pairs = paramsString.split(/[&;]/);
  19681. for (var i = 0, len = pairs.length; i < len; ++i) {
  19682. var keyValue = pairs[i].split('=');
  19683. if (keyValue[0]) {
  19684. var key = keyValue[0];
  19685. try {
  19686. key = decodeURIComponent(key);
  19687. } catch (err) {
  19688. key = unescape(key);
  19689. }
  19690. // being liberal by replacing "+" with " "
  19691. var value = (keyValue[1] || '').replace(/\+/g, ' ');
  19692. try {
  19693. value = decodeURIComponent(value);
  19694. } catch (err) {
  19695. value = unescape(value);
  19696. }
  19697. // follow OGC convention of comma delimited values
  19698. value = value.split(',');
  19699. //if there's only one value, do not return as array
  19700. if (value.length == 1) {
  19701. value = value[0];
  19702. }
  19703. parameters[key] = value;
  19704. }
  19705. }
  19706. return parameters;
  19707. },
  19708. /**
  19709. * @memberOf CommonUtil
  19710. * @description 不断递增计数变量,用于生成唯一 ID。
  19711. * @type {number}
  19712. * @default 0
  19713. */
  19714. lastSeqID: 0,
  19715. /**
  19716. * @memberOf CommonUtil
  19717. * @description 创建唯一 ID 值。
  19718. * @param {string} [prefix] - 前缀。
  19719. * @returns {string} 唯一的 ID 值。
  19720. */
  19721. createUniqueID: function createUniqueID(prefix) {
  19722. if (prefix == null) {
  19723. prefix = 'id_';
  19724. }
  19725. Util_Util.lastSeqID += 1;
  19726. return prefix + Util_Util.lastSeqID;
  19727. },
  19728. /**
  19729. * @memberOf CommonUtil
  19730. * @description 判断并转化比例尺。
  19731. * @param {number} scale - 比例尺。
  19732. * @returns {number} 正常的 scale 值。
  19733. */
  19734. normalizeScale: function normalizeScale(scale) {
  19735. var normScale = scale > 1.0 ? 1.0 / scale : scale;
  19736. return normScale;
  19737. },
  19738. /**
  19739. * @memberOf CommonUtil
  19740. * @description 比例尺转分辨率。
  19741. * @param {number} scale - 比例尺。
  19742. * @param {string} [units='degrees'] - 比例尺单位。
  19743. * @returns {number} 转化后的分辨率。
  19744. */
  19745. getResolutionFromScale: function getResolutionFromScale(scale, units) {
  19746. var resolution;
  19747. if (scale) {
  19748. if (units == null) {
  19749. units = 'degrees';
  19750. }
  19751. var normScale = Util_Util.normalizeScale(scale);
  19752. resolution = 1 / (normScale * INCHES_PER_UNIT[units] * DOTS_PER_INCH);
  19753. }
  19754. return resolution;
  19755. },
  19756. /**
  19757. * @memberOf CommonUtil
  19758. * @description 分辨率转比例尺。
  19759. * @param {number} resolution - 分辨率。
  19760. * @param {string} [units='degrees'] - 分辨率单位。
  19761. * @returns {number} 转化后的比例尺。
  19762. */
  19763. getScaleFromResolution: function getScaleFromResolution(resolution, units) {
  19764. if (units == null) {
  19765. units = 'degrees';
  19766. }
  19767. var scale = resolution * INCHES_PER_UNIT[units] * DOTS_PER_INCH;
  19768. return scale;
  19769. },
  19770. /**
  19771. * @memberOf CommonUtil
  19772. * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
  19773. * @returns {Object} 浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
  19774. */
  19775. getBrowser: function getBrowser() {
  19776. return Browser;
  19777. },
  19778. /**
  19779. * @memberOf CommonUtil
  19780. * @description 浏览器是否支持 Canvas。
  19781. * @returns {boolean} 当前浏览器是否支持 HTML5 Canvas。
  19782. */
  19783. isSupportCanvas: isSupportCanvas,
  19784. /**
  19785. * @memberOf CommonUtil
  19786. * @description 判断浏览器是否支持 Canvas。
  19787. * @returns {boolean} 当前浏览器是否支持 HTML5 Canvas 。
  19788. */
  19789. supportCanvas: function supportCanvas() {
  19790. return Util_Util.isSupportCanvas;
  19791. },
  19792. /**
  19793. * @memberOf CommonUtil
  19794. * @description 判断一个 URL 请求是否在当前域中。
  19795. * @param {string} url - URL 请求字符串。
  19796. * @returns {boolean} URL 请求是否在当前域中。
  19797. */
  19798. isInTheSameDomain: function isInTheSameDomain(url) {
  19799. if (!url) {
  19800. return true;
  19801. }
  19802. var index = url.indexOf('//');
  19803. var documentUrl = document.location.toString();
  19804. var documentIndex = documentUrl.indexOf('//');
  19805. if (index === -1) {
  19806. return true;
  19807. } else {
  19808. var protocol;
  19809. var substring = protocol = url.substring(0, index);
  19810. var documentSubString = documentUrl.substring(documentIndex + 2);
  19811. documentIndex = documentSubString.indexOf('/');
  19812. var documentPortIndex = documentSubString.indexOf(':');
  19813. var documentDomainWithPort = documentSubString.substring(0, documentIndex);
  19814. //var documentPort;
  19815. var documentprotocol = document.location.protocol;
  19816. if (documentPortIndex !== -1) {
  19817. // documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
  19818. } else {
  19819. documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
  19820. }
  19821. if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
  19822. return false;
  19823. }
  19824. substring = url.substring(index + 2);
  19825. var portIndex = substring.indexOf(':');
  19826. index = substring.indexOf('/');
  19827. var domainWithPort = substring.substring(0, index);
  19828. var domain;
  19829. if (portIndex !== -1) {
  19830. domain = substring.substring(0, portIndex);
  19831. } else {
  19832. domain = substring.substring(0, index);
  19833. domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
  19834. }
  19835. var documentDomain = document.domain;
  19836. if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
  19837. return true;
  19838. }
  19839. }
  19840. return false;
  19841. },
  19842. /**
  19843. * @memberOf CommonUtil
  19844. * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
  19845. * @param {Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
  19846. * @param {Size} viewer - 地图初始化时默认的地图图片的尺寸。
  19847. * @param {number} scale - 地图初始化时默认的显示比例尺。
  19848. * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
  19849. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
  19850. * @returns {number} 图层显示分辨率。
  19851. */
  19852. calculateDpi: function calculateDpi(viewBounds, viewer, scale, coordUnit, datumAxis) {
  19853. //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
  19854. if (!viewBounds || !viewer || !scale) {
  19855. return;
  19856. }
  19857. var ratio = 10000,
  19858. rvbWidth = viewBounds.getWidth(),
  19859. rvbHeight = viewBounds.getHeight(),
  19860. rvWidth = viewer.w,
  19861. rvHeight = viewer.h;
  19862. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  19863. datumAxis = datumAxis || 6378137;
  19864. coordUnit = coordUnit || 'degrees';
  19865. var dpi;
  19866. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  19867. var num1 = rvbWidth / rvWidth,
  19868. num2 = rvbHeight / rvHeight,
  19869. resolution = num1 > num2 ? num1 : num2;
  19870. dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  19871. } else {
  19872. var _resolution = rvbWidth / rvWidth;
  19873. dpi = 0.0254 * ratio / _resolution / scale / ratio;
  19874. }
  19875. return dpi;
  19876. },
  19877. /**
  19878. * @memberOf CommonUtil
  19879. * @description 将对象转换成 JSON 字符串。
  19880. * @param {Object} obj - 要转换成 JSON 的 Object 对象。
  19881. * @returns {string} 转换后的 JSON 对象。
  19882. */
  19883. toJSON: function toJSON(obj) {
  19884. var objInn = obj;
  19885. if (objInn == null) {
  19886. return null;
  19887. }
  19888. switch (objInn.constructor) {
  19889. case String:
  19890. //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
  19891. objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
  19892. objInn = objInn.replace(/\n/g, '\\n');
  19893. objInn = objInn.replace(/\r/g, '\\r');
  19894. objInn = objInn.replace('<', '&lt;');
  19895. objInn = objInn.replace('>', '&gt;');
  19896. objInn = objInn.replace(/%/g, '%25');
  19897. objInn = objInn.replace(/&/g, '%26');
  19898. return objInn;
  19899. case Array:
  19900. var arr = '';
  19901. for (var i = 0, len = objInn.length; i < len; i++) {
  19902. arr += Util_Util.toJSON(objInn[i]);
  19903. if (i !== objInn.length - 1) {
  19904. arr += ',';
  19905. }
  19906. }
  19907. return "[" + arr + "]";
  19908. case Number:
  19909. return isFinite(objInn) ? String(objInn) : null;
  19910. case Boolean:
  19911. return String(objInn);
  19912. case Date:
  19913. 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() + '}';
  19914. return dateStr;
  19915. default:
  19916. if (objInn['toJSON'] != null && typeof objInn['toJSON'] === 'function') {
  19917. return objInn.toJSON();
  19918. }
  19919. if (_typeof(objInn) === 'object') {
  19920. if (objInn.length) {
  19921. var _arr = [];
  19922. for (var _i2 = 0, _len2 = objInn.length; _i2 < _len2; _i2++) {
  19923. _arr.push(Util_Util.toJSON(objInn[_i2]));
  19924. }
  19925. return '[' + _arr.join(',') + ']';
  19926. }
  19927. var _arr2 = [];
  19928. for (var attr in objInn) {
  19929. //为解决Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
  19930. if (typeof objInn[attr] !== 'function' && attr !== 'CLASS_NAME' && attr !== 'parent') {
  19931. _arr2.push("'" + attr + "':" + Util_Util.toJSON(objInn[attr]));
  19932. }
  19933. }
  19934. if (_arr2.length > 0) {
  19935. return '{' + _arr2.join(',') + '}';
  19936. } else {
  19937. return '{}';
  19938. }
  19939. }
  19940. return objInn.toString();
  19941. }
  19942. },
  19943. /**
  19944. * @memberOf CommonUtil
  19945. * @description 根据比例尺和 DPI 计算屏幕分辨率。
  19946. * @category BaseTypes Util
  19947. * @param {number} scale - 比例尺。
  19948. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  19949. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  19950. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  19951. * @returns {number} 当前比例尺下的屏幕分辨率。
  19952. */
  19953. getResolutionFromScaleDpi: function getResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis) {
  19954. var resolution = null,
  19955. ratio = 10000;
  19956. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  19957. datumAxis = datumAxis || 6378137;
  19958. coordUnit = coordUnit || '';
  19959. if (scale > 0 && dpi > 0) {
  19960. scale = Util_Util.normalizeScale(scale);
  19961. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  19962. //scale = Util.normalizeScale(scale);
  19963. resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  19964. return resolution;
  19965. } else {
  19966. resolution = 0.0254 * ratio / dpi / scale / ratio;
  19967. return resolution;
  19968. }
  19969. }
  19970. return -1;
  19971. },
  19972. /**
  19973. * @memberOf CommonUtil
  19974. * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
  19975. * @param {number} resolution - 用于计算比例尺的地图分辨率。
  19976. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  19977. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  19978. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  19979. * @returns {number} 当前屏幕分辨率下的比例尺。
  19980. */
  19981. getScaleFromResolutionDpi: function getScaleFromResolutionDpi(resolution, dpi, coordUnit, datumAxis) {
  19982. var scale = null,
  19983. ratio = 10000;
  19984. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  19985. datumAxis = datumAxis || 6378137;
  19986. coordUnit = coordUnit || '';
  19987. if (resolution > 0 && dpi > 0) {
  19988. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  19989. scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
  19990. return scale;
  19991. } else {
  19992. scale = 0.0254 * ratio / dpi / resolution / ratio;
  19993. return scale;
  19994. }
  19995. }
  19996. return -1;
  19997. },
  19998. /**
  19999. * @memberOf CommonUtil
  20000. * @description 转换查询结果。
  20001. * @param {Object} result - 查询结果。
  20002. * @returns {Object} 转换后的查询结果。
  20003. */
  20004. transformResult: function transformResult(result) {
  20005. if (result.responseText && typeof result.responseText === 'string') {
  20006. result = JSON.parse(result.responseText);
  20007. }
  20008. return result;
  20009. },
  20010. /**
  20011. * @memberOf CommonUtil
  20012. * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
  20013. * @param {Object} [destination] - 拷贝目标。
  20014. * @param {Object} source - 源对象。
  20015. *
  20016. */
  20017. copyAttributes: function copyAttributes(destination, source) {
  20018. destination = destination || {};
  20019. if (source) {
  20020. for (var property in source) {
  20021. var value = source[property];
  20022. if (value !== undefined && property !== 'CLASS_NAME' && typeof value !== 'function') {
  20023. destination[property] = value;
  20024. }
  20025. }
  20026. }
  20027. return destination;
  20028. },
  20029. /**
  20030. * @memberOf CommonUtil
  20031. * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
  20032. * @param {Object} [destination] - 目标对象。
  20033. * @param {Object} source - 源对象。
  20034. * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
  20035. *
  20036. */
  20037. copyAttributesWithClip: function copyAttributesWithClip(destination, source, clip) {
  20038. destination = destination || {};
  20039. if (source) {
  20040. for (var property in source) {
  20041. //去掉禁止拷贝的属性
  20042. var isInClip = false;
  20043. if (clip && clip.length) {
  20044. for (var i = 0, len = clip.length; i < len; i++) {
  20045. if (property === clip[i]) {
  20046. isInClip = true;
  20047. break;
  20048. }
  20049. }
  20050. }
  20051. if (isInClip === true) {
  20052. continue;
  20053. }
  20054. var value = source[property];
  20055. if (value !== undefined && property !== 'CLASS_NAME' && typeof value !== 'function') {
  20056. destination[property] = value;
  20057. }
  20058. }
  20059. }
  20060. return destination;
  20061. },
  20062. /**
  20063. * @memberOf CommonUtil
  20064. * @description 克隆一个 Object 对象。
  20065. * @param {Object} obj - 需要克隆的对象。
  20066. * @returns {Object} 对象的拷贝对象,注意是新的对象,不是指向。
  20067. */
  20068. cloneObject: function cloneObject(obj) {
  20069. // Handle the 3 simple types, and null or undefined
  20070. if (null === obj || 'object' !== _typeof(obj)) {
  20071. return obj;
  20072. }
  20073. // Handle Date
  20074. if (obj instanceof Date) {
  20075. var copy = new Date();
  20076. copy.setTime(obj.getTime());
  20077. return copy;
  20078. }
  20079. // Handle Array
  20080. if (obj instanceof Array) {
  20081. var _copy = obj.slice(0);
  20082. return _copy;
  20083. }
  20084. // Handle Object
  20085. if (obj instanceof Object) {
  20086. var _copy2 = {};
  20087. for (var attr in obj) {
  20088. if (obj.hasOwnProperty(attr)) {
  20089. _copy2[attr] = Util_Util.cloneObject(obj[attr]);
  20090. }
  20091. }
  20092. return _copy2;
  20093. }
  20094. throw new Error("Unable to copy obj! Its type isn't supported.");
  20095. },
  20096. /**
  20097. * @memberOf CommonUtil
  20098. * @description 判断两条线段是不是有交点。
  20099. * @param {GeometryPoint} a1 - 第一条线段的起始节点。
  20100. * @param {GeometryPoint} a2 - 第一条线段的结束节点。
  20101. * @param {GeometryPoint} b1 - 第二条线段的起始节点。
  20102. * @param {GeometryPoint} b2 - 第二条线段的结束节点。
  20103. * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
  20104. */
  20105. lineIntersection: function lineIntersection(a1, a2, b1, b2) {
  20106. var intersectValue = null;
  20107. var k1;
  20108. var k2;
  20109. var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
  20110. var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
  20111. var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y);
  20112. //ab==0代表两条线断的斜率一样
  20113. if (ab != 0) {
  20114. k1 = b / ab;
  20115. k2 = a / ab;
  20116. if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
  20117. intersectValue = new Geometry_Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
  20118. } else {
  20119. intersectValue = 'No Intersection';
  20120. }
  20121. } else {
  20122. if (b == 0 && a == 0) {
  20123. var maxy = Math.max(a1.y, a2.y);
  20124. var miny = Math.min(a1.y, a2.y);
  20125. var maxx = Math.max(a1.x, a2.x);
  20126. var minx = Math.min(a1.x, a2.x);
  20127. 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) {
  20128. intersectValue = 'Coincident'; //重合
  20129. } else {
  20130. intersectValue = 'Parallel'; //平行
  20131. }
  20132. } else {
  20133. intersectValue = 'Parallel'; //平行
  20134. }
  20135. }
  20136. return intersectValue;
  20137. },
  20138. /**
  20139. * @memberOf CommonUtil
  20140. * @description 获取文本外接矩形宽度与高度。
  20141. * @param {ThemeStyle} style - 文本样式。
  20142. * @param {string} text - 文本内容。
  20143. * @param {Object} element - DOM 元素。
  20144. * @returns {Object} 裁剪后的宽度,高度信息。
  20145. */
  20146. getTextBounds: function getTextBounds(style, text, element) {
  20147. document.body.appendChild(element);
  20148. element.style.width = 'auto';
  20149. element.style.height = 'auto';
  20150. if (style.fontSize) {
  20151. element.style.fontSize = style.fontSize;
  20152. }
  20153. if (style.fontFamily) {
  20154. element.style.fontFamily = style.fontFamily;
  20155. }
  20156. if (style.fontWeight) {
  20157. element.style.fontWeight = style.fontWeight;
  20158. }
  20159. element.style.position = 'relative';
  20160. element.style.visibility = 'hidden';
  20161. //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
  20162. element.style.display = 'inline-block';
  20163. element.innerHTML = text;
  20164. var textWidth = element.clientWidth;
  20165. var textHeight = element.clientHeight;
  20166. document.body.removeChild(element);
  20167. return {
  20168. textWidth: textWidth,
  20169. textHeight: textHeight
  20170. };
  20171. },
  20172. /**
  20173. * @memberOf CommonUtil
  20174. * @description 获取转换后的path路径。
  20175. * @param {string} path - 待转换的path,包含`{param}`。
  20176. * @param {Object} pathParams - path中待替换的参数。
  20177. * @returns {string} 转换后的path路径。
  20178. */
  20179. convertPath: function convertPath(path, pathParams) {
  20180. if (!pathParams) {
  20181. return path;
  20182. }
  20183. return path.replace(/\{([\w-\.]+)\}/g, function (fullMatch, key) {
  20184. var value;
  20185. if (pathParams.hasOwnProperty(key)) {
  20186. value = paramToString(pathParams[key]);
  20187. } else {
  20188. value = fullMatch;
  20189. }
  20190. return encodeURIComponent(value);
  20191. });
  20192. }
  20193. };
  20194. /**
  20195. * @enum INCHES_PER_UNIT
  20196. * @description 每单位的英尺数。
  20197. * @type {number}
  20198. * @private
  20199. */
  20200. var INCHES_PER_UNIT = {
  20201. inches: 1.0,
  20202. ft: 12.0,
  20203. mi: 63360.0,
  20204. m: 39.3701,
  20205. km: 39370.1,
  20206. dd: 4374754,
  20207. yd: 36
  20208. };
  20209. INCHES_PER_UNIT['in'] = INCHES_PER_UNIT.inches;
  20210. INCHES_PER_UNIT['degrees'] = INCHES_PER_UNIT.dd;
  20211. INCHES_PER_UNIT['nmi'] = 1852 * INCHES_PER_UNIT.m;
  20212. // Units from CS-Map
  20213. var METERS_PER_INCH = 0.0254000508001016002;
  20214. Util_Util.extend(INCHES_PER_UNIT, {
  20215. Inch: INCHES_PER_UNIT.inches,
  20216. Meter: 1.0 / METERS_PER_INCH,
  20217. //EPSG:9001
  20218. Foot: 0.30480060960121920243 / METERS_PER_INCH,
  20219. //EPSG:9003
  20220. IFoot: 0.3048 / METERS_PER_INCH,
  20221. //EPSG:9002
  20222. ClarkeFoot: 0.3047972651151 / METERS_PER_INCH,
  20223. //EPSG:9005
  20224. SearsFoot: 0.30479947153867624624 / METERS_PER_INCH,
  20225. //EPSG:9041
  20226. GoldCoastFoot: 0.30479971018150881758 / METERS_PER_INCH,
  20227. //EPSG:9094
  20228. IInch: 0.0254 / METERS_PER_INCH,
  20229. MicroInch: 0.0000254 / METERS_PER_INCH,
  20230. Mil: 0.0000000254 / METERS_PER_INCH,
  20231. Centimeter: 0.01 / METERS_PER_INCH,
  20232. Kilometer: 1000.0 / METERS_PER_INCH,
  20233. //EPSG:9036
  20234. Yard: 0.91440182880365760731 / METERS_PER_INCH,
  20235. SearsYard: 0.914398414616029 / METERS_PER_INCH,
  20236. //EPSG:9040
  20237. IndianYard: 0.91439853074444079983 / METERS_PER_INCH,
  20238. //EPSG:9084
  20239. IndianYd37: 0.91439523 / METERS_PER_INCH,
  20240. //EPSG:9085
  20241. IndianYd62: 0.9143988 / METERS_PER_INCH,
  20242. //EPSG:9086
  20243. IndianYd75: 0.9143985 / METERS_PER_INCH,
  20244. //EPSG:9087
  20245. IndianFoot: 0.30479951 / METERS_PER_INCH,
  20246. //EPSG:9080
  20247. IndianFt37: 0.30479841 / METERS_PER_INCH,
  20248. //EPSG:9081
  20249. IndianFt62: 0.3047996 / METERS_PER_INCH,
  20250. //EPSG:9082
  20251. IndianFt75: 0.3047995 / METERS_PER_INCH,
  20252. //EPSG:9083
  20253. Mile: 1609.34721869443738887477 / METERS_PER_INCH,
  20254. IYard: 0.9144 / METERS_PER_INCH,
  20255. //EPSG:9096
  20256. IMile: 1609.344 / METERS_PER_INCH,
  20257. //EPSG:9093
  20258. NautM: 1852.0 / METERS_PER_INCH,
  20259. //EPSG:9030
  20260. 'Lat-66': 110943.316488932731 / METERS_PER_INCH,
  20261. 'Lat-83': 110946.25736872234125 / METERS_PER_INCH,
  20262. Decimeter: 0.1 / METERS_PER_INCH,
  20263. Millimeter: 0.001 / METERS_PER_INCH,
  20264. Dekameter: 10.0 / METERS_PER_INCH,
  20265. Decameter: 10.0 / METERS_PER_INCH,
  20266. Hectometer: 100.0 / METERS_PER_INCH,
  20267. GermanMeter: 1.0000135965 / METERS_PER_INCH,
  20268. //EPSG:9031
  20269. CaGrid: 0.999738 / METERS_PER_INCH,
  20270. ClarkeChain: 20.1166194976 / METERS_PER_INCH,
  20271. //EPSG:9038
  20272. GunterChain: 20.11684023368047 / METERS_PER_INCH,
  20273. //EPSG:9033
  20274. BenoitChain: 20.116782494375872 / METERS_PER_INCH,
  20275. //EPSG:9062
  20276. SearsChain: 20.11676512155 / METERS_PER_INCH,
  20277. //EPSG:9042
  20278. ClarkeLink: 0.201166194976 / METERS_PER_INCH,
  20279. //EPSG:9039
  20280. GunterLink: 0.2011684023368047 / METERS_PER_INCH,
  20281. //EPSG:9034
  20282. BenoitLink: 0.20116782494375872 / METERS_PER_INCH,
  20283. //EPSG:9063
  20284. SearsLink: 0.2011676512155 / METERS_PER_INCH,
  20285. //EPSG:9043
  20286. Rod: 5.02921005842012 / METERS_PER_INCH,
  20287. IntnlChain: 20.1168 / METERS_PER_INCH,
  20288. //EPSG:9097
  20289. IntnlLink: 0.201168 / METERS_PER_INCH,
  20290. //EPSG:9098
  20291. Perch: 5.02921005842012 / METERS_PER_INCH,
  20292. Pole: 5.02921005842012 / METERS_PER_INCH,
  20293. Furlong: 201.1684023368046 / METERS_PER_INCH,
  20294. Rood: 3.778266898 / METERS_PER_INCH,
  20295. CapeFoot: 0.3047972615 / METERS_PER_INCH,
  20296. Brealey: 375.0 / METERS_PER_INCH,
  20297. ModAmFt: 0.304812252984505969011938 / METERS_PER_INCH,
  20298. Fathom: 1.8288 / METERS_PER_INCH,
  20299. 'NautM-UK': 1853.184 / METERS_PER_INCH,
  20300. '50kilometers': 50000.0 / METERS_PER_INCH,
  20301. '150kilometers': 150000.0 / METERS_PER_INCH
  20302. });
  20303. //unit abbreviations supported by PROJ.4
  20304. Util_Util.extend(INCHES_PER_UNIT, {
  20305. mm: INCHES_PER_UNIT['Meter'] / 1000.0,
  20306. cm: INCHES_PER_UNIT['Meter'] / 100.0,
  20307. dm: INCHES_PER_UNIT['Meter'] * 100.0,
  20308. km: INCHES_PER_UNIT['Meter'] * 1000.0,
  20309. kmi: INCHES_PER_UNIT['nmi'],
  20310. //International Nautical Mile
  20311. fath: INCHES_PER_UNIT['Fathom'],
  20312. //International Fathom
  20313. ch: INCHES_PER_UNIT['IntnlChain'],
  20314. //International Chain
  20315. link: INCHES_PER_UNIT['IntnlLink'],
  20316. //International Link
  20317. 'us-in': INCHES_PER_UNIT['inches'],
  20318. //U.S. Surveyor's Inch
  20319. 'us-ft': INCHES_PER_UNIT['Foot'],
  20320. //U.S. Surveyor's Foot
  20321. 'us-yd': INCHES_PER_UNIT['Yard'],
  20322. //U.S. Surveyor's Yard
  20323. 'us-ch': INCHES_PER_UNIT['GunterChain'],
  20324. //U.S. Surveyor's Chain
  20325. 'us-mi': INCHES_PER_UNIT['Mile'],
  20326. //U.S. Surveyor's Statute Mile
  20327. 'ind-yd': INCHES_PER_UNIT['IndianYd37'],
  20328. //Indian Yard
  20329. 'ind-ft': INCHES_PER_UNIT['IndianFt37'],
  20330. //Indian Foot
  20331. 'ind-ch': 20.11669506 / METERS_PER_INCH //Indian Chain
  20332. });
  20333. //将服务端的地图单位转成SuperMap的地图单位
  20334. INCHES_PER_UNIT['degree'] = INCHES_PER_UNIT.dd;
  20335. INCHES_PER_UNIT['meter'] = INCHES_PER_UNIT.m;
  20336. INCHES_PER_UNIT['foot'] = INCHES_PER_UNIT.ft;
  20337. INCHES_PER_UNIT['inch'] = INCHES_PER_UNIT.inches;
  20338. INCHES_PER_UNIT['mile'] = INCHES_PER_UNIT.mi;
  20339. INCHES_PER_UNIT['kilometer'] = INCHES_PER_UNIT.km;
  20340. INCHES_PER_UNIT['yard'] = INCHES_PER_UNIT.yd;
  20341. function paramToString(param) {
  20342. if (param == undefined || param == null) {
  20343. return '';
  20344. }
  20345. if (param instanceof Date) {
  20346. return param.toJSON();
  20347. }
  20348. if (canBeJsonified(param)) {
  20349. return JSON.stringify(param);
  20350. }
  20351. return param.toString();
  20352. }
  20353. function canBeJsonified(str) {
  20354. if (typeof str !== 'string' && _typeof(str) !== 'object') {
  20355. return false;
  20356. }
  20357. try {
  20358. var type = str.toString();
  20359. return type === '[object Object]' || type === '[object Array]';
  20360. } catch (err) {
  20361. return false;
  20362. }
  20363. }
  20364. ;// CONCATENATED MODULE: ./src/common/commontypes/LonLat.js
  20365. function LonLat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20366. 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); } }
  20367. 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; }
  20368. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20369. * This program are made available under the terms of the Apache License, Version 2.0
  20370. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20371. /**
  20372. * @class LonLat
  20373. * @category BaseTypes Geometry
  20374. * @classdesc 这个类用来表示经度和纬度对。
  20375. * @param {number|Array.<number>} [lon=0.0] - 地图单位上的 X 轴坐标或者横纵坐标组成的数组;如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
  20376. * @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。
  20377. * @example
  20378. * var lonLat = new LonLat(30,45);
  20379. * @usage
  20380. */
  20381. var LonLat = /*#__PURE__*/function () {
  20382. function LonLat(lon, lat) {
  20383. LonLat_classCallCheck(this, LonLat);
  20384. if (Util_Util.isArray(lon)) {
  20385. lat = lon[1];
  20386. lon = lon[0];
  20387. }
  20388. /**
  20389. * @member {number} [LonLat.prototype.lon=0.0]
  20390. * @description 地图的单位的 X 轴(横轴)坐标。
  20391. */
  20392. this.lon = lon ? Util_Util.toFloat(lon) : 0.0;
  20393. /**
  20394. * @member {number} [LonLat.prototype.lat=0.0]
  20395. * @description 地图的单位的 Y 轴(纵轴)坐标。
  20396. */
  20397. this.lat = lat ? Util_Util.toFloat(lat) : 0.0;
  20398. this.CLASS_NAME = "SuperMap.LonLat";
  20399. }
  20400. /**
  20401. * @function LonLat.prototype.toString
  20402. * @description 返回此对象的字符串形式。
  20403. * @example
  20404. * var lonLat = new LonLat(100,50);
  20405. * var str = lonLat.toString();
  20406. * @returns {string} 例如: "lon=100,lat=50"。
  20407. */
  20408. LonLat_createClass(LonLat, [{
  20409. key: "toString",
  20410. value: function toString() {
  20411. return "lon=" + this.lon + ",lat=" + this.lat;
  20412. }
  20413. /**
  20414. * @function LonLat.prototype.toShortString
  20415. * @description 将经度纬度转换成简单字符串。
  20416. * @example
  20417. * var lonLat = new LonLat(100,50);
  20418. * var str = lonLat.toShortString();
  20419. * @returns {string} 处理后的经纬度字符串。例如:"100,50"。
  20420. */
  20421. }, {
  20422. key: "toShortString",
  20423. value: function toShortString() {
  20424. return this.lon + "," + this.lat;
  20425. }
  20426. /**
  20427. * @function LonLat.prototype.clone
  20428. * @description 复制坐标对象,并返回复制后的新对象。
  20429. * @example
  20430. * var lonLat1 = new LonLat(100,50);
  20431. * var lonLat2 = lonLat1.clone();
  20432. * @returns {LonLat} 相同坐标值的新的坐标对象。
  20433. */
  20434. }, {
  20435. key: "clone",
  20436. value: function clone() {
  20437. return new LonLat(this.lon, this.lat);
  20438. }
  20439. /**
  20440. * @function LonLat.prototype.add
  20441. * @description 在已有坐标对象的经纬度基础上加上新的坐标经纬度,并返回新的坐标对象。
  20442. * @example
  20443. * var lonLat1 = new LonLat(100,50);
  20444. * //lonLat2 是新的对象
  20445. * var lonLat2 = lonLat1.add(100,50);
  20446. * @param {number} lon - 经度参数。
  20447. * @param {number} lat - 纬度参数。
  20448. * @returns {LonLat} 新的 LonLat 对象,此对象的经纬度是由传入的经纬度与当前的经纬度相加所得。
  20449. */
  20450. }, {
  20451. key: "add",
  20452. value: function add(lon, lat) {
  20453. if (lon == null || lat == null) {
  20454. throw new TypeError('LonLat.add cannot receive null values');
  20455. }
  20456. return new LonLat(this.lon + Util_Util.toFloat(lon), this.lat + Util_Util.toFloat(lat));
  20457. }
  20458. /**
  20459. * @function LonLat.prototype.equals
  20460. * @description 判断两个坐标对象是否相等。
  20461. * @example
  20462. * var lonLat1 = new LonLat(100,50);
  20463. * var lonLat2 = new LonLat(100,50);
  20464. * var isEquals = lonLat1.equals(lonLat2);
  20465. * @param {LonLat} ll - 需要进行比较的坐标对象。
  20466. * @returns {boolean} 如果LonLat对象的经纬度和传入的经纬度一致则返回true,不一
  20467. * 致或传入的ll参数为NULL则返回false。
  20468. */
  20469. }, {
  20470. key: "equals",
  20471. value: function equals(ll) {
  20472. var equals = false;
  20473. if (ll != null) {
  20474. equals = this.lon === ll.lon && this.lat === ll.lat || isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat);
  20475. }
  20476. return equals;
  20477. }
  20478. /**
  20479. * @function LonLat.prototype.wrapDateLine
  20480. * @description 通过传入的范围对象对坐标对象转换到该范围内。
  20481. * 如果经度小于给定范围最小精度,则在原经度基础上加上范围宽度,直到精度在范围内为止,如果经度大于给定范围则在原经度基础上减去范围宽度。
  20482. * 即指将不在经度范围内的坐标转换到范围以内(只会转换 lon,不会转换 lat,主要用于转移到日界线以内)。
  20483. * @example
  20484. * var lonLat1 = new LonLat(420,50);
  20485. * var lonLat2 = lonLat1.wrapDateLine(
  20486. * new Bounds(-180,-90,180,90)
  20487. * );
  20488. * @param {Bounds} maxExtent - 最大边界的范围。
  20489. * @returns {LonLat} 将坐标转换到范围对象以内,并返回新的坐标。
  20490. */
  20491. }, {
  20492. key: "wrapDateLine",
  20493. value: function wrapDateLine(maxExtent) {
  20494. var newLonLat = this.clone();
  20495. if (maxExtent) {
  20496. //shift right?
  20497. while (newLonLat.lon < maxExtent.left) {
  20498. newLonLat.lon += maxExtent.getWidth();
  20499. }
  20500. //shift left?
  20501. while (newLonLat.lon > maxExtent.right) {
  20502. newLonLat.lon -= maxExtent.getWidth();
  20503. }
  20504. }
  20505. return newLonLat;
  20506. }
  20507. /**
  20508. *
  20509. * @function LonLat.prototype.destroy
  20510. * @description 销毁此对象。
  20511. * 销毁后此对象的所有属性为 null,而不是初始值。
  20512. * @example
  20513. * var lonLat = new LonLat(100,50);
  20514. * lonLat.destroy();
  20515. */
  20516. }, {
  20517. key: "destroy",
  20518. value: function destroy() {
  20519. this.lon = null;
  20520. this.lat = null;
  20521. }
  20522. /**
  20523. * @function LonLat.fromString
  20524. * @description 通过字符串生成一个 {@link LonLat} 对象。
  20525. * @example
  20526. * var str = "100,50";
  20527. * var lonLat = LonLat.fromString(str);
  20528. * @param {string} str - 字符串的格式:Lon+","+Lat。如:"100,50"。
  20529. * @returns {LonLat} {@link LonLat} 对象。
  20530. */
  20531. }], [{
  20532. key: "fromString",
  20533. value: function fromString(str) {
  20534. var pair = str.split(",");
  20535. return new LonLat(pair[0], pair[1]);
  20536. }
  20537. /**
  20538. * @function LonLat.fromArray
  20539. * @description 通过数组生成一个 {@link LonLat} 对象。
  20540. * @param {Array.<number>} arr - 数组的格式,长度只能为2,:[Lon,Lat]。如:[5,-42]。
  20541. * @returns {LonLat} {@link LonLat} 对象。
  20542. */
  20543. }, {
  20544. key: "fromArray",
  20545. value: function fromArray(arr) {
  20546. var gotArr = Util_Util.isArray(arr),
  20547. lon = gotArr && arr[0],
  20548. lat = gotArr && arr[1];
  20549. return new LonLat(lon, lat);
  20550. }
  20551. }]);
  20552. return LonLat;
  20553. }();
  20554. ;// CONCATENATED MODULE: ./src/common/commontypes/Bounds.js
  20555. function Bounds_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20556. 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); } }
  20557. 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; }
  20558. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  20559. * This program are made available under the terms of the Apache License, Version 2.0
  20560. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20561. /**
  20562. * @class Bounds
  20563. * @deprecatedclass SuperMap.Bounds
  20564. * @category BaseTypes Geometry
  20565. * @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
  20566. * @param {number|Array.<number>} [left] - 如果是number,则表示左边界,注意考虑宽度,理论上小于 right 值。如果是数组,则表示 [left, bottom, right, top] 左下右上组成的数组。
  20567. * @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。
  20568. * @param {number} [right] - 右边界。
  20569. * @param {number} [top] - 上边界。
  20570. * @example
  20571. * var bounds = new Bounds();
  20572. * bounds.extend(new LonLat(4,5));
  20573. * bounds.extend(new LonLat(5,6));
  20574. * bounds.toBBOX(); // returns 4,5,5,6
  20575. * @usage
  20576. */
  20577. var Bounds = /*#__PURE__*/function () {
  20578. function Bounds(left, bottom, right, top) {
  20579. Bounds_classCallCheck(this, Bounds);
  20580. if (Util_Util.isArray(left)) {
  20581. top = left[3];
  20582. right = left[2];
  20583. bottom = left[1];
  20584. left = left[0];
  20585. }
  20586. /**
  20587. * @member {number} Bounds.prototype.left
  20588. * @description 最小的水平坐标系。
  20589. */
  20590. this.left = left != null ? Util_Util.toFloat(left) : this.left;
  20591. /**
  20592. * @member {number} Bounds.prototype.bottom
  20593. * @description 最小的垂直坐标系。
  20594. */
  20595. this.bottom = bottom != null ? Util_Util.toFloat(bottom) : this.bottom;
  20596. /**
  20597. * @member {number} Bounds.prototype.right
  20598. * @description 最大的水平坐标系。
  20599. */
  20600. this.right = right != null ? Util_Util.toFloat(right) : this.right;
  20601. /**
  20602. * @member {number} Bounds.prototype.top
  20603. * @description 最大的垂直坐标系。
  20604. */
  20605. this.top = top != null ? Util_Util.toFloat(top) : this.top;
  20606. /**
  20607. * @member {LonLat} Bounds.prototype.centerLonLat
  20608. * @description bounds 的地图空间的中心点。用 getCenterLonLat() 获得。
  20609. */
  20610. this.centerLonLat = null;
  20611. this.CLASS_NAME = "SuperMap.Bounds";
  20612. }
  20613. /**
  20614. * @function Bounds.prototype.clone
  20615. * @description 复制当前 bounds 对象。
  20616. * @example
  20617. * var bounds1 = new Bounds(-180,-90,180,90);
  20618. * var bounds2 = bounds1.clone();
  20619. * @returns {Bounds} 克隆后的 bounds。
  20620. */
  20621. Bounds_createClass(Bounds, [{
  20622. key: "clone",
  20623. value: function clone() {
  20624. return new Bounds(this.left, this.bottom, this.right, this.top);
  20625. }
  20626. /**
  20627. * @function Bounds.prototype.equals
  20628. * @description 判断两个 bounds 对象是否相等。
  20629. * @example
  20630. * var bounds1 = new Bounds(-180,-90,180,90);
  20631. * var bounds2 = new Bounds(-180,-90,180,90);
  20632. * var isEquals = bounds1.equals(bounds2);
  20633. * @param {Bounds} bounds - 需要进行计较的 bounds。
  20634. * @returns {boolean} 如果 bounds 对象的边和传入的 bounds 一致则返回 true,不一致或传入的 bounds 参数为 NULL 则返回 false。
  20635. */
  20636. }, {
  20637. key: "equals",
  20638. value: function equals(bounds) {
  20639. var equals = false;
  20640. if (bounds != null) {
  20641. equals = this.left === bounds.left && this.right === bounds.right && this.top === bounds.top && this.bottom === bounds.bottom;
  20642. }
  20643. return equals;
  20644. }
  20645. /**
  20646. * @function Bounds.prototype.toString
  20647. * @description 返回此对象的字符串形式。
  20648. * @example
  20649. * var bounds = new Bounds(-180,-90,180,90);
  20650. * var str = bounds.toString();
  20651. * @returns {string} 边界对象的字符串表示形式(left,bottom,right,top),例如: "-180,-90,180,90"。
  20652. */
  20653. }, {
  20654. key: "toString",
  20655. value: function toString() {
  20656. return [this.left, this.bottom, this.right, this.top].join(",");
  20657. }
  20658. /**
  20659. * @function Bounds.prototype.toArray
  20660. * @description 边界对象的数组表示形式。
  20661. * @example
  20662. * var bounds = new Bounds(-180,-90,100,80);
  20663. * //array1 = [-180,-90,100,80];
  20664. * var array1 = bounds.toArray();
  20665. * //array1 = [-90,-180,80,100];
  20666. * var array2 = bounds.toArray(true);
  20667. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  20668. * 如果设为 true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  20669. * @returns {Array.<number>} left, bottom, right, top 数组。
  20670. */
  20671. }, {
  20672. key: "toArray",
  20673. value: function toArray(reverseAxisOrder) {
  20674. if (reverseAxisOrder === true) {
  20675. return [this.bottom, this.left, this.top, this.right];
  20676. } else {
  20677. return [this.left, this.bottom, this.right, this.top];
  20678. }
  20679. }
  20680. /**
  20681. * @function Bounds.prototype.toBBOX
  20682. * @description 取小数点后 decimal 位数字进行四舍五入再转换为 BBOX 字符串。
  20683. * @example
  20684. * var bounds = new Bounds(-1.1234567,-1.7654321,1.4444444,1.5555555);
  20685. * //str1 = "-1.123457,-1.765432,1.444444,1.555556";
  20686. * var str1 = bounds.toBBOX();
  20687. * //str2 = "-1.1,-1.8,1.4,1.6";
  20688. * var str2 = bounds.toBBOX(1);
  20689. * //str2 = "-1.8,-1.1,1.6,1.4";
  20690. * var str2 = bounds.toBBOX(1,true);
  20691. * @param {number} [decimal=6] - 边界方位坐标的有效数字个数。
  20692. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。
  20693. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  20694. * @returns {string} 边界对象的字符串表示形式,如:"5,42,10,45"。
  20695. */
  20696. }, {
  20697. key: "toBBOX",
  20698. value: function toBBOX(decimal, reverseAxisOrder) {
  20699. if (decimal == null) {
  20700. decimal = 6;
  20701. }
  20702. var mult = Math.pow(10, decimal);
  20703. var xmin = Math.round(this.left * mult) / mult;
  20704. var ymin = Math.round(this.bottom * mult) / mult;
  20705. var xmax = Math.round(this.right * mult) / mult;
  20706. var ymax = Math.round(this.top * mult) / mult;
  20707. if (reverseAxisOrder === true) {
  20708. return ymin + "," + xmin + "," + ymax + "," + xmax;
  20709. } else {
  20710. return xmin + "," + ymin + "," + xmax + "," + ymax;
  20711. }
  20712. }
  20713. ///**
  20714. // * @function Bounds.prototype.toGeometry
  20715. // * @description 基于当前边界范围创建一个新的多边形对象。
  20716. // * @example
  20717. // * var bounds = new Bounds(-180,-90,100,80);
  20718. // * // Polygon对象
  20719. // * var geo = bounds.toGeometry();
  20720. // * @returns {GeometryPolygon} 基于当前 bounds 坐标创建的新的多边形。
  20721. // */
  20722. // toGeometry() {
  20723. // return new Polygon([
  20724. // new LinearRing([
  20725. // new Point(this.left, this.bottom),
  20726. // new Point(this.right, this.bottom),
  20727. // new Point(this.right, this.top),
  20728. // new Point(this.left, this.top)
  20729. // ])
  20730. // ]);
  20731. // }
  20732. /**
  20733. * @function Bounds.prototype.getWidth
  20734. * @description 获取 bounds 的宽度。
  20735. * @example
  20736. * var bounds = new Bounds(-180,-90,100,80);
  20737. * //width = 280;
  20738. * var width = bounds.getWidth();
  20739. * @returns {number} 获取当前 bounds 的宽度(right 减去 left)。
  20740. */
  20741. }, {
  20742. key: "getWidth",
  20743. value: function getWidth() {
  20744. return this.right - this.left;
  20745. }
  20746. /**
  20747. * @function Bounds.prototype.getHeight
  20748. * @description 获取 bounds 的高度。
  20749. * @example
  20750. * var bounds = new Bounds(-180,-90,100,80);
  20751. * //height = 170;
  20752. * var height = bounds.getHeight();
  20753. * @returns {number} 边界高度(top 减去 bottom)。
  20754. */
  20755. }, {
  20756. key: "getHeight",
  20757. value: function getHeight() {
  20758. return this.top - this.bottom;
  20759. }
  20760. /**
  20761. * @function Bounds.prototype.getSize
  20762. * @description 获取边框大小。
  20763. * @example
  20764. * var bounds = new Bounds(-180,-90,100,80);
  20765. * var size = bounds.getSize();
  20766. * @returns {Size} 边框大小。
  20767. */
  20768. }, {
  20769. key: "getSize",
  20770. value: function getSize() {
  20771. return new Size(this.getWidth(), this.getHeight());
  20772. }
  20773. /**
  20774. * @function Bounds.prototype.getCenterPixel
  20775. * @description 获取像素格式的范围中心点。
  20776. * @example
  20777. * var bounds = new Bounds(-180,-90,100,80);
  20778. * var pixel = bounds.getCenterPixel();
  20779. * @returns {Pixel} 像素格式的当前范围的中心点。
  20780. */
  20781. }, {
  20782. key: "getCenterPixel",
  20783. value: function getCenterPixel() {
  20784. return new Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  20785. }
  20786. /**
  20787. * @function Bounds.prototype.getCenterLonLat
  20788. * @description 获取地理格式的范围中心点。
  20789. * @example
  20790. * var bounds = new Bounds(-180,-90,100,80);
  20791. * var lonlat = bounds.getCenterLonLat();
  20792. * @returns {LonLat} 当前地理范围的中心点。
  20793. */
  20794. }, {
  20795. key: "getCenterLonLat",
  20796. value: function getCenterLonLat() {
  20797. if (!this.centerLonLat) {
  20798. this.centerLonLat = new LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  20799. }
  20800. return this.centerLonLat;
  20801. }
  20802. /**
  20803. * @function Bounds.prototype.scale
  20804. * @description 按照比例扩大/缩小出一个新的 bounds。
  20805. * @example
  20806. * var bounds = new Bounds(-50,-50,40,40);
  20807. * var bounds2 = bounds.scale(2);
  20808. * @param {number} [ratio=1] - 需要扩大的比例。
  20809. * @param {(Pixel|LonLat)} [origin] - 扩大时的基准点,默认为当前 bounds 的中心点。
  20810. * @returns {Bounds} 通过 ratio、origin 计算得到的新的边界范围。
  20811. */
  20812. }, {
  20813. key: "scale",
  20814. value: function scale(ratio, origin) {
  20815. ratio = ratio ? ratio : 1;
  20816. if (origin == null) {
  20817. origin = this.getCenterLonLat();
  20818. }
  20819. var origx, origy;
  20820. // get origin coordinates
  20821. if (origin.CLASS_NAME === "SuperMap.LonLat") {
  20822. origx = origin.lon;
  20823. origy = origin.lat;
  20824. } else {
  20825. origx = origin.x;
  20826. origy = origin.y;
  20827. }
  20828. var left = (this.left - origx) * ratio + origx;
  20829. var bottom = (this.bottom - origy) * ratio + origy;
  20830. var right = (this.right - origx) * ratio + origx;
  20831. var top = (this.top - origy) * ratio + origy;
  20832. return new Bounds(left, bottom, right, top);
  20833. }
  20834. /**
  20835. * @function Bounds.prototype.add
  20836. * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。
  20837. * @example
  20838. * var bounds1 = new Bounds(-50,-50,40,40);
  20839. * //bounds2 是新的 bounds
  20840. * var bounds2 = bounds.add(20,10);
  20841. * @param {number} x - 坐标点的 x 坐标。
  20842. * @param {number} y - 坐标点的 y 坐标。
  20843. * @returns {Bounds} 新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
  20844. */
  20845. }, {
  20846. key: "add",
  20847. value: function add(x, y) {
  20848. if (x == null || y == null) {
  20849. throw new TypeError('Bounds.add cannot receive null values');
  20850. }
  20851. return new Bounds(this.left + x, this.bottom + y, this.right + x, this.top + y);
  20852. }
  20853. /**
  20854. * @function Bounds.prototype.extend
  20855. * @description 在当前 bounds 上扩展 bounds,支持 point,lonlat 和 bounds。扩展后的 bounds 的范围是两者的结合。
  20856. * @example
  20857. * var bounds1 = new Bounds(-50,-50,40,40);
  20858. * //bounds 改变
  20859. * bounds.extend(new LonLat(50,60));
  20860. * @param {GeometryPoint|LonLat|Bounds} object - 可以是 point、lonlat 和 bounds。
  20861. */
  20862. }, {
  20863. key: "extend",
  20864. value: function extend(object) {
  20865. var bounds = null;
  20866. if (object) {
  20867. // clear cached center location
  20868. switch (object.CLASS_NAME) {
  20869. case "SuperMap.LonLat":
  20870. bounds = new Bounds(object.lon, object.lat, object.lon, object.lat);
  20871. break;
  20872. case "SuperMap.Geometry.Point":
  20873. bounds = new Bounds(object.x, object.y, object.x, object.y);
  20874. break;
  20875. case "SuperMap.Bounds":
  20876. bounds = object;
  20877. break;
  20878. }
  20879. if (bounds) {
  20880. this.centerLonLat = null;
  20881. if (this.left == null || bounds.left < this.left) {
  20882. this.left = bounds.left;
  20883. }
  20884. if (this.bottom == null || bounds.bottom < this.bottom) {
  20885. this.bottom = bounds.bottom;
  20886. }
  20887. if (this.right == null || bounds.right > this.right) {
  20888. this.right = bounds.right;
  20889. }
  20890. if (this.top == null || bounds.top > this.top) {
  20891. this.top = bounds.top;
  20892. }
  20893. }
  20894. }
  20895. }
  20896. /**
  20897. * @function Bounds.prototype.containsLonLat
  20898. * @description 判断传入的坐标是否在范围内。
  20899. * @example
  20900. * var bounds1 = new Bounds(-50,-50,40,40);
  20901. * //isContains1 = true
  20902. * //这里的第二个参数可以直接为 boolean 类型,也就是inclusive
  20903. * var isContains1 = bounds.containsLonLat(new LonLat(40,40),true);
  20904. *
  20905. * //(40,40)在范围内,同样(40+360,40)也在范围内
  20906. * var bounds2 = new Bounds(-50,-50,40,40);
  20907. * //isContains2 = true;
  20908. * var isContains2 = bounds2.containsLonLat(
  20909. * new LonLat(400,40),
  20910. * {
  20911. * inclusive:true,
  20912. * //全球的范围
  20913. * worldBounds: new Bounds(-180,-90,180,90)
  20914. * }
  20915. * );
  20916. * @param {(LonLat|Object)} ll - <LonLat> 对象或者是一个包含 'lon' 与 'lat' 属性的对象。
  20917. * @param {Object} options - 可选参数。
  20918. * @param {boolean} [options.inclusive=true] - 是否包含边界。
  20919. * @param {Bounds} [options.worldBounds] - 如果提供 worldBounds 参数, 如果 ll 参数提供的坐标超出了世界边界(worldBounds),
  20920. * 但是通过日界线的转化可以被包含, 它将被认为是包含在该范围内的。
  20921. * @returns {boolean} 传入坐标是否包含在范围内。
  20922. */
  20923. }, {
  20924. key: "containsLonLat",
  20925. value: function containsLonLat(ll, options) {
  20926. if (typeof options === "boolean") {
  20927. options = {
  20928. inclusive: options
  20929. };
  20930. }
  20931. options = options || {};
  20932. var contains = this.contains(ll.lon, ll.lat, options.inclusive),
  20933. worldBounds = options.worldBounds;
  20934. //日界线以外的也有可能算包含,
  20935. if (worldBounds && !contains) {
  20936. var worldWidth = worldBounds.getWidth();
  20937. var worldCenterX = (worldBounds.left + worldBounds.right) / 2;
  20938. //这一步很关键
  20939. var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
  20940. contains = this.containsLonLat({
  20941. lon: ll.lon - worldsAway * worldWidth,
  20942. lat: ll.lat
  20943. }, {
  20944. inclusive: options.inclusive
  20945. });
  20946. }
  20947. return contains;
  20948. }
  20949. /**
  20950. * @function Bounds.prototype.containsPixel
  20951. * @description 判断传入的像素是否在范围内。直接匹配大小,不涉及像素和地理转换。
  20952. * @example
  20953. * var bounds = new Bounds(-50,-50,40,40);
  20954. * //isContains = true
  20955. * var isContains = bounds.containsPixel(new Pixel(40,40),true);
  20956. * @param {Pixel} px - 提供的像素参数。
  20957. * @param {boolean} [inclusive=true] - 是否包含边界。
  20958. * @returns {boolean} 传入的 pixel 在当前边界范围之内。
  20959. */
  20960. }, {
  20961. key: "containsPixel",
  20962. value: function containsPixel(px, inclusive) {
  20963. return this.contains(px.x, px.y, inclusive);
  20964. }
  20965. /**
  20966. * @function Bounds.prototype.contains
  20967. * @description 判断传入的 x,y 坐标值是否在范围内。
  20968. * @example
  20969. * var bounds = new Bounds(-50,-50,40,40);
  20970. * //isContains = true
  20971. * var isContains = bounds.contains(40,40,true);
  20972. * @param {number} x - x 坐标值。
  20973. * @param {number} y - y 坐标值。
  20974. * @param {boolean} [inclusive=true] - 是否包含边界。
  20975. * @returns {boolean} 传入的 x,y 坐标是否在当前范围内。
  20976. */
  20977. }, {
  20978. key: "contains",
  20979. value: function contains(x, y, inclusive) {
  20980. //set default
  20981. if (inclusive == null) {
  20982. inclusive = true;
  20983. }
  20984. if (x == null || y == null) {
  20985. return false;
  20986. }
  20987. //x = Util.toFloat(x);
  20988. //y = Util.toFloat(y);
  20989. var contains = false;
  20990. if (inclusive) {
  20991. contains = x >= this.left && x <= this.right && y >= this.bottom && y <= this.top;
  20992. } else {
  20993. contains = x > this.left && x < this.right && y > this.bottom && y < this.top;
  20994. }
  20995. return contains;
  20996. }
  20997. /**
  20998. * @function Bounds.prototype.intersectsBounds
  20999. * @description 判断目标边界范围是否与当前边界范围相交。如果两个边界范围中的任意边缘相交或者一个边界包含了另外一个就认为这两个边界相交。
  21000. * @example
  21001. * var bounds = new Bounds(-180,-90,100,80);
  21002. * var isIntersects = bounds.intersectsBounds(
  21003. * new Bounds(-170,-90,120,80)
  21004. * );
  21005. * @param {Bounds} bounds - 目标边界。
  21006. * @param {Object} options - 参数。
  21007. * @param {boolean} [options.inclusive=true] - 边缘重合也看成相交。如果是false,两个边界范围没有重叠部分仅仅是在边缘相接(重合),这种情况被认为没有相交。
  21008. * @param {Bounds} [options.worldBounds] - 提供了 worldBounds 参数,如果他们相交时是在全球范围内,两个边界将被视为相交。这仅适用于交叉或完全不在世界范围的边界。
  21009. * @returns {boolean} 传入的 bounds 对象与当前 bounds 相交。
  21010. */
  21011. }, {
  21012. key: "intersectsBounds",
  21013. value: function intersectsBounds(bounds, options) {
  21014. if (typeof options === "boolean") {
  21015. options = {
  21016. inclusive: options
  21017. };
  21018. }
  21019. options = options || {};
  21020. if (options.worldBounds) {
  21021. var self = this.wrapDateLine(options.worldBounds);
  21022. bounds = bounds.wrapDateLine(options.worldBounds);
  21023. } else {
  21024. self = this;
  21025. }
  21026. if (options.inclusive == null) {
  21027. options.inclusive = true;
  21028. }
  21029. var intersects = false;
  21030. var mightTouch = self.left === bounds.right || self.right === bounds.left || self.top === bounds.bottom || self.bottom === bounds.top;
  21031. // if the two bounds only touch at an edge, and inclusive is false,
  21032. // then the bounds don't *really* intersect.
  21033. if (options.inclusive || !mightTouch) {
  21034. // otherwise, if one of the boundaries even partially contains another,
  21035. // inclusive of the edges, then they do intersect.
  21036. var inBottom = bounds.bottom >= self.bottom && bounds.bottom <= self.top || self.bottom >= bounds.bottom && self.bottom <= bounds.top;
  21037. var inTop = bounds.top >= self.bottom && bounds.top <= self.top || self.top > bounds.bottom && self.top < bounds.top;
  21038. var inLeft = bounds.left >= self.left && bounds.left <= self.right || self.left >= bounds.left && self.left <= bounds.right;
  21039. var inRight = bounds.right >= self.left && bounds.right <= self.right || self.right >= bounds.left && self.right <= bounds.right;
  21040. intersects = (inBottom || inTop) && (inLeft || inRight);
  21041. }
  21042. // document me
  21043. if (options.worldBounds && !intersects) {
  21044. var world = options.worldBounds;
  21045. var width = world.getWidth();
  21046. var selfCrosses = !world.containsBounds(self);
  21047. var boundsCrosses = !world.containsBounds(bounds);
  21048. if (selfCrosses && !boundsCrosses) {
  21049. bounds = bounds.add(-width, 0);
  21050. intersects = self.intersectsBounds(bounds, {
  21051. inclusive: options.inclusive
  21052. });
  21053. } else if (boundsCrosses && !selfCrosses) {
  21054. self = self.add(-width, 0);
  21055. intersects = bounds.intersectsBounds(self, {
  21056. inclusive: options.inclusive
  21057. });
  21058. }
  21059. }
  21060. return intersects;
  21061. }
  21062. /**
  21063. * @function Bounds.prototype.containsBounds
  21064. * @description 判断目标边界是否被当前边界包含在内。
  21065. * @example
  21066. * var bounds = new Bounds(-180,-90,100,80);
  21067. * var isContains = bounds.containsBounds(
  21068. * new Bounds(-170,-90,100,80),true,true
  21069. * );
  21070. * @param {Bounds} bounds - 目标边界。
  21071. * @param {boolean} [partial=false] - 目标边界的任意部分都包含在当前边界中则被认为是包含关系。
  21072. * 如果设为 false,整个目标边界全部被包含在当前边界范围内。
  21073. * @param {boolean} [inclusive=true] - 边缘共享是否被视为包含。
  21074. * @returns {boolean} 传入的边界是否被当前边界包含。
  21075. */
  21076. }, {
  21077. key: "containsBounds",
  21078. value: function containsBounds(bounds, partial, inclusive) {
  21079. if (partial == null) {
  21080. partial = false;
  21081. }
  21082. if (inclusive == null) {
  21083. inclusive = true;
  21084. }
  21085. var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive);
  21086. var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive);
  21087. var topLeft = this.contains(bounds.left, bounds.top, inclusive);
  21088. var topRight = this.contains(bounds.right, bounds.top, inclusive);
  21089. return partial ? bottomLeft || bottomRight || topLeft || topRight : bottomLeft && bottomRight && topLeft && topRight;
  21090. }
  21091. /**
  21092. * @function Bounds.prototype.determineQuadrant
  21093. * @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。
  21094. * @example
  21095. * var bounds = new Bounds(-180,-90,100,80);
  21096. * //str = "tr";
  21097. * var str = bounds.determineQuadrant(
  21098. * new LonLat(20,20)
  21099. * );
  21100. * @param {LonLat} lonlat - 传入的坐标对象。
  21101. * @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下","右上","左上" "左下")。
  21102. */
  21103. }, {
  21104. key: "determineQuadrant",
  21105. value: function determineQuadrant(lonlat) {
  21106. var quadrant = "";
  21107. var center = this.getCenterLonLat();
  21108. quadrant += lonlat.lat < center.lat ? "b" : "t";
  21109. quadrant += lonlat.lon < center.lon ? "l" : "r";
  21110. return quadrant;
  21111. }
  21112. /**
  21113. * @function Bounds.prototype.wrapDateLine
  21114. * @description 将当前 bounds 移动到最大边界范围内部(所谓的内部是相交或者内部)。
  21115. * @example
  21116. * var bounds = new Bounds(380,-40,400,-20);
  21117. * var maxExtent = new Bounds(-180,-90,100,80);
  21118. * //新的bounds
  21119. * var newBounds = bounds.wrapDateLine(maxExtent);
  21120. * @param {Bounds} maxExtent - 最大的边界范围(一般是全球范围)。
  21121. * @param {Object} options - 可选选项参数。
  21122. * @param {number} [options.leftTolerance=0] - left 允许的误差。
  21123. * @param {number} [options.rightTolerance=0] - right 允许的误差。
  21124. * @returns {Bounds} 克隆当前边界。如果当前边界完全在最大范围之外此函数则返回一个不同值的边界,
  21125. * 若落在最大边界的左边,则给当前的bounds值加上最大范围的宽度,即向右移动,
  21126. * 若落在右边,则向左移动,即给当前的bounds值加上负的最大范围的宽度。
  21127. */
  21128. }, {
  21129. key: "wrapDateLine",
  21130. value: function wrapDateLine(maxExtent, options) {
  21131. options = options || {};
  21132. var leftTolerance = options.leftTolerance || 0;
  21133. var rightTolerance = options.rightTolerance || 0;
  21134. var newBounds = this.clone();
  21135. if (maxExtent) {
  21136. var width = maxExtent.getWidth();
  21137. //如果 newBounds 在 maxExtent 的左边,那么一直向右移动,直到相交或者包含为止,每次移动width
  21138. //shift right?
  21139. while (newBounds.left < maxExtent.left && newBounds.right - rightTolerance <= maxExtent.left) {
  21140. newBounds = newBounds.add(width, 0);
  21141. }
  21142. //如果 newBounds 在 maxExtent 的右边,那么一直向左移动,直到相交或者包含为止,每次移动width
  21143. //shift left?
  21144. while (newBounds.left + leftTolerance >= maxExtent.right && newBounds.right > maxExtent.right) {
  21145. newBounds = newBounds.add(-width, 0);
  21146. }
  21147. //如果和右边相交,左边又在内部,那么再次向左边移动一次
  21148. // crosses right only? force left
  21149. var newLeft = newBounds.left + leftTolerance;
  21150. if (newLeft < maxExtent.right && newLeft > maxExtent.left && newBounds.right - rightTolerance > maxExtent.right) {
  21151. newBounds = newBounds.add(-width, 0);
  21152. }
  21153. }
  21154. return newBounds;
  21155. }
  21156. /**
  21157. * @function Bounds.prototype.toServerJSONObject
  21158. * @description 转换成对应的 JSON 格式对象。
  21159. * @example
  21160. * var bounds = new Bounds(-180,-90,100,80);
  21161. * var obj = bounds.toServerJSONObject();
  21162. * @returns {Object} JSON 格式的 Object 对象。
  21163. */
  21164. }, {
  21165. key: "toServerJSONObject",
  21166. value: function toServerJSONObject() {
  21167. var jsonObject = {
  21168. rightTop: {
  21169. x: this.right,
  21170. y: this.top
  21171. },
  21172. leftBottom: {
  21173. x: this.left,
  21174. y: this.bottom
  21175. },
  21176. left: this.left,
  21177. right: this.right,
  21178. top: this.top,
  21179. bottom: this.bottom
  21180. };
  21181. return jsonObject;
  21182. }
  21183. /**
  21184. *
  21185. * @function Bounds.prototype.destroy
  21186. * @description 销毁此对象。
  21187. * 销毁后此对象的所有属性为 null,而不是初始值。
  21188. * @example
  21189. * var bounds = new Bounds(-180,-90,100,80);
  21190. * bounds.destroy();
  21191. */
  21192. }, {
  21193. key: "destroy",
  21194. value: function destroy() {
  21195. this.left = null;
  21196. this.right = null;
  21197. this.top = null;
  21198. this.bottom = null;
  21199. this.centerLonLat = null;
  21200. }
  21201. /**
  21202. * @function Bounds.fromString
  21203. * @description 通过字符串参数创建新的 bounds 的构造函数。
  21204. * @example
  21205. * var bounds = Bounds.fromString("-180,-90,100,80");
  21206. * @param {string} str - 边界字符串,用逗号隔开(e.g. <i>"5,42,10,45"</i>)。
  21207. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  21208. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  21209. * @returns {Bounds} 给定的字符串创建的新的边界对象。
  21210. */
  21211. }], [{
  21212. key: "fromString",
  21213. value: function fromString(str, reverseAxisOrder) {
  21214. var bounds = str.split(",");
  21215. return Bounds.fromArray(bounds, reverseAxisOrder);
  21216. }
  21217. /**
  21218. * @function Bounds.fromArray
  21219. * @description 通过边界框数组创建 Bounds。
  21220. * @example
  21221. * var bounds = Bounds.fromArray([-180,-90,100,80]);
  21222. * @param {Array.<number>} bbox - 边界值数组。(e.g. <i>[5,42,10,45]</i>)。
  21223. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  21224. * @returns {Bounds} 根据传入的数组创建的新的边界对象。
  21225. */
  21226. }, {
  21227. key: "fromArray",
  21228. value: function fromArray(bbox, reverseAxisOrder) {
  21229. return reverseAxisOrder === true ? new Bounds(bbox[1], bbox[0], bbox[3], bbox[2]) : new Bounds(bbox[0], bbox[1], bbox[2], bbox[3]);
  21230. }
  21231. /**
  21232. * @function Bounds.fromSize
  21233. * @description 通过传入的边界大小来创建新的边界。
  21234. * @example
  21235. * var bounds = Bounds.fromSize(new Size(20,10));
  21236. * @param {Size} size - 边界大小。
  21237. * @returns {Bounds} 根据传入的边界大小的创建新的边界。
  21238. */
  21239. }, {
  21240. key: "fromSize",
  21241. value: function fromSize(size) {
  21242. return new Bounds(0, size.h, size.w, 0);
  21243. }
  21244. /**
  21245. * @function Bounds.oppositeQuadrant
  21246. * @description 反转象限。"t"和"b" 交换,"r"和"l"交换, 如:"tl"变为"br"。
  21247. * @param {string} quadrant - 代表象限的字符串,如:"tl"。
  21248. * @returns {string} 反转后的象限。
  21249. */
  21250. }, {
  21251. key: "oppositeQuadrant",
  21252. value: function oppositeQuadrant(quadrant) {
  21253. var opp = "";
  21254. opp += quadrant.charAt(0) === 't' ? 'b' : 't';
  21255. opp += quadrant.charAt(1) === 'l' ? 'r' : 'l';
  21256. return opp;
  21257. }
  21258. }]);
  21259. return Bounds;
  21260. }();
  21261. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Collection.js
  21262. 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); }
  21263. function Collection_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21264. 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); } }
  21265. 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; }
  21266. 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); }
  21267. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  21268. 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); }
  21269. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  21270. 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); }; }
  21271. function _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 _assertThisInitialized(self); }
  21272. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21273. 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; } }
  21274. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  21275. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21276. * This program are made available under the terms of the Apache License, Version 2.0
  21277. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21278. /**
  21279. * @class GeometryCollection
  21280. * @aliasclass Geometry.Collection
  21281. * @deprecatedclass SuperMap.Geometry.Collection
  21282. * @classdesc 几何对象集合类,存储在本地的 components 属性中(可作为参数传递给构造函数)。<br>
  21283. * 随着新的几何图形添加到集合中,将不能被克隆,当移动几何图形时,需要指定参照物。<br>
  21284. * getArea 和 getLength 函数只能通过遍历存储几何对象的 components 数组,总计所有几何图形的面积和长度。
  21285. * @category BaseTypes Geometry
  21286. * @extends {Geometry}
  21287. * @param {Array.<Geometry>} components - 几何对象数组。
  21288. * @example
  21289. * var point1 = new GeometryPoint(10,20);
  21290. * var point2 = new GeometryPoint(30,40);
  21291. * var col = new GeometryCollection([point1,point2]);
  21292. * @usage
  21293. */
  21294. var Collection = /*#__PURE__*/function (_Geometry) {
  21295. _inherits(Collection, _Geometry);
  21296. var _super = _createSuper(Collection);
  21297. function Collection(components) {
  21298. var _this;
  21299. Collection_classCallCheck(this, Collection);
  21300. _this = _super.call(this);
  21301. /**
  21302. * @description 存储几何对象的数组。
  21303. * @member {Array.<Geometry>} GeometryCollection.prototype.components
  21304. */
  21305. _this.components = [];
  21306. /**
  21307. * @member {Array.<string>} GeometryCollection.prototype.componentTypes
  21308. * @description components 存储的几何对象所支持的几何类型数组,为空表示类型不受限制。
  21309. */
  21310. _this.componentTypes = null;
  21311. if (components != null) {
  21312. _this.addComponents(components);
  21313. }
  21314. _this.CLASS_NAME = "SuperMap.Geometry.Collection";
  21315. _this.geometryType = "Collection";
  21316. return _this;
  21317. }
  21318. /**
  21319. * @function GeometryCollection.prototype.destroy
  21320. * @description 销毁几何图形。
  21321. */
  21322. Collection_createClass(Collection, [{
  21323. key: "destroy",
  21324. value: function destroy() {
  21325. this.components.length = 0;
  21326. this.components = null;
  21327. _get(_getPrototypeOf(Collection.prototype), "destroy", this).call(this);
  21328. }
  21329. /**
  21330. * @function GeometryCollection.prototype.clone
  21331. * @description 克隆当前几何对象。
  21332. * @returns {GeometryCollection} 克隆的几何对象集合。
  21333. */
  21334. }, {
  21335. key: "clone",
  21336. value: function clone() {
  21337. var geometry = new Collection();
  21338. for (var i = 0, len = this.components.length; i < len; i++) {
  21339. geometry.addComponent(this.components[i].clone());
  21340. }
  21341. // catch any randomly tagged-on properties
  21342. Util_Util.applyDefaults(geometry, this);
  21343. return geometry;
  21344. }
  21345. /**
  21346. * @function GeometryCollection.prototype.getComponentsString
  21347. * @description 获取 components 字符串。
  21348. * @returns {string} components 字符串。
  21349. */
  21350. }, {
  21351. key: "getComponentsString",
  21352. value: function getComponentsString() {
  21353. var strings = [];
  21354. for (var i = 0, len = this.components.length; i < len; i++) {
  21355. strings.push(this.components[i].toShortString());
  21356. }
  21357. return strings.join(",");
  21358. }
  21359. /**
  21360. * @function GeometryCollection.prototype.calculateBounds
  21361. * @description 通过遍历数组重新计算边界,在遍历每一子项中时调用 extend 方法。
  21362. */
  21363. }, {
  21364. key: "calculateBounds",
  21365. value: function calculateBounds() {
  21366. this.bounds = null;
  21367. var bounds = new Bounds();
  21368. var components = this.components;
  21369. if (components) {
  21370. for (var i = 0, len = components.length; i < len; i++) {
  21371. bounds.extend(components[i].getBounds());
  21372. }
  21373. }
  21374. // to preserve old behavior, we only set bounds if non-null
  21375. // in the future, we could add bounds.isEmpty()
  21376. if (bounds.left != null && bounds.bottom != null && bounds.right != null && bounds.top != null) {
  21377. this.setBounds(bounds);
  21378. }
  21379. }
  21380. /**
  21381. * @function GeometryCollection.prototype.addComponents
  21382. * @description 给几何图形对象添加元素。
  21383. * @param {Array.<Geometry>} components - 几何对象组件。
  21384. * @example
  21385. * var geometryCollection = new GeometryCollection();
  21386. * geometryCollection.addComponents(new SuerpMap.Geometry.Point(10,10));
  21387. */
  21388. }, {
  21389. key: "addComponents",
  21390. value: function addComponents(components) {
  21391. if (!Util_Util.isArray(components)) {
  21392. components = [components];
  21393. }
  21394. for (var i = 0, len = components.length; i < len; i++) {
  21395. this.addComponent(components[i]);
  21396. }
  21397. }
  21398. /**
  21399. * @function GeometryCollection.prototype.addComponent
  21400. * @description 添加几何对象到集合中。如果设置了 componentTypes 类型,则添加的几何对象必须是 componentTypes 中的类型。
  21401. * @param {Geometry} component - 待添加的几何对象。
  21402. * @param {number} [index] - 几何对象插入的位置。
  21403. * @returns {boolean} 是否添加成功。
  21404. */
  21405. }, {
  21406. key: "addComponent",
  21407. value: function addComponent(component, index) {
  21408. var added = false;
  21409. if (component) {
  21410. if (this.componentTypes == null || Util_Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1) {
  21411. if (index != null && index < this.components.length) {
  21412. var components1 = this.components.slice(0, index);
  21413. var components2 = this.components.slice(index, this.components.length);
  21414. components1.push(component);
  21415. this.components = components1.concat(components2);
  21416. } else {
  21417. this.components.push(component);
  21418. }
  21419. component.parent = this;
  21420. this.clearBounds();
  21421. added = true;
  21422. }
  21423. }
  21424. return added;
  21425. }
  21426. /**
  21427. * @function GeometryCollection.prototype.removeComponents
  21428. * @description 清除几何对象。
  21429. * @param {Array.<Geometry>} components - 需要清除的几何对象。
  21430. * @returns {boolean} 元素是否被删除。
  21431. */
  21432. }, {
  21433. key: "removeComponents",
  21434. value: function removeComponents(components) {
  21435. var removed = false;
  21436. if (!Util_Util.isArray(components)) {
  21437. components = [components];
  21438. }
  21439. for (var i = components.length - 1; i >= 0; --i) {
  21440. removed = this.removeComponent(components[i]) || removed;
  21441. }
  21442. return removed;
  21443. }
  21444. /**
  21445. * @function GeometryCollection.prototype.removeComponent
  21446. * @description 从集合中移除几何对象。
  21447. * @param {Geometry} component - 要移除的几何对象。
  21448. * @returns {boolean} 几何对象是否移除成功。
  21449. */
  21450. }, {
  21451. key: "removeComponent",
  21452. value: function removeComponent(component) {
  21453. Util_Util.removeItem(this.components, component);
  21454. // clearBounds() so that it gets recalculated on the next call
  21455. // to this.getBounds();
  21456. this.clearBounds();
  21457. return true;
  21458. }
  21459. /**
  21460. * @function GeometryCollection.prototype.getArea
  21461. * @description 计算几何对象的面积。注意,这个方法在 {@link GeometryPolygon} 类中需要重写。
  21462. * @returns {number} 几何图形的面积,是几何对象中所有组成部分的面积之和。
  21463. */
  21464. }, {
  21465. key: "getArea",
  21466. value: function getArea() {
  21467. var area = 0.0;
  21468. for (var i = 0, len = this.components.length; i < len; i++) {
  21469. area += this.components[i].getArea();
  21470. }
  21471. return area;
  21472. }
  21473. /**
  21474. * @function GeometryCollection.prototype.equals
  21475. * @description 判断两个几何图形是否相等。如果所有的 components 具有相同的坐标,则认为是相等的。
  21476. * @param {Geometry} geometry - 需要判断的几何图形。
  21477. * @returns {boolean} 输入的几何图形与当前几何图形是否相等。
  21478. */
  21479. }, {
  21480. key: "equals",
  21481. value: function equals(geometry) {
  21482. var equivalent = true;
  21483. if (!geometry || !geometry.CLASS_NAME || this.CLASS_NAME !== geometry.CLASS_NAME) {
  21484. equivalent = false;
  21485. } else if (!Util_Util.isArray(geometry.components) || geometry.components.length !== this.components.length) {
  21486. equivalent = false;
  21487. } else {
  21488. for (var i = 0, len = this.components.length; i < len; ++i) {
  21489. if (!this.components[i].equals(geometry.components[i])) {
  21490. equivalent = false;
  21491. break;
  21492. }
  21493. }
  21494. }
  21495. return equivalent;
  21496. }
  21497. /**
  21498. * @function GeometryCollection.prototype.getVertices
  21499. * @description 返回几何对象的所有结点的列表。
  21500. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  21501. * @returns {Array} 几何对象的顶点列表。
  21502. */
  21503. }, {
  21504. key: "getVertices",
  21505. value: function getVertices(nodes) {
  21506. var vertices = [];
  21507. for (var i = 0, len = this.components.length; i < len; ++i) {
  21508. Array.prototype.push.apply(vertices, this.components[i].getVertices(nodes));
  21509. }
  21510. return vertices;
  21511. }
  21512. }]);
  21513. return Collection;
  21514. }(Geometry_Geometry);
  21515. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPoint.js
  21516. 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); }
  21517. function MultiPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21518. 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); } }
  21519. 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; }
  21520. 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); }
  21521. 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); }
  21522. 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); }; }
  21523. 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); }
  21524. function MultiPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21525. 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; } }
  21526. function MultiPoint_getPrototypeOf(o) { MultiPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPoint_getPrototypeOf(o); }
  21527. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21528. * This program are made available under the terms of the Apache License, Version 2.0
  21529. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21530. /**
  21531. * @class GeometryMultiPoint
  21532. * @aliasclass Geometry.MultiPoint
  21533. * @deprecatedclass SuperMap.Geometry.MultiPoint
  21534. * @classdesc 几何对象多点类。
  21535. * @category BaseTypes Geometry
  21536. * @extends GeometryCollection
  21537. * @param {Array.<GeometryPoint>} components - 点对象数组。
  21538. * @example
  21539. * var point1 = new GeometryPoint(5,6);
  21540. * var poine2 = new GeometryMultiPoint(7,8);
  21541. * var multiPoint = new MultiPoint([point1,point2]);
  21542. * @usage
  21543. */
  21544. var MultiPoint = /*#__PURE__*/function (_Collection) {
  21545. MultiPoint_inherits(MultiPoint, _Collection);
  21546. var _super = MultiPoint_createSuper(MultiPoint);
  21547. function MultiPoint(components) {
  21548. var _this;
  21549. MultiPoint_classCallCheck(this, MultiPoint);
  21550. _this = _super.call(this, components);
  21551. /**
  21552. * @member {Array.<string>} [GeometryMultiPoint.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  21553. * @description components 存储的几何对象所支持的几何类型数组。
  21554. * @readonly
  21555. */
  21556. _this.componentTypes = ["SuperMap.Geometry.Point"];
  21557. _this.CLASS_NAME = "SuperMap.Geometry.MultiPoint";
  21558. _this.geometryType = "MultiPoint";
  21559. return _this;
  21560. }
  21561. /**
  21562. * @function GeometryMultiPoint.prototype.addPoint
  21563. * @description 添加点,封装了 {@link GeometryCollection|GeometryCollection.addComponent} 方法。
  21564. * @param {GeometryPoint} point - 添加的点。
  21565. * @param {number} [index] - 下标。
  21566. */
  21567. MultiPoint_createClass(MultiPoint, [{
  21568. key: "addPoint",
  21569. value: function addPoint(point, index) {
  21570. this.addComponent(point, index);
  21571. }
  21572. /**
  21573. * @function GeometryMultiPoint.prototype.removePoint
  21574. * @description 移除点,封装了 {@link GeometryCollection|GeometryCollection.removeComponent} 方法。
  21575. * @param {GeometryPoint} point - 移除的点对象。
  21576. */
  21577. }, {
  21578. key: "removePoint",
  21579. value: function removePoint(point) {
  21580. this.removeComponent(point);
  21581. }
  21582. }]);
  21583. return MultiPoint;
  21584. }(Collection);
  21585. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Curve.js
  21586. 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); }
  21587. 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); } }
  21588. 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; }
  21589. function Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21590. 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); }
  21591. 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); }
  21592. 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); }; }
  21593. 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); }
  21594. function Curve_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21595. 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; } }
  21596. function Curve_getPrototypeOf(o) { Curve_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Curve_getPrototypeOf(o); }
  21597. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21598. * This program are made available under the terms of the Apache License, Version 2.0
  21599. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21600. /**
  21601. * @class GeometryCurve
  21602. * @aliasclass Geometry.Curve
  21603. * @deprecatedclass SuperMap.Geometry.Curve
  21604. * @classdesc 几何对象曲线类。
  21605. * @category BaseTypes Geometry
  21606. * @extends GeometryMultiPoint
  21607. * @param {Array.<GeometryPoint>} components - 几何对象数组。
  21608. * @example
  21609. * var point1 = new GeometryPoint(10,20);
  21610. * var point2 = new GeometryPoint(30,40);
  21611. * var curve = new Curve([point1,point2]);
  21612. * @usage
  21613. */
  21614. var Curve = /*#__PURE__*/function (_MultiPoint) {
  21615. Curve_inherits(Curve, _MultiPoint);
  21616. var _super = Curve_createSuper(Curve);
  21617. function Curve(components) {
  21618. var _this;
  21619. Curve_classCallCheck(this, Curve);
  21620. _this = _super.call(this, components);
  21621. /**
  21622. * @member {Array.<string>} [GeometryCurve.prototype.componentTypes=["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"]]
  21623. * @description components 存储的几何对象所支持的几何类型数组。
  21624. * @readonly
  21625. */
  21626. _this.componentTypes = ["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"];
  21627. _this.CLASS_NAME = "SuperMap.Geometry.Curve";
  21628. _this.geometryType = "Curve";
  21629. return _this;
  21630. }
  21631. return Curve_createClass(Curve);
  21632. }(MultiPoint);
  21633. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Point.js
  21634. 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); }
  21635. function Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21636. 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); } }
  21637. 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; }
  21638. 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); }
  21639. function Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Point_getPrototypeOf(object); if (object === null) break; } return object; }
  21640. 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); }
  21641. 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); }
  21642. 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); }; }
  21643. function Point_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 Point_assertThisInitialized(self); }
  21644. function Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21645. 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; } }
  21646. function Point_getPrototypeOf(o) { Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Point_getPrototypeOf(o); }
  21647. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21648. * This program are made available under the terms of the Apache License, Version 2.0
  21649. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21650. /**
  21651. * @class GeometryPoint
  21652. * @aliasclass Geometry.Point
  21653. * @deprecatedclass SuperMap.Geometry.Point
  21654. * @classdesc 点几何对象类。
  21655. * @category BaseTypes Geometry
  21656. * @extends {Geometry}
  21657. * @param {number} x - x 坐标。
  21658. * @param {number} y - y 坐标。
  21659. * @param {string} [type = 'Point'] - 点的类型。
  21660. * @param {number} [tag] - 额外的属性,比如插值分析中的 Z 值。
  21661. * @example
  21662. * var point = new GeometryPoint(-111.04, 45.68);
  21663. * @usage
  21664. */
  21665. var Point = /*#__PURE__*/function (_Geometry) {
  21666. Point_inherits(Point, _Geometry);
  21667. var _super = Point_createSuper(Point);
  21668. function Point(x, y, type, tag) {
  21669. var _this;
  21670. Point_classCallCheck(this, Point);
  21671. _this = _super.call(this, x, y, type, tag);
  21672. /**
  21673. * @member {number} GeometryPoint.prototype.x
  21674. * @description 横坐标。
  21675. */
  21676. _this.x = parseFloat(x);
  21677. /**
  21678. * @member {number} GeometryPoint.prototype.y
  21679. * @description 纵坐标。
  21680. */
  21681. _this.y = parseFloat(y);
  21682. /**
  21683. * @member {string} GeometryPoint.prototype.tag
  21684. * @description 用来存储额外的属性,比如插值分析中的 Z 值。
  21685. */
  21686. _this.tag = tag || tag == 0 ? parseFloat(tag) : null;
  21687. /**
  21688. * @member {string} GeometryPoint.prototype.type
  21689. * @description 用来存储点的类型。
  21690. */
  21691. _this.type = type || "Point";
  21692. _this.CLASS_NAME = "SuperMap.Geometry.Point";
  21693. _this.geometryType = "Point";
  21694. return _this;
  21695. }
  21696. /**
  21697. * @function GeometryPoint.prototype.clone
  21698. * @description 克隆点对象。
  21699. * @returns {GeometryPoint} 克隆后的点对象。
  21700. */
  21701. Point_createClass(Point, [{
  21702. key: "clone",
  21703. value: function clone(obj) {
  21704. if (obj == null) {
  21705. obj = new Point(this.x, this.y);
  21706. }
  21707. // catch any randomly tagged-on properties
  21708. Util_Util.applyDefaults(obj, this);
  21709. return obj;
  21710. }
  21711. /**
  21712. * @function GeometryPoint.prototype.calculateBounds
  21713. * @description 计算点对象的范围。
  21714. */
  21715. }, {
  21716. key: "calculateBounds",
  21717. value: function calculateBounds() {
  21718. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  21719. }
  21720. /**
  21721. * @function GeometryPoint.prototype.equals
  21722. * @description 判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。
  21723. * @example
  21724. * var point= new GeometryPoint(0,0);
  21725. * var point1={x:0,y:0};
  21726. * var result= point.equals(point1);
  21727. * @param {GeometryPoint} geom - 需要判断的点对象。
  21728. * @returns {boolean} 两个点对象是否相等(true 为相等,false 为不等)。
  21729. */
  21730. }, {
  21731. key: "equals",
  21732. value: function equals(geom) {
  21733. var equals = false;
  21734. if (geom != null) {
  21735. equals = this.x === geom.x && this.y === geom.y || isNaN(this.x) && isNaN(this.y) && isNaN(geom.x) && isNaN(geom.y);
  21736. }
  21737. return equals;
  21738. }
  21739. /**
  21740. * @function GeometryPoint.prototype.move
  21741. * @description 沿着 x、y 轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。
  21742. * @param {number} x - x 轴正方向上的偏移量。
  21743. * @param {number} y - y 轴正方向上偏移量。
  21744. */
  21745. }, {
  21746. key: "move",
  21747. value: function move(x, y) {
  21748. this.x = this.x + x;
  21749. this.y = this.y + y;
  21750. this.clearBounds();
  21751. }
  21752. /**
  21753. * @function GeometryPoint.prototype.toShortString
  21754. * @description 将 x/y 坐标转换成简单字符串。
  21755. * @returns {string} 字符串代表点对象。(ex. <i>"5, 42"</i>)
  21756. */
  21757. }, {
  21758. key: "toShortString",
  21759. value: function toShortString() {
  21760. return this.x + ", " + this.y;
  21761. }
  21762. /**
  21763. * @function GeometryPoint.prototype.destroy
  21764. * @description 释放点对象的资源。
  21765. */
  21766. }, {
  21767. key: "destroy",
  21768. value: function destroy() {
  21769. this.x = null;
  21770. this.y = null;
  21771. this.tag = null;
  21772. Point_get(Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  21773. }
  21774. /**
  21775. * @function GeometryPoint.prototype.getVertices
  21776. * @description 获取几何图形所有顶点的列表。
  21777. * @returns {Array} 几何图形的顶点列表。
  21778. */
  21779. }, {
  21780. key: "getVertices",
  21781. value: function getVertices() {
  21782. return [this];
  21783. }
  21784. }]);
  21785. return Point;
  21786. }(Geometry_Geometry);
  21787. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LineString.js
  21788. 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); }
  21789. function LineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21790. 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); } }
  21791. 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; }
  21792. 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); }
  21793. function LineString_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LineString_getPrototypeOf(object); if (object === null) break; } return object; }
  21794. 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); }
  21795. 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); }
  21796. 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); }; }
  21797. 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); }
  21798. function LineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21799. 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; } }
  21800. function LineString_getPrototypeOf(o) { LineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LineString_getPrototypeOf(o); }
  21801. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  21802. * This program are made available under the terms of the Apache License, Version 2.0
  21803. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21804. /**
  21805. * @class GeometryLineString
  21806. * @aliasclass Geometry.LineString
  21807. * @deprecatedclass SuperMap.Geometry.LineString
  21808. * @classdesc 几何对象线串类。
  21809. * @category BaseTypes Geometry
  21810. * @param {Array.<GeometryPoint>} points - 用来生成线串的点数组。
  21811. * @extends GeometryCurve
  21812. * @example
  21813. * var points = [new GeometryPoint(4933.319287022352, -3337.3849141502124),
  21814. * new GeometryPoint(4960.9674060199022, -3349.3316322355736),
  21815. * new GeometryPoint(5006.0235999418364, -3358.8890067038628),
  21816. * new GeometryPoint(5075.3145648369318, -3378.0037556404409),
  21817. * new GeometryPoint(5305.19551436013, -3376.9669111768926)],
  21818. * var roadLine = new GeometryLineString(points);
  21819. * @usage
  21820. */
  21821. var LineString = /*#__PURE__*/function (_Curve) {
  21822. LineString_inherits(LineString, _Curve);
  21823. var _super = LineString_createSuper(LineString);
  21824. function LineString(points) {
  21825. var _this;
  21826. LineString_classCallCheck(this, LineString);
  21827. _this = _super.call(this, points);
  21828. _this.CLASS_NAME = "SuperMap.Geometry.LineString";
  21829. _this.geometryType = "LineString";
  21830. return _this;
  21831. }
  21832. /**
  21833. * @function GeometryLineString.prototype.removeComponent
  21834. * @description 只有在线串上有三个或更多的点的时候,才会允许移除点(否则结果将会是单一的点)。
  21835. * @param {GeometryPoint} point - 将被删除的点。
  21836. * @returns {boolean} 删除的点。
  21837. */
  21838. LineString_createClass(LineString, [{
  21839. key: "removeComponent",
  21840. value: function removeComponent(point) {
  21841. // eslint-disable-line no-unused-vars
  21842. var removed = this.components && this.components.length > 2;
  21843. if (removed) {
  21844. LineString_get(LineString_getPrototypeOf(LineString.prototype), "removeComponent", this).apply(this, arguments);
  21845. }
  21846. return removed;
  21847. }
  21848. /**
  21849. * @function GeometryLineString.prototype.getSortedSegments
  21850. * @description 获取升序排列的点坐标对象数组。
  21851. * @returns {Array} 升序排列的点坐标对象数组。
  21852. */
  21853. }, {
  21854. key: "getSortedSegments",
  21855. value: function getSortedSegments() {
  21856. var numSeg = this.components.length - 1;
  21857. var segments = new Array(numSeg),
  21858. point1,
  21859. point2;
  21860. for (var i = 0; i < numSeg; ++i) {
  21861. point1 = this.components[i];
  21862. point2 = this.components[i + 1];
  21863. if (point1.x < point2.x) {
  21864. segments[i] = {
  21865. x1: point1.x,
  21866. y1: point1.y,
  21867. x2: point2.x,
  21868. y2: point2.y
  21869. };
  21870. } else {
  21871. segments[i] = {
  21872. x1: point2.x,
  21873. y1: point2.y,
  21874. x2: point1.x,
  21875. y2: point1.y
  21876. };
  21877. }
  21878. }
  21879. // more efficient to define this somewhere static
  21880. function byX1(seg1, seg2) {
  21881. return seg1.x1 - seg2.x1;
  21882. }
  21883. return segments.sort(byX1);
  21884. }
  21885. /**
  21886. * @function GeometryLineString.prototype.getVertices
  21887. * @description 返回几何图形的所有顶点的列表。
  21888. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  21889. * @returns {Array} 几何图形的顶点列表。
  21890. */
  21891. }, {
  21892. key: "getVertices",
  21893. value: function getVertices(nodes) {
  21894. var vertices;
  21895. if (nodes === true) {
  21896. vertices = [this.components[0], this.components[this.components.length - 1]];
  21897. } else if (nodes === false) {
  21898. vertices = this.components.slice(1, this.components.length - 1);
  21899. } else {
  21900. vertices = this.components.slice();
  21901. }
  21902. return vertices;
  21903. }
  21904. /**
  21905. * @function GeometryLineString.calculateCircle
  21906. * @description 三点画圆弧。
  21907. * @param {Array.<GeometryPoint>} points - 传入的待计算的初始点串。
  21908. * @returns {Array.<GeometryPoint>} 计算出相应的圆弧控制点。
  21909. * @example
  21910. * var points = [];
  21911. * points.push(new GeometryPoint(-50,30));
  21912. * points.push(new GeometryPoint(-30,50));
  21913. * points.push(new GeometryPoint(2,60));
  21914. * var circle = GeometryLineString.calculateCircle(points);
  21915. */
  21916. }], [{
  21917. key: "calculateCircle",
  21918. value: function calculateCircle(points) {
  21919. if (points.length < 3) {
  21920. return points;
  21921. }
  21922. var centerPoint = {},
  21923. p1 = points[0],
  21924. p2 = points[1],
  21925. p3 = points[2];
  21926. var R = 0,
  21927. dStep = 0,
  21928. direc = true,
  21929. dRotation = 0,
  21930. dRotationBegin = 0,
  21931. dRotationAngle = 0,
  21932. nSegmentCount = 72,
  21933. circlePoints = [];
  21934. var KTan13 = (p3.y - p1.y) / (p3.x - p1.x);
  21935. var B13 = p3.y - KTan13 * p3.x;
  21936. 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) {
  21937. circlePoints.push(p1);
  21938. circlePoints.push(p2);
  21939. circlePoints.push(p3);
  21940. } else {
  21941. 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));
  21942. 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));
  21943. var F = 4 * ((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y));
  21944. centerPoint.x = D / F;
  21945. centerPoint.y = E / F;
  21946. R = Math.sqrt((p1.x - centerPoint.x) * (p1.x - centerPoint.x) + (p1.y - centerPoint.y) * (p1.y - centerPoint.y));
  21947. var dis = (p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y);
  21948. var cons = (2 * R * R - dis) / (2 * R * R);
  21949. cons = cons >= 1 ? 1 : cons;
  21950. cons = cons <= -1 ? -1 : cons;
  21951. dRotationAngle = Math.acos(cons) * 180 / Math.PI;
  21952. if (p3.x == p1.x) {
  21953. dRotationAngle = centerPoint.x > p1.x && p2.x > p1.x || centerPoint.x < p1.x && p2.x < p1.x ? 360 - dRotationAngle : dRotationAngle;
  21954. } else {
  21955. 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;
  21956. }
  21957. dStep = dRotationAngle / 72;
  21958. if (p3.y != p1.y) {
  21959. if (p3.x == p1.x) {
  21960. if (p3.y > p1.y) {
  21961. if (p2.x < p1.x) {
  21962. direc = false;
  21963. }
  21964. } else {
  21965. if (p2.x > p1.x) {
  21966. direc = false;
  21967. }
  21968. }
  21969. } else if (p3.x < p1.x) {
  21970. if (p2.y < KTan13 * p2.x + B13) {
  21971. direc = false;
  21972. }
  21973. } else {
  21974. if (p2.y > KTan13 * p2.x + B13) {
  21975. direc = false;
  21976. }
  21977. }
  21978. } else {
  21979. if (p3.x > p1.x) {
  21980. if (p2.y > p1.y) {
  21981. direc = false;
  21982. }
  21983. } else {
  21984. if (p2.y < p1.y) {
  21985. direc = false;
  21986. }
  21987. }
  21988. }
  21989. var K10 = (p1.y - centerPoint.y) / (p1.x - centerPoint.x);
  21990. var atan10 = K10 >= 0 ? Math.atan(K10) * 180 / Math.PI : Math.abs(Math.atan(K10) * 180 / Math.PI) + 90;
  21991. var CY = Math.abs(centerPoint.y);
  21992. if (p1.y == CY && CY == p3.y) {
  21993. if (p1.x < p3.x) {
  21994. atan10 = atan10 + 180;
  21995. }
  21996. }
  21997. var newPY = p1.y - centerPoint.y;
  21998. circlePoints.push(p1);
  21999. for (var i = 1; i < nSegmentCount; i++) {
  22000. dRotation = dStep * i;
  22001. dRotationBegin = atan10;
  22002. if (direc) {
  22003. if (newPY >= 0) {
  22004. if (K10 >= 0) {
  22005. dRotationBegin = dRotationBegin + dRotation;
  22006. } else {
  22007. dRotationBegin = 180 - (dRotationBegin - 90) + dRotation;
  22008. }
  22009. } else {
  22010. if (K10 > 0) {
  22011. dRotationBegin = dRotationBegin - 180 + dRotation;
  22012. } else {
  22013. dRotationBegin = 90 - dRotationBegin + dRotation;
  22014. }
  22015. }
  22016. } else {
  22017. if (newPY >= 0) {
  22018. if (K10 >= 0) {
  22019. dRotationBegin = dRotationBegin - dRotation;
  22020. } else {
  22021. dRotationBegin = 180 - (dRotationBegin - 90) - dRotation;
  22022. }
  22023. } else {
  22024. if (K10 >= 0) {
  22025. dRotationBegin = dRotationBegin - 180 - dRotation;
  22026. } else {
  22027. dRotationBegin = 90 - dRotationBegin - dRotation;
  22028. }
  22029. }
  22030. }
  22031. dRotationBegin = dRotationBegin * Math.PI / 180;
  22032. var x = centerPoint.x + R * Math.cos(dRotationBegin);
  22033. var y = centerPoint.y + R * Math.sin(dRotationBegin);
  22034. circlePoints.push(new Point(x, y));
  22035. }
  22036. circlePoints.push(p3);
  22037. }
  22038. return circlePoints;
  22039. }
  22040. /**
  22041. * @function GeometryLineString.createLineEPS
  22042. * @description 根据点的类型画出不同类型的曲线。
  22043. * 点的类型有三种:LTypeArc,LTypeCurve,NONE。
  22044. * @param {Array.<GeometryPoint>} points - 传入的待计算的初始点串。
  22045. * @returns {Array.<GeometryPoint>} 计算出相应的 lineEPS 控制点。
  22046. * @example
  22047. * var points = [];
  22048. * points.push(new GeometryPoint(-50,30));
  22049. * points.push(new GeometryPoint(-30,50,"LTypeArc"));
  22050. * points.push(new GeometryPoint(2,60));
  22051. * points.push(new GeometryPoint(8,20));
  22052. * var lineEPS = GeometryLineString.createLineEPS(points);
  22053. */
  22054. }, {
  22055. key: "createLineEPS",
  22056. value: function createLineEPS(points) {
  22057. var list = [],
  22058. len = points.length;
  22059. if (len < 2) {
  22060. return points;
  22061. }
  22062. for (var i = 0; i < len;) {
  22063. var type = points[i].type;
  22064. if (type == 'LTypeArc') {
  22065. var listObj = LineString.createLineArc(list, i, len, points);
  22066. list = listObj[0];
  22067. i = listObj[1];
  22068. } else {
  22069. list.push(points[i]);
  22070. i++;
  22071. }
  22072. }
  22073. return list;
  22074. }
  22075. }, {
  22076. key: "createLineArc",
  22077. value: function createLineArc(list, i, len, points) {
  22078. if (i == 0) {
  22079. var bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  22080. Array.prototype.push.apply(list, bezierPtsObj[0]);
  22081. i = bezierPtsObj[1] + 1;
  22082. } else if (i == len - 1) {
  22083. var bezierP = [points[i - 1], points[i]],
  22084. bezierPts = LineString.calculateCircle(bezierP);
  22085. Array.prototype.push.apply(list, bezierPts);
  22086. i++;
  22087. } else {
  22088. var _bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  22089. list.pop();
  22090. Array.prototype.push.apply(list, _bezierPtsObj[0]);
  22091. i = _bezierPtsObj[1] + 1;
  22092. }
  22093. return [list, i];
  22094. }
  22095. }, {
  22096. key: "addPointEPS",
  22097. value: function addPointEPS(points, i, len, type) {
  22098. var bezierP = [],
  22099. j = i + 1;
  22100. if (i == 0) {
  22101. Array.prototype.push.apply(bezierP, [points[i], points[i + 1]]);
  22102. } else if (i == len - 1) {
  22103. Array.prototype.push.apply(bezierP, [points[i - 1], points[i]]);
  22104. } else {
  22105. Array.prototype.push.apply(bezierP, [points[i - 1], points[i], points[i + 1]]);
  22106. }
  22107. var bezierPts;
  22108. if (type == 'LTypeCurve') {
  22109. bezierPts = LineString.calculatePointsFBZN(bezierP);
  22110. } else if (type == 'LTypeArc') {
  22111. bezierPts = LineString.calculateCircle(bezierP);
  22112. }
  22113. return [bezierPts, j];
  22114. }
  22115. }]);
  22116. return LineString;
  22117. }(Curve);
  22118. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/GeoText.js
  22119. 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); }
  22120. function GeoText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22121. 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); } }
  22122. 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; }
  22123. 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); }
  22124. function GeoText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoText_getPrototypeOf(object); if (object === null) break; } return object; }
  22125. 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); }
  22126. 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); }
  22127. 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); }; }
  22128. 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); }
  22129. function GeoText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22130. 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; } }
  22131. function GeoText_getPrototypeOf(o) { GeoText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoText_getPrototypeOf(o); }
  22132. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22133. * This program are made available under the terms of the Apache License, Version 2.0
  22134. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22135. /**
  22136. * @class GeometryGeoText
  22137. * @aliasclass Geometry.GeoText
  22138. * @deprecatedclass SuperMap.Geometry.GeoText
  22139. * @classdesc 文本标签类。
  22140. * @category BaseTypes Geometry
  22141. * @extends {Geometry}
  22142. * @param {number} x - x 坐标。
  22143. * @param {number} y - y 坐标。
  22144. * @param {string} text - 标签中的文本内容。
  22145. * @usage
  22146. */
  22147. var GeoText = /*#__PURE__*/function (_Geometry) {
  22148. GeoText_inherits(GeoText, _Geometry);
  22149. var _super = GeoText_createSuper(GeoText);
  22150. function GeoText(x, y, text) {
  22151. var _this;
  22152. GeoText_classCallCheck(this, GeoText);
  22153. _this = _super.call(this, x, y, text);
  22154. /**
  22155. * @member {number} GeometryGeoText.prototype.x
  22156. * @description 横坐标。
  22157. */
  22158. _this.x = parseFloat(x);
  22159. /**
  22160. * @member {number} GeometryGeoText.prototype.y
  22161. * @description 纵坐标。
  22162. */
  22163. _this.y = parseFloat(y);
  22164. /**
  22165. * @member {string} GeometryGeoText.prototype.text
  22166. * @description 标签中的文本内容。
  22167. */
  22168. _this.text = text.toString();
  22169. /**
  22170. * @member {Object} GeometryGeoText.prototype.bsInfo
  22171. * @description 标签范围的基础信息。
  22172. * @property {number} w - bounds 的宽度。
  22173. * @property {number} h - bounds 的高度。
  22174. */
  22175. _this.bsInfo = {
  22176. "h": null,
  22177. "w": null
  22178. };
  22179. _this.element = document.createElement('span');
  22180. _this.CLASS_NAME = "SuperMap.Geometry.GeoText";
  22181. _this.geometryType = "GeoText";
  22182. return _this;
  22183. }
  22184. /**
  22185. * @function GeometryGeoText.prototype.destroy
  22186. * @description 销毁文本标签类。
  22187. */
  22188. GeoText_createClass(GeoText, [{
  22189. key: "destroy",
  22190. value: function destroy() {
  22191. GeoText_get(GeoText_getPrototypeOf(GeoText.prototype), "destroy", this).call(this);
  22192. this.x = null;
  22193. this.y = null;
  22194. this.text = null;
  22195. }
  22196. /**
  22197. * @function GeometryGeoText.prototype.getCentroid
  22198. * @description 获取标签对象的质心。
  22199. * @returns {GeometryPoint} 标签对象的质心。
  22200. */
  22201. }, {
  22202. key: "getCentroid",
  22203. value: function getCentroid() {
  22204. return new Point(this.x, this.y);
  22205. }
  22206. /**
  22207. * @function GeometryGeoText.prototype.clone
  22208. * @description 克隆标签对象。
  22209. * @returns {GeometryGeoText} 克隆后的标签对象。
  22210. */
  22211. }, {
  22212. key: "clone",
  22213. value: function clone(obj) {
  22214. if (obj == null) {
  22215. obj = new GeoText(this.x, this.y, this.text);
  22216. }
  22217. Util_Util.applyDefaults(obj, this);
  22218. return obj;
  22219. }
  22220. /**
  22221. * @function GeometryGeoText.prototype.calculateBounds
  22222. * @description 计算标签对象的范围。
  22223. */
  22224. }, {
  22225. key: "calculateBounds",
  22226. value: function calculateBounds() {
  22227. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  22228. }
  22229. /**
  22230. * @function GeometryGeoText.prototype.getLabelPxBoundsByLabel
  22231. * @description 根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。
  22232. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  22233. * @param {string} labelWidth - 标签的宽度,如:“90px”。
  22234. * @param {string} labelHeight - 标签的高度。
  22235. * @param {Object} style - 标签的 style。
  22236. * @returns {Bounds} 标签的像素范围。
  22237. */
  22238. }, {
  22239. key: "getLabelPxBoundsByLabel",
  22240. value: function getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style) {
  22241. var labelPxBounds, left, bottom, top, right;
  22242. var locationPx = Util_Util.cloneObject(locationPixel);
  22243. //计算文本行数
  22244. var theText = style.label || this.text;
  22245. var textRows = theText.split('\n');
  22246. var laberRows = textRows.length;
  22247. //处理文字对齐
  22248. labelWidth = parseFloat(labelWidth);
  22249. labelHeight = parseFloat(labelHeight);
  22250. if (laberRows > 1) {
  22251. labelHeight = parseFloat(labelHeight) * laberRows;
  22252. }
  22253. if (style.labelAlign && style.labelAlign !== "cm") {
  22254. switch (style.labelAlign) {
  22255. case "lt":
  22256. locationPx.x += labelWidth / 2;
  22257. locationPx.y += labelHeight / 2;
  22258. break;
  22259. case "lm":
  22260. locationPx.x += labelWidth / 2;
  22261. break;
  22262. case "lb":
  22263. locationPx.x += labelWidth / 2;
  22264. locationPx.y -= labelHeight / 2;
  22265. break;
  22266. case "ct":
  22267. locationPx.y += labelHeight / 2;
  22268. break;
  22269. case "cb":
  22270. locationPx.y -= labelHeight / 2;
  22271. break;
  22272. case "rt":
  22273. locationPx.x -= labelWidth / 2;
  22274. locationPx.y += labelHeight / 2;
  22275. break;
  22276. case "rm":
  22277. locationPx.x -= labelWidth / 2;
  22278. break;
  22279. case "rb":
  22280. locationPx.x -= labelWidth / 2;
  22281. locationPx.y -= labelHeight / 2;
  22282. break;
  22283. default:
  22284. break;
  22285. }
  22286. }
  22287. this.bsInfo.h = labelHeight;
  22288. this.bsInfo.w = labelWidth;
  22289. //bounds的四边
  22290. left = locationPx.x - parseFloat(labelWidth) / 2;
  22291. bottom = locationPx.y + parseFloat(labelHeight) / 2;
  22292. right = locationPx.x + parseFloat(labelWidth) / 2;
  22293. top = locationPx.y - parseFloat(labelHeight) / 2;
  22294. labelPxBounds = new Bounds(left, bottom, right, top);
  22295. return labelPxBounds;
  22296. }
  22297. /**
  22298. * @function GeometryGeoText.prototype.getLabelPxBoundsByText
  22299. * @description 根据文本内容获取文字标签的像素范围。
  22300. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  22301. * @param {Object} style - 标签的样式。
  22302. * @returns {Bounds} 标签的像素范围。
  22303. */
  22304. }, {
  22305. key: "getLabelPxBoundsByText",
  22306. value: function getLabelPxBoundsByText(locationPixel, style) {
  22307. var labelPxBounds, left, bottom, top, right;
  22308. var labelSize = this.getLabelPxSize(style);
  22309. var locationPx = Util_Util.cloneObject(locationPixel);
  22310. //处理文字对齐
  22311. if (style.labelAlign && style.labelAlign !== "cm") {
  22312. switch (style.labelAlign) {
  22313. case "lt":
  22314. locationPx.x += labelSize.w / 2;
  22315. locationPx.y += labelSize.h / 2;
  22316. break;
  22317. case "lm":
  22318. locationPx.x += labelSize.w / 2;
  22319. break;
  22320. case "lb":
  22321. locationPx.x += labelSize.w / 2;
  22322. locationPx.y -= labelSize.h / 2;
  22323. break;
  22324. case "ct":
  22325. locationPx.y += labelSize.h / 2;
  22326. break;
  22327. case "cb":
  22328. locationPx.y -= labelSize.h / 2;
  22329. break;
  22330. case "rt":
  22331. locationPx.x -= labelSize.w / 2;
  22332. locationPx.y += labelSize.h / 2;
  22333. break;
  22334. case "rm":
  22335. locationPx.x -= labelSize.w / 2;
  22336. break;
  22337. case "rb":
  22338. locationPx.x -= labelSize.w / 2;
  22339. locationPx.y -= labelSize.h / 2;
  22340. break;
  22341. default:
  22342. break;
  22343. }
  22344. }
  22345. this.bsInfo.h = labelSize.h;
  22346. this.bsInfo.w = labelSize.w;
  22347. left = locationPx.x - labelSize.w / 2;
  22348. bottom = locationPx.y + labelSize.h / 2;
  22349. //处理斜体字
  22350. if (style.fontStyle && style.fontStyle === "italic") {
  22351. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  22352. } else {
  22353. right = locationPx.x + labelSize.w / 2;
  22354. }
  22355. top = locationPx.y - labelSize.h / 2;
  22356. labelPxBounds = new Bounds(left, bottom, right, top);
  22357. return labelPxBounds;
  22358. }
  22359. /**
  22360. * @function GeometryGeoText.prototype.getLabelPxSize
  22361. * @description 获取 label 的像素大小。
  22362. * @param {Object} style - 标签样式。
  22363. * @returns {Object} 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。
  22364. */
  22365. }, {
  22366. key: "getLabelPxSize",
  22367. value: function getLabelPxSize(style) {
  22368. var text,
  22369. //文本内容
  22370. fontSize,
  22371. //字体大小
  22372. spacing = 1,
  22373. //两个字符间的间距(单位:px)
  22374. lineSpacing = 0.2,
  22375. bgstrokeWidth = parseFloat(style.strokeWidth); //标签背景框边框的宽度
  22376. text = style.label || this.text;
  22377. if (style.fontSize) {
  22378. fontSize = parseFloat(style.fontSize);
  22379. } else {
  22380. fontSize = parseFloat("12px");
  22381. }
  22382. //标签宽高
  22383. var labelW, labelH;
  22384. var textRows = text.split('\n');
  22385. var numRows = textRows.length;
  22386. if (numRows > 1) {
  22387. labelH = fontSize * numRows + numRows + bgstrokeWidth + lineSpacing * fontSize;
  22388. } else {
  22389. labelH = fontSize + bgstrokeWidth + lineSpacing * fontSize + 1;
  22390. }
  22391. //取最大宽度
  22392. labelW = 0;
  22393. if (this.labelWTmp && labelW < this.labelWTmp) {
  22394. labelW = this.labelWTmp;
  22395. }
  22396. for (var i = 0; i < numRows; i++) {
  22397. var textCharC = this.getTextCount(textRows[i]);
  22398. var labelWTmp = this.labelWTmp = Util_Util.getTextBounds(style, textRows[i], this.element).textWidth + textCharC.textC * spacing + bgstrokeWidth;
  22399. if (labelW < labelWTmp) {
  22400. labelW = labelWTmp;
  22401. }
  22402. }
  22403. var labelSize = new Object(); //标签大小
  22404. labelSize.h = labelH;
  22405. labelSize.w = labelW;
  22406. return labelSize;
  22407. }
  22408. /**
  22409. * @function GeometryGeoText.prototype.getTextCount
  22410. * @description 获取 text 中的字符个数。
  22411. * @param {string} text - 字符串。
  22412. * @returns {Object} 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。
  22413. */
  22414. }, {
  22415. key: "getTextCount",
  22416. value: function getTextCount(text) {
  22417. var textCharCount = {};
  22418. var cnCount = 0;
  22419. var enCount = 0;
  22420. for (var i = 0; i < text.length; i++) {
  22421. if (text.charCodeAt(i) > 255) {
  22422. //遍历判断字符串中每个字符的Unicode码,大于255则为中文
  22423. cnCount++;
  22424. } else {
  22425. enCount++;
  22426. }
  22427. }
  22428. //中午字符个数
  22429. textCharCount.cnC = cnCount;
  22430. //英文字符个数
  22431. textCharCount.enC = enCount;
  22432. //字符总个数
  22433. textCharCount.textC = text.length;
  22434. return textCharCount;
  22435. }
  22436. }]);
  22437. return GeoText;
  22438. }(Geometry_Geometry);
  22439. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LinearRing.js
  22440. 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); }
  22441. function LinearRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22442. 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); } }
  22443. 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; }
  22444. 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); }
  22445. function LinearRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LinearRing_getPrototypeOf(object); if (object === null) break; } return object; }
  22446. 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); }
  22447. 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); }
  22448. 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); }; }
  22449. 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); }
  22450. function LinearRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22451. 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; } }
  22452. function LinearRing_getPrototypeOf(o) { LinearRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LinearRing_getPrototypeOf(o); }
  22453. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22454. * This program are made available under the terms of the Apache License, Version 2.0
  22455. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22456. /**
  22457. * @class GeometryLinearRing
  22458. * @aliasclass Geometry.LinearRing
  22459. * @deprecatedclass SuperMap.Geometry.LinearRing
  22460. * @classdesc 几何对象线环类,是一个特殊的封闭的线串,在每次 addPoint/removePoint 之后会通过添加一个点(此点是复制的第一个点得到的)
  22461. * 作为最后的一个点来自动关闭线环。
  22462. * @category BaseTypes Geometry
  22463. * @extends GeometryLineString
  22464. * @param {Array.<GeometryPoint>} points - 组成线性环的点。
  22465. * @example
  22466. * var points = [new GeometryPoint(4933.319287022352, -3337.3849141502124),
  22467. * new GeometryPoint(4960.9674060199022, -3349.3316322355736),
  22468. * new GeometryPoint(5006.0235999418364, -3358.8890067038628),
  22469. * new GeometryPoint(5075.3145648369318, -3378.0037556404409),
  22470. * new GeometryPoint(5305.19551436013, -3376.9669111768926)],
  22471. * var linearRing = new GeometryLinearRing(points);
  22472. * @usage
  22473. */
  22474. var LinearRing_LinearRing = /*#__PURE__*/function (_LineString) {
  22475. LinearRing_inherits(LinearRing, _LineString);
  22476. var _super = LinearRing_createSuper(LinearRing);
  22477. function LinearRing(points) {
  22478. var _this;
  22479. LinearRing_classCallCheck(this, LinearRing);
  22480. _this = _super.call(this, points);
  22481. /**
  22482. * @member {Array.<string>} [GeometryLinearRing.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  22483. * @description components 存储的几何对象所支持的几何类型数组,为空表示类型不受限制。
  22484. * @readonly
  22485. */
  22486. _this.componentTypes = ["SuperMap.Geometry.Point"];
  22487. _this.CLASS_NAME = "SuperMap.Geometry.LinearRing";
  22488. _this.geometryType = "LinearRing";
  22489. return _this;
  22490. }
  22491. /**
  22492. * @function GeometryLinearRing.prototype.addComponent
  22493. * @description 添加一个点到几何图形数组中,如果这个点将要被添加到组件数组的末端,并且与数组中已经存在的最后一个点相同,
  22494. * 重复的点是不能被添加的。这将影响未关闭环的关闭。
  22495. * 这个方法可以通过将非空索引(组件数组的下标)作为第二个参数重写。
  22496. * @param {GeometryPoint} point - 点对象。
  22497. * @param {number} [index] - 插入组件数组的下标。
  22498. * @returns {boolean} 点对象是否添加成功。
  22499. */
  22500. LinearRing_createClass(LinearRing, [{
  22501. key: "addComponent",
  22502. value: function addComponent(point, index) {
  22503. var added = false;
  22504. //remove last point
  22505. var lastPoint = this.components.pop();
  22506. // given an index, add the point
  22507. // without an index only add non-duplicate points
  22508. if (index != null || !point.equals(lastPoint)) {
  22509. added = LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, arguments);
  22510. }
  22511. //append copy of first point
  22512. var firstPoint = this.components[0];
  22513. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  22514. return added;
  22515. }
  22516. /**
  22517. * @function GeometryLinearRing.prototype.removeComponent
  22518. * @description 从几何组件中删除一个点。
  22519. * @param {GeometryPoint} point - 点对象。
  22520. * @returns {boolean} 点对象是否删除。
  22521. */
  22522. }, {
  22523. key: "removeComponent",
  22524. value: function removeComponent(point) {
  22525. // eslint-disable-line no-unused-vars
  22526. var removed = this.components && this.components.length > 3;
  22527. if (removed) {
  22528. //remove last point
  22529. this.components.pop();
  22530. //remove our point
  22531. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "removeComponent", this).apply(this, arguments);
  22532. //append copy of first point
  22533. var firstPoint = this.components[0];
  22534. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  22535. }
  22536. return removed;
  22537. }
  22538. /**
  22539. * @function GeometryLinearRing.prototype.getArea
  22540. * @description 获得当前几何对象区域大小,如果是沿顺时针方向的环则是正值,否则为负值。
  22541. * @returns {number} 环的面积。
  22542. */
  22543. }, {
  22544. key: "getArea",
  22545. value: function getArea() {
  22546. var area = 0.0;
  22547. if (this.components && this.components.length > 2) {
  22548. var sum = 0.0;
  22549. for (var i = 0, len = this.components.length; i < len - 1; i++) {
  22550. var b = this.components[i];
  22551. var c = this.components[i + 1];
  22552. sum += (b.x + c.x) * (c.y - b.y);
  22553. }
  22554. area = -sum / 2.0;
  22555. }
  22556. return area;
  22557. }
  22558. /**
  22559. * @function GeometryLinearRing.prototype.getVertices
  22560. * @description 返回几何图形的所有点的列表。
  22561. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false ,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  22562. * @returns {Array} 几何对象所有点的列表。
  22563. */
  22564. }, {
  22565. key: "getVertices",
  22566. value: function getVertices(nodes) {
  22567. return nodes === true ? [] : this.components.slice(0, this.components.length - 1);
  22568. }
  22569. }]);
  22570. return LinearRing;
  22571. }(LineString);
  22572. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiLineString.js
  22573. 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); }
  22574. 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); } }
  22575. 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; }
  22576. function MultiLineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22577. 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); }
  22578. 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); }
  22579. 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); }; }
  22580. 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); }
  22581. function MultiLineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22582. 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; } }
  22583. function MultiLineString_getPrototypeOf(o) { MultiLineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiLineString_getPrototypeOf(o); }
  22584. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22585. * This program are made available under the terms of the Apache License, Version 2.0
  22586. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22587. /**
  22588. * @class GeometryMultiLineString
  22589. * @aliasclass Geometry.MultiLineString
  22590. * @deprecatedclass SuperMap.Geometry.MultiLineString
  22591. * @classdesc 几何对象多线类。
  22592. * @category BaseTypes Geometry
  22593. * @extends GeometryCollection
  22594. * @param {Array.<GeometryLineString>} components - GeometryLineString 数组。
  22595. * @example
  22596. * var multi = new GeometryMultiLineString([
  22597. * new GeometryLineString([
  22598. * new GeometryPoint(1, 0),
  22599. * new GeometryPoint(0, 1)
  22600. * ])
  22601. * ]);
  22602. * @usage
  22603. */
  22604. var MultiLineString = /*#__PURE__*/function (_Collection) {
  22605. MultiLineString_inherits(MultiLineString, _Collection);
  22606. var _super = MultiLineString_createSuper(MultiLineString);
  22607. function MultiLineString(components) {
  22608. var _this;
  22609. MultiLineString_classCallCheck(this, MultiLineString);
  22610. _this = _super.call(this, components);
  22611. /**
  22612. * @member {Array.<string>} [GeometryMultiLineString.prototype.componentTypes=["SuperMap.Geometry.LineString"]]
  22613. * @description components 存储的几何对象所支持的几何类型数组。
  22614. * @readonly
  22615. */
  22616. _this.componentTypes = ["SuperMap.Geometry.LineString"];
  22617. _this.CLASS_NAME = "SuperMap.Geometry.MultiLineString";
  22618. _this.geometryType = "MultiLineString";
  22619. return _this;
  22620. }
  22621. return MultiLineString_createClass(MultiLineString);
  22622. }(Collection);
  22623. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPolygon.js
  22624. 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); }
  22625. 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); } }
  22626. 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; }
  22627. function MultiPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22628. 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); }
  22629. 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); }
  22630. 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); }; }
  22631. 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); }
  22632. function MultiPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22633. 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; } }
  22634. function MultiPolygon_getPrototypeOf(o) { MultiPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPolygon_getPrototypeOf(o); }
  22635. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22636. * This program are made available under the terms of the Apache License, Version 2.0
  22637. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22638. /**
  22639. * @class GeometryMultiPolygon
  22640. * @aliasclass Geometry.MultiPolygon
  22641. * @deprecatedclass SuperMap.Geometry.MultiPolygon
  22642. * @classdesc 几何对象多多边形类。
  22643. * @category BaseTypes Geometry
  22644. * @extends GeometryCollection
  22645. * @param {Array.<GeometryPolygon>} components - 形成 GeometryMultiPolygon 的多边形数组。
  22646. * @example
  22647. * var points1 = [new GeometryPoint(10,10),new GeometryPoint(0,0)];
  22648. * var points2 = [new GeometryPoint(10,10),new GeometryPoint(0,0),new GeometryPoint(3,3),new GeometryPoint(10,10)];
  22649. *
  22650. * var linearRing1 = new GeometryLinearRing(points1);
  22651. * var linearRing2 = new GeometryLinearRing(points2);
  22652. *
  22653. * var polygon1 = new GeometryPolygon([linearRing1]);
  22654. * var polygon2 = new GeometryPolygon([linearRing2]);
  22655. *
  22656. * var multiPolygon1 = new GeometryMultiPolygon([polygon1,polygon2]);
  22657. * @usage
  22658. */
  22659. var MultiPolygon = /*#__PURE__*/function (_Collection) {
  22660. MultiPolygon_inherits(MultiPolygon, _Collection);
  22661. var _super = MultiPolygon_createSuper(MultiPolygon);
  22662. function MultiPolygon(components) {
  22663. var _this;
  22664. MultiPolygon_classCallCheck(this, MultiPolygon);
  22665. _this = _super.call(this, components);
  22666. /**
  22667. * @member {Array.<string>} [GeometryMultiPolygon.prototype.componentTypes=["SuperMap.Geometry.Polygon"]]
  22668. * @description components 存储的几何对象所支持的几何类型数组。
  22669. * @readonly
  22670. */
  22671. _this.componentTypes = ["SuperMap.Geometry.Polygon"];
  22672. _this.CLASS_NAME = "SuperMap.Geometry.MultiPolygon";
  22673. _this.geometryType = "MultiPolygon";
  22674. return _this;
  22675. }
  22676. return MultiPolygon_createClass(MultiPolygon);
  22677. }(Collection);
  22678. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Polygon.js
  22679. 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); }
  22680. function Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22681. 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); } }
  22682. 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; }
  22683. 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); }
  22684. 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); }
  22685. 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); }; }
  22686. 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); }
  22687. function Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22688. 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; } }
  22689. function Polygon_getPrototypeOf(o) { Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Polygon_getPrototypeOf(o); }
  22690. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22691. * This program are made available under the terms of the Apache License, Version 2.0
  22692. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22693. /**
  22694. * @class GeometryPolygon
  22695. * @aliasclass Geometry.Polygon
  22696. * @deprecatedclass SuperMap.Geometry.Polygon
  22697. * @classdesc 多边形几何对象类。
  22698. * @category BaseTypes Geometry
  22699. * @extends GeometryCollection
  22700. * @param {Array.<GeometryLinearRing>} components - 多边形的线环数组。
  22701. * @example
  22702. * var points =[new GeometryPoint(0,4010338),
  22703. * new GeometryPoint(1063524,4010338),
  22704. * new GeometryPoint(1063524,3150322),
  22705. * new GeometryPoint(0,3150322)
  22706. * ],
  22707. * var linearRings = new GeometryLinearRing(points),
  22708. * var region = new GeometryPolygon([linearRings]);
  22709. * @usage
  22710. */
  22711. var Polygon_Polygon = /*#__PURE__*/function (_Collection) {
  22712. Polygon_inherits(Polygon, _Collection);
  22713. var _super = Polygon_createSuper(Polygon);
  22714. function Polygon(components) {
  22715. var _this;
  22716. Polygon_classCallCheck(this, Polygon);
  22717. _this = _super.call(this, components);
  22718. /**
  22719. * @member {Array.<string>} [GeometryPolygon.prototype.componentTypes=["SuperMap.Geometry.LinearRing"]]
  22720. * @description components 存储的几何对象所支持的几何类型数组。
  22721. * @readonly
  22722. */
  22723. _this.componentTypes = ["SuperMap.Geometry.LinearRing"];
  22724. _this.CLASS_NAME = "SuperMap.Geometry.Polygon";
  22725. _this.geometryType = "Polygon";
  22726. return _this;
  22727. }
  22728. /**
  22729. * @function GeometryMultiPoint.prototype.getArea
  22730. * @description 获得区域面积,从区域的外部口径减去计此区域内部口径算所得的面积。
  22731. * @returns {number} 几何对象的面积。
  22732. */
  22733. Polygon_createClass(Polygon, [{
  22734. key: "getArea",
  22735. value: function getArea() {
  22736. var area = 0.0;
  22737. if (this.components && this.components.length > 0) {
  22738. area += Math.abs(this.components[0].getArea());
  22739. for (var i = 1, len = this.components.length; i < len; i++) {
  22740. area -= Math.abs(this.components[i].getArea());
  22741. }
  22742. }
  22743. return area;
  22744. }
  22745. }]);
  22746. return Polygon;
  22747. }(Collection);
  22748. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Rectangle.js
  22749. 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); }
  22750. function Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22751. 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); } }
  22752. 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; }
  22753. 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); }
  22754. 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); }
  22755. 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); }; }
  22756. 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); }
  22757. function Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22758. 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; } }
  22759. function Rectangle_getPrototypeOf(o) { Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Rectangle_getPrototypeOf(o); }
  22760. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22761. * This program are made available under the terms of the Apache License, Version 2.0
  22762. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22763. /**
  22764. * @class GeometryRectangle
  22765. * @aliasclass Geometry.Rectangle
  22766. * @deprecatedclass SuperMap.Geometry.Rectangle
  22767. * @classdesc 矩形几何对象类。
  22768. * @category BaseTypes Geometry
  22769. * @param {number} x - 矩形左下角点的横坐标。
  22770. * @param {number} y - 矩形左下角点的纵坐标。
  22771. * @param {number} width - 矩形的宽度。
  22772. * @param {number} height - 矩形的高度。
  22773. * @extends {Geometry}
  22774. * @example
  22775. * //x 为矩形左下角点的横坐标;y 为矩形左下角点的纵坐标;w 为矩形的宽度;h 为矩形的高度
  22776. * var x = 1;
  22777. * var y = 2;
  22778. * var w = 10;
  22779. * var h = 20;
  22780. * var recttangle = new GeometryRectangle(x, y, w, h);
  22781. * @usage
  22782. */
  22783. var Rectangle = /*#__PURE__*/function (_Geometry) {
  22784. Rectangle_inherits(Rectangle, _Geometry);
  22785. var _super = Rectangle_createSuper(Rectangle);
  22786. function Rectangle(x, y, width, height) {
  22787. var _this;
  22788. Rectangle_classCallCheck(this, Rectangle);
  22789. _this = _super.call(this, x, y, width, height);
  22790. /**
  22791. * @member {number} GeometryRectangle.prototype.x
  22792. * @description 矩形左下角点的横坐标。
  22793. */
  22794. _this.x = x;
  22795. /**
  22796. * @member {number} GeometryRectangle.prototype.y
  22797. * @description 矩形左下角点的纵坐标。
  22798. */
  22799. _this.y = y;
  22800. /**
  22801. * @member {number} GeometryRectangle.prototype.width
  22802. * @description 矩形的宽度。
  22803. */
  22804. _this.width = width;
  22805. /**
  22806. * @member {number} GeometryRectangle.prototype.height
  22807. * @description 矩形的高度。
  22808. */
  22809. _this.height = height;
  22810. _this.CLASS_NAME = "SuperMap.Geometry.Rectangle";
  22811. _this.geometryType = "Rectangle";
  22812. return _this;
  22813. }
  22814. /**
  22815. * @function GeometryRectangle.prototype.calculateBounds
  22816. * @description 计算出此矩形对象的 bounds。
  22817. */
  22818. Rectangle_createClass(Rectangle, [{
  22819. key: "calculateBounds",
  22820. value: function calculateBounds() {
  22821. this.bounds = new Bounds(this.x, this.y, this.x + this.width, this.y + this.height);
  22822. }
  22823. /**
  22824. * @function GeometryRectangle.prototype.getArea
  22825. * @description 获取矩形对象的面积。
  22826. * @returns {number} 矩形对象面积。
  22827. */
  22828. }, {
  22829. key: "getArea",
  22830. value: function getArea() {
  22831. var area = this.width * this.height;
  22832. return area;
  22833. }
  22834. }]);
  22835. return Rectangle;
  22836. }(Geometry_Geometry);
  22837. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/index.js
  22838. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22839. * This program are made available under the terms of the Apache License, Version 2.0
  22840. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22841. ;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
  22842. function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22843. 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); } }
  22844. 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; }
  22845. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22846. * This program are made available under the terms of the Apache License, Version 2.0
  22847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22848. /**
  22849. * @class Credential
  22850. * @deprecatedclass SuperMap.Credential
  22851. * @category Security
  22852. * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
  22853. * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
  22854. * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
  22855. * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
  22856. * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
  22857. * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
  22858. * @example
  22859. * var pixcel = new Credential("valueString","token");
  22860. * pixcel.destroy();
  22861. * @usage
  22862. */
  22863. var Credential = /*#__PURE__*/function () {
  22864. function Credential(value, name) {
  22865. Credential_classCallCheck(this, Credential);
  22866. /**
  22867. * @member {string} Credential.prototype.value
  22868. * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
  22869. */
  22870. this.value = value ? value : "";
  22871. /**
  22872. * @member {string} [Credential.prototype.name='token']
  22873. * @description 验证信息前缀,name=value 部分的 name 部分。
  22874. */
  22875. this.name = name ? name : "token";
  22876. this.CLASS_NAME = "SuperMap.Credential";
  22877. }
  22878. /**
  22879. * @function Credential.prototype.getUrlParameters
  22880. * @description 获取 name=value 的表达式。
  22881. * @example
  22882. * var credential = new Credential("valueString","token");
  22883. * //这里 str = "token=valueString";
  22884. * var str = credential.getUrlParameters();
  22885. * @returns {string} 安全信息组成的 url 片段。
  22886. */
  22887. Credential_createClass(Credential, [{
  22888. key: "getUrlParameters",
  22889. value: function getUrlParameters() {
  22890. //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
  22891. return this.name + "=" + this.value;
  22892. }
  22893. /**
  22894. * @function Credential.prototype.getValue
  22895. * @description 获取 value。
  22896. * @example
  22897. * var credential = new Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
  22898. * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
  22899. * var str = credential.getValue();
  22900. * @returns {string} value 字符串,在 iServer 服务下该 value 值即为 token 值。
  22901. */
  22902. }, {
  22903. key: "getValue",
  22904. value: function getValue() {
  22905. return this.value;
  22906. }
  22907. /**
  22908. *
  22909. * @function Credential.prototype.destroy
  22910. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  22911. * @example
  22912. * var credential = new Credential("valueString","token");
  22913. * credential.destroy();
  22914. */
  22915. }, {
  22916. key: "destroy",
  22917. value: function destroy() {
  22918. this.value = null;
  22919. this.name = null;
  22920. }
  22921. }]);
  22922. return Credential;
  22923. }();
  22924. /**
  22925. * @member {Credential} Credential.CREDENTIAL
  22926. * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
  22927. * @example
  22928. * 代码实例:
  22929. * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
  22930. * var value = "(以iServer为例,这里是申请的token值)";
  22931. * var name = "token";
  22932. * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
  22933. * Credential.CREDENTIAL = new Credential(value, name);
  22934. *
  22935. */
  22936. Credential.CREDENTIAL = null;
  22937. ;// CONCATENATED MODULE: ./src/common/commontypes/Date.js
  22938. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  22939. * This program are made available under the terms of the Apache License, Version 2.0
  22940. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22941. /**
  22942. * @name Date
  22943. * @namespace
  22944. * @category BaseTypes Util
  22945. * @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
  22946. * @private
  22947. */
  22948. var DateExt = {
  22949. /**
  22950. * @description 生成代表一个具体的日期字符串,该日期遵循 ISO 8601 标准(详情查看{@link http://tools.ietf.org/html/rfc3339})。
  22951. * @example
  22952. * var dateString = DateExt.toISOString(new Date());
  22953. * @param {Date} date - 日期对象。
  22954. * @returns {string} 一个代表日期的字符串。(例如 "2010-08-07T16:58:23.123Z")。
  22955. */
  22956. toISOString: function () {
  22957. //标准的Date会存在toISOString方法,可以直接调用
  22958. if ("toISOString" in Date.prototype) {
  22959. return function (date) {
  22960. return date.toISOString();
  22961. };
  22962. } else {
  22963. // 部分浏览器没有,就得自己组合,组合后的字符串规则不变
  22964. var pad = function pad(num, len) {
  22965. var str = num + "";
  22966. while (str.length < len) {
  22967. str = "0" + str;
  22968. }
  22969. return str;
  22970. };
  22971. return function (date) {
  22972. var str;
  22973. if (isNaN(date.getTime())) {
  22974. // ECMA-262 says throw RangeError, Firefox returns
  22975. // "Invalid Date"
  22976. str = "Invalid Date";
  22977. } else {
  22978. 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";
  22979. }
  22980. return str;
  22981. };
  22982. }
  22983. }(),
  22984. /**
  22985. * @description 从一个字符串生成一个日期对象。
  22986. * @example
  22987. * var date = DateExt.parse("2010-08-07");
  22988. * @param {string} str - 日期的字符串。(例如: "2010", "2010-08", "2010-08-07", "2010-08-07T16:58:23.123Z","2010-08-07T11:58:23.123-06")。
  22989. * @returns {Date} 日期对象,如果字符串无法被解析,则返回一个无效的日期。(例如 isNaN(date.getTime()))。
  22990. */
  22991. parse: function parse(str) {
  22992. var date;
  22993. 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)?$/);
  22994. if (match && (match[1] || match[7])) {
  22995. // must have at least year or time
  22996. var year = parseInt(match[1], 10) || 0;
  22997. var month = parseInt(match[2], 10) - 1 || 0;
  22998. var day = parseInt(match[3], 10) || 1;
  22999. date = new Date(Date.UTC(year, month, day));
  23000. // optional time
  23001. var type = match[7];
  23002. if (type) {
  23003. var hours = parseInt(match[4], 10);
  23004. var minutes = parseInt(match[5], 10);
  23005. var secFrac = parseFloat(match[6]);
  23006. var seconds = secFrac | 0;
  23007. var milliseconds = Math.round(1000 * (secFrac - seconds));
  23008. date.setUTCHours(hours, minutes, seconds, milliseconds);
  23009. // check offset
  23010. if (type !== "Z") {
  23011. var hoursOffset = parseInt(type, 10);
  23012. var minutesOffset = parseInt(match[8], 10) || 0;
  23013. var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
  23014. date = new Date(date.getTime() + offset);
  23015. }
  23016. }
  23017. } else {
  23018. date = new Date("invalid");
  23019. }
  23020. return date;
  23021. }
  23022. };
  23023. ;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
  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. * @name Event
  23029. * @namespace
  23030. * @category BaseTypes Events
  23031. * @description 事件处理函数.
  23032. * @usage
  23033. * ```
  23034. * // 浏览器
  23035. * <script type="text/javascript" src="{cdn}"></script>
  23036. * <script>
  23037. * const element = {namespace}.Event.element();
  23038. *
  23039. * // 弃用的写法
  23040. * const result = SuperMap.Event.element();
  23041. *
  23042. * </script>
  23043. *
  23044. * // ES6 Import
  23045. * import { Event } from '{npm}';
  23046. *
  23047. * const result = Event.element();
  23048. * ```
  23049. */
  23050. var Event = {
  23051. /**
  23052. * @description 事件观察者列表。
  23053. * @type {Object}
  23054. * @default false
  23055. */
  23056. observers: false,
  23057. /**
  23058. * @description KEY_SPACE
  23059. * @type {number}
  23060. * @default 32
  23061. */
  23062. KEY_SPACE: 32,
  23063. /**
  23064. * @description KEY_BACKSPACE
  23065. * @type {number}
  23066. * @default 8
  23067. */
  23068. KEY_BACKSPACE: 8,
  23069. /**
  23070. * @description KEY_TAB
  23071. * @type {number}
  23072. * @default 9
  23073. */
  23074. KEY_TAB: 9,
  23075. /**
  23076. * @description KEY_RETURN
  23077. * @type {number}
  23078. * @default 13
  23079. */
  23080. KEY_RETURN: 13,
  23081. /**
  23082. * @description KEY_ESC
  23083. * @type {number}
  23084. * @default 27
  23085. */
  23086. KEY_ESC: 27,
  23087. /**
  23088. * @description KEY_LEFT
  23089. * @type {number}
  23090. * @default 37
  23091. */
  23092. KEY_LEFT: 37,
  23093. /**
  23094. * @description KEY_UP
  23095. * @type {number}
  23096. * @default 38
  23097. */
  23098. KEY_UP: 38,
  23099. /**
  23100. * @description KEY_RIGHT
  23101. * @type {number}
  23102. * @default 39
  23103. */
  23104. KEY_RIGHT: 39,
  23105. /**
  23106. * @description KEY_DOWN
  23107. * @type {number}
  23108. * @default 40
  23109. */
  23110. KEY_DOWN: 40,
  23111. /**
  23112. * @description KEY_DELETE
  23113. * @type {number}
  23114. * @default 46
  23115. */
  23116. KEY_DELETE: 46,
  23117. /**
  23118. * @description 监听浏览器 DOM 事件。
  23119. * @param {Event} event - Event 对象。
  23120. * @returns {HTMLElement} 触发事件的 DOM 元素。
  23121. */
  23122. element: function element(event) {
  23123. return event.target || event.srcElement;
  23124. },
  23125. /**
  23126. * @description 判断事件是否由单次触摸引起。
  23127. * @param {Event} event - Event 对象。
  23128. * @returns {boolean} 是否有且只有一个当前在与触摸表面接触的 Touch 对象。
  23129. */
  23130. isSingleTouch: function isSingleTouch(event) {
  23131. return event.touches && event.touches.length === 1;
  23132. },
  23133. /**
  23134. * @description 判断事件是否由多点触控引起。
  23135. * @param {Event} event - Event 对象。
  23136. * @returns {boolean} 是否存在多个当前在与触摸表面接触的 Touch 对象。
  23137. */
  23138. isMultiTouch: function isMultiTouch(event) {
  23139. return event.touches && event.touches.length > 1;
  23140. },
  23141. /**
  23142. * @description 确定事件是否由左键单击引起。
  23143. * @param {Event} event - Event 对象。
  23144. * @returns {boolean} 是否点击鼠标左键。
  23145. */
  23146. isLeftClick: function isLeftClick(event) {
  23147. return event.which && event.which === 1 || event.button && event.button === 1;
  23148. },
  23149. /**
  23150. * @description 确定事件是否由鼠标右键单击引起。
  23151. * @param {Event} event - Event 对象。
  23152. * @returns {boolean} 是否点击鼠标右键。
  23153. */
  23154. isRightClick: function isRightClick(event) {
  23155. return event.which && event.which === 3 || event.button && event.button === 2;
  23156. },
  23157. /**
  23158. * @description 阻止事件冒泡。
  23159. * @param {Event} event - Event 对象。
  23160. * @param {boolean} allowDefault - 默认为 false,表示阻止事件的默认行为。
  23161. */
  23162. stop: function stop(event, allowDefault) {
  23163. if (!allowDefault) {
  23164. if (event.preventDefault) {
  23165. event.preventDefault();
  23166. } else {
  23167. event.returnValue = false;
  23168. }
  23169. }
  23170. if (event.stopPropagation) {
  23171. event.stopPropagation();
  23172. } else {
  23173. event.cancelBubble = true;
  23174. }
  23175. },
  23176. /**
  23177. * @description 查询触发指定事件的 DOM 元素。
  23178. * @param {Event} event - Event 对象。
  23179. * @param {string} tagName - html 标签名。
  23180. * @returns {HTMLElement} DOM 元素。
  23181. */
  23182. findElement: function findElement(event, tagName) {
  23183. var element = Event.element(event);
  23184. while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
  23185. element = element.parentNode;
  23186. }
  23187. return element;
  23188. },
  23189. /**
  23190. * @description 监听事件,注册事件处理方法。
  23191. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  23192. * @param {string} name - 监听事件的类别名称。
  23193. * @param {function} observer - 注册的事件处理方法。
  23194. * @param {boolean} [useCapture=false] - 是否捕获。
  23195. */
  23196. observe: function observe(elementParam, name, observer, useCapture) {
  23197. var element = Util_Util.getElement(elementParam);
  23198. useCapture = useCapture || false;
  23199. if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
  23200. name = 'keydown';
  23201. }
  23202. //if observers cache has not yet been created, create it
  23203. if (!this.observers) {
  23204. this.observers = {};
  23205. }
  23206. //if not already assigned, make a new unique cache ID
  23207. if (!element._eventCacheID) {
  23208. var idPrefix = "eventCacheID_";
  23209. if (element.id) {
  23210. idPrefix = element.id + "_" + idPrefix;
  23211. }
  23212. element._eventCacheID = Util_Util.createUniqueID(idPrefix);
  23213. }
  23214. var cacheID = element._eventCacheID;
  23215. //if there is not yet a hash entry for this element, add one
  23216. if (!this.observers[cacheID]) {
  23217. this.observers[cacheID] = [];
  23218. }
  23219. //add a new observer to this element's list
  23220. this.observers[cacheID].push({
  23221. 'element': element,
  23222. 'name': name,
  23223. 'observer': observer,
  23224. 'useCapture': useCapture
  23225. });
  23226. //add the actual browser event listener
  23227. if (element.addEventListener) {
  23228. if (name === 'mousewheel') {
  23229. // https://www.chromestatus.com/features/6662647093133312
  23230. element.addEventListener(name, observer, {
  23231. useCapture: useCapture,
  23232. passive: false
  23233. });
  23234. } else {
  23235. element.addEventListener(name, observer, useCapture);
  23236. }
  23237. } else if (element.attachEvent) {
  23238. element.attachEvent('on' + name, observer);
  23239. }
  23240. },
  23241. /**
  23242. * @description 移除给定 DOM 元素的监听事件。
  23243. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  23244. */
  23245. stopObservingElement: function stopObservingElement(elementParam) {
  23246. var element = Util_Util.getElement(elementParam);
  23247. var cacheID = element._eventCacheID;
  23248. this._removeElementObservers(Event.observers[cacheID]);
  23249. },
  23250. _removeElementObservers: function _removeElementObservers(elementObservers) {
  23251. if (elementObservers) {
  23252. for (var i = elementObservers.length - 1; i >= 0; i--) {
  23253. var entry = elementObservers[i];
  23254. var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
  23255. Event.stopObserving.apply(this, args);
  23256. }
  23257. }
  23258. },
  23259. /**
  23260. * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时保持一致才能确保事件移除成功。
  23261. * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
  23262. * @param {string} name - 需要移除的被监听事件名称。
  23263. * @param {function} observer - 需要移除的事件处理方法。
  23264. * @param {boolean} [useCapture=false] - 是否捕获。
  23265. * @returns {boolean} 监听事件是否被移除。
  23266. */
  23267. stopObserving: function stopObserving(elementParam, name, observer, useCapture) {
  23268. useCapture = useCapture || false;
  23269. var element = Util_Util.getElement(elementParam);
  23270. var cacheID = element._eventCacheID;
  23271. if (name === 'keypress') {
  23272. if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) {
  23273. name = 'keydown';
  23274. }
  23275. }
  23276. // find element's entry in this.observers cache and remove it
  23277. var foundEntry = false;
  23278. var elementObservers = Event.observers[cacheID];
  23279. if (elementObservers) {
  23280. // find the specific event type in the element's list
  23281. var i = 0;
  23282. while (!foundEntry && i < elementObservers.length) {
  23283. var cacheEntry = elementObservers[i];
  23284. if (cacheEntry.name === name && cacheEntry.observer === observer && cacheEntry.useCapture === useCapture) {
  23285. elementObservers.splice(i, 1);
  23286. if (elementObservers.length == 0) {
  23287. delete Event.observers[cacheID];
  23288. }
  23289. foundEntry = true;
  23290. break;
  23291. }
  23292. i++;
  23293. }
  23294. }
  23295. //actually remove the event listener from browser
  23296. if (foundEntry) {
  23297. if (element.removeEventListener) {
  23298. element.removeEventListener(name, observer, useCapture);
  23299. } else if (element && element.detachEvent) {
  23300. element.detachEvent('on' + name, observer);
  23301. }
  23302. }
  23303. return foundEntry;
  23304. },
  23305. /**
  23306. * @description 移除缓存中的监听事件。
  23307. */
  23308. unloadCache: function unloadCache() {
  23309. // check for Event before checking for observers, because
  23310. // Event may be undefined in IE if no map instance was
  23311. // created
  23312. if (Event && Event.observers) {
  23313. for (var cacheID in Event.observers) {
  23314. var elementObservers = Event.observers[cacheID];
  23315. Event._removeElementObservers.apply(this, [elementObservers]);
  23316. }
  23317. Event.observers = false;
  23318. }
  23319. },
  23320. CLASS_NAME: "SuperMap.Event"
  23321. };
  23322. /* prevent memory leaks in IE */
  23323. Event.observe(window, 'resize', Event.unloadCache, false);
  23324. ;// CONCATENATED MODULE: ./src/common/commontypes/Events.js
  23325. 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); }
  23326. function Events_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23327. 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); } }
  23328. 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; }
  23329. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23330. * This program are made available under the terms of the Apache License, Version 2.0
  23331. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23332. /**
  23333. * @class Events
  23334. * @deprecatedclass SuperMap.Events
  23335. * @classdesc 事件类。
  23336. * @category BaseTypes Events
  23337. * @param {Object} object - 当前事件对象被添加到的 JS 对象。
  23338. * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
  23339. * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
  23340. * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  23341. * @param {Object} options - 事件对象选项。
  23342. * @usage
  23343. */
  23344. var Events = /*#__PURE__*/function () {
  23345. function Events(object, element, eventTypes, fallThrough, options) {
  23346. Events_classCallCheck(this, Events);
  23347. /**
  23348. * @member {Array.<string>} Events.prototype.BROWSER_EVENTS
  23349. * @description 支持的事件。
  23350. * @constant
  23351. * @default [
  23352. "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
  23353. "click", "dblclick", "rightclick", "dblrightclick","resize",
  23354. "focus", "blur","touchstart", "touchmove", "touchend","keydown",
  23355. "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  23356. "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
  23357. ]
  23358. */
  23359. 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"];
  23360. /**
  23361. * @member {Object} Events.prototype.listeners
  23362. * @description 事件监听器函数。
  23363. */
  23364. this.listeners = {};
  23365. /**
  23366. * @member {Object} Events.prototype.object
  23367. * @description 发布应用程序事件的对象。
  23368. */
  23369. this.object = object;
  23370. /**
  23371. * @member {HTMLElement} Events.prototype.element
  23372. * @description 接受浏览器事件的 DOM 节点。
  23373. */
  23374. this.element = null;
  23375. /**
  23376. * @member {Array.<string>} Events.prototype.eventTypes
  23377. * @description 支持的事件类型列表。
  23378. */
  23379. this.eventTypes = [];
  23380. /**
  23381. * @member {function} Events.prototype.eventHandler
  23382. * @description 绑定在元素上的事件处理器对象。
  23383. */
  23384. this.eventHandler = null;
  23385. /**
  23386. * @member {boolean} [Events.prototype.fallThrough=false]
  23387. * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  23388. */
  23389. this.fallThrough = fallThrough;
  23390. /**
  23391. * @member {boolean} [Events.prototype.includeXY=false]
  23392. * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
  23393. * @example
  23394. * function named(evt) {
  23395. * this.xy = this.object.events.getMousePosition(evt);
  23396. * }
  23397. */
  23398. this.includeXY = false;
  23399. /**
  23400. * @member {Object} Events.prototype.extensions
  23401. * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
  23402. */
  23403. this.extensions = {};
  23404. /**
  23405. * @member {Object} Events.prototype.extensionCount
  23406. * @description 事件扩展数量。
  23407. */
  23408. this.extensionCount = {};
  23409. /**
  23410. * @member {Object} Events.prototype.clearMouseListener
  23411. * @description 待移除的鼠标监听事件。
  23412. */
  23413. this.clearMouseListener = null;
  23414. Util_Util.extend(this, options);
  23415. if (eventTypes != null) {
  23416. for (var i = 0, len = eventTypes.length; i < len; i++) {
  23417. this.addEventType(eventTypes[i]);
  23418. }
  23419. }
  23420. if (element != null) {
  23421. this.attachToElement(element);
  23422. }
  23423. this.CLASS_NAME = "SuperMap.Events";
  23424. }
  23425. /**
  23426. * @function Events.prototype.destroy
  23427. * @description 移除当前要素 element 上的所有事件监听和处理。
  23428. */
  23429. Events_createClass(Events, [{
  23430. key: "destroy",
  23431. value: function destroy() {
  23432. for (var e in this.extensions) {
  23433. if (typeof this.extensions[e] !== "boolean") {
  23434. this.extensions[e].destroy();
  23435. }
  23436. }
  23437. this.extensions = null;
  23438. if (this.element) {
  23439. Event.stopObservingElement(this.element);
  23440. if (this.element.hasScrollEvent) {
  23441. Event.stopObserving(window, "scroll", this.clearMouseListener);
  23442. }
  23443. }
  23444. this.element = null;
  23445. this.listeners = null;
  23446. this.object = null;
  23447. this.eventTypes = null;
  23448. this.fallThrough = null;
  23449. this.eventHandler = null;
  23450. }
  23451. /**
  23452. * @function Events.prototype.addEventType
  23453. * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
  23454. * @param {string} eventName - 事件名。
  23455. */
  23456. }, {
  23457. key: "addEventType",
  23458. value: function addEventType(eventName) {
  23459. if (!this.listeners[eventName]) {
  23460. this.eventTypes.push(eventName);
  23461. this.listeners[eventName] = [];
  23462. }
  23463. }
  23464. /**
  23465. * @function Events.prototype.attachToElement
  23466. * @description 给 DOM 元素绑定浏览器事件。
  23467. * @param {HTMLElement} element - 绑定浏览器事件的 DOM 元素。
  23468. */
  23469. }, {
  23470. key: "attachToElement",
  23471. value: function attachToElement(element) {
  23472. if (this.element) {
  23473. Event.stopObservingElement(this.element);
  23474. } else {
  23475. // keep a bound copy of handleBrowserEvent() so that we can
  23476. // pass the same function to both Event.observe() and .stopObserving()
  23477. this.eventHandler = FunctionExt.bindAsEventListener(this.handleBrowserEvent, this);
  23478. // to be used with observe and stopObserving
  23479. this.clearMouseListener = FunctionExt.bind(this.clearMouseCache, this);
  23480. }
  23481. this.element = element;
  23482. for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
  23483. var eventType = this.BROWSER_EVENTS[i];
  23484. // every browser event has a corresponding application event
  23485. // (whether it's listened for or not).
  23486. this.addEventType(eventType);
  23487. // use Prototype to register the event cross-browser
  23488. Event.observe(element, eventType, this.eventHandler);
  23489. }
  23490. // disable dragstart in IE so that mousedown/move/up works normally
  23491. Event.observe(element, "dragstart", Event.stop);
  23492. }
  23493. /**
  23494. * @function Events.prototype.on
  23495. * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
  23496. * @example
  23497. * // 注册一个 "loadstart" 监听事件
  23498. * events.on({"loadstart": loadStartListener});
  23499. *
  23500. * // 同样注册一个 "loadstart" 监听事件
  23501. * events.register("loadstart", undefined, loadStartListener);
  23502. *
  23503. * // 同时为对象注册多个监听事件
  23504. * events.on({
  23505. * "loadstart": loadStartListener,
  23506. * "loadend": loadEndListener,
  23507. * scope: object
  23508. * });
  23509. *
  23510. * // 同时为对象注册多个监听事件,多次调用 register 方法
  23511. * events.register("loadstart", object, loadStartListener);
  23512. * events.register("loadend", object, loadEndListener);
  23513. *
  23514. *
  23515. * @param {Object} object - 添加监听的对象。
  23516. */
  23517. }, {
  23518. key: "on",
  23519. value: function on(object) {
  23520. for (var type in object) {
  23521. if (type !== "scope" && object.hasOwnProperty(type)) {
  23522. this.register(type, object.scope, object[type]);
  23523. }
  23524. }
  23525. }
  23526. /**
  23527. * @function Events.prototype.register
  23528. * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
  23529. * 指定 Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
  23530. * @param {string} type - 事件注册者的名字。
  23531. * @param {Object} [obj=this.object] - 对象绑定的回调。
  23532. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  23533. * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
  23534. */
  23535. }, {
  23536. key: "register",
  23537. value: function register(type, obj, func, priority) {
  23538. if (type in Events && !this.extensions[type]) {
  23539. this.extensions[type] = new Events[type](this);
  23540. }
  23541. if (func != null && Util_Util.indexOf(this.eventTypes, type) !== -1) {
  23542. if (obj == null) {
  23543. obj = this.object;
  23544. }
  23545. var listeners = this.listeners[type];
  23546. if (!listeners) {
  23547. listeners = [];
  23548. this.listeners[type] = listeners;
  23549. this.extensionCount[type] = 0;
  23550. }
  23551. var listener = {
  23552. obj: obj,
  23553. func: func
  23554. };
  23555. if (priority) {
  23556. listeners.splice(this.extensionCount[type], 0, listener);
  23557. if (Events_typeof(priority) === "object" && priority.extension) {
  23558. this.extensionCount[type]++;
  23559. }
  23560. } else {
  23561. listeners.push(listener);
  23562. }
  23563. }
  23564. }
  23565. /**
  23566. * @function Events.prototype.registerPriority
  23567. * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
  23568. * @param {string} type - 事件注册者的名字。
  23569. * @param {Object} [obj=this.object] - 对象绑定的回调。
  23570. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  23571. */
  23572. }, {
  23573. key: "registerPriority",
  23574. value: function registerPriority(type, obj, func) {
  23575. this.register(type, obj, func, true);
  23576. }
  23577. /**
  23578. * @function Events.prototype.un
  23579. * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
  23580. * @example
  23581. * // 移除 "loadstart" 事件监听
  23582. * events.un({"loadstart": loadStartListener});
  23583. *
  23584. * // 使用 "unregister" 方法移除 "loadstart" 事件监听
  23585. * events.unregister("loadstart", undefined, loadStartListener);
  23586. *
  23587. * // 取消对象多个事件监听
  23588. * events.un({
  23589. * "loadstart": loadStartListener,
  23590. * "loadend": loadEndListener,
  23591. * scope: object
  23592. * });
  23593. *
  23594. * // 取消对象多个事件监听,多次调用unregister方法。
  23595. * events.unregister("loadstart", object, loadStartListener);
  23596. * events.unregister("loadend", object, loadEndListener);
  23597. *
  23598. * @param {Object} object - 移除监听的对象。
  23599. */
  23600. }, {
  23601. key: "un",
  23602. value: function un(object) {
  23603. for (var type in object) {
  23604. if (type !== "scope" && object.hasOwnProperty(type)) {
  23605. this.unregister(type, object.scope, object[type]);
  23606. }
  23607. }
  23608. }
  23609. /**
  23610. * @function Events.prototype.unregister
  23611. * @description 取消注册。
  23612. * @param {string} type - 事件类型。
  23613. * @param {Object} [obj=this.object] - 对象绑定的回调。
  23614. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  23615. */
  23616. }, {
  23617. key: "unregister",
  23618. value: function unregister(type, obj, func) {
  23619. if (obj == null) {
  23620. obj = this.object;
  23621. }
  23622. var listeners = this.listeners[type];
  23623. if (listeners != null) {
  23624. for (var i = 0, len = listeners.length; i < len; i++) {
  23625. if (listeners[i].obj === obj && listeners[i].func === func) {
  23626. listeners.splice(i, 1);
  23627. break;
  23628. }
  23629. }
  23630. }
  23631. }
  23632. /**
  23633. * @function Events.prototype.remove
  23634. * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
  23635. * @param {string} type - 事件类型。
  23636. */
  23637. }, {
  23638. key: "remove",
  23639. value: function remove(type) {
  23640. if (this.listeners[type] != null) {
  23641. this.listeners[type] = [];
  23642. }
  23643. }
  23644. /**
  23645. * @function Events.prototype.triggerEvent
  23646. * @description 触发一个特定的注册事件。
  23647. * @param {string} type - 触发事件类型。
  23648. * @param {Event} evt - 事件对象。
  23649. * @returns {Event|boolean} 监听对象,如果返回是 false,则停止监听。
  23650. */
  23651. }, {
  23652. key: "triggerEvent",
  23653. value: function triggerEvent(type, evt) {
  23654. var listeners = this.listeners[type];
  23655. // fast path
  23656. if (!listeners || listeners.length == 0) {
  23657. return undefined;
  23658. }
  23659. // prep evt object with object & div references
  23660. if (evt == null) {
  23661. evt = {};
  23662. }
  23663. evt.object = this.object;
  23664. evt.element = this.element;
  23665. if (!evt.type) {
  23666. evt.type = type;
  23667. }
  23668. // execute all callbacks registered for specified type
  23669. // get a clone of the listeners array to
  23670. // allow for splicing during callbacks
  23671. listeners = listeners.slice();
  23672. var continueChain;
  23673. for (var i = 0, len = listeners.length; i < len; i++) {
  23674. var callback = listeners[i];
  23675. // bind the context to callback.obj
  23676. continueChain = callback.func.apply(callback.obj, [evt]);
  23677. if (continueChain != undefined && continueChain === false) {
  23678. // if callback returns false, execute no more callbacks.
  23679. break;
  23680. }
  23681. }
  23682. // don't fall through to other DOM elements
  23683. if (!this.fallThrough) {
  23684. Event.stop(evt, true);
  23685. }
  23686. return continueChain;
  23687. }
  23688. /**
  23689. * @function Events.prototype.handleBrowserEvent
  23690. * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
  23691. * @param {Event} evt - 事件对象。
  23692. */
  23693. }, {
  23694. key: "handleBrowserEvent",
  23695. value: function handleBrowserEvent(evt) {
  23696. var type = evt.type,
  23697. listeners = this.listeners[type];
  23698. if (!listeners || listeners.length == 0) {
  23699. // noone's listening, bail out
  23700. return;
  23701. }
  23702. // add clientX & clientY to all events - corresponds to average x, y
  23703. var touches = evt.touches;
  23704. if (touches && touches[0]) {
  23705. var x = 0;
  23706. var y = 0;
  23707. var num = touches.length;
  23708. var touch;
  23709. for (var i = 0; i < num; ++i) {
  23710. touch = touches[i];
  23711. x += touch.clientX;
  23712. y += touch.clientY;
  23713. }
  23714. evt.clientX = x / num;
  23715. evt.clientY = y / num;
  23716. }
  23717. if (this.includeXY) {
  23718. evt.xy = this.getMousePosition(evt);
  23719. }
  23720. this.triggerEvent(type, evt);
  23721. }
  23722. /**
  23723. * @function Events.prototype.clearMouseCache
  23724. * @description 清除鼠标缓存。
  23725. */
  23726. }, {
  23727. key: "clearMouseCache",
  23728. value: function clearMouseCache() {
  23729. this.element.scrolls = null;
  23730. this.element.lefttop = null;
  23731. var body = document.body;
  23732. if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) && navigator.userAgent.match(/iPhone/i))) {
  23733. this.element.offsets = null;
  23734. }
  23735. }
  23736. /**
  23737. * @function Events.prototype.getMousePosition
  23738. * @description 获取当前鼠标的位置。
  23739. * @param {Event} evt - 事件对象。
  23740. * @returns {Pixel} 当前的鼠标的 xy 坐标点。
  23741. */
  23742. }, {
  23743. key: "getMousePosition",
  23744. value: function getMousePosition(evt) {
  23745. if (!this.includeXY) {
  23746. this.clearMouseCache();
  23747. } else if (!this.element.hasScrollEvent) {
  23748. Event.observe(window, "scroll", this.clearMouseListener);
  23749. this.element.hasScrollEvent = true;
  23750. }
  23751. if (!this.element.scrolls) {
  23752. var viewportElement = Util_Util.getViewportElement();
  23753. this.element.scrolls = [viewportElement.scrollLeft, viewportElement.scrollTop];
  23754. }
  23755. if (!this.element.lefttop) {
  23756. this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0];
  23757. }
  23758. if (!this.element.offsets) {
  23759. this.element.offsets = Util_Util.pagePosition(this.element);
  23760. }
  23761. 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]);
  23762. }
  23763. }]);
  23764. return Events;
  23765. }();
  23766. 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"];
  23767. ;// CONCATENATED MODULE: ./src/common/commontypes/Feature.js
  23768. function Feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23769. 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); } }
  23770. 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; }
  23771. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23772. * This program are made available under the terms of the Apache License, Version 2.0
  23773. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23774. /**
  23775. * @class Feature
  23776. * @deprecatedclass SuperMap.Feature
  23777. * @category BaseTypes Geometry
  23778. * @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
  23779. * @param {SuperMap.Layer} layer - 图层。
  23780. * @param {LonLat} lonlat - 经纬度。
  23781. * @param {Object} data - 数据对象。
  23782. * @usage
  23783. */
  23784. var Feature_Feature = /*#__PURE__*/function () {
  23785. function Feature(layer, lonlat, data) {
  23786. Feature_classCallCheck(this, Feature);
  23787. this.CLASS_NAME = "SuperMap.Feature";
  23788. /**
  23789. * @deprecated
  23790. * @member {SuperMap.Layer} Feature.prototype.layer
  23791. * @description 图层。
  23792. */
  23793. this.layer = layer;
  23794. /**
  23795. * @member {string} Feature.prototype.id
  23796. * @description 要素 ID。
  23797. */
  23798. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  23799. /**
  23800. * @member {LonLat} Feature.prototype.lonlat
  23801. * @description 经纬度。
  23802. *
  23803. */
  23804. this.lonlat = lonlat;
  23805. /**
  23806. * @member {Object} Feature.prototype.data
  23807. * @description 数据对象。
  23808. */
  23809. this.data = data != null ? data : {};
  23810. }
  23811. /**
  23812. * @function Feature.prototype.destroy
  23813. * @description 释放相关资源。
  23814. */
  23815. Feature_createClass(Feature, [{
  23816. key: "destroy",
  23817. value: function destroy() {
  23818. this.id = null;
  23819. this.lonlat = null;
  23820. this.data = null;
  23821. }
  23822. }]);
  23823. return Feature;
  23824. }();
  23825. ;// CONCATENATED MODULE: ./src/common/commontypes/Vector.js
  23826. 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); }
  23827. function Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23828. 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); } }
  23829. 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; }
  23830. 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); }
  23831. function Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  23832. 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); }
  23833. 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); }
  23834. 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); }; }
  23835. 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); }
  23836. function Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23837. 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; } }
  23838. function Vector_getPrototypeOf(o) { Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Vector_getPrototypeOf(o); }
  23839. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  23840. * This program are made available under the terms of the Apache License, Version 2.0
  23841. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23842. /**
  23843. * @class FeatureVector
  23844. * @aliasclass Feature.Vector
  23845. * @deprecatedclass SuperMap.Feature.Vector
  23846. * @category BaseTypes Geometry
  23847. * @classdesc 矢量要素类。该类具有 Geometry 属性存放几何信息,
  23848. * attributes 属性存放非几何信息,另外还包含了 style 属性,用来定义矢量要素的样式,
  23849. * 其中,默认的样式在 {@link FeatureVector.style} 类中定义,如果没有特别的指定将使用默认的样式。
  23850. * @extends {Feature}
  23851. * @param {Geometry} geometry - 要素的几何信息。
  23852. * @param {Object} [attributes] - 描述要素的任意的可序列化属性,将要映射到 attributes 属性中的对象。
  23853. * @param {Object} [style] - 样式对象。
  23854. * @example
  23855. * var geometry = new GeometryPoint(-115,10);
  23856. * var style = {
  23857. * strokeColor:"#339933",
  23858. * strokeOpacity:1,
  23859. * strokeWidth:3,
  23860. * pointRadius:6
  23861. * }
  23862. * var pointFeature = new FeatureVector(geometry,null,style);
  23863. * vectorLayer.addFeatures(pointFeature);
  23864. * @usage
  23865. */
  23866. // TRASH THIS
  23867. var State = {
  23868. /** states */
  23869. UNKNOWN: 'Unknown',
  23870. INSERT: 'Insert',
  23871. UPDATE: 'Update',
  23872. DELETE: 'Delete'
  23873. };
  23874. var Vector = /*#__PURE__*/function (_Feature) {
  23875. Vector_inherits(Vector, _Feature);
  23876. var _super = Vector_createSuper(Vector);
  23877. function Vector(geometry, attributes, style) {
  23878. var _this;
  23879. Vector_classCallCheck(this, Vector);
  23880. _this = _super.call(this, null, null, attributes);
  23881. /**
  23882. * @member {string} FeatureVector.prototype.fid
  23883. * @description fid。
  23884. */
  23885. _this.fid = null;
  23886. /**
  23887. * @member {Geometry} FeatureVector.prototype.geometry
  23888. * @description 存放几何信息。
  23889. */
  23890. _this.geometry = geometry ? geometry : null;
  23891. /**
  23892. * @member {Object} FeatureVector.prototype.attributes
  23893. * @description 描述要素的任意的可序列化属性。
  23894. */
  23895. _this.attributes = {};
  23896. if (attributes) {
  23897. _this.attributes = Util_Util.extend(_this.attributes, attributes);
  23898. }
  23899. /**
  23900. * @member {Bounds} FeatureVector.prototype.bounds
  23901. * @description 限制要素几何的边界。
  23902. */
  23903. _this.bounds = null;
  23904. /**
  23905. * @member {string} FeatureVector.prototype.state
  23906. * @description state。
  23907. */
  23908. _this.state = null;
  23909. /**
  23910. * @member {Object} FeatureVector.prototype.style
  23911. * @description 要素的样式属性,地图查询返回的 feature 的 style,8C 变为null。
  23912. */
  23913. _this.style = style ? style : null;
  23914. /**
  23915. * @member {string} FeatureVector.prototype.url
  23916. * @description 如果设置了这个属性,在更新或者删除要素时需要考虑 {@link HTTP} 。
  23917. */
  23918. _this.url = null;
  23919. _this.lonlat = null;
  23920. _this.CLASS_NAME = "SuperMap.Feature.Vector";
  23921. Vector.style = {
  23922. 'default': {
  23923. fillColor: "#ee9900",
  23924. fillOpacity: 0.4,
  23925. hoverFillColor: "white",
  23926. hoverFillOpacity: 0.8,
  23927. strokeColor: "#ee9900",
  23928. strokeOpacity: 1,
  23929. strokeWidth: 1,
  23930. strokeLinecap: "round",
  23931. strokeDashstyle: "solid",
  23932. hoverStrokeColor: "red",
  23933. hoverStrokeOpacity: 1,
  23934. hoverStrokeWidth: 0.2,
  23935. pointRadius: 6,
  23936. hoverPointRadius: 1,
  23937. hoverPointUnit: "%",
  23938. pointerEvents: "visiblePainted",
  23939. cursor: "inherit",
  23940. fontColor: "#000000",
  23941. labelAlign: "cm",
  23942. labelOutlineColor: "white",
  23943. labelOutlineWidth: 3
  23944. },
  23945. 'select': {
  23946. fillColor: "blue",
  23947. fillOpacity: 0.4,
  23948. hoverFillColor: "white",
  23949. hoverFillOpacity: 0.8,
  23950. strokeColor: "blue",
  23951. strokeOpacity: 1,
  23952. strokeWidth: 2,
  23953. strokeLinecap: "round",
  23954. strokeDashstyle: "solid",
  23955. hoverStrokeColor: "red",
  23956. hoverStrokeOpacity: 1,
  23957. hoverStrokeWidth: 0.2,
  23958. pointRadius: 6,
  23959. hoverPointRadius: 1,
  23960. hoverPointUnit: "%",
  23961. pointerEvents: "visiblePainted",
  23962. cursor: "pointer",
  23963. fontColor: "#000000",
  23964. labelAlign: "cm",
  23965. labelOutlineColor: "white",
  23966. labelOutlineWidth: 3
  23967. },
  23968. 'temporary': {
  23969. fillColor: "#66cccc",
  23970. fillOpacity: 0.2,
  23971. hoverFillColor: "white",
  23972. hoverFillOpacity: 0.8,
  23973. strokeColor: "#66cccc",
  23974. strokeOpacity: 1,
  23975. strokeLinecap: "round",
  23976. strokeWidth: 2,
  23977. strokeDashstyle: "solid",
  23978. hoverStrokeColor: "red",
  23979. hoverStrokeOpacity: 1,
  23980. hoverStrokeWidth: 0.2,
  23981. pointRadius: 6,
  23982. hoverPointRadius: 1,
  23983. hoverPointUnit: "%",
  23984. pointerEvents: "visiblePainted",
  23985. //cursor:"inherit",
  23986. cursor: "default",
  23987. fontColor: "#000000",
  23988. labelAlign: "cm",
  23989. labelOutlineColor: "white",
  23990. labelOutlineWidth: 3
  23991. },
  23992. 'delete': {
  23993. display: "none"
  23994. }
  23995. };
  23996. return _this;
  23997. }
  23998. /**
  23999. * @function FeatureVector.prototype.destroy
  24000. * @description 释放资源,将引用资源的属性置空。
  24001. */
  24002. Vector_createClass(Vector, [{
  24003. key: "destroy",
  24004. value: function destroy() {
  24005. if (this.layer) {
  24006. this.layer.removeFeatures(this);
  24007. this.layer = null;
  24008. }
  24009. this.geometry = null;
  24010. Vector_get(Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  24011. }
  24012. /**
  24013. * @function FeatureVector.prototype.clone
  24014. * @description 复制矢量要素,并返回复制后的新对象。
  24015. * @returns {FeatureVector} 相同要素的新的矢量要素。
  24016. */
  24017. }, {
  24018. key: "clone",
  24019. value: function clone() {
  24020. return new Vector(this.geometry ? this.geometry.clone() : null, this.attributes, this.style);
  24021. }
  24022. /**
  24023. * @function FeatureVector.prototype.toState
  24024. * @description 设置新状态。
  24025. * @param {string} state - 状态。
  24026. */
  24027. }, {
  24028. key: "toState",
  24029. value: function toState(state) {
  24030. if (state === State.UPDATE) {
  24031. switch (this.state) {
  24032. case State.UNKNOWN:
  24033. case State.DELETE:
  24034. this.state = state;
  24035. break;
  24036. case State.UPDATE:
  24037. case State.INSERT:
  24038. break;
  24039. }
  24040. } else if (state === State.INSERT) {
  24041. switch (this.state) {
  24042. case State.UNKNOWN:
  24043. break;
  24044. default:
  24045. this.state = state;
  24046. break;
  24047. }
  24048. } else if (state === State.DELETE) {
  24049. switch (this.state) {
  24050. case State.INSERT:
  24051. // the feature should be destroyed
  24052. break;
  24053. case State.DELETE:
  24054. break;
  24055. case State.UNKNOWN:
  24056. case State.UPDATE:
  24057. this.state = state;
  24058. break;
  24059. }
  24060. } else if (state === State.UNKNOWN) {
  24061. this.state = state;
  24062. }
  24063. }
  24064. }]);
  24065. return Vector;
  24066. }(Feature_Feature);
  24067. /**
  24068. *
  24069. * @typedef {Object} FeatureVector.style
  24070. * @description Feature 有大量的样式属性,如果没有特别的指定将使用默认的样式,
  24071. * 大部分样式通过 SVG 标准定义属性。
  24072. * - fill properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#FillProperties}
  24073. * - stroke properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#StrokeProperties}
  24074. * @property {boolean} [fill] - 不需要填充则设置为 false。
  24075. * @property {string} [fillColor='#ee9900'] - 十六进制填充颜色。
  24076. * @property {number} [fillOpacity=0.4] - 填充不透明度。
  24077. * @property {boolean} [stroke] - 不需要描边则设为 false。
  24078. * @property {string} [strokeColor='#ee9900'] - 十六进制描边颜色。
  24079. * @property {number} [strokeOpacity=0.4] - 描边的不透明度(0-1)。
  24080. * @property {number} [strokeWidth=1] - 像素描边宽度。
  24081. * @property {string} [strokeLinecap='round'] - strokeLinecap 有三种类型 butt,round,square。
  24082. * @property {string} [strokeDashstyle='solid'] - 有 dot,dash,dashdot,longdash,longdashdot,solid 几种样式。
  24083. * @property {boolean} [graphic] - 不需要则设置为 false。
  24084. * @property {number} [pointRadius=6] - 像素点半径。
  24085. * @property {string} [pointerEvents='visiblePainted'] - pointerEvents。
  24086. * @property {string} [cursor] - cursor。
  24087. * @property {boolean} [allowRotate='false'] - 是否允许图标随着运行方向旋转。用于时空数据图层。
  24088. * @property {string} [externalGraphic] - 连接到用来渲染点的外部的图形。
  24089. * @property {number} [graphicWidth] - 外部图表的像素宽度。
  24090. * @property {number} [graphicHeight] - 外部图表的像素高度。
  24091. * @property {number} [graphicOpacity] - 外部图表的不透明度(0-1)。
  24092. * @property {number} [graphicXOffset] - 外部图表沿着x方向的偏移量。
  24093. * @property {number} [graphicYOffset] - 外部图表沿着y方向的偏移量。
  24094. * @property {number} [rotation] - 一个图表沿着其中心点(或者偏移中心指定点)在顺时针方向旋转。
  24095. * @property {number} [graphicZIndex] - 渲染时使用的索引值。
  24096. * @property {string} [graphicName='circle'] - 渲染点时图标使用的名字。支持"circle" , "square", "star", "x", "cross", "triangle"。
  24097. * @property {string} [graphicTitle] - 外部图表的提示框。
  24098. * @property {string} [backgroundGraphic] - 外部图表的背景。
  24099. * @property {number} [backgroundGraphicZIndex] - 背景图渲染时使用的索引值。
  24100. * @property {number} [backgroundXOffset] - 背景图在 x 轴的偏移量。
  24101. * @property {number} [backgroundYOffset] - 背景图在 y 轴的偏移量。
  24102. * @property {number} [backgroundHeight] - 背景图的高度。如果没有设置,将用 graphicHeight。
  24103. * @property {number} [backgroundWidth] - 背景图的宽度。如果没有设置,将用 graphicWidth。
  24104. * @property {boolean} [isUnicode=false] - 这个属性要配合 label 属性来用,当为 true时,label 就可以使用 unicode 编码,
  24105. * 比如 "a" 的 unicode 十六进制编码为 61,则 label 属性可以为 "&#x61;",其中 "&#" 为前缀,标志这个为 unicode 编码,
  24106. * "x" 是指 16 进制,这时页面显示的是 "a";当此值为 false 的时候,label 的内容会被直接输出,
  24107. * 比如,label 为 "&#x61;",这时页面显示的也是 "&#x61;"。
  24108. * @property {string} [label] - 可选的标签文本。
  24109. * @property {string} [labelAlign='cm'] - 标签对齐,是由两个字符组成的字符串,如:"lt", "cm", "rb",
  24110. * 其中第一个字符代表水平方向上的对齐,"l"=left, "c"=center, "r"=right;
  24111. * 第二个字符代表垂直方向上的对齐,"t"=top, "m"=middle, "b"=bottom。
  24112. * @property {number} [labelXOffset] - 标签在 x 轴方向的偏移量。
  24113. * @property {number} [labelYOffset] - 标签在 y 轴方向的偏移量。
  24114. * @property {boolean} [labelSelect=false] - 如果设为 true,标签可以选用 SelectFeature 或者 similar 控件。
  24115. * @property {string} [fontColor='#000000'] - 标签字体颜色。
  24116. * @property {number} [fontOpacity] - 标签透明度 (0-1)。
  24117. * @property {string} [fontFamily] - 标签的字体类型。
  24118. * @property {string} [fontSize] - 标签的字体大小。
  24119. * @property {string} [fontStyle] - 标签的字体样式。
  24120. * @property {string} [fontWeight] - 标签的字体粗细。
  24121. * @property {string} [display] - 如果 display 属性设置为 “none”,符号将没有任何效果。
  24122. * @example
  24123. * // label的用法如下:
  24124. * function addGeoTest(){
  24125. * var geometry = new GeometryPoint(105, 35);
  24126. * var pointFeature = new FeatureVector(geometry);
  24127. * var styleTest = {
  24128. * label:"supermap",
  24129. * fontColor:"#0000ff",
  24130. * fontOpacity:"0.5",
  24131. * fontFamily:"隶书",
  24132. * fontSize:"8em",
  24133. * fontWeight:"bold",
  24134. * fontStyle:"italic",
  24135. * labelSelect:"true",
  24136. * }
  24137. * pointFeature.style = styleTest;
  24138. * vectorLayer.addFeatures([pointFeature]);
  24139. * }
  24140. */
  24141. ;// CONCATENATED MODULE: ./src/common/commontypes/index.js
  24142. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24143. * This program are made available under the terms of the Apache License, Version 2.0
  24144. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24145. ;// CONCATENATED MODULE: ./src/common/format/Format.js
  24146. function Format_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24147. 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); } }
  24148. 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; }
  24149. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24150. * This program are made available under the terms of the Apache License, Version 2.0
  24151. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24152. /**
  24153. * @class Format
  24154. * @deprecatedclass SuperMap.Format
  24155. * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
  24156. * @category BaseTypes Format
  24157. * @param {Object} options - 可选参数。
  24158. * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
  24159. * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  24160. * @usage
  24161. */
  24162. var Format = /*#__PURE__*/function () {
  24163. function Format(options) {
  24164. Format_classCallCheck(this, Format);
  24165. /**
  24166. * @member {Object} Format.prototype.data
  24167. * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  24168. */
  24169. this.data = null;
  24170. /**
  24171. * @member {Object} [Format.prototype.keepData=false]
  24172. * @description 保持最近读到的数据的引用(通过 data 属性)。
  24173. */
  24174. this.keepData = false;
  24175. Util_Util.extend(this, options);
  24176. this.options = options;
  24177. this.CLASS_NAME = "SuperMap.Format";
  24178. }
  24179. /**
  24180. * @function Format.prototype.destroy
  24181. * @description 销毁该格式类,释放相关资源。
  24182. */
  24183. Format_createClass(Format, [{
  24184. key: "destroy",
  24185. value: function destroy() {
  24186. //用来销毁该格式类,释放相关资源
  24187. }
  24188. /**
  24189. * @function Format.prototype.read
  24190. * @description 来从字符串中读取数据。
  24191. * @param {string} data - 读取的数据。
  24192. */
  24193. }, {
  24194. key: "read",
  24195. value: function read(data) {// eslint-disable-line no-unused-vars
  24196. //用来从字符串中读取数据
  24197. }
  24198. /**
  24199. * @function Format.prototype.write
  24200. * @description 将对象写成字符串。
  24201. * @param {Object} object - 可序列化的对象。
  24202. * @returns {string} 对象转化后的字符串。
  24203. */
  24204. }, {
  24205. key: "write",
  24206. value: function write(object) {// eslint-disable-line no-unused-vars
  24207. //用来写字符串
  24208. }
  24209. }]);
  24210. return Format;
  24211. }();
  24212. ;// CONCATENATED MODULE: ./src/common/format/JSON.js
  24213. 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); }
  24214. function JSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24215. 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); } }
  24216. 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; }
  24217. 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); }
  24218. 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); }
  24219. 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); }; }
  24220. 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); }
  24221. function JSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24222. 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; } }
  24223. function JSON_getPrototypeOf(o) { JSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return JSON_getPrototypeOf(o); }
  24224. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24225. * This program are made available under the terms of the Apache License, Version 2.0
  24226. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24227. /**
  24228. * @class JSONFormat
  24229. * @aliasclass Format.JSON
  24230. * @deprecatedclass SuperMap.Format.JSON
  24231. * @classdesc 安全的读写 JSON 的解析类。使用 {@link JSONFormat} 构造函数创建新实例。
  24232. * @category BaseTypes Format
  24233. * @param {Object} [options] - 可选参数。
  24234. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  24235. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  24236. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  24237. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  24238. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  24239. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  24240. * @extends {Format}
  24241. * @usage
  24242. */
  24243. var JSONFormat = /*#__PURE__*/function (_Format) {
  24244. JSON_inherits(JSONFormat, _Format);
  24245. var _super = JSON_createSuper(JSONFormat);
  24246. function JSONFormat(options) {
  24247. var _this;
  24248. JSON_classCallCheck(this, JSONFormat);
  24249. _this = _super.call(this, options);
  24250. /**
  24251. * @member {string} [JSONFormat.prototype.indent=" "]
  24252. * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  24253. */
  24254. _this.indent = " ";
  24255. /**
  24256. * @member {string} [JSONFormat.prototype.space=" "]
  24257. * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  24258. */
  24259. _this.space = " ";
  24260. /**
  24261. * @member {string} [JSONFormat.prototype.newline="\n"]
  24262. * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  24263. */
  24264. _this.newline = "\n";
  24265. /**
  24266. * @member {number} [JSONFormat.prototype.level=0]
  24267. * @description 用于格式化输出, 表示的是缩进级别。
  24268. */
  24269. _this.level = 0;
  24270. /**
  24271. * @member {boolean} [JSONFormat.prototype.pretty=false]
  24272. * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  24273. */
  24274. _this.pretty = false;
  24275. /**
  24276. * @member {boolean} JSONFormat.prototype.nativeJSON
  24277. * @description 判断浏览器是否原生支持 JSON 格式数据。
  24278. */
  24279. _this.nativeJSON = function () {
  24280. return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
  24281. }();
  24282. _this.CLASS_NAME = "SuperMap.Format.JSON";
  24283. /**
  24284. * @member JSONFormat.prototype.serialize
  24285. * @description 提供一些类型对象转 JSON 字符串的方法。
  24286. */
  24287. _this.serialize = {
  24288. /**
  24289. * @function JSONFormat.serialize.object
  24290. * @description 把对象转换为 JSON 字符串。
  24291. * @param {Object} object - 可序列化的对象。
  24292. * @returns {string} JSON 字符串。
  24293. */
  24294. 'object': function object(_object) {
  24295. // three special objects that we want to treat differently
  24296. if (_object == null) {
  24297. return "null";
  24298. }
  24299. if (_object.constructor === Date) {
  24300. return this.serialize.date.apply(this, [_object]);
  24301. }
  24302. if (_object.constructor === Array) {
  24303. return this.serialize.array.apply(this, [_object]);
  24304. }
  24305. var pieces = ['{'];
  24306. this.level += 1;
  24307. var key, keyJSON, valueJSON;
  24308. var addComma = false;
  24309. for (key in _object) {
  24310. if (_object.hasOwnProperty(key)) {
  24311. // recursive calls need to allow for sub-classing
  24312. keyJSON = this.write.apply(this, [key, this.pretty]);
  24313. valueJSON = this.write.apply(this, [_object[key], this.pretty]);
  24314. if (keyJSON != null && valueJSON != null) {
  24315. if (addComma) {
  24316. pieces.push(',');
  24317. }
  24318. pieces.push(this.writeNewline(), this.writeIndent(), keyJSON, ':', this.writeSpace(), valueJSON);
  24319. addComma = true;
  24320. }
  24321. }
  24322. }
  24323. this.level -= 1;
  24324. pieces.push(this.writeNewline(), this.writeIndent(), '}');
  24325. return pieces.join('');
  24326. },
  24327. /**
  24328. * @function JSONFormat.serialize.array
  24329. * @description 把数组转换成 JSON 字符串。
  24330. * @param {Array} array - 可序列化的数组。
  24331. * @returns {string} JSON 字符串。
  24332. */
  24333. 'array': function array(_array) {
  24334. var json;
  24335. var pieces = ['['];
  24336. this.level += 1;
  24337. for (var i = 0, len = _array.length; i < len; ++i) {
  24338. // recursive calls need to allow for sub-classing
  24339. json = this.write.apply(this, [_array[i], this.pretty]);
  24340. if (json != null) {
  24341. if (i > 0) {
  24342. pieces.push(',');
  24343. }
  24344. pieces.push(this.writeNewline(), this.writeIndent(), json);
  24345. }
  24346. }
  24347. this.level -= 1;
  24348. pieces.push(this.writeNewline(), this.writeIndent(), ']');
  24349. return pieces.join('');
  24350. },
  24351. /**
  24352. * @function JSONFormat.serialize.string
  24353. * @description 把字符串转换成 JSON 字符串。
  24354. * @param {string} string - 可序列化的字符串。
  24355. * @returns {string} JSON 字符串。
  24356. */
  24357. 'string': function string(_string) {
  24358. // If the string contains no control characters, no quote characters, and no
  24359. // backslash characters, then we can simply slap some quotes around it.
  24360. // Otherwise we must also replace the offending characters with safe
  24361. // sequences.
  24362. var m = {
  24363. '\b': '\\b',
  24364. '\t': '\\t',
  24365. '\n': '\\n',
  24366. '\f': '\\f',
  24367. '\r': '\\r',
  24368. '"': '\\"',
  24369. '\\': '\\\\'
  24370. };
  24371. /*eslint-disable no-control-regex*/
  24372. if (/["\\\x00-\x1f]/.test(_string)) {
  24373. return '"' + _string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
  24374. var c = m[b];
  24375. if (c) {
  24376. return c;
  24377. }
  24378. c = b.charCodeAt();
  24379. return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  24380. }) + '"';
  24381. }
  24382. return '"' + _string + '"';
  24383. },
  24384. /**
  24385. * @function JSONFormat.serialize.number
  24386. * @description 把数字转换成 JSON 字符串。
  24387. * @param {number} number - 可序列化的数字。
  24388. * @returns {string} JSON 字符串。
  24389. */
  24390. 'number': function number(_number) {
  24391. return isFinite(_number) ? String(_number) : "null";
  24392. },
  24393. /**
  24394. * @function JSONFormat.serialize.boolean
  24395. * @description Transform a boolean into a JSON string.
  24396. * @param {boolean} bool - The boolean to be serialized.
  24397. * @returns {string} A JSON string representing the boolean.
  24398. */
  24399. 'boolean': function boolean(bool) {
  24400. return String(bool);
  24401. },
  24402. /**
  24403. * @function JSONFormat.serialize.object
  24404. * @description 将日期对象转换成 JSON 字符串。
  24405. * @param {Date} date - 可序列化的日期对象。
  24406. * @returns {string} JSON 字符串。
  24407. */
  24408. 'date': function date(_date) {
  24409. function format(number) {
  24410. // Format integers to have at least two digits.
  24411. return number < 10 ? '0' + number : number;
  24412. }
  24413. return '"' + _date.getFullYear() + '-' + format(_date.getMonth() + 1) + '-' + format(_date.getDate()) + 'T' + format(_date.getHours()) + ':' + format(_date.getMinutes()) + ':' + format(_date.getSeconds()) + '"';
  24414. }
  24415. };
  24416. return _this;
  24417. }
  24418. /**
  24419. * @function JSONFormat.prototype.read
  24420. * @description 将一个符合 JSON 结构的字符串进行解析。
  24421. * @param {string} json - 符合 JSON 结构的字符串。
  24422. * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
  24423. * @returns {(Object|string|Array|number|boolean)} 对象,数组,字符串或数字。
  24424. */
  24425. JSON_createClass(JSONFormat, [{
  24426. key: "read",
  24427. value: function read(json, filter) {
  24428. var object;
  24429. if (this.nativeJSON) {
  24430. try {
  24431. object = JSON.parse(json, filter);
  24432. } catch (e) {
  24433. // Fall through if the regexp test fails.
  24434. return {
  24435. data: json
  24436. };
  24437. }
  24438. }
  24439. if (this.keepData) {
  24440. this.data = object;
  24441. }
  24442. return object;
  24443. }
  24444. /**
  24445. * @function JSONFormat.prototype.write
  24446. * @description 序列化一个对象到一个符合 JSON 格式的字符串。
  24447. * @param {Object|string|Array|number|boolean} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
  24448. * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  24449. * @returns {string} 符合 JSON 格式的字符串。
  24450. *
  24451. */
  24452. }, {
  24453. key: "write",
  24454. value: function write(value, pretty) {
  24455. this.pretty = !!pretty;
  24456. var json = null;
  24457. var type = JSON_typeof(value);
  24458. if (this.serialize[type]) {
  24459. try {
  24460. json = !this.pretty && this.nativeJSON ? JSON.stringify(value) : this.serialize[type].apply(this, [value]);
  24461. } catch (err) {
  24462. //console.error("Trouble serializing: " + err);
  24463. }
  24464. }
  24465. return json;
  24466. }
  24467. /**
  24468. * @function JSONFormat.prototype.writeIndent
  24469. * @description 根据缩进级别输出一个缩进字符串。
  24470. * @private
  24471. * @returns {string} 一个适当的缩进字符串。
  24472. */
  24473. }, {
  24474. key: "writeIndent",
  24475. value: function writeIndent() {
  24476. var pieces = [];
  24477. if (this.pretty) {
  24478. for (var i = 0; i < this.level; ++i) {
  24479. pieces.push(this.indent);
  24480. }
  24481. }
  24482. return pieces.join('');
  24483. }
  24484. /**
  24485. * @function JSONFormat.prototype.writeNewline
  24486. * @description 在格式化输出模式情况下输出代表新一行的字符串。
  24487. * @private
  24488. * @returns {string} 代表新的一行的字符串。
  24489. */
  24490. }, {
  24491. key: "writeNewline",
  24492. value: function writeNewline() {
  24493. return this.pretty ? this.newline : '';
  24494. }
  24495. /**
  24496. * @function JSONFormat.prototype.writeSpace
  24497. * @private
  24498. * @description 在格式化输出模式情况下输出一个代表空格的字符串。
  24499. * @returns {string} 空格字符串。
  24500. */
  24501. }, {
  24502. key: "writeSpace",
  24503. value: function writeSpace() {
  24504. return this.pretty ? this.space : '';
  24505. }
  24506. }]);
  24507. return JSONFormat;
  24508. }(Format);
  24509. ;// CONCATENATED MODULE: ./src/common/iServer/ServerColor.js
  24510. function ServerColor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24511. 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); } }
  24512. 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; }
  24513. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24514. * This program are made available under the terms of the Apache License, Version 2.0
  24515. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24516. /**
  24517. * @class ServerColor
  24518. * @deprecatedclass SuperMap.ServerColor
  24519. * @category iServer Map Theme
  24520. * @classdesc 颜色类。该类使用三原色( RGB )来表达颜色。
  24521. * @param {Object} options - 可选参数。
  24522. * @param {number} [options.red=255] - 获取或设置红色值。
  24523. * @param {number} [options.green=0] - 获取或设置绿色值。
  24524. * @param {number} [options.blue=0] - 获取或设置蓝色值。
  24525. * @usage
  24526. */
  24527. var ServerColor = /*#__PURE__*/function () {
  24528. function ServerColor(red, green, blue) {
  24529. ServerColor_classCallCheck(this, ServerColor);
  24530. /**
  24531. * @member {number} [ServerColor.prototype.red=255]
  24532. * @description 获取或设置红色值。
  24533. */
  24534. this.red = !red && red != 0 ? 255 : red;
  24535. /**
  24536. * @member {number} [ServerColor.prototype.green=0]
  24537. * @description 获取或设置绿色值。
  24538. */
  24539. this.green = green || 0;
  24540. /**
  24541. * @member {number} [ServerColor.prototype.blue=0]
  24542. * @description 获取或设置蓝色值。
  24543. */
  24544. this.blue = blue || 0;
  24545. this.CLASS_NAME = "SuperMap.ServerColor";
  24546. }
  24547. /**
  24548. * @function ServerColor.prototype.destroy
  24549. * @description 释放资源,将引用资源的属性置空。
  24550. */
  24551. ServerColor_createClass(ServerColor, [{
  24552. key: "destroy",
  24553. value: function destroy() {
  24554. var me = this;
  24555. me.red = null;
  24556. me.green = null;
  24557. me.blue = null;
  24558. }
  24559. /**
  24560. * @function ServerColor.formJson
  24561. * @description 将 JSON 对象转化为 ServerColor 对象。
  24562. * @param {Object} jsonObject - 要转换的 JSON 对象。
  24563. * @returns {ServerColor} 转化后的 ServerColor 对象。
  24564. */
  24565. }], [{
  24566. key: "fromJson",
  24567. value: function fromJson(jsonObject) {
  24568. if (!jsonObject) {
  24569. return;
  24570. }
  24571. var color = new ServerColor();
  24572. var red = 255;
  24573. if (jsonObject.red !== null) {
  24574. red = Number(jsonObject.red);
  24575. }
  24576. color.red = red;
  24577. var green = 0;
  24578. if (jsonObject.green !== null) {
  24579. green = Number(jsonObject.green);
  24580. }
  24581. color.green = green;
  24582. var blue = 0;
  24583. if (jsonObject.blue !== null) {
  24584. blue = Number(jsonObject.blue);
  24585. }
  24586. color.blue = blue;
  24587. return color;
  24588. }
  24589. }]);
  24590. return ServerColor;
  24591. }();
  24592. ;// CONCATENATED MODULE: ./src/common/iServer/ServerStyle.js
  24593. function ServerStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24594. 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); } }
  24595. 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; }
  24596. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24597. * This program are made available under the terms of the Apache License, Version 2.0
  24598. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24599. /**
  24600. * @class ServerStyle
  24601. * @deprecatedclass SuperMap.ServerStyle
  24602. * @category iServer Map Theme
  24603. * @classdesc 服务端矢量要素风格类。该类用于定义点状符号、线状符号、填充符号风格及其相关属性。
  24604. * @param {Object} options - 参数。
  24605. * @param {FillGradientMode} options.fillGradientMode - 渐变填充风格的渐变类型。
  24606. * @param {ServerColor} [options.fillBackColor=[255,255,255]] - 填充背景颜色。
  24607. * @param {boolean} [options.fillBackOpaque=false] - 背景是否不透明。
  24608. * @param {ServerColor} [options.fillForeColor=[255,0,0]] - 填充颜色。
  24609. * @param {number} [options.fillGradientAngle=0] - 渐变填充的旋转角度。
  24610. * @param {number} [options.fillGradientOffsetRatioX=0] - 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。
  24611. * @param {number} [options.fillGradientOffsetRatioY=0] - 填充中心点相对于填充区域范围中心点的垂直偏移百分比。
  24612. * @param {number} [options.fillOpaqueRate=100] - 填充不透明度。
  24613. * @param {number} [options.fillSymbolID=0] - 填充符号的编码。
  24614. * @param {ServerColor} [options.lineColor] - 矢量要素的边线颜色。默认 lineColor = new ServerColor(0, 0, 0)。
  24615. * @param {number} [options.lineSymbolID=0] - 线状符号的编码。
  24616. * @param {number} [options.lineWidth=1] - 边线的宽度。
  24617. * @param {number} [options.markerAngle=0] - 点状符号的旋转角度。
  24618. * @param {number} [options.markerSize=1] - 点状符号的大小。
  24619. * @param {number} [options.markerSymbolID=-1] - 点状符号的编码。
  24620. * @usage
  24621. */
  24622. var ServerStyle = /*#__PURE__*/function () {
  24623. function ServerStyle(options) {
  24624. ServerStyle_classCallCheck(this, ServerStyle);
  24625. /**
  24626. * @member {ServerColor} ServerStyle.prototype.fillBackColor
  24627. * @description 填充背景颜色。当填充模式为渐变填充时,该颜色为填充终止色。
  24628. */
  24629. this.fillBackColor = new ServerColor(255, 255, 255);
  24630. /**
  24631. * @member {boolean} [ServerStyle.prototype.fillBackOpaque=false]
  24632. * @description 背景是否不透明。false 表示透明。
  24633. */
  24634. this.fillBackOpaque = false;
  24635. /**
  24636. * @member {ServerColor} ServerStyle.prototype.fillForeColor
  24637. * @description 填充颜色。当填充模式为渐变填充时,该颜色为填充起始颜色。
  24638. */
  24639. this.fillForeColor = new ServerColor(255, 0, 0);
  24640. /**
  24641. * @member {FillGradientMode} ServerStyle.prototype.fillGradientMode
  24642. * @description 渐变填充风格的渐变类型。
  24643. */
  24644. this.fillGradientMode = null;
  24645. /**
  24646. * @member {number} ServerStyle.prototype.fillGradientAngle -
  24647. * @description 渐变填充的旋转角度。单位为度,精确到 0.1 度,逆时针方向为正方向。
  24648. */
  24649. this.fillGradientAngle = 0;
  24650. /**
  24651. * @member {number} ServerStyle.prototype.fillGradientOffsetRatioX
  24652. * @description 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。它们的关系如下:设填充区域范围中心点的坐标为(x0, y0),
  24653. * 填充中心点的坐标为(x, y),填充区域范围的宽度为 a,水平偏移百分比为 dx,则 x=x0 + a*dx/100。
  24654. */
  24655. this.fillGradientOffsetRatioX = 0;
  24656. /**
  24657. * @member {number} ServerStyle.prototype.fillGradientOffsetRatioY
  24658. * @description 填充中心点相对于填充区域范围中心点的垂直偏移百分比。它们的关系如下:<br>
  24659. * 设填充区域范围中心点的坐标为(x0, y0),填充中心点的坐标为(x, y),填充区域范围的高度为 b,垂直偏移百分比为 dy,则 y=y0 + b*dx/100。
  24660. */
  24661. this.fillGradientOffsetRatioY = 0;
  24662. /**
  24663. * @member {number} [ServerStyle.prototype.fillOpaqueRate=100]
  24664. * @description 填充不透明度。合法值为 0 - 100 的数值。其中为 0 表示完全透明;
  24665. * 100 表示完全不透明。赋值小于 0 时按照 0 处理,大于 100 时按照 100 处理。
  24666. */
  24667. this.fillOpaqueRate = 100;
  24668. /**
  24669. * @member {number} ServerStyle.prototype.fillSymbolID
  24670. * @description 填充符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  24671. * 关于填充符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  24672. */
  24673. this.fillSymbolID = 0;
  24674. /**
  24675. * @member {ServerColor} ServerStyle.prototype.lineColor
  24676. * @description 矢量要素的边线颜色。如果等级符号是点符号,点符号的颜色由 lineColor 控制。
  24677. */
  24678. this.lineColor = new ServerColor(0, 0, 0);
  24679. /**
  24680. * @member {number} [ServerStyle.prototype.lineSymbolID=0]
  24681. * @description 线状符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  24682. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  24683. */
  24684. this.lineSymbolID = 0;
  24685. /**
  24686. * @member {number} [ServerStyle.prototype.lineWidth=1.0]
  24687. * @description 边线的宽度。单位为毫米,精度到 0.1。
  24688. */
  24689. this.lineWidth = 1;
  24690. /**
  24691. * @member {number} [ServerStyle.prototype.markerAngle=0]
  24692. * @description 点状符号的旋转角度。以度为单位,精确到 0.1 度,逆时针方向为正方向。
  24693. */
  24694. this.markerAngle = 0;
  24695. /**
  24696. * @member {number} [ServerStyle.prototype.markerSize=1.0]
  24697. * @description 点状符号的大小。单位为毫米,精度为 0.1。当该属性设置为0时,采用符号默认大小 1.0 显示。
  24698. * 当该属性设置为非法值时,交由服务器默认处理。
  24699. */
  24700. this.markerSize = 1;
  24701. /**
  24702. * @member {number} [ServerStyle.prototype.markerSymbolID=-1]
  24703. * @description 点状符号的编码。此编码用于唯一标识各点状符号。
  24704. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  24705. */
  24706. this.markerSymbolID = -1;
  24707. if (options) {
  24708. Util_Util.extend(this, options);
  24709. }
  24710. this.CLASS_NAME = "SuperMap.ServerStyle";
  24711. }
  24712. /**
  24713. * @function ServerStyle.prototype.destroy
  24714. * @description 释放资源,将引用资源的属性置空。
  24715. */
  24716. ServerStyle_createClass(ServerStyle, [{
  24717. key: "destroy",
  24718. value: function destroy() {
  24719. var me = this;
  24720. if (me.fillBackColor) {
  24721. me.fillBackColor.destroy();
  24722. me.fillBackColor = null;
  24723. }
  24724. me.fillBackOpaque = null;
  24725. if (me.fillForeColor) {
  24726. me.fillForeColor.destroy();
  24727. me.fillForeColor = null;
  24728. }
  24729. me.fillGradientMode = null;
  24730. me.fillGradientAngle = null;
  24731. me.fillGradientOffsetRatioX = null;
  24732. me.fillGradientOffsetRatioY = null;
  24733. me.fillOpaqueRate = null;
  24734. me.fillSymbolID = null;
  24735. if (me.lineColor) {
  24736. me.lineColor.destroy();
  24737. me.lineColor = null;
  24738. }
  24739. me.lineSymbolID = null;
  24740. me.lineWidth = null;
  24741. me.markerAngle = null;
  24742. me.markerSize = null;
  24743. me.markerSymbolID = null;
  24744. }
  24745. /**
  24746. * @function ServerStyle.prototype.toServerJSONObject
  24747. * @description 转换成对应的 JSON 格式对象。
  24748. * @returns {Object} 对应的 JSON 格式对象.
  24749. */
  24750. }, {
  24751. key: "toServerJSONObject",
  24752. value: function toServerJSONObject() {
  24753. var styleObj = {};
  24754. styleObj = Util_Util.copyAttributes(styleObj, this);
  24755. //暂时先忽略serverColor往Json的转换
  24756. return styleObj;
  24757. }
  24758. /**
  24759. * @function ServerStyle.fromJson
  24760. * @description 将JSON对象转换为 ServerStyle 对象。
  24761. * @param {Object} jsonObject - 要转换的 JSON 对象。
  24762. * @returns {ServerStyle} 转化后的 ServerStyle 对象。
  24763. */
  24764. }], [{
  24765. key: "fromJson",
  24766. value: function fromJson(jsonObject) {
  24767. if (!jsonObject) {
  24768. return;
  24769. }
  24770. return new ServerStyle({
  24771. fillBackColor: ServerColor.fromJson(jsonObject.fillBackColor),
  24772. fillBackOpaque: jsonObject.fillBackOpaque,
  24773. fillForeColor: ServerColor.fromJson(jsonObject.fillForeColor),
  24774. fillGradientMode: jsonObject.fillGradientMode,
  24775. fillGradientAngle: jsonObject.fillGradientAngle,
  24776. fillGradientOffsetRatioX: jsonObject.fillGradientOffsetRatioX,
  24777. fillGradientOffsetRatioY: jsonObject.fillGradientOffsetRatioY,
  24778. fillOpaqueRate: jsonObject.fillOpaqueRate,
  24779. fillSymbolID: jsonObject.fillSymbolID,
  24780. lineColor: ServerColor.fromJson(jsonObject.lineColor),
  24781. lineSymbolID: jsonObject.lineSymbolID,
  24782. lineWidth: jsonObject.lineWidth,
  24783. markerAngle: jsonObject.markerAngle,
  24784. markerSize: jsonObject.markerSize,
  24785. markerSymbolID: jsonObject.markerSymbolID
  24786. });
  24787. }
  24788. }]);
  24789. return ServerStyle;
  24790. }();
  24791. ;// CONCATENATED MODULE: ./src/common/iServer/PointWithMeasure.js
  24792. 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); }
  24793. function PointWithMeasure_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24794. 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); } }
  24795. 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; }
  24796. 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); }
  24797. 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); }
  24798. 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); }; }
  24799. 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); }
  24800. function PointWithMeasure_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24801. 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; } }
  24802. function PointWithMeasure_getPrototypeOf(o) { PointWithMeasure_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PointWithMeasure_getPrototypeOf(o); }
  24803. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24804. * This program are made available under the terms of the Apache License, Version 2.0
  24805. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24806. /**
  24807. * @class PointWithMeasure
  24808. * @deprecatedclass SuperMap.PointWithMeasure
  24809. * @category iServer SpatialAnalyst RouteLocator
  24810. * @classdesc 路由点类。路由点是指具有线性度量值 (Measure) 的二维地理坐标点。
  24811. * @param {Object} options - 参数。
  24812. * @param {number} options.measure - 度量值,即路由对象属性值 M。
  24813. * @param {number} options.x - 地理坐标系下的 X 坐标值。
  24814. * @param {number} options.y - 地理坐标系下的 Y 坐标值。
  24815. * @extends {GeometryPoint}
  24816. * @usage
  24817. */
  24818. var PointWithMeasure = /*#__PURE__*/function (_Point) {
  24819. PointWithMeasure_inherits(PointWithMeasure, _Point);
  24820. var _super = PointWithMeasure_createSuper(PointWithMeasure);
  24821. function PointWithMeasure(options) {
  24822. var _this;
  24823. PointWithMeasure_classCallCheck(this, PointWithMeasure);
  24824. _this = _super.call(this, options);
  24825. /**
  24826. * @member {number} PointWithMeasure.prototype.measure
  24827. * @description 度量值,即路由对象属性值 M。
  24828. */
  24829. _this.measure = null;
  24830. if (options) {
  24831. Util_Util.extend(PointWithMeasure_assertThisInitialized(_this), options);
  24832. }
  24833. _this.CLASS_NAME = "SuperMap.PointWithMeasure";
  24834. return _this;
  24835. }
  24836. /**
  24837. * @function PointWithMeasure.prototype.equals
  24838. * @description 判断两个路由点对象是否相等。如果两个路由点对象具有相同的坐标以及度量值,则认为是相等的。
  24839. * @param {PointWithMeasure} geom - 需要判断的路由点对象。
  24840. * @returns {boolean} 两个路由点对象是否相等(true 为相等,false 为不等)。
  24841. */
  24842. PointWithMeasure_createClass(PointWithMeasure, [{
  24843. key: "equals",
  24844. value: function equals(geom) {
  24845. var equals = false;
  24846. if (geom != null) {
  24847. var isValueEquals = this.x === geom.x && this.y === geom.y && this.measure === geom.measure;
  24848. var isNaNValue = isNaN(this.x) && isNaN(this.y) && isNaN(this.measure);
  24849. var isNaNGeometry = isNaN(geom.x) && isNaN(geom.y) && isNaN(geom.measure);
  24850. equals = isValueEquals || isNaNValue && isNaNGeometry;
  24851. }
  24852. return equals;
  24853. }
  24854. /**
  24855. * @function PointWithMeasure.prototype.toJson
  24856. * @description 转换为 JSON 对象。
  24857. * */
  24858. }, {
  24859. key: "toJson",
  24860. value: function toJson() {
  24861. var result = "{";
  24862. if (this.measure != null && this.measure != undefined) {
  24863. result += "\"measure\":" + this.measure + ",";
  24864. }
  24865. result += "\"x\":" + this.x + ",";
  24866. result += "\"y\":" + this.y;
  24867. result += "}";
  24868. return result;
  24869. }
  24870. /**
  24871. * @function PointWithMeasure.prototype.destroy
  24872. * @description 释放资源,将引用资源的属性置空。
  24873. */
  24874. }, {
  24875. key: "destroy",
  24876. value: function destroy() {
  24877. var me = this;
  24878. me.measure = null;
  24879. me.x = null;
  24880. me.y = null;
  24881. }
  24882. /**
  24883. * @function PointWithMeasure.fromJson
  24884. * @description 将 JSON 对象转换为{@link PointWithMeasure} 对象。
  24885. * @param {Object} jsonObject - JSON 对象表示的路由点。
  24886. * @returns {PointWithMeasure} 转化后的 PointWithMeasure 对象。
  24887. */
  24888. }], [{
  24889. key: "fromJson",
  24890. value: function fromJson(jsonObject) {
  24891. if (!jsonObject) {
  24892. return;
  24893. }
  24894. return new PointWithMeasure({
  24895. x: jsonObject.x,
  24896. y: jsonObject.y,
  24897. measure: jsonObject.measure
  24898. });
  24899. }
  24900. }]);
  24901. return PointWithMeasure;
  24902. }(Point);
  24903. ;// CONCATENATED MODULE: ./src/common/iServer/Route.js
  24904. 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); }
  24905. function Route_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24906. 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); } }
  24907. 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; }
  24908. 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); }
  24909. 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); }
  24910. 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); }; }
  24911. 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); }
  24912. function Route_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24913. 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; } }
  24914. function Route_getPrototypeOf(o) { Route_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Route_getPrototypeOf(o); }
  24915. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  24916. * This program are made available under the terms of the Apache License, Version 2.0
  24917. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24918. /**
  24919. * @class Route
  24920. * @deprecatedclass SuperMap.Route
  24921. * @category iServer SpatialAnalyst RouteCalculateMeasure
  24922. * @classdesc 路由对象类。路由对象为一系列有序的带有属性值 M 的 x,y 坐标对,其中 M 值为该结点的距离属性(到已知点的距离)。
  24923. * @param {Array.<Geometry>} points - 形成路由对象的线数组。
  24924. * @param {Object} options - 参数。
  24925. * @param {number} options.id - 路由对象在数据库中的 ID。
  24926. * @param {number} options.length - 路由对象的长度。单位与数据集的单位相同。
  24927. * @param {number} [options.maxM] - 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  24928. * @param {number} [options.minM] - 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  24929. * @param {string} [options.type] - 数据类型,如:"LINEM"。
  24930. * @extends GeometryCollection
  24931. * @usage
  24932. */
  24933. var Route = /*#__PURE__*/function (_Collection) {
  24934. Route_inherits(Route, _Collection);
  24935. var _super = Route_createSuper(Route);
  24936. function Route(points, options) {
  24937. var _this;
  24938. Route_classCallCheck(this, Route);
  24939. _this = _super.call(this, points, options);
  24940. /**
  24941. * @member {number} Route.prototype.id
  24942. * @description 路由对象在数据库中的 ID。
  24943. */
  24944. _this.id = null;
  24945. /**
  24946. * @member {number} Route.prototype.center
  24947. * @description 路由对象的中心点。
  24948. */
  24949. _this.center = null;
  24950. /**
  24951. * @member {string} Route.prototype.style
  24952. * @description 路由对象的样式。
  24953. */
  24954. _this.style = null;
  24955. /**
  24956. * @member {number} Route.prototype.length
  24957. * @description 路由对象的长度。单位与数据集的单位相同。
  24958. */
  24959. _this.length = null;
  24960. /**
  24961. * @member {number} Route.prototype.maxM
  24962. * @description 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  24963. */
  24964. _this.maxM = null;
  24965. /**
  24966. * @member {number} Route.prototype.minM
  24967. * @description 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  24968. */
  24969. _this.minM = null;
  24970. /**
  24971. * @member {Array.<number>} Route.prototype.parts
  24972. * @description 服务端几何对象中各个子对象所包含的节点个数。
  24973. */
  24974. _this.parts = null;
  24975. /**
  24976. * @member {Array.<Object>} Route.prototype.points
  24977. * @description 路由对象的所有路由点。
  24978. * @example
  24979. * (start code)
  24980. * [
  24981. * {
  24982. * "measure": 0,
  24983. * "y": -4377.027184298267,
  24984. * "x": 4020.0045221720466
  24985. * },
  24986. * {
  24987. * "measure": 37.33288381391519,
  24988. * "y": -4381.569363260499,
  24989. * "x": 4057.0600591960642
  24990. * }
  24991. * ]
  24992. * (end)
  24993. */
  24994. _this.points = null;
  24995. /**
  24996. * @member {string} Route.prototype.type
  24997. * @description 服务端几何对象类型。
  24998. */
  24999. _this.type = null;
  25000. /**
  25001. * @member {Array.<string>} [Route.prototype.componentTypes=LineString]
  25002. * @description components 存储的几何对象所支持的几何类型数组。
  25003. */
  25004. _this.componentTypes = ["SuperMap.Geometry.LinearRing", "SuperMap.Geometry.LineString"];
  25005. if (options) {
  25006. Util_Util.extend(Route_assertThisInitialized(_this), options);
  25007. }
  25008. _this.CLASS_NAME = "SuperMap.Route";
  25009. _this.geometryType = "LINEM";
  25010. return _this;
  25011. }
  25012. /**
  25013. *
  25014. * @function Route.prototype.toJson
  25015. * @description 转换为 JSON 对象。
  25016. * @returns {Object} JSON 对象。
  25017. */
  25018. Route_createClass(Route, [{
  25019. key: "toJson",
  25020. value: function toJson() {
  25021. var result = "{";
  25022. if (this.id != null && this.id != undefined) {
  25023. result += "\"id\":" + this.id + ",";
  25024. }
  25025. if (this.center != null && this.center != undefined) {
  25026. result += "\"center\":" + this.center + ",";
  25027. }
  25028. if (this.style != null && this.style != undefined) {
  25029. result += "\"style\":" + this.style + ",";
  25030. }
  25031. if (this.length != null && this.length != undefined) {
  25032. result += "\"length\":" + this.length + ",";
  25033. }
  25034. if (this.maxM != null && this.maxM != undefined) {
  25035. result += "\"maxM\":" + this.maxM + ",";
  25036. }
  25037. if (this.minM != null && this.minM != undefined) {
  25038. result += "\"minM\":" + this.minM + ",";
  25039. }
  25040. if (this.type != null && this.type != undefined) {
  25041. result += "\"type\":\"" + this.type + "\",";
  25042. }
  25043. if (this.parts != null && this.parts != undefined) {
  25044. result += "\"parts\":[" + this.parts[0];
  25045. for (var i = 1; i < this.parts.length; i++) {
  25046. result += "," + this.parts[i];
  25047. }
  25048. result += "],";
  25049. }
  25050. if (this.components != null && this.components.length > 0) {
  25051. result += "\"points\":[";
  25052. for (var j = 0, len = this.components.length; j < len; j++) {
  25053. for (var k = 0, len2 = this.components[j].components.length; k < len2; k++) {
  25054. result += this.components[j].components[k].toJson() + ",";
  25055. }
  25056. }
  25057. result = result.replace(/,$/g, '');
  25058. result += "]";
  25059. }
  25060. result = result.replace(/,$/g, '');
  25061. result += "}";
  25062. return result;
  25063. }
  25064. /**
  25065. * @function Route.prototype.destroy
  25066. * @override
  25067. */
  25068. }, {
  25069. key: "destroy",
  25070. value: function destroy() {
  25071. var me = this;
  25072. me.id = null;
  25073. me.center = null;
  25074. me.style = null;
  25075. me.length = null;
  25076. me.maxM = null;
  25077. me.minM = null;
  25078. me.type = null;
  25079. me.parts = null;
  25080. me.components.length = 0;
  25081. me.components = null;
  25082. me.componentTypes = null;
  25083. }
  25084. /**
  25085. * @function Route.fromJson
  25086. * @description 将 JSON 对象转换为 Route 对象。
  25087. * @param {Object} [jsonObject] - JSON 对象表示的路由对象。
  25088. * @returns {Route} 转化后的 Route 对象。
  25089. */
  25090. }], [{
  25091. key: "fromJson",
  25092. value: function fromJson(jsonObject) {
  25093. if (!jsonObject) {
  25094. return;
  25095. }
  25096. var geoParts = jsonObject.parts || [],
  25097. geoPoints = jsonObject.points || [],
  25098. len = geoParts.length,
  25099. lineList = [];
  25100. if (len > 0) {
  25101. for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
  25102. for (var j = 0; j < geoParts[i]; j++) {
  25103. pointList.push(PointWithMeasure.fromJson(geoPoints[pointIndex + j]));
  25104. }
  25105. pointIndex += geoParts[i];
  25106. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  25107. if (pointList[0].equals(pointList[geoParts[i] - 1])) {
  25108. lineList.push(new LinearRing_LinearRing(pointList));
  25109. } else {
  25110. lineList.push(new LineString(pointList));
  25111. }
  25112. pointList = [];
  25113. }
  25114. } else {
  25115. return null;
  25116. }
  25117. return new Route(lineList, {
  25118. id: jsonObject.id,
  25119. center: jsonObject.center,
  25120. style: jsonObject.style,
  25121. length: jsonObject.length,
  25122. maxM: jsonObject.maxM,
  25123. minM: jsonObject.minM,
  25124. type: jsonObject.type,
  25125. parts: jsonObject.parts
  25126. });
  25127. }
  25128. }]);
  25129. return Route;
  25130. }(Collection);
  25131. ;// CONCATENATED MODULE: ./src/common/iServer/ServerGeometry.js
  25132. function ServerGeometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25133. 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); } }
  25134. 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; }
  25135. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25136. * This program are made available under the terms of the Apache License, Version 2.0
  25137. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25138. /**
  25139. * @class ServerGeometry
  25140. * @deprecatedclass SuperMap.ServerGeometry
  25141. * @category iServer Data Feature
  25142. * @classdesc 服务端几何对象类。该类描述几何对象(矢量)的特征数据(坐标点对、几何对象的类型等)。基于服务端的空间分析、空间关系运算、查询等 GIS 服务功能使用服务端几何对象。
  25143. * @param {Object} options - 参数。
  25144. * @param {string} options.id - 服务端几何对象唯一标识符。
  25145. * @param {Array.<number>} options.parts - 服务端几何对象中各个子对象所包含的节点个数。
  25146. * @param {Array.<GeometryPoint>} options.points - 组成几何对象的节点的坐标对数组。
  25147. * @param {GeometryType} options.type - 几何对象的类型。
  25148. * @param {ServerStyle} [options.style] - 服务端几何对象的风格。
  25149. * @usage
  25150. */
  25151. var ServerGeometry = /*#__PURE__*/function () {
  25152. function ServerGeometry(options) {
  25153. ServerGeometry_classCallCheck(this, ServerGeometry);
  25154. /**
  25155. * @member {string} ServerGeometry.prototype.id
  25156. * @description 服务端几何对象唯一标识符。
  25157. */
  25158. this.id = 0;
  25159. /**
  25160. * @member {ServerStyle} [ServerGeometry.prototype.style]
  25161. * @description 服务端几何对象的风格(ServerStyle)。
  25162. */
  25163. this.style = null;
  25164. /**
  25165. * @member {Array.<number>} ServerGeometry.prototype.parts
  25166. * @description 服务端几何对象中各个子对象所包含的节点个数。<br>
  25167. * 1.几何对象从结构上可以分为简单几何对象和复杂几何对象。
  25168. * 简单几何对象与复杂几何对象的区别:简单的几何对象一般为单一对象,
  25169. * 而复杂的几何对象由多个简单对象组成或经过一定的空间运算之后产生,
  25170. * 如:矩形为简单的区域对象,而中空的矩形为复杂的区域对象。<br>
  25171. * 2.通常情况,一个简单几何对象的子对象就是它本身,
  25172. * 因此对于简单对象来说的该字段为长度为1的整型数组,
  25173. * 该字段的值就是这个简单对象节点的个数。
  25174. * 如果一个几何对象是由几个简单对象组合而成的,
  25175. * 例如,一个岛状几何对象由 3 个简单的多边形组成而成,
  25176. * 那么这个岛状的几何对象的 Parts 字段值就是一个长度为 3 的整型数组,
  25177. * 数组中每个成员的值分别代表这三个多边形所包含的节点个数。
  25178. */
  25179. this.parts = null;
  25180. /**
  25181. * @member {Array.<GeometryPoint>} ServerGeometry.prototype.points
  25182. * @description 组成几何对象的节点的坐标对数组。<br>
  25183. * 1.所有几何对象(点、线、面)都是由一些简单的点坐标组成的,
  25184. * 该字段存放了组成几何对象的点坐标的数组。
  25185. * 对于简单的面对象,他的起点和终点的坐标点相同。<br>
  25186. * 2.对于复杂的几何对象,根据 Parts 属性来确定每一个组成复杂几何对象的简单对象所对应的节点的个数,
  25187. * 从而确定 Points 字段中坐标对的分配归属问题。
  25188. */
  25189. this.points = null;
  25190. /**
  25191. * @member {GeometryType} ServerGeometry.prototype.type
  25192. * @description 几何对象的类型(GeometryType)。
  25193. */
  25194. this.type = null;
  25195. /**
  25196. * @member {Object} ServerGeometry.prototype.prjCoordSys
  25197. * @description 投影坐标参数,现仅在缓冲区分析中有效。
  25198. */
  25199. this.prjCoordSys = null;
  25200. if (options) {
  25201. Util_Util.extend(this, options);
  25202. }
  25203. this.CLASS_NAME = 'SuperMap.ServerGeometry';
  25204. }
  25205. /**
  25206. * @function ServerGeometry.prototype.destroy
  25207. * @description 释放资源,将引用资源的属性置空。
  25208. */
  25209. ServerGeometry_createClass(ServerGeometry, [{
  25210. key: "destroy",
  25211. value: function destroy() {
  25212. var me = this;
  25213. me.id = null;
  25214. me.style = null;
  25215. me.parts = null;
  25216. me.partTopo = null;
  25217. me.points = null;
  25218. me.type = null;
  25219. me.prjCoordSys = null;
  25220. }
  25221. /**
  25222. * @function ServerGeometry.prototype.toGeometry
  25223. * @description 将服务端几何对象 ServerGeometry 转换为客户端几何对象 Geometry。
  25224. * @returns {Geometry} 转换后的客户端几何对象。
  25225. */
  25226. }, {
  25227. key: "toGeometry",
  25228. value: function toGeometry() {
  25229. var me = this,
  25230. geoType = me.type;
  25231. switch (geoType.toUpperCase()) {
  25232. case REST_GeometryType.POINT:
  25233. return me.toGeoPoint();
  25234. case REST_GeometryType.LINE:
  25235. return me.toGeoLine();
  25236. case REST_GeometryType.LINEM:
  25237. return me.toGeoLinem();
  25238. case REST_GeometryType.REGION:
  25239. return me.toGeoRegion();
  25240. case REST_GeometryType.POINTEPS:
  25241. return me.toGeoPoint();
  25242. case REST_GeometryType.LINEEPS:
  25243. return me.toGeoLineEPS();
  25244. case REST_GeometryType.REGIONEPS:
  25245. return me.toGeoRegionEPS();
  25246. case REST_GeometryType.GEOCOMPOUND:
  25247. return me.transformGeoCompound();
  25248. }
  25249. }
  25250. /**
  25251. * @function ServerGeometry.prototype.toGeoPoint
  25252. * @description 将服务端的点几何对象转换为客户端几何对象。包括 Point、MultiPoint。
  25253. * @returns {Geometry} 转换后的客户端几何对象。
  25254. */
  25255. }, {
  25256. key: "toGeoPoint",
  25257. value: function toGeoPoint() {
  25258. var me = this,
  25259. geoParts = me.parts || [],
  25260. geoPoints = me.points || [],
  25261. len = geoParts.length;
  25262. if (len > 0) {
  25263. if (len === 1) {
  25264. return new Point(geoPoints[0].x, geoPoints[0].y);
  25265. } else {
  25266. var pointList = [];
  25267. for (var i = 0; i < len; i++) {
  25268. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  25269. }
  25270. return new MultiPoint(pointList);
  25271. }
  25272. } else {
  25273. return null;
  25274. }
  25275. }
  25276. /**
  25277. * @function ServerGeometry.prototype.toGeoLine
  25278. * @description 将服务端的线几何对象转换为客户端几何对象。包括 GeometryLinearRing、GeometryLineString、GeometryMultiLineString。
  25279. * @returns {Geometry} 转换后的客户端几何对象。
  25280. */
  25281. }, {
  25282. key: "toGeoLine",
  25283. value: function toGeoLine() {
  25284. var me = this,
  25285. geoParts = me.parts || [],
  25286. geoPoints = me.points || [],
  25287. len = geoParts.length;
  25288. if (len > 0) {
  25289. if (len === 1) {
  25290. var pointList = [];
  25291. for (var i = 0; i < geoParts[0]; i++) {
  25292. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  25293. }
  25294. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  25295. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  25296. return new LinearRing_LinearRing(pointList);
  25297. } else {
  25298. return new LineString(pointList);
  25299. }
  25300. } else {
  25301. var lineList = [];
  25302. for (var _i2 = 0; _i2 < len; _i2++) {
  25303. var _pointList = [];
  25304. for (var j = 0; j < geoParts[_i2]; j++) {
  25305. _pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  25306. }
  25307. lineList.push(new LineString(_pointList));
  25308. geoPoints.splice(0, geoParts[_i2]);
  25309. }
  25310. return new MultiLineString(lineList);
  25311. }
  25312. } else {
  25313. return null;
  25314. }
  25315. }
  25316. /**
  25317. * @function ServerGeometry.prototype.toGeoLineEPS
  25318. * @description 将服务端的线几何对象转换为客户端几何对象。包括 GeometryLinearRing、GeometryLineString、GeometryMultiLineString。
  25319. * @returns {Geometry} 转换后的客户端几何对象。
  25320. */
  25321. }, {
  25322. key: "toGeoLineEPS",
  25323. value: function toGeoLineEPS() {
  25324. var me = this,
  25325. geoParts = me.parts || [],
  25326. geoPoints = me.points || [],
  25327. i,
  25328. j,
  25329. pointList,
  25330. lineList,
  25331. lineEPS,
  25332. len = geoParts.length;
  25333. if (len > 0) {
  25334. if (len === 1) {
  25335. for (i = 0, pointList = []; i < geoParts[0]; i++) {
  25336. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y, geoPoints[i].type));
  25337. }
  25338. //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  25339. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  25340. lineEPS = LineString.createLineEPS(pointList);
  25341. return new LinearRing_LinearRing(lineEPS);
  25342. } else {
  25343. lineEPS = LineString.createLineEPS(pointList);
  25344. return new LineString(lineEPS);
  25345. }
  25346. } else {
  25347. for (i = 0, lineList = []; i < len; i++) {
  25348. for (j = 0, pointList = []; j < geoParts[i]; j++) {
  25349. pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  25350. }
  25351. lineEPS = LineString.createLineEPS(pointList);
  25352. lineList.push(new LineString(lineEPS));
  25353. geoPoints.splice(0, geoParts[i]);
  25354. }
  25355. return new MultiLineString(lineList);
  25356. }
  25357. } else {
  25358. return null;
  25359. }
  25360. }
  25361. /**
  25362. * @function ServerGeometry.prototype.toGeoLinem
  25363. * @description 将服务端的路由线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  25364. * @returns {Geometry} 转换后的客户端几何对象。
  25365. */
  25366. }, {
  25367. key: "toGeoLinem",
  25368. value: function toGeoLinem() {
  25369. var me = this;
  25370. return Route.fromJson(me);
  25371. }
  25372. /**
  25373. * @function ServerGeometry.prototype.toGeoRegion
  25374. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 GeometryPolygon。
  25375. * @returns {Geometry} 转换后的客户端几何对象。
  25376. */
  25377. }, {
  25378. key: "toGeoRegion",
  25379. value: function toGeoRegion() {
  25380. var me = this,
  25381. geoParts = me.parts || [],
  25382. geoTopo = me.partTopo || [],
  25383. geoPoints = me.points || [],
  25384. len = geoParts.length;
  25385. if (len <= 0) {
  25386. return null;
  25387. }
  25388. var polygonArray = [];
  25389. var pointList = [];
  25390. if (len == 1) {
  25391. for (var i = 0; i < geoPoints.length; i++) {
  25392. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  25393. }
  25394. polygonArray.push(new Polygon_Polygon([new LinearRing_LinearRing(pointList)]));
  25395. return new MultiPolygon(polygonArray);
  25396. }
  25397. //处理复杂面
  25398. var CCWArray = [];
  25399. var areaArray = [];
  25400. var polygonArrayTemp = [];
  25401. var polygonBounds = [];
  25402. //polyon岛洞标识数组,初始都是岛。
  25403. var CCWIdent = [];
  25404. for (var _i4 = 0, pointIndex = 0; _i4 < len; _i4++) {
  25405. for (var j = 0; j < geoParts[_i4]; j++) {
  25406. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  25407. }
  25408. pointIndex += geoParts[_i4];
  25409. var polygon = new Polygon_Polygon([new LinearRing_LinearRing(pointList)]);
  25410. pointList = [];
  25411. polygonArrayTemp.push(polygon);
  25412. if (geoTopo.length === 0) {
  25413. polygonBounds.push(polygon.getBounds());
  25414. }
  25415. CCWIdent.push(1);
  25416. areaArray.push(polygon.getArea());
  25417. }
  25418. //iServer 9D新增字段
  25419. if (geoTopo.length === 0) {
  25420. //根据面积排序
  25421. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds);
  25422. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  25423. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  25424. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  25425. //目标polygon索引列表 -1标示没有被任何polygon包含,
  25426. var targetArray = [];
  25427. for (var _i6 = 1; _i6 < polygonArrayTemp.length; _i6++) {
  25428. for (var _j2 = _i6 - 1; _j2 >= 0; _j2--) {
  25429. targetArray[_i6] = -1;
  25430. if (polygonBounds[_j2].containsBounds(polygonBounds[_i6])) {
  25431. CCWIdent[_i6] = CCWIdent[_j2] * -1;
  25432. if (CCWIdent[_i6] < 0) {
  25433. targetArray[_i6] = _j2;
  25434. }
  25435. break;
  25436. }
  25437. }
  25438. }
  25439. for (var _i8 = 0; _i8 < polygonArrayTemp.length; _i8++) {
  25440. if (CCWIdent[_i8] > 0) {
  25441. polygonArray.push(polygonArrayTemp[_i8]);
  25442. } else {
  25443. polygonArray[targetArray[_i8]].components = polygonArray[targetArray[_i8]].components.concat(polygonArrayTemp[_i8].components);
  25444. //占位
  25445. polygonArray.push('');
  25446. }
  25447. }
  25448. } else {
  25449. polygonArray = new Array();
  25450. for (var _i10 = 0; _i10 < polygonArrayTemp.length; _i10++) {
  25451. if (geoTopo[_i10] && geoTopo[_i10] == -1) {
  25452. CCWArray = CCWArray.concat(polygonArrayTemp[_i10].components);
  25453. } else {
  25454. if (CCWArray.length > 0 && polygonArray.length > 0) {
  25455. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  25456. CCWArray = [];
  25457. }
  25458. polygonArray.push(polygonArrayTemp[_i10]);
  25459. }
  25460. if (_i10 == len - 1) {
  25461. var polyLength = polygonArray.length;
  25462. if (polyLength) {
  25463. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  25464. } else {
  25465. for (var k = 0, length = CCWArray.length; k < length; k++) {
  25466. polygonArray.push(new Polygon_Polygon(CCWArray));
  25467. }
  25468. }
  25469. }
  25470. }
  25471. }
  25472. return new MultiPolygon(polygonArray);
  25473. }
  25474. /**
  25475. * @function ServerGeometry.prototype.toGeoRegionEPS
  25476. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  25477. * @returns {Geometry} 转换后的客户端几何对象。
  25478. */
  25479. }, {
  25480. key: "toGeoRegionEPS",
  25481. value: function toGeoRegionEPS() {
  25482. var me = this,
  25483. geoParts = me.parts || [],
  25484. geoTopo = me.partTopo || [],
  25485. geoPoints = me.points || [],
  25486. len = geoParts.length;
  25487. if (len <= 0) {
  25488. return null;
  25489. }
  25490. var polygonArray = [];
  25491. var pointList = [];
  25492. var lineEPS;
  25493. if (len == 1) {
  25494. for (var i = 0; i < geoPoints.length; i++) {
  25495. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  25496. }
  25497. lineEPS = LineString.createLineEPS(pointList);
  25498. polygonArray.push(new Polygon_Polygon([new LinearRing_LinearRing(lineEPS)]));
  25499. return new MultiPolygon(polygonArray);
  25500. }
  25501. //处理复杂面
  25502. var CCWArray = [];
  25503. var areaArray = [];
  25504. var polygonArrayTemp = [];
  25505. var polygonBounds = [];
  25506. //polyon岛洞标识数组,初始都是岛。
  25507. var CCWIdent = [];
  25508. for (var _i12 = 0, pointIndex = 0; _i12 < len; _i12++) {
  25509. for (var j = 0; j < geoParts[_i12]; j++) {
  25510. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  25511. }
  25512. pointIndex += geoParts[_i12];
  25513. lineEPS = LineString.createLineEPS(pointList);
  25514. var polygon = new Polygon_Polygon([new LinearRing_LinearRing(lineEPS)]);
  25515. pointList = [];
  25516. polygonArrayTemp.push(polygon);
  25517. if (geoTopo.length === 0) {
  25518. polygonBounds.push(polygon.getBounds());
  25519. }
  25520. CCWIdent.push(1);
  25521. areaArray.push(polygon.getArea());
  25522. }
  25523. //iServer 9D新增字段
  25524. if (geoTopo.length === 0) {
  25525. //根据面积排序
  25526. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds);
  25527. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  25528. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  25529. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  25530. //目标polygon索引列表 -1标示没有被任何polygon包含,
  25531. var targetArray = [];
  25532. for (var _i14 = 1; _i14 < polygonArrayTemp.length; _i14++) {
  25533. for (var _j4 = _i14 - 1; _j4 >= 0; _j4--) {
  25534. targetArray[_i14] = -1;
  25535. if (polygonBounds[_j4].containsBounds(polygonBounds[_i14])) {
  25536. CCWIdent[_i14] = CCWIdent[_j4] * -1;
  25537. if (CCWIdent[_i14] < 0) {
  25538. targetArray[_i14] = _j4;
  25539. }
  25540. break;
  25541. }
  25542. }
  25543. }
  25544. for (var _i16 = 0; _i16 < polygonArrayTemp.length; _i16++) {
  25545. if (CCWIdent[_i16] > 0) {
  25546. polygonArray.push(polygonArrayTemp[_i16]);
  25547. } else {
  25548. polygonArray[targetArray[_i16]].components = polygonArray[targetArray[_i16]].components.concat(polygonArrayTemp[_i16].components);
  25549. //占位
  25550. polygonArray.push('');
  25551. }
  25552. }
  25553. } else {
  25554. polygonArray = new Array();
  25555. for (var _i18 = 0; _i18 < polygonArrayTemp.length; _i18++) {
  25556. if (geoTopo[_i18] && geoTopo[_i18] == -1) {
  25557. CCWArray = CCWArray.concat(polygonArrayTemp[_i18].components);
  25558. } else {
  25559. if (CCWArray.length > 0 && polygonArray.length > 0) {
  25560. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  25561. CCWArray = [];
  25562. }
  25563. polygonArray.push(polygonArrayTemp[_i18]);
  25564. }
  25565. if (_i18 == len - 1) {
  25566. var polyLength = polygonArray.length;
  25567. if (polyLength) {
  25568. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  25569. } else {
  25570. for (var k = 0, length = CCWArray.length; k < length; k++) {
  25571. polygonArray.push(new Polygon_Polygon(CCWArray));
  25572. }
  25573. }
  25574. }
  25575. }
  25576. }
  25577. return new MultiPolygon(polygonArray);
  25578. }
  25579. }, {
  25580. key: "transformGeoCompound",
  25581. value: function transformGeoCompound() {
  25582. var me = this,
  25583. geoParts = me.geoParts || [],
  25584. len = geoParts.length;
  25585. if (len <= 0) {
  25586. return null;
  25587. }
  25588. var geometryList = [];
  25589. for (var index = 0; index < len; index++) {
  25590. var geometry = geoParts[index];
  25591. geometryList.push(new ServerGeometry(geometry).toGeometry());
  25592. }
  25593. return new Collection(geometryList);
  25594. }
  25595. /**
  25596. * @function ServerGeometry.prototype.fromJson
  25597. * @description 将 JSON 对象表示服务端几何对象转换为 ServerGeometry。
  25598. * @param {Object} jsonObject - 要转换的 JSON 对象。
  25599. * @returns {ServerGeometry} 转换后的 ServerGeometry 对象。
  25600. */
  25601. }], [{
  25602. key: "fromJson",
  25603. value: function fromJson(jsonObject) {
  25604. if (!jsonObject) {
  25605. return;
  25606. }
  25607. return new ServerGeometry({
  25608. id: jsonObject.id,
  25609. style: ServerStyle.fromJson(jsonObject.style),
  25610. parts: jsonObject.parts,
  25611. partTopo: jsonObject.partTopo,
  25612. points: jsonObject.points,
  25613. center: jsonObject.center,
  25614. length: jsonObject.length,
  25615. maxM: jsonObject.maxM,
  25616. minM: jsonObject.minM,
  25617. type: jsonObject.type
  25618. });
  25619. }
  25620. /**
  25621. * @function ServerGeometry.prototype.fromGeometry
  25622. * @description 将客户端 Geometry 转换成服务端 ServerGeometry。
  25623. * @param {Geometry} geometry - 要转换的客户端 Geometry 对象。
  25624. * @returns {ServerGeometry} 转换后的 ServerGeometry 对象。
  25625. */
  25626. }, {
  25627. key: "fromGeometry",
  25628. value: function fromGeometry(geometry) {
  25629. if (!geometry) {
  25630. return;
  25631. }
  25632. var id = 0,
  25633. parts = [],
  25634. points = [],
  25635. type = null,
  25636. icomponents = geometry.components,
  25637. className = geometry.CLASS_NAME,
  25638. prjCoordSys = {
  25639. epsgCode: geometry.SRID
  25640. };
  25641. if (!isNaN(geometry.id)) {
  25642. id = geometry.id;
  25643. }
  25644. //坑爹的改法,没法,为了支持态势标绘,有时间就得全改
  25645. if (className != 'SuperMap.Geometry.LinearRing' && className != 'SuperMap.Geometry.LineString' && (geometry instanceof MultiPoint || geometry instanceof MultiLineString)) {
  25646. var ilen = icomponents.length;
  25647. for (var i = 0; i < ilen; i++) {
  25648. var vertices = icomponents[i].getVertices();
  25649. var partPointsCount = vertices.length;
  25650. parts.push(partPointsCount);
  25651. for (var j = 0; j < partPointsCount; j++) {
  25652. points.push(new Point(vertices[j].x, vertices[j].y));
  25653. }
  25654. }
  25655. //这里className不是多点就全部是算线
  25656. type = className == 'SuperMap.Geometry.MultiPoint' ? REST_GeometryType.POINT : REST_GeometryType.LINE;
  25657. } else if (geometry instanceof MultiPolygon) {
  25658. var _ilen = icomponents.length;
  25659. for (var _i20 = 0; _i20 < _ilen; _i20++) {
  25660. var polygon = icomponents[_i20],
  25661. linearRingOfPolygon = polygon.components,
  25662. linearRingOfPolygonLen = linearRingOfPolygon.length;
  25663. for (var _j6 = 0; _j6 < linearRingOfPolygonLen; _j6++) {
  25664. var _vertices = linearRingOfPolygon[_j6].getVertices();
  25665. var _partPointsCount = _vertices.length + 1;
  25666. parts.push(_partPointsCount);
  25667. for (var k = 0; k < _partPointsCount - 1; k++) {
  25668. points.push(new Point(_vertices[k].x, _vertices[k].y));
  25669. }
  25670. points.push(new Point(_vertices[0].x, _vertices[0].y));
  25671. }
  25672. }
  25673. type = REST_GeometryType.REGION;
  25674. } else if (geometry instanceof Polygon_Polygon) {
  25675. var _ilen2 = icomponents.length;
  25676. for (var _i22 = 0; _i22 < _ilen2; _i22++) {
  25677. var _vertices2 = icomponents[_i22].getVertices();
  25678. var _partPointsCount2 = _vertices2.length + 1;
  25679. parts.push(_partPointsCount2);
  25680. for (var _j8 = 0; _j8 < _partPointsCount2 - 1; _j8++) {
  25681. points.push(new Point(_vertices2[_j8].x, _vertices2[_j8].y));
  25682. }
  25683. points.push(new Point(_vertices2[0].x, _vertices2[0].y));
  25684. }
  25685. type = REST_GeometryType.REGION;
  25686. } else {
  25687. var _vertices3 = geometry.getVertices();
  25688. var geometryVerticesCount = _vertices3.length;
  25689. for (var _j10 = 0; _j10 < geometryVerticesCount; _j10++) {
  25690. points.push(new Point(_vertices3[_j10].x, _vertices3[_j10].y));
  25691. }
  25692. if (geometry instanceof LinearRing_LinearRing) {
  25693. points.push(new Point(_vertices3[0].x, _vertices3[0].y));
  25694. geometryVerticesCount++;
  25695. }
  25696. parts.push(geometryVerticesCount);
  25697. type = geometry instanceof Point ? REST_GeometryType.POINT : REST_GeometryType.LINE;
  25698. }
  25699. return new ServerGeometry({
  25700. id: id,
  25701. style: null,
  25702. parts: parts,
  25703. points: points,
  25704. type: type,
  25705. prjCoordSys: prjCoordSys
  25706. });
  25707. }
  25708. /**
  25709. * @function ServerGeometry.prototype.IsClockWise
  25710. * @description 判断 linearRing 中的点的顺序。返回值大于 0,逆时针;小于 0,顺时针。
  25711. * @param {Geometry} geometry - 要转换的客户端 Geometry 对象。
  25712. * @returns {number} 返回值大于 0,逆时针;小于 0,顺时针。
  25713. */
  25714. }, {
  25715. key: "IsClockWise",
  25716. value: function IsClockWise(points) {
  25717. var length = points.length;
  25718. if (length < 3) {
  25719. return 0.0;
  25720. }
  25721. var s = points[0].y * (points[length - 1].x - points[1].x);
  25722. points.push(points[0]);
  25723. for (var i = 1; i < length; i++) {
  25724. s += points[i].y * (points[i - 1].x - points[i + 1].x);
  25725. }
  25726. return s * 0.5;
  25727. }
  25728. }, {
  25729. key: "bubbleSort",
  25730. value: function bubbleSort(areaArray, pointList, geoTopo, polygonBounds) {
  25731. for (var i = 0; i < areaArray.length; i++) {
  25732. for (var j = 0; j < areaArray.length; j++) {
  25733. if (areaArray[i] > areaArray[j]) {
  25734. var d = areaArray[j];
  25735. areaArray[j] = areaArray[i];
  25736. areaArray[i] = d;
  25737. var b = pointList[j];
  25738. pointList[j] = pointList[i];
  25739. pointList[i] = b;
  25740. if (geoTopo && geoTopo.length > 0) {
  25741. var c = geoTopo[j];
  25742. geoTopo[j] = geoTopo[i];
  25743. geoTopo[i] = c;
  25744. }
  25745. if (polygonBounds && polygonBounds.length > 0) {
  25746. var f = polygonBounds[j];
  25747. polygonBounds[j] = polygonBounds[i];
  25748. polygonBounds[i] = f;
  25749. }
  25750. }
  25751. }
  25752. }
  25753. }
  25754. }]);
  25755. return ServerGeometry;
  25756. }();
  25757. ;// CONCATENATED MODULE: ./src/common/format/GeoJSON.js
  25758. 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); }
  25759. function GeoJSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25760. 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); } }
  25761. 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; }
  25762. 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); }
  25763. function GeoJSON_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoJSON_getPrototypeOf(object); if (object === null) break; } return object; }
  25764. 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); }
  25765. 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); }
  25766. 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); }; }
  25767. 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); }
  25768. function GeoJSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25769. 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; } }
  25770. function GeoJSON_getPrototypeOf(o) { GeoJSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoJSON_getPrototypeOf(o); }
  25771. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  25772. * This program are made available under the terms of the Apache License, Version 2.0
  25773. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25774. /**
  25775. * @class GeoJSONFormat
  25776. * @aliasclass Format.GeoJSON
  25777. * @deprecatedclass SuperMap.Format.GeoJSON
  25778. * @classdesc GeoJSON 的读和写。使用 {@link GeoJSONObject} 构造器创建一个 GeoJSON 解析器。
  25779. * @category BaseTypes Format
  25780. * @param {Object} [options] - 可选参数。
  25781. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  25782. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  25783. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  25784. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  25785. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  25786. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  25787. * @param {boolean} [options.ignoreExtraDims=true] - 忽略维度超过 2 的几何要素。
  25788. * @extends {JSONFormat}
  25789. * @usage
  25790. */
  25791. var GeoJSON = /*#__PURE__*/function (_JSONFormat) {
  25792. GeoJSON_inherits(GeoJSON, _JSONFormat);
  25793. var _super = GeoJSON_createSuper(GeoJSON);
  25794. function GeoJSON(options) {
  25795. var _this;
  25796. GeoJSON_classCallCheck(this, GeoJSON);
  25797. _this = _super.call(this, options);
  25798. /**
  25799. * @member {boolean} [GeoJSONFormat.prototype.ignoreExtraDims=true]
  25800. * @description 忽略维度超过 2 的几何要素。
  25801. */
  25802. _this.ignoreExtraDims = true;
  25803. _this.CLASS_NAME = "SuperMap.Format.GeoJSON";
  25804. /**
  25805. * @member {Object} GeoJSONFormat.prototype.parseCoords
  25806. * @private
  25807. * @description 一个属性名对应着 GeoJSON 对象的几何类型的对象。每个属性其实都是一个实际上做解析用的方法。
  25808. */
  25809. _this.parseCoords = {
  25810. /**
  25811. * @function GeoJSONFormat.parseCoords.point
  25812. * @description 将一组坐标转成一个 {@link Geometry} 对象。
  25813. * @param {Object} array - GeoJSON 片段中的一组坐标。
  25814. * @returns {Geometry} 一个几何对象。
  25815. */
  25816. "point": function point(array) {
  25817. if (this.ignoreExtraDims === false && array.length != 2) {
  25818. throw "Only 2D points are supported: " + array;
  25819. }
  25820. return new Point(array[0], array[1]);
  25821. },
  25822. /**
  25823. * @function GeoJSONFormat.parseCoords.multipoint
  25824. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  25825. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  25826. * @returns {Geometry} 一个几何对象。
  25827. */
  25828. "multipoint": function multipoint(array) {
  25829. var points = [];
  25830. var p = null;
  25831. for (var i = 0, len = array.length; i < len; ++i) {
  25832. try {
  25833. p = this.parseCoords["point"].apply(this, [array[i]]);
  25834. } catch (err) {
  25835. throw err;
  25836. }
  25837. points.push(p);
  25838. }
  25839. return new MultiPoint(points);
  25840. },
  25841. /**
  25842. * @function GeoJSONFormat.parseCoords.linestring
  25843. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  25844. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  25845. * @returns {Geometry} 一个几何对象。
  25846. */
  25847. "linestring": function linestring(array) {
  25848. var points = [];
  25849. var p = null;
  25850. for (var i = 0, len = array.length; i < len; ++i) {
  25851. try {
  25852. p = this.parseCoords["point"].apply(this, [array[i]]);
  25853. } catch (err) {
  25854. throw err;
  25855. }
  25856. points.push(p);
  25857. }
  25858. return new LineString(points);
  25859. },
  25860. /**
  25861. * @function GeoJSONFormat.parseCoords.multilinestring
  25862. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  25863. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  25864. * @returns {Geometry} 一个几何对象。
  25865. */
  25866. "multilinestring": function multilinestring(array) {
  25867. var lines = [];
  25868. var l = null;
  25869. for (var i = 0, len = array.length; i < len; ++i) {
  25870. try {
  25871. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  25872. } catch (err) {
  25873. throw err;
  25874. }
  25875. lines.push(l);
  25876. }
  25877. return new MultiLineString(lines);
  25878. },
  25879. /**
  25880. * @function GeoJSONFormat.parseCoords.polygon
  25881. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  25882. * @returns {Geometry} 一个几何对象。
  25883. */
  25884. "polygon": function polygon(array) {
  25885. var rings = [];
  25886. var r, l;
  25887. for (var i = 0, len = array.length; i < len; ++i) {
  25888. try {
  25889. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  25890. } catch (err) {
  25891. throw err;
  25892. }
  25893. r = new LinearRing_LinearRing(l.components);
  25894. rings.push(r);
  25895. }
  25896. return new Polygon_Polygon(rings);
  25897. },
  25898. /**
  25899. * @function GeoJSONFormat.parseCoords.multipolygon
  25900. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  25901. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  25902. * @returns {Geometry} 一个几何对象。
  25903. */
  25904. "multipolygon": function multipolygon(array) {
  25905. var polys = [];
  25906. var p = null;
  25907. for (var i = 0, len = array.length; i < len; ++i) {
  25908. try {
  25909. p = this.parseCoords["polygon"].apply(this, [array[i]]);
  25910. } catch (err) {
  25911. throw err;
  25912. }
  25913. polys.push(p);
  25914. }
  25915. return new MultiPolygon(polys);
  25916. },
  25917. /**
  25918. * @function GeoJSONFormat.parseCoords.box
  25919. * @description 将坐标组数组转化成为一个 {@link Geometry} 对象。
  25920. * @param {Array} array - GeoJSON 片段中的坐标组数组。
  25921. * @returns {Geometry} 一个几何对象。
  25922. */
  25923. "box": function box(array) {
  25924. if (array.length != 2) {
  25925. throw "GeoJSON box coordinates must have 2 elements";
  25926. }
  25927. 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])])]);
  25928. }
  25929. };
  25930. /**
  25931. * @member {Object} GeoJSONFormat.prototype.extract
  25932. * @private
  25933. * @description 一个属性名对应着GeoJSON类型的对象。其值为相应的实际的解析方法。
  25934. */
  25935. _this.extract = {
  25936. /**
  25937. * @function GeoJSONFormat.extract.feature
  25938. * @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
  25939. * @param {SuperMap.ServerFeature} feature - iServer 要素对象。
  25940. * @returns {Object} 一个表示点的对象。
  25941. */
  25942. 'feature': function feature(_feature) {
  25943. var geom = this.extract.geometry.apply(this, [_feature.geometry]);
  25944. var json = {
  25945. "type": "Feature",
  25946. "properties": this.createAttributes(_feature),
  25947. "geometry": geom
  25948. };
  25949. if (_feature.geometry && _feature.geometry.type === 'TEXT') {
  25950. json.properties.texts = _feature.geometry.texts;
  25951. json.properties.textStyle = _feature.geometry.textStyle;
  25952. }
  25953. if (_feature.fid) {
  25954. json.id = _feature.fid;
  25955. }
  25956. if (_feature.ID) {
  25957. json.id = _feature.ID;
  25958. }
  25959. return json;
  25960. },
  25961. /**
  25962. * @function GeoJSONFormat.extract.geometry
  25963. * @description 返回一个表示单个几何对象的 GeoJSON 的一部分。
  25964. * @param {Object} geometry - iServer 几何对象。
  25965. * @returns {Object} 一个表示几何体的对象。
  25966. */
  25967. 'geometry': function geometry(_geometry) {
  25968. if (_geometry == null) {
  25969. return null;
  25970. }
  25971. if (!_geometry.parts && _geometry.points) {
  25972. _geometry.parts = [_geometry.points.length];
  25973. }
  25974. var geo = _geometry.hasOwnProperty('geometryType') ? _geometry : new ServerGeometry(_geometry).toGeometry() || _geometry;
  25975. var geometryType = geo.geometryType || geo.type;
  25976. var data;
  25977. if (geometryType === "LinearRing") {
  25978. geometryType = "LineString";
  25979. }
  25980. if (geometryType === "LINEM") {
  25981. geometryType = "MultiLineString";
  25982. }
  25983. data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
  25984. geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
  25985. var json;
  25986. if (geometryType === "Collection") {
  25987. json = {
  25988. "type": "GeometryCollection",
  25989. "geometries": data
  25990. };
  25991. } else {
  25992. json = {
  25993. "type": geometryType,
  25994. "coordinates": data
  25995. };
  25996. }
  25997. return json;
  25998. },
  25999. /**
  26000. * @function GeoJSONFormat.extract.point
  26001. * @description 从一个点对象中返回一个坐标组。
  26002. * @param {GeometryPoint} point - 一个点对象。
  26003. * @returns {Array} 一个表示一个点的坐标组。
  26004. */
  26005. 'point': function point(_point) {
  26006. var p = [_point.x, _point.y];
  26007. for (var name in _point) {
  26008. if (name !== "x" && name !== "y" && _point[name] !== null && !isNaN(_point[name])) {
  26009. p.push(_point[name]);
  26010. }
  26011. }
  26012. return p;
  26013. },
  26014. /**
  26015. * @function GeoJSONFormat.extract.point
  26016. * @description 从一个文本对象中返回一个坐标组。
  26017. * @param {Object} geo - 一个文本对象。
  26018. * @returns {Array} 一个表示一个点的坐标组。
  26019. */
  26020. 'text': function text(geo) {
  26021. return [geo.points[0].x, geo.points[0].y];
  26022. },
  26023. /**
  26024. * @function GeoJSONFormat.extract.multipoint
  26025. * @description 从一个多点对象中返一个坐标组数组。
  26026. * @param {GeometryMultiPoint} multipoint - 多点对象。
  26027. * @returns {Array} 一个表示多点的坐标组数组。
  26028. */
  26029. 'multipoint': function multipoint(_multipoint) {
  26030. var array = [];
  26031. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  26032. array.push(this.extract.point.apply(this, [_multipoint.components[i]]));
  26033. }
  26034. return array;
  26035. },
  26036. /**
  26037. * @function GeoJSONFormat.extract.linestring
  26038. * @description 从一个线对象中返回一个坐标组数组。
  26039. * @param {Linestring} linestring - 线对象。
  26040. * @returns {Array} 一个表示线对象的坐标组数组。
  26041. */
  26042. 'linestring': function linestring(_linestring) {
  26043. var array = [];
  26044. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  26045. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  26046. }
  26047. return array;
  26048. },
  26049. /**
  26050. * @function GeoJSONFormat.extract.multilinestring
  26051. * @description 从一个多线对象中返回一个线数组。
  26052. * @param {GeometryMultiLineString} multilinestring - 多线对象。
  26053. *
  26054. * @returns {Array} 一个表示多线的线数组。
  26055. */
  26056. 'multilinestring': function multilinestring(_multilinestring) {
  26057. var array = [];
  26058. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  26059. array.push(this.extract.linestring.apply(this, [_multilinestring.components[i]]));
  26060. }
  26061. return array;
  26062. },
  26063. /**
  26064. * @function GeoJSONFormat.extract.polygon
  26065. * @description 从一个面对象中返回一组线环。
  26066. * @param {GeometryPolygon} polygon - 面对象。
  26067. * @returns {Array} 一组表示面的线环。
  26068. */
  26069. 'polygon': function polygon(_polygon) {
  26070. var array = [];
  26071. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  26072. array.push(this.extract.linestring.apply(this, [_polygon.components[i]]));
  26073. }
  26074. return array;
  26075. },
  26076. /**
  26077. * @function GeoJSONFormat.extract.multipolygon
  26078. * @description 从一个多面对象中返回一组面。
  26079. * @param {GeometryMultiPolygon} multipolygon - 多面对象。
  26080. * @returns {Array} 一组表示多面的面。
  26081. */
  26082. 'multipolygon': function multipolygon(_multipolygon) {
  26083. var array = [];
  26084. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  26085. array.push(this.extract.polygon.apply(this, [_multipolygon.components[i]]));
  26086. }
  26087. return array;
  26088. },
  26089. /**
  26090. * @function GeoJSONFormat.extract.collection
  26091. * @description 从一个几何要素集合中一组几何要素数组。
  26092. * @param {GeometryCollection} collection - 几何要素集合。
  26093. * @returns {Array} 一组表示几何要素集合的几何要素数组。
  26094. */
  26095. 'collection': function collection(_collection) {
  26096. var len = _collection.components.length;
  26097. var array = new Array(len);
  26098. for (var i = 0; i < len; ++i) {
  26099. array[i] = this.extract.geometry.apply(this, [_collection.components[i]]);
  26100. }
  26101. return array;
  26102. }
  26103. };
  26104. return _this;
  26105. }
  26106. /**
  26107. * @function GeoJSONFormat.prototype.read
  26108. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为 SuperMap Feature 对象。
  26109. * @param {GeoJSONObject} json - GeoJSON 对象。
  26110. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  26111. * @param {function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  26112. * @returns {Object} 返回值依赖于 type 参数的值。
  26113. * -如果 type 等于 "FeatureCollection",返回值将会是 {@link FeatureVector} 数组。
  26114. * -如果 type 为 "Geometry",输入的 JSON 对象必须表示一个唯一的几何体,然后返回值就会是 {@link Geometry}。
  26115. * -如果 type 为 "Feature",输入的 JSON 对象也必须表示的一个要素,这样返回值才会是 {@link FeatureVector}。
  26116. */
  26117. GeoJSON_createClass(GeoJSON, [{
  26118. key: "read",
  26119. value: function read(json, type, filter) {
  26120. type = type ? type : "FeatureCollection";
  26121. var results = null;
  26122. var obj = null;
  26123. if (typeof json == "string") {
  26124. obj = GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "read", this).call(this, json, filter);
  26125. } else {
  26126. obj = json;
  26127. }
  26128. if (!obj) {
  26129. //console.error("Bad JSON: " + json);
  26130. } else if (typeof obj.type != "string") {
  26131. //console.error("Bad GeoJSON - no type: " + json);
  26132. } else if (this.isValidType(obj, type)) {
  26133. switch (type) {
  26134. case "Geometry":
  26135. try {
  26136. results = this.parseGeometry(obj);
  26137. } catch (err) {
  26138. //console.error(err);
  26139. }
  26140. break;
  26141. case "Feature":
  26142. try {
  26143. results = this.parseFeature(obj);
  26144. results.type = "Feature";
  26145. } catch (err) {
  26146. //console.error(err);
  26147. }
  26148. break;
  26149. case "FeatureCollection":
  26150. // for type FeatureCollection, we allow input to be any type
  26151. results = [];
  26152. switch (obj.type) {
  26153. case "Feature":
  26154. try {
  26155. results.push(this.parseFeature(obj));
  26156. } catch (err) {
  26157. results = null;
  26158. //console.error(err);
  26159. }
  26160. break;
  26161. case "FeatureCollection":
  26162. for (var i = 0, len = obj.features.length; i < len; ++i) {
  26163. try {
  26164. results.push(this.parseFeature(obj.features[i]));
  26165. } catch (err) {
  26166. results = null;
  26167. // console.error(err);
  26168. }
  26169. }
  26170. break;
  26171. default:
  26172. try {
  26173. var geom = this.parseGeometry(obj);
  26174. results.push(new Vector(geom));
  26175. } catch (err) {
  26176. results = null;
  26177. //console.error(err);
  26178. }
  26179. }
  26180. break;
  26181. default:
  26182. break;
  26183. }
  26184. }
  26185. return results;
  26186. }
  26187. /**
  26188. * @function GeoJSONFormat.prototype.write
  26189. * @description iServer Geometry JSON 对象 转 GeoJSON对象字符串。
  26190. * @param {Object} obj - iServer Geometry JSON 对象。
  26191. * @param {boolean} [pretty=false] - 是否使用换行和缩进来控制输出。
  26192. * @returns {GeoJSONObject} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
  26193. */
  26194. }, {
  26195. key: "write",
  26196. value: function write(obj, pretty) {
  26197. return GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "write", this).call(this, this.toGeoJSON(obj), pretty);
  26198. }
  26199. /**
  26200. * @function GeoJSONFormat.prototype.fromGeoJSON
  26201. * @version 9.1.1
  26202. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为iServer Feature JSON。
  26203. * @param {GeoJSONObject} json - GeoJSON 对象。
  26204. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  26205. * @param {function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  26206. * @returns {Object} iServer Feature JSON。
  26207. */
  26208. }, {
  26209. key: "fromGeoJSON",
  26210. value: function fromGeoJSON(json, type, filter) {
  26211. var _this2 = this;
  26212. var feature = this.read(json, type, filter);
  26213. if (!Util_Util.isArray(feature)) {
  26214. return this._toiSevrerFeature(feature);
  26215. }
  26216. return feature.map(function (element) {
  26217. return _this2._toiSevrerFeature(element);
  26218. });
  26219. }
  26220. /**
  26221. * @function GeoJSONFormat.prototype.toGeoJSON
  26222. * @version 9.1.1
  26223. * @description 将 iServer Feature JSON 对象转换为 GeoJSON 对象。
  26224. * @param {Object} obj - iServer Feature JSON。
  26225. * @returns {GeoJSONObject} GeoJSON 对象。
  26226. */
  26227. }, {
  26228. key: "toGeoJSON",
  26229. value: function toGeoJSON(obj) {
  26230. var geojson = {
  26231. "type": null
  26232. };
  26233. if (Util_Util.isArray(obj)) {
  26234. geojson.type = "FeatureCollection";
  26235. var numFeatures = obj.length;
  26236. geojson.features = new Array(numFeatures);
  26237. for (var i = 0; i < numFeatures; ++i) {
  26238. var element = obj[i];
  26239. if (isGeometry(element)) {
  26240. var feature = {};
  26241. feature.geometry = element;
  26242. geojson.features[i] = this.extract.feature.apply(this, [feature]);
  26243. } else {
  26244. geojson.features[i] = this.extract.feature.apply(this, [element]);
  26245. }
  26246. }
  26247. } else if (isGeometry(obj)) {
  26248. var _feature2 = {};
  26249. _feature2.geometry = obj;
  26250. geojson = this.extract.feature.apply(this, [_feature2]);
  26251. } else {
  26252. geojson = this.extract.feature.apply(this, [obj]);
  26253. }
  26254. function isGeometry(input) {
  26255. return input.hasOwnProperty("parts") && input.hasOwnProperty("points") || input.hasOwnProperty("geoParts");
  26256. }
  26257. return geojson;
  26258. }
  26259. /**
  26260. * @function GeoJSONFormat.prototype.isValidType
  26261. * @description 检查一个 GeoJSON 对象是否和给定的类型相符的合法的对象。
  26262. * @returns {boolean} GeoJSON 是否是给定类型的合法对象。
  26263. * @private
  26264. */
  26265. }, {
  26266. key: "isValidType",
  26267. value: function isValidType(obj, type) {
  26268. var valid = false;
  26269. switch (type) {
  26270. case "Geometry":
  26271. if (Util_Util.indexOf(["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection"], obj.type) == -1) {
  26272. // unsupported geometry type
  26273. //console.error("Unsupported geometry type: " +
  26274. // obj.type);
  26275. } else {
  26276. valid = true;
  26277. }
  26278. break;
  26279. case "FeatureCollection":
  26280. // allow for any type to be converted to a feature collection
  26281. valid = true;
  26282. break;
  26283. default:
  26284. // for Feature types must match
  26285. if (obj.type == type) {
  26286. valid = true;
  26287. } else {
  26288. //console.error("Cannot convert types from " +
  26289. //obj.type + " to " + type);
  26290. }
  26291. }
  26292. return valid;
  26293. }
  26294. /**
  26295. * @function GeoJSONFormat.prototype.parseFeature
  26296. * @description 将一个 GeoJSON 中的 feature 转化成 {@link FeatureVector}> 对象。
  26297. * @private
  26298. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  26299. * @returns {FeatureVector} 一个要素。
  26300. */
  26301. }, {
  26302. key: "parseFeature",
  26303. value: function parseFeature(obj) {
  26304. var feature, geometry, attributes, bbox;
  26305. attributes = obj.properties ? obj.properties : {};
  26306. bbox = obj.geometry && obj.geometry.bbox || obj.bbox;
  26307. try {
  26308. geometry = this.parseGeometry(obj.geometry);
  26309. } catch (err) {
  26310. // deal with bad geometries
  26311. throw err;
  26312. }
  26313. feature = new Vector(geometry, attributes);
  26314. if (bbox) {
  26315. feature.bounds = Bounds.fromArray(bbox);
  26316. }
  26317. if (obj.id) {
  26318. feature.geometry.id = obj.id;
  26319. feature.fid = obj.id;
  26320. }
  26321. return feature;
  26322. }
  26323. /**
  26324. * @function GeoJSONFormat.prototype.parseGeometry
  26325. * @description 将一个 GeoJSON 中的几何要素转化成 {@link Geometry} 对象。
  26326. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  26327. * @returns {Geometry} 一个几何要素。
  26328. * @private
  26329. */
  26330. }, {
  26331. key: "parseGeometry",
  26332. value: function parseGeometry(obj) {
  26333. if (obj == null) {
  26334. return null;
  26335. }
  26336. var geometry;
  26337. if (obj.type == "GeometryCollection") {
  26338. if (!Util_Util.isArray(obj.geometries)) {
  26339. throw "GeometryCollection must have geometries array: " + obj;
  26340. }
  26341. var numGeom = obj.geometries.length;
  26342. var components = new Array(numGeom);
  26343. for (var i = 0; i < numGeom; ++i) {
  26344. components[i] = this.parseGeometry.apply(this, [obj.geometries[i]]);
  26345. }
  26346. geometry = new Collection(components);
  26347. } else {
  26348. if (!Util_Util.isArray(obj.coordinates)) {
  26349. throw "Geometry must have coordinates array: " + obj;
  26350. }
  26351. if (!this.parseCoords[obj.type.toLowerCase()]) {
  26352. throw "Unsupported geometry type: " + obj.type;
  26353. }
  26354. try {
  26355. geometry = this.parseCoords[obj.type.toLowerCase()].apply(this, [obj.coordinates]);
  26356. } catch (err) {
  26357. // deal with bad coordinates
  26358. throw err;
  26359. }
  26360. }
  26361. return geometry;
  26362. }
  26363. /**
  26364. * @function GeoJSONFormat.prototype.createCRSObject
  26365. * @description 从一个要素对象中创建一个坐标参考系对象。
  26366. * @param {FeatureVector} object - 要素对象。
  26367. * @private
  26368. * @returns {GeoJSONObject} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
  26369. */
  26370. }, {
  26371. key: "createCRSObject",
  26372. value: function createCRSObject(object) {
  26373. var proj = object.layer.projection.toString();
  26374. var crs = {};
  26375. if (proj.match(/epsg:/i)) {
  26376. var code = parseInt(proj.substring(proj.indexOf(":") + 1));
  26377. if (code == 4326) {
  26378. crs = {
  26379. "type": "name",
  26380. "properties": {
  26381. "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
  26382. }
  26383. };
  26384. } else {
  26385. crs = {
  26386. "type": "name",
  26387. "properties": {
  26388. "name": "EPSG:" + code
  26389. }
  26390. };
  26391. }
  26392. }
  26393. return crs;
  26394. }
  26395. }, {
  26396. key: "_toiSevrerFeature",
  26397. value: function _toiSevrerFeature(feature) {
  26398. var attributes = feature.attributes;
  26399. var attrNames = [];
  26400. var attrValues = [];
  26401. for (var attr in attributes) {
  26402. attrNames.push(attr);
  26403. attrValues.push(attributes[attr]);
  26404. }
  26405. var newFeature = {
  26406. fieldNames: attrNames,
  26407. fieldValues: attrValues,
  26408. geometry: ServerGeometry.fromGeometry(feature.geometry)
  26409. };
  26410. newFeature.geometry.id = feature.fid;
  26411. return newFeature;
  26412. }
  26413. }, {
  26414. key: "createAttributes",
  26415. value: function createAttributes(feature) {
  26416. if (!feature) {
  26417. return null;
  26418. }
  26419. var attr = {};
  26420. processFieldsAttributes(feature, attr);
  26421. var exceptKeys = ["fieldNames", "fieldValues", "geometry", "stringID", "ID"];
  26422. for (var key in feature) {
  26423. if (exceptKeys.indexOf(key) > -1) {
  26424. continue;
  26425. }
  26426. attr[key] = feature[key];
  26427. }
  26428. function processFieldsAttributes(feature, attributes) {
  26429. if (!(feature.hasOwnProperty("fieldNames") && feature.hasOwnProperty("fieldValues"))) {
  26430. return;
  26431. }
  26432. var names = feature.fieldNames,
  26433. values = feature.fieldValues;
  26434. for (var i in names) {
  26435. attributes[names[i]] = values[i];
  26436. }
  26437. }
  26438. return attr;
  26439. }
  26440. }]);
  26441. return GeoJSON;
  26442. }(JSONFormat);
  26443. ;// CONCATENATED MODULE: ./src/common/format/WKT.js
  26444. 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); }
  26445. function WKT_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26446. 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); } }
  26447. 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; }
  26448. 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); }
  26449. 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); }
  26450. 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); }; }
  26451. 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); }
  26452. function WKT_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26453. 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; } }
  26454. function WKT_getPrototypeOf(o) { WKT_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WKT_getPrototypeOf(o); }
  26455. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26456. * This program are made available under the terms of the Apache License, Version 2.0
  26457. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26458. /**
  26459. * @class WKTFormat
  26460. * @aliasclass Format.WKT
  26461. * @deprecatedclass SuperMap.Format.WKT
  26462. * @classdesc 用于读写常见文本的类。通过 {@link WKTFormat} 构造器来创建一个新的实例。
  26463. * @category BaseTypes Format
  26464. * @extends {Format}
  26465. * @param {Object} options - 可选的选项对象,其属性将被设置到实例。option 具体配置项继承自 {@link Format}。
  26466. * @usage
  26467. */
  26468. var WKT = /*#__PURE__*/function (_Format) {
  26469. WKT_inherits(WKT, _Format);
  26470. var _super = WKT_createSuper(WKT);
  26471. function WKT(options) {
  26472. var _this;
  26473. WKT_classCallCheck(this, WKT);
  26474. _this = _super.call(this, options);
  26475. _this.regExes = {
  26476. 'typeStr': /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
  26477. 'spaces': /\s+/,
  26478. 'parenComma': /\)\s*,\s*\(/,
  26479. 'doubleParenComma': /\)\s*\)\s*,\s*\(\s*\(/,
  26480. // can't use {2} here
  26481. 'trimParens': /^\s*\(?(.*?)\)?\s*$/
  26482. };
  26483. _this.CLASS_NAME = "SuperMap.Format.WKT"; /**
  26484. * @private
  26485. * @description Object with properties corresponding to the geometry types.
  26486. * Property values are functions that do the actual data extraction.
  26487. */
  26488. _this.extract = {
  26489. /**
  26490. * @description Return a space delimited string of point coordinates.
  26491. * @param {GeometryPoint} point
  26492. * @returns {string} A string of coordinates representing the point
  26493. */
  26494. 'point': function point(_point) {
  26495. return _point.x + ' ' + _point.y;
  26496. },
  26497. /**
  26498. * @description Return a comma delimited string of point coordinates from a multipoint.
  26499. * @param {GeometryMultiPoint} multipoint
  26500. * @returns {string} A string of point coordinate strings representing
  26501. * the multipoint
  26502. */
  26503. 'multipoint': function multipoint(_multipoint) {
  26504. var array = [];
  26505. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  26506. array.push('(' + this.extract.point.apply(this, [_multipoint.components[i]]) + ')');
  26507. }
  26508. return array.join(',');
  26509. },
  26510. /**
  26511. * @description Return a comma delimited string of point coordinates from a line.
  26512. * @param {GeometryLineString} linestring
  26513. * @returns {string} A string of point coordinate strings representing
  26514. * the linestring
  26515. */
  26516. 'linestring': function linestring(_linestring) {
  26517. var array = [];
  26518. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  26519. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  26520. }
  26521. return array.join(',');
  26522. },
  26523. /**
  26524. * @description Return a comma delimited string of linestring strings from a multilinestring.
  26525. * @param {GeometryMultiLineString} multilinestring
  26526. * @returns {string} A string of of linestring strings representing
  26527. * the multilinestring
  26528. */
  26529. 'multilinestring': function multilinestring(_multilinestring) {
  26530. var array = [];
  26531. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  26532. array.push('(' + this.extract.linestring.apply(this, [_multilinestring.components[i]]) + ')');
  26533. }
  26534. return array.join(',');
  26535. },
  26536. /**
  26537. * @description Return a comma delimited string of linear ring arrays from a polygon.
  26538. * @param {GeometryPolygon} polygon
  26539. * @returns {string} An array of linear ring arrays representing the polygon
  26540. */
  26541. 'polygon': function polygon(_polygon) {
  26542. var array = [];
  26543. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  26544. array.push('(' + this.extract.linestring.apply(this, [_polygon.components[i]]) + ')');
  26545. }
  26546. return array.join(',');
  26547. },
  26548. /**
  26549. * @description Return an array of polygon arrays from a multipolygon.
  26550. * @param {GeometryMultiPolygon} multipolygon
  26551. * @returns {string} An array of polygon arrays representing
  26552. * the multipolygon
  26553. */
  26554. 'multipolygon': function multipolygon(_multipolygon) {
  26555. var array = [];
  26556. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  26557. array.push('(' + this.extract.polygon.apply(this, [_multipolygon.components[i]]) + ')');
  26558. }
  26559. return array.join(',');
  26560. },
  26561. /**
  26562. * @description Return the WKT portion between 'GEOMETRYCOLLECTION(' and ')' for an <GeometryCollection>
  26563. * @param {GeometryCollection} collection
  26564. * @returns {string} internal WKT representation of the collection
  26565. */
  26566. 'collection': function collection(_collection) {
  26567. var array = [];
  26568. for (var i = 0, len = _collection.components.length; i < len; ++i) {
  26569. array.push(this.extractGeometry.apply(this, [_collection.components[i]]));
  26570. }
  26571. return array.join(',');
  26572. }
  26573. };
  26574. /**
  26575. * @private
  26576. * @description Object with properties corresponding to the geometry types.
  26577. * Property values are functions that do the actual parsing.
  26578. */
  26579. _this.parse = {
  26580. /**
  26581. * @private
  26582. * @description Return point feature given a point WKT fragment.
  26583. * @param {string} str A WKT fragment representing the point
  26584. * @returns {FeatureVector} A point feature
  26585. *
  26586. */
  26587. 'point': function point(str) {
  26588. var coords = StringExt.trim(str).split(this.regExes.spaces);
  26589. return new Vector(new Point(coords[0], coords[1]));
  26590. },
  26591. /**
  26592. * @description Return a multipoint feature given a multipoint WKT fragment.
  26593. * @param {string} A WKT fragment representing the multipoint
  26594. * @returns {FeatureVector} A multipoint feature
  26595. * @private
  26596. */
  26597. 'multipoint': function multipoint(str) {
  26598. var point;
  26599. var points = StringExt.trim(str).split(',');
  26600. var components = [];
  26601. for (var i = 0, len = points.length; i < len; ++i) {
  26602. point = points[i].replace(this.regExes.trimParens, '$1');
  26603. components.push(this.parse.point.apply(this, [point]).geometry);
  26604. }
  26605. return new Vector(new MultiPoint(components));
  26606. },
  26607. /**
  26608. * @description Return a linestring feature given a linestring WKT fragment.
  26609. * @param {string} A WKT fragment representing the linestring
  26610. * @returns {FeatureVector} A linestring feature
  26611. * @private
  26612. */
  26613. 'linestring': function linestring(str) {
  26614. var points = StringExt.trim(str).split(',');
  26615. var components = [];
  26616. for (var i = 0, len = points.length; i < len; ++i) {
  26617. components.push(this.parse.point.apply(this, [points[i]]).geometry);
  26618. }
  26619. return new Vector(new LineString(components));
  26620. },
  26621. /**
  26622. * @description Return a multilinestring feature given a multilinestring WKT fragment.
  26623. * @param {string} A WKT fragment representing the multilinestring
  26624. * @returns {FeatureVector} A multilinestring feature
  26625. * @private
  26626. */
  26627. 'multilinestring': function multilinestring(str) {
  26628. var line;
  26629. var lines = StringExt.trim(str).split(this.regExes.parenComma);
  26630. var components = [];
  26631. for (var i = 0, len = lines.length; i < len; ++i) {
  26632. line = lines[i].replace(this.regExes.trimParens, '$1');
  26633. components.push(this.parse.linestring.apply(this, [line]).geometry);
  26634. }
  26635. return new Vector(new MultiLineString(components));
  26636. },
  26637. /**
  26638. * @description Return a polygon feature given a polygon WKT fragment.
  26639. * @param {string} A WKT fragment representing the polygon
  26640. * @returns {FeatureVector} A polygon feature
  26641. * @private
  26642. */
  26643. 'polygon': function polygon(str) {
  26644. var ring, linestring, linearring;
  26645. var rings = StringExt.trim(str).split(this.regExes.parenComma);
  26646. var components = [];
  26647. for (var i = 0, len = rings.length; i < len; ++i) {
  26648. ring = rings[i].replace(this.regExes.trimParens, '$1');
  26649. linestring = this.parse.linestring.apply(this, [ring]).geometry;
  26650. linearring = new LinearRing_LinearRing(linestring.components);
  26651. components.push(linearring);
  26652. }
  26653. return new Vector(new Polygon_Polygon(components));
  26654. },
  26655. /**
  26656. * @private
  26657. * @description Return a multipolygon feature given a multipolygon WKT fragment.
  26658. * @param {string} A WKT fragment representing the multipolygon
  26659. * @returns {FeatureVector} A multipolygon feature
  26660. *
  26661. */
  26662. 'multipolygon': function multipolygon(str) {
  26663. var polygon;
  26664. var polygons = StringExt.trim(str).split(this.regExes.doubleParenComma);
  26665. var components = [];
  26666. for (var i = 0, len = polygons.length; i < len; ++i) {
  26667. polygon = polygons[i].replace(this.regExes.trimParens, '$1');
  26668. components.push(this.parse.polygon.apply(this, [polygon]).geometry);
  26669. }
  26670. return new Vector(new MultiPolygon(components));
  26671. },
  26672. /**
  26673. * @description Return an array of features given a geometrycollection WKT fragment.
  26674. * @param {string} A WKT fragment representing the geometrycollection
  26675. * @returns {Array} An array of FeatureVector
  26676. * @private
  26677. */
  26678. 'geometrycollection': function geometrycollection(str) {
  26679. // separate components of the collection with |
  26680. str = str.replace(/,\s*([A-Za-z])/g, '|$1');
  26681. var wktArray = StringExt.trim(str).split('|');
  26682. var components = [];
  26683. for (var i = 0, len = wktArray.length; i < len; ++i) {
  26684. components.push(this.read(wktArray[i]));
  26685. }
  26686. return components;
  26687. }
  26688. };
  26689. return _this;
  26690. }
  26691. /**
  26692. * @function WKTFormat.prototype.read
  26693. * @description 反序列化 WKT 字符串并返回向量特征或向量特征数组。支持 POINT、MULTIPOINT、LINESTRING、MULTILINESTRING、POLYGON、MULTIPOLYGON 和 GEOMETRYCOLLECTION 的 WKT。
  26694. * @param {string} wkt - WKT 字符串。
  26695. * @returns {FeatureVector|Array} GEOMETRYCOLLECTION WKT 的矢量要素或者矢量要素数组。
  26696. */
  26697. WKT_createClass(WKT, [{
  26698. key: "read",
  26699. value: function read(wkt) {
  26700. var features, type, str;
  26701. wkt = wkt.replace(/[\n\r]/g, " ");
  26702. var matches = this.regExes.typeStr.exec(wkt);
  26703. if (matches) {
  26704. type = matches[1].toLowerCase();
  26705. str = matches[2];
  26706. if (this.parse[type]) {
  26707. features = this.parse[type].apply(this, [str]);
  26708. }
  26709. }
  26710. return features;
  26711. }
  26712. /**
  26713. * @function WKTFormat.prototype.write
  26714. * @description 将矢量要素或矢量要素数组序列化为 WKT 字符串。
  26715. * @param {(FeatureVector|Array)} features - 矢量要素或矢量要素数组。
  26716. * @returns {string} 表示几何的 WKT 字符串。
  26717. */
  26718. }, {
  26719. key: "write",
  26720. value: function write(features) {
  26721. var collection, geometry, isCollection;
  26722. if (features.constructor === Array) {
  26723. collection = features;
  26724. isCollection = true;
  26725. } else {
  26726. collection = [features];
  26727. isCollection = false;
  26728. }
  26729. var pieces = [];
  26730. if (isCollection) {
  26731. pieces.push('GEOMETRYCOLLECTION(');
  26732. }
  26733. for (var i = 0, len = collection.length; i < len; ++i) {
  26734. if (isCollection && i > 0) {
  26735. pieces.push(',');
  26736. }
  26737. geometry = collection[i].geometry;
  26738. pieces.push(this.extractGeometry(geometry));
  26739. }
  26740. if (isCollection) {
  26741. pieces.push(')');
  26742. }
  26743. return pieces.join('');
  26744. }
  26745. /**
  26746. * @function WKTFormat.prototype.extractGeometry
  26747. * @description 为单个 Geometry 对象构造 WKT 的入口点。
  26748. * @param {Geometry} geometry - Geometry 对象。
  26749. * @returns {string} 表示几何的 WKT 字符串。
  26750. */
  26751. }, {
  26752. key: "extractGeometry",
  26753. value: function extractGeometry(geometry) {
  26754. var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
  26755. if (!this.extract[type]) {
  26756. return null;
  26757. }
  26758. var wktType = type === 'collection' ? 'GEOMETRYCOLLECTION' : type.toUpperCase();
  26759. var data = wktType + '(' + this.extract[type].apply(this, [geometry]) + ')';
  26760. return data;
  26761. }
  26762. }]);
  26763. return WKT;
  26764. }(Format);
  26765. ;// CONCATENATED MODULE: ./src/common/format/index.js
  26766. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26767. * This program are made available under the terms of the Apache License, Version 2.0
  26768. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26769. ;// CONCATENATED MODULE: ./src/common/control/TimeControlBase.js
  26770. function TimeControlBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26771. 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); } }
  26772. 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; }
  26773. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  26774. * This program are made available under the terms of the Apache License, Version 2.0
  26775. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26776. /**
  26777. * @class TimeControlBase
  26778. * @deprecatedclass SuperMap.TimeControlBase
  26779. * @classdesc 时间控制基类。
  26780. * @modulecategory Control
  26781. * @category Control
  26782. * @param {Object} options - 可选参数。
  26783. * @param {number} [options.speed=1] - 速度。不能小于 0,(每帧渲染的数据之间的间隔为1),设置越大速度越快。
  26784. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms),服务器刷新的时间间隔。
  26785. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  26786. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时以当前时间进行设置,建议设置。
  26787. * @param {boolean} [options.repeat=true] - 是否重复循环。
  26788. * @param {boolean} [options.reverse=false] - 是否反向。
  26789. * @usage
  26790. */
  26791. var TimeControlBase = /*#__PURE__*/function () {
  26792. function TimeControlBase(options) {
  26793. TimeControlBase_classCallCheck(this, TimeControlBase);
  26794. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  26795. var me = this;
  26796. options = options || {};
  26797. /**
  26798. * @member {number} [TimeControlBase.prototype.speed=1]
  26799. * @description 步长,必须为非负数,默认为1(表示前后两次渲染的数据之间的间隔为1)。
  26800. */
  26801. this.speed = options.speed && options.speed >= 0 ? options.speed : 1;
  26802. /**
  26803. * @member {number} [TimeControlBase.prototype.frequency=1000]
  26804. * @description 刷新频率(单位ms),服务器刷新的时间间隔。
  26805. */
  26806. this.frequency = options.speed && options.frequency >= 0 ? options.frequency : 1000;
  26807. /**
  26808. * @member {number} [TimeControlBase.prototype.startTime=0]
  26809. * @description 记录的起始时间,必须为数字,
  26810. * 如果不设置,初始化时为0,建议设置。
  26811. */
  26812. this.startTime = options.startTime && options.startTime != null ? options.startTime : 0;
  26813. /**
  26814. * @member {number} TimeControlBase.prototype.endTime
  26815. * @description 记录的结束时间,必须为数字,
  26816. * 如果不设置,初始化时以当前时间进行设置,建议设置。
  26817. */
  26818. this.endTime = options.endTime && options.endTime != null && options.endTime >= me.startTime ? options.endTime : +new Date();
  26819. /**
  26820. * @member {boolean} [TimeControlBase.prototype.repeat=true]
  26821. * @description 是否重复循环。
  26822. */
  26823. this.repeat = options.repeat !== undefined ? options.repeat : true;
  26824. /**
  26825. * @member {boolean} [TimeControlBase.prototype.reverse=false]
  26826. * @description 是否反向。
  26827. */
  26828. this.reverse = options.reverse !== undefined ? options.reverse : false;
  26829. /**
  26830. * @member {number} TimeControlBase.prototype.currentTime
  26831. * @description 记录近期的时间,也就是当前帧运行到的时间。
  26832. */
  26833. this.currentTime = null;
  26834. /**
  26835. * @member {number} TimeControlBase.prototype.oldTime
  26836. * @description 记录上一帧的时间,也就是之前运行到的时间。
  26837. */
  26838. this.oldTime = null;
  26839. /**
  26840. * @member {boolean} [TimeControlBase.prototype.running=false]
  26841. * @description 记录当前是否处于运行中。
  26842. */
  26843. this.running = false;
  26844. /**
  26845. * @private
  26846. * @member {Array.<string>} TimeControlBase.prototype.EVENT_TYPES
  26847. * @description 此类支持的事件类型。
  26848. *
  26849. */
  26850. this.EVENT_TYPES = ["start", "pause", "stop"];
  26851. /**
  26852. * @private
  26853. * @member {Events} TimeControlBase.prototype.events
  26854. * @description 事件
  26855. */
  26856. me.events = new Events(this, null, this.EVENT_TYPES);
  26857. me.speed = Number(me.speed);
  26858. me.frequency = Number(me.frequency);
  26859. me.startTime = Number(me.startTime);
  26860. me.endTime = Number(me.endTime);
  26861. me.startTime = Date.parse(new Date(me.startTime));
  26862. me.endTime = Date.parse(new Date(me.endTime));
  26863. //初始化当前时间
  26864. me.currentTime = me.startTime;
  26865. this.CLASS_NAME = "SuperMap.TimeControlBase";
  26866. }
  26867. /**
  26868. * @function TimeControlBase.prototype.updateOptions
  26869. * @description 更新参数。
  26870. * @param {Object} options - 设置参数的可选参数。设置步长,刷新频率、开始结束时间、是否循环、是否反向。
  26871. */
  26872. TimeControlBase_createClass(TimeControlBase, [{
  26873. key: "updateOptions",
  26874. value: function updateOptions(options) {
  26875. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  26876. var me = this;
  26877. options = options || {};
  26878. if (options.speed && options.speed >= 0) {
  26879. me.speed = options.speed;
  26880. me.speed = Number(me.speed);
  26881. }
  26882. if (options.speed && options.frequency >= 0) {
  26883. me.frequency = options.frequency;
  26884. me.frequency = Number(me.frequency);
  26885. }
  26886. if (options.startTime && options.startTime != null) {
  26887. me.startTime = options.startTime;
  26888. me.startTime = Date.parse(new Date(me.startTime));
  26889. }
  26890. if (options.endTime && options.endTime != null && options.endTime >= me.startTime) {
  26891. me.endTime = options.endTime;
  26892. me.endTime = Date.parse(new Date(me.endTime));
  26893. }
  26894. if (options.repeat != null) {
  26895. me.repeat = options.repeat;
  26896. }
  26897. if (options.reverse != null) {
  26898. me.reverse = options.reverse;
  26899. }
  26900. }
  26901. /**
  26902. * @function TimeControlBase.prototype.start
  26903. * @description 开始。
  26904. */
  26905. }, {
  26906. key: "start",
  26907. value: function start() {
  26908. var me = this;
  26909. if (!me.running) {
  26910. me.running = true;
  26911. me.tick();
  26912. me.events.triggerEvent('start', me.currentTime);
  26913. }
  26914. }
  26915. /**
  26916. * @function TimeControlBase.prototype.pause
  26917. * @description 暂停。
  26918. */
  26919. }, {
  26920. key: "pause",
  26921. value: function pause() {
  26922. var me = this;
  26923. me.running = false;
  26924. me.events.triggerEvent('pause', me.currentTime);
  26925. }
  26926. /**
  26927. * @function TimeControlBase.prototype.stop
  26928. * @description 停止,停止后返回起始状态。
  26929. */
  26930. }, {
  26931. key: "stop",
  26932. value: function stop() {
  26933. var me = this;
  26934. //停止时 时间设置为开始时间
  26935. me.currentTime = me.startTime;
  26936. //如果正在运行,修改为初始时间即可绘制一帧
  26937. if (me.running) {
  26938. me.running = false;
  26939. }
  26940. me.events.triggerEvent('stop', me.currentTime);
  26941. }
  26942. /**
  26943. * @function TimeControlBase.prototype.toggle
  26944. * @description 开关切换,切换的是开始和暂停。
  26945. */
  26946. }, {
  26947. key: "toggle",
  26948. value: function toggle() {
  26949. var me = this;
  26950. if (me.running) {
  26951. me.pause();
  26952. } else {
  26953. me.start();
  26954. }
  26955. }
  26956. /**
  26957. * @function TimeControlBase.prototype.setSpeed
  26958. * @description 设置步长。
  26959. * @param {number} [speed=1] - 步长,必须为非负数。
  26960. * @returns {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
  26961. */
  26962. }, {
  26963. key: "setSpeed",
  26964. value: function setSpeed(speed) {
  26965. var me = this;
  26966. if (speed >= 0) {
  26967. me.speed = speed;
  26968. return true;
  26969. }
  26970. return false;
  26971. }
  26972. /**
  26973. * @function TimeControlBase.prototype.getSpeed
  26974. * @description 获取步长。
  26975. * @returns {number} 返回当前的步长。
  26976. */
  26977. }, {
  26978. key: "getSpeed",
  26979. value: function getSpeed() {
  26980. return this.speed;
  26981. }
  26982. /**
  26983. * @function TimeControlBase.prototype.setFrequency
  26984. * @description 设置刷新频率。
  26985. * @param {number} [frequency=1000] - 刷新频率,单位为 ms。
  26986. * @returns {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
  26987. */
  26988. }, {
  26989. key: "setFrequency",
  26990. value: function setFrequency(frequency) {
  26991. var me = this;
  26992. if (frequency >= 0) {
  26993. me.frequency = frequency;
  26994. return true;
  26995. }
  26996. return false;
  26997. }
  26998. /**
  26999. * @function TimeControlBase.prototype.getFrequency
  27000. * @description 获取刷新频率。
  27001. * @returns {number} 返回当前的刷新频率。
  27002. */
  27003. }, {
  27004. key: "getFrequency",
  27005. value: function getFrequency() {
  27006. return this.frequency;
  27007. }
  27008. /**
  27009. * @function TimeControlBase.prototype.setStartTime
  27010. * @description 设置起始时间,设置完成后如果当前时间小于起始时间,则从起始时间开始。
  27011. * @param {number} startTime - 需要设置的起始时间。
  27012. * @returns {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
  27013. */
  27014. }, {
  27015. key: "setStartTime",
  27016. value: function setStartTime(startTime) {
  27017. var me = this;
  27018. startTime = Date.parse(new Date(startTime));
  27019. //起始时间不得大于结束时间
  27020. if (startTime > me.endTime) {
  27021. return false;
  27022. }
  27023. me.startTime = startTime;
  27024. //如果当前时间小于了起始时间,则从当前起始时间开始
  27025. if (me.currentTime < me.startTime) {
  27026. me.currentTime = me.startTime;
  27027. me.tick();
  27028. }
  27029. return true;
  27030. }
  27031. /**
  27032. * @function TimeControlBase.prototype.getStartTime
  27033. * @description 获取起始时间。
  27034. * @returns {number} 返回当前的起始时间。
  27035. */
  27036. }, {
  27037. key: "getStartTime",
  27038. value: function getStartTime() {
  27039. return this.startTime;
  27040. }
  27041. /**
  27042. * @function TimeControlBase.prototype.setEndTime
  27043. * @description 设置结束时间,设置完成后如果当前时间大于结束,则从起始时间开始。
  27044. * @param {number} endTime - 需要设置的结束时间。
  27045. * @returns {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
  27046. */
  27047. }, {
  27048. key: "setEndTime",
  27049. value: function setEndTime(endTime) {
  27050. var me = this;
  27051. me.endTime = Date.parse(new Date(me.endTime));
  27052. //结束时间不得小于开始时间
  27053. if (endTime < me.startTime) {
  27054. return false;
  27055. }
  27056. me.endTime = endTime;
  27057. //如果当前时间大于了结束时间,则从起始时间开始
  27058. if (me.currentTime >= me.endTime) {
  27059. me.currentTime = me.startTime;
  27060. me.tick();
  27061. }
  27062. return true;
  27063. }
  27064. /**
  27065. * @function TimeControlBase.prototype.getEndTime
  27066. * @description 获取结束时间。
  27067. * @returns {number} 返回当前的结束时间。
  27068. */
  27069. }, {
  27070. key: "getEndTime",
  27071. value: function getEndTime() {
  27072. return this.endTime;
  27073. }
  27074. /**
  27075. * @function TimeControlBase.prototype.setCurrentTime
  27076. * @description 设置当前时间。
  27077. * @param {number} currentTime - 需要设置的当前时间。
  27078. * @returns {boolean} true 代表设置成功,false 设置失败。
  27079. */
  27080. }, {
  27081. key: "setCurrentTime",
  27082. value: function setCurrentTime(currentTime) {
  27083. var me = this;
  27084. me.currentTime = Date.parse(new Date(me.currentTime));
  27085. //结束时间不得小于开始时间
  27086. if (currentTime >= me.startTime && currentTime <= me.endTime) {
  27087. me.currentTime = currentTime;
  27088. me.startTime = me.currentTime;
  27089. me.tick();
  27090. return true;
  27091. }
  27092. return false;
  27093. }
  27094. /**
  27095. * @function TimeControlBase.prototype.getCurrentTime
  27096. * @description 获取当前时间。
  27097. * @returns {number} 返回当前时间。
  27098. */
  27099. }, {
  27100. key: "getCurrentTime",
  27101. value: function getCurrentTime() {
  27102. return this.currentTime;
  27103. }
  27104. /**
  27105. * @function TimeControlBase.prototype.setRepeat
  27106. * @description 设置是否重复循环。
  27107. * @param {boolean} [repeat=true] - 是否重复循环。
  27108. */
  27109. }, {
  27110. key: "setRepeat",
  27111. value: function setRepeat(repeat) {
  27112. this.repeat = repeat;
  27113. }
  27114. /**
  27115. * @function TimeControlBase.prototype.getRepeat
  27116. * @description 获取是否重复循环,默认是 true。
  27117. * @returns {boolean} 返回是否重复循环。
  27118. */
  27119. }, {
  27120. key: "getRepeat",
  27121. value: function getRepeat() {
  27122. return this.repeat;
  27123. }
  27124. /**
  27125. * @function TimeControlBase.prototype.setReverse
  27126. * @description 设置是否反向。
  27127. * @param {boolean} [reverse=false] - 是否反向。
  27128. */
  27129. }, {
  27130. key: "setReverse",
  27131. value: function setReverse(reverse) {
  27132. this.reverse = reverse;
  27133. }
  27134. /**
  27135. * @function TimeControlBase.prototype.getReverse
  27136. * @description 获取是否反向,默认是false。
  27137. * @returns {boolean} 返回是否反向。
  27138. */
  27139. }, {
  27140. key: "getReverse",
  27141. value: function getReverse() {
  27142. return this.reverse;
  27143. }
  27144. /**
  27145. * @function TimeControlBase.prototype.getRunning
  27146. * @description 获取运行状态。
  27147. * @returns {boolean} true 代表正在运行,false 发表没有运行。
  27148. */
  27149. }, {
  27150. key: "getRunning",
  27151. value: function getRunning() {
  27152. return this.running;
  27153. }
  27154. /**
  27155. * @function TimeControlBase.prototype.destroy
  27156. * @description 销毁 Animator 对象,释放资源。
  27157. */
  27158. }, {
  27159. key: "destroy",
  27160. value: function destroy() {
  27161. var me = this;
  27162. me.speed = null;
  27163. me.frequency = null;
  27164. me.startTime = null;
  27165. me.endTime = null;
  27166. me.currentTime = null;
  27167. me.repeat = null;
  27168. me.running = false;
  27169. me.reverse = null;
  27170. }
  27171. }, {
  27172. key: "tick",
  27173. value: function tick() {
  27174. //TODO 每次刷新执行的操作。子类实现
  27175. }
  27176. }]);
  27177. return TimeControlBase;
  27178. }();
  27179. ;// CONCATENATED MODULE: ./src/common/control/TimeFlowControl.js
  27180. 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); }
  27181. function TimeFlowControl_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27182. 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); } }
  27183. 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; }
  27184. 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); }
  27185. function TimeFlowControl_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TimeFlowControl_getPrototypeOf(object); if (object === null) break; } return object; }
  27186. 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); }
  27187. 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); }
  27188. 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); }; }
  27189. 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); }
  27190. function TimeFlowControl_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27191. 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; } }
  27192. function TimeFlowControl_getPrototypeOf(o) { TimeFlowControl_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TimeFlowControl_getPrototypeOf(o); }
  27193. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27194. * This program are made available under the terms of the Apache License, Version 2.0
  27195. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27196. /**
  27197. * @class TimeFlowControl
  27198. * @deprecatedclass SuperMap.TimeFlowControl
  27199. * @category Control
  27200. * @classdesc 时间管理类。此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。
  27201. * 如设置起始时间为 1000,结束时间是 2000,步长设置为 1,
  27202. * 那么表示按照每次1年(可以通过 setSpeed 进行修改)的变化从公元 1000 年开始到公元 2000 年为止,默认每 1 秒会变化 1 次(通过 setFrequency 修改)
  27203. * @modulecategory Control
  27204. * @extends {TimeControlBase}
  27205. * @param {function} callback - 每次刷新回调函数。具体的效果需要用户在此回调函数里面实现。
  27206. * @param {Object} options - 可选参数。
  27207. * @param {number} [options.speed=1] - 步长(单位 ms)。不能小于 0,(每次刷新的数据之间的间隔为 1ms)。
  27208. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms)。
  27209. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  27210. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时使用 new Date() 以当前时间进行设置,建议设置。
  27211. * @param {boolean} [options.repeat=true] - 是否重复循环。
  27212. * @param {boolean} [options.reverse=false] - 是否反向。
  27213. * @usage
  27214. */
  27215. var TimeFlowControl = /*#__PURE__*/function (_TimeControlBase) {
  27216. TimeFlowControl_inherits(TimeFlowControl, _TimeControlBase);
  27217. var _super = TimeFlowControl_createSuper(TimeFlowControl);
  27218. function TimeFlowControl(callback, options) {
  27219. var _this;
  27220. TimeFlowControl_classCallCheck(this, TimeFlowControl);
  27221. _this = _super.call(this, options);
  27222. var me = TimeFlowControl_assertThisInitialized(_this);
  27223. /**
  27224. * @member TimeFlowControl.prototype.callback -{function}
  27225. * @description 每次刷新执行的回调函数。
  27226. */
  27227. me.callback = callback;
  27228. //先让IE下支持bind方法
  27229. if (!Function.prototype.bind) {
  27230. Function.prototype.bind = function (oThis) {
  27231. if (typeof this !== "function") {
  27232. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  27233. }
  27234. var aArgs = Array.prototype.slice.call(arguments, 1),
  27235. fToBind = this,
  27236. fNOP = function fNOP() {
  27237. //empty Function
  27238. },
  27239. fBound = function fBound() {
  27240. return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  27241. };
  27242. fNOP.prototype = this.prototype;
  27243. fBound.prototype = new fNOP();
  27244. return fBound;
  27245. };
  27246. }
  27247. //保证 this.tick 的上下文还是 TimeControl 这个对象
  27248. me.update = me.update.bind(me);
  27249. me.oldTime = me.currentTime;
  27250. me.CLASS_NAME = "SuperMap.TimeFlowControl";
  27251. return _this;
  27252. }
  27253. /**
  27254. * @function TimeFlowControl.prototype.updateOptions
  27255. * @override
  27256. */
  27257. TimeFlowControl_createClass(TimeFlowControl, [{
  27258. key: "updateOptions",
  27259. value: function updateOptions(options) {
  27260. options = options || {};
  27261. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "updateOptions", this).call(this, options);
  27262. }
  27263. /**
  27264. * @function TimeFlowControl.prototype.start
  27265. * @override
  27266. */
  27267. }, {
  27268. key: "start",
  27269. value: function start() {
  27270. var me = this;
  27271. if (me.running) {
  27272. return;
  27273. }
  27274. me.running = true;
  27275. if (me.reverse) {
  27276. if (me.currentTime === me.startTime) {
  27277. me.oldTime = me.endTime;
  27278. me.currentTime = me.oldTime;
  27279. }
  27280. } else {
  27281. if (me.oldTime === me.endTime) {
  27282. me.currentTime = me.startTime;
  27283. me.oldTime = me.currentTime;
  27284. }
  27285. }
  27286. me.tick();
  27287. }
  27288. /**
  27289. * @function TimeFlowControl.prototype.stop
  27290. * @override
  27291. */
  27292. }, {
  27293. key: "stop",
  27294. value: function stop() {
  27295. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "stop", this).call(this);
  27296. var me = this;
  27297. me.oldTime = me.currentTime;
  27298. if (me.running) {
  27299. me.running = false;
  27300. }
  27301. //清除定时tick
  27302. me.intervalId && window.clearTimeout(me.intervalId);
  27303. }
  27304. /**
  27305. * @function TimeFlowControl.prototype.destroy
  27306. * @override
  27307. */
  27308. }, {
  27309. key: "destroy",
  27310. value: function destroy() {
  27311. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "destroy", this).call(this);
  27312. var me = this;
  27313. me.oldTime = null;
  27314. me.callback = null;
  27315. }
  27316. /**
  27317. * @function TimeFlowControl.prototype.tick
  27318. * @description 定时刷新。
  27319. */
  27320. }, {
  27321. key: "tick",
  27322. value: function tick() {
  27323. var me = this;
  27324. me.intervalId && window.clearInterval(me.intervalId);
  27325. me.intervalId = null;
  27326. me.update();
  27327. me.intervalId = window.setInterval(me.update, me.frequency);
  27328. }
  27329. /**
  27330. * @function TimeFlowControl.prototype.update
  27331. * @description 更新控件。
  27332. */
  27333. }, {
  27334. key: "update",
  27335. value: function update() {
  27336. var me = this;
  27337. //判定是否还需要继续
  27338. if (!me.running) {
  27339. return;
  27340. }
  27341. //调用回调函数
  27342. me.callback && me.callback(me.currentTime); //destroy之后callback就为空,所以需要判定一下
  27343. if (!me.reverse) {
  27344. //如果相等,则代表上一帧已经运行到了最后,下一帧运行初始化的状态
  27345. if (me.currentTime === me.endTime) {
  27346. //不循环时
  27347. if (!me.repeat) {
  27348. me.running = false;
  27349. me.stop();
  27350. return null;
  27351. }
  27352. me.stop();
  27353. me.currentTime = me.startTime;
  27354. me.oldTime = me.currentTime;
  27355. me.start();
  27356. } else {
  27357. //否则时间递增
  27358. me.oldTime = me.currentTime;
  27359. me.currentTime += me.speed;
  27360. }
  27361. if (me.currentTime >= me.endTime) {
  27362. me.currentTime = me.endTime;
  27363. }
  27364. } else {
  27365. //如果相等,则代表上一帧已经运行到了最前,下一帧运行结束的状态
  27366. if (me.currentTime === me.startTime) {
  27367. //不循环时
  27368. if (!me.repeat) {
  27369. me.running = false;
  27370. return null;
  27371. }
  27372. me.oldTime = me.endTime;
  27373. me.currentTime = me.oldTime;
  27374. } else {
  27375. //否则时间递减
  27376. me.currentTime = me.oldTime;
  27377. me.oldTime -= me.speed;
  27378. }
  27379. if (me.oldTime <= me.startTime) {
  27380. me.oldTime = me.startTime;
  27381. }
  27382. }
  27383. }
  27384. }]);
  27385. return TimeFlowControl;
  27386. }(TimeControlBase);
  27387. ;// CONCATENATED MODULE: ./src/common/control/index.js
  27388. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27389. * This program are made available under the terms of the Apache License, Version 2.0
  27390. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27391. // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
  27392. var polyfill = __webpack_require__(9957);
  27393. // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
  27394. var fetch_ie8_fetch = __webpack_require__(5937);
  27395. // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
  27396. var fetch_jsonp = __webpack_require__(4238);
  27397. var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
  27398. ;// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
  27399. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27400. * This program are made available under the terms of the Apache License, Version 2.0
  27401. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27402. var FetchRequest_fetch = window.fetch;
  27403. var setFetch = function setFetch(newFetch) {
  27404. FetchRequest_fetch = newFetch;
  27405. };
  27406. var RequestJSONPPromise = {
  27407. limitLength: 1500,
  27408. queryKeys: [],
  27409. queryValues: [],
  27410. supermap_callbacks: {},
  27411. addQueryStrings: function addQueryStrings(values) {
  27412. var me = this;
  27413. for (var key in values) {
  27414. me.queryKeys.push(key);
  27415. if (typeof values[key] !== 'string') {
  27416. values[key] = Util_Util.toJSON(values[key]);
  27417. }
  27418. var tempValue = encodeURIComponent(values[key]);
  27419. me.queryValues.push(tempValue);
  27420. }
  27421. },
  27422. issue: function issue(config) {
  27423. var me = this,
  27424. uid = me.getUid(),
  27425. url = config.url,
  27426. splitQuestUrl = [];
  27427. // me.addQueryStrings({
  27428. // callback: "RequestJSONPPromise.supermap_callbacks[" + uid + "]"
  27429. // });
  27430. var sectionURL = url,
  27431. keysCount = 0; //此次sectionURL中有多少个key
  27432. var length = me.queryKeys ? me.queryKeys.length : 0;
  27433. for (var i = 0; i < length; i++) {
  27434. if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
  27435. //+2 for ("&"or"?")and"="
  27436. if (keysCount == 0) {
  27437. return false;
  27438. }
  27439. splitQuestUrl.push(sectionURL);
  27440. sectionURL = url;
  27441. keysCount = 0;
  27442. i--;
  27443. } else {
  27444. if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
  27445. var leftValue = me.queryValues[i];
  27446. while (leftValue.length > 0) {
  27447. var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
  27448. if (sectionURL.indexOf('?') > -1) {
  27449. sectionURL += '&';
  27450. } else {
  27451. sectionURL += '?';
  27452. }
  27453. var tempLeftValue = leftValue.substring(0, leftLength);
  27454. //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
  27455. if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
  27456. leftLength -= 1;
  27457. tempLeftValue = leftValue.substring(0, leftLength);
  27458. } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
  27459. leftLength -= 2;
  27460. tempLeftValue = leftValue.substring(0, leftLength);
  27461. }
  27462. sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
  27463. leftValue = leftValue.substring(leftLength);
  27464. if (tempLeftValue.length > 0) {
  27465. splitQuestUrl.push(sectionURL);
  27466. sectionURL = url;
  27467. keysCount = 0;
  27468. }
  27469. }
  27470. } else {
  27471. keysCount++;
  27472. if (sectionURL.indexOf('?') > -1) {
  27473. sectionURL += '&';
  27474. } else {
  27475. sectionURL += '?';
  27476. }
  27477. sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
  27478. }
  27479. }
  27480. }
  27481. splitQuestUrl.push(sectionURL);
  27482. return me.send(splitQuestUrl, 'SuperMapJSONPCallbacks_' + uid, config && config.proxy);
  27483. },
  27484. getUid: function getUid() {
  27485. var uid = new Date().getTime(),
  27486. random = Math.floor(Math.random() * 1e17);
  27487. return uid * 1000 + random;
  27488. },
  27489. send: function send(splitQuestUrl, callback, proxy) {
  27490. var len = splitQuestUrl.length;
  27491. if (len > 0) {
  27492. return new Promise(function (resolve) {
  27493. var jsonpUserID = new Date().getTime();
  27494. for (var i = 0; i < len; i++) {
  27495. var url = splitQuestUrl[i];
  27496. if (url.indexOf('?') > -1) {
  27497. url += '&';
  27498. } else {
  27499. url += '?';
  27500. }
  27501. url += 'sectionCount=' + len;
  27502. url += '&sectionIndex=' + i;
  27503. url += '&jsonpUserID=' + jsonpUserID;
  27504. if (proxy) {
  27505. url = decodeURIComponent(url);
  27506. url = proxy + encodeURIComponent(url);
  27507. }
  27508. fetch_jsonp_default()(url, {
  27509. jsonpCallbackFunction: callback,
  27510. timeout: 30000
  27511. }).then(function (result) {
  27512. resolve(result.json());
  27513. });
  27514. }
  27515. });
  27516. }
  27517. },
  27518. GET: function GET(config) {
  27519. var me = this;
  27520. me.queryKeys.length = 0;
  27521. me.queryValues.length = 0;
  27522. me.addQueryStrings(config.params);
  27523. return me.issue(config);
  27524. },
  27525. POST: function POST(config) {
  27526. var me = this;
  27527. me.queryKeys.length = 0;
  27528. me.queryValues.length = 0;
  27529. me.addQueryStrings({
  27530. requestEntity: config.data
  27531. });
  27532. return me.issue(config);
  27533. },
  27534. PUT: function PUT(config) {
  27535. var me = this;
  27536. me.queryKeys.length = 0;
  27537. me.queryValues.length = 0;
  27538. me.addQueryStrings({
  27539. requestEntity: config.data
  27540. });
  27541. return me.issue(config);
  27542. },
  27543. DELETE: function DELETE(config) {
  27544. var me = this;
  27545. me.queryKeys.length = 0;
  27546. me.queryValues.length = 0;
  27547. me.addQueryStrings({
  27548. requestEntity: config.data
  27549. });
  27550. return me.issue(config);
  27551. }
  27552. };
  27553. var CORS;
  27554. var RequestTimeout;
  27555. /**
  27556. * @function setCORS
  27557. * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
  27558. * @category BaseTypes Util
  27559. * @param {boolean} cors - 是否允许跨域请求。
  27560. * @usage
  27561. * ```
  27562. * // 浏览器
  27563. * <script type="text/javascript" src="{cdn}"></script>
  27564. * <script>
  27565. * {namespace}.setCORS(cors);
  27566. *
  27567. * // 弃用的写法
  27568. * SuperMap.setCORS(cors);
  27569. *
  27570. * </script>
  27571. *
  27572. * // ES6 Import
  27573. * import { setCORS } from '{npm}';
  27574. *
  27575. * setCORS(cors);
  27576. * ```
  27577. */
  27578. var setCORS = function setCORS(cors) {
  27579. CORS = cors;
  27580. };
  27581. /**
  27582. * @function isCORS
  27583. * @description 是是否允许跨域请求。
  27584. * @category BaseTypes Util
  27585. * @returns {boolean} 是否允许跨域请求。
  27586. * @usage
  27587. * ```
  27588. * // 浏览器
  27589. * <script type="text/javascript" src="{cdn}"></script>
  27590. * <script>
  27591. * const result = {namespace}.isCORS();
  27592. *
  27593. * // 弃用的写法
  27594. * const result = SuperMap.isCORS();
  27595. *
  27596. * </script>
  27597. *
  27598. * // ES6 Import
  27599. * import { isCORS } from '{npm}';
  27600. *
  27601. * const result = isCORS();
  27602. * ```
  27603. */
  27604. var isCORS = function isCORS() {
  27605. if (CORS != undefined) {
  27606. return CORS;
  27607. }
  27608. return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
  27609. };
  27610. /**
  27611. * @function setRequestTimeout
  27612. * @category BaseTypes Util
  27613. * @description 设置请求超时时间。
  27614. * @param {number} [timeout=45] - 请求超时时间,单位秒。
  27615. * @usage
  27616. * ```
  27617. * // 浏览器
  27618. <script type="text/javascript" src="{cdn}"></script>
  27619. <script>
  27620. {namespace}.setRequestTimeout(timeout);
  27621. // 弃用的写法
  27622. SuperMap.setRequestTimeout(timeout);
  27623. </script>
  27624. // ES6 Import
  27625. import { setRequestTimeout } from '{npm}';
  27626. setRequestTimeout(timeout);
  27627. * ```
  27628. */
  27629. var setRequestTimeout = function setRequestTimeout(timeout) {
  27630. return RequestTimeout = timeout;
  27631. };
  27632. /**
  27633. * @function getRequestTimeout
  27634. * @category BaseTypes Util
  27635. * @description 获取请求超时时间。
  27636. * @returns {number} 请求超时时间。
  27637. * @usage
  27638. * ```
  27639. * // 浏览器
  27640. <script type="text/javascript" src="{cdn}"></script>
  27641. <script>
  27642. {namespace}.getRequestTimeout();
  27643. // 弃用的写法
  27644. SuperMap.getRequestTimeout();
  27645. </script>
  27646. // ES6 Import
  27647. import { getRequestTimeout } from '{npm}';
  27648. getRequestTimeout();
  27649. * ```
  27650. */
  27651. var getRequestTimeout = function getRequestTimeout() {
  27652. return RequestTimeout || 45000;
  27653. };
  27654. /**
  27655. * @name FetchRequest
  27656. * @namespace
  27657. * @category BaseTypes Util
  27658. * @description 获取请求。
  27659. * @usage
  27660. * ```
  27661. * // 浏览器
  27662. * <script type="text/javascript" src="{cdn}"></script>
  27663. * <script>
  27664. * const result = {namespace}.FetchRequest.commit(method, url, params, options);
  27665. *
  27666. * </script>
  27667. *
  27668. * // ES6 Import
  27669. * import { FetchRequest } from '{npm}';
  27670. *
  27671. * const result = FetchRequest.commit(method, url, params, options);
  27672. *
  27673. * ```
  27674. */
  27675. var FetchRequest = {
  27676. /**
  27677. * @function FetchRequest.commit
  27678. * @description commit 请求。
  27679. * @param {string} method - 请求方法。
  27680. * @param {string} url - 请求地址。
  27681. * @param {string} params - 请求参数。
  27682. * @param {Object} options - 请求的配置属性。
  27683. * @returns {Promise} Promise 对象。
  27684. */
  27685. commit: function commit(method, url, params, options) {
  27686. method = method ? method.toUpperCase() : method;
  27687. switch (method) {
  27688. case 'GET':
  27689. return this.get(url, params, options);
  27690. case 'POST':
  27691. return this.post(url, params, options);
  27692. case 'PUT':
  27693. return this.put(url, params, options);
  27694. case 'DELETE':
  27695. return this["delete"](url, params, options);
  27696. default:
  27697. return this.get(url, params, options);
  27698. }
  27699. },
  27700. /**
  27701. * @function FetchRequest.supportDirectRequest
  27702. * @description supportDirectRequest 请求。
  27703. * @param {string} url - 请求地址。
  27704. * @param {Object} options - 请求的配置属性。
  27705. * @returns {boolean} 是否允许跨域请求。
  27706. */
  27707. supportDirectRequest: function supportDirectRequest(url, options) {
  27708. if (Util_Util.isInTheSameDomain(url)) {
  27709. return true;
  27710. }
  27711. if (options.crossOrigin != undefined) {
  27712. return options.crossOrigin;
  27713. } else {
  27714. return isCORS() || options.proxy;
  27715. }
  27716. },
  27717. /**
  27718. * @function FetchRequest.get
  27719. * @description get 请求。
  27720. * @param {string} url - 请求地址。
  27721. * @param {string} params - 请求参数。
  27722. * @param {Object} options - 请求的配置属性。
  27723. * @returns {Promise} Promise 对象。
  27724. */
  27725. get: function get(url, params, options) {
  27726. options = options || {};
  27727. var type = 'GET';
  27728. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  27729. url = this._processUrl(url, options);
  27730. if (!this.supportDirectRequest(url, options)) {
  27731. url = url.replace('.json', '.jsonp');
  27732. var config = {
  27733. url: url,
  27734. data: params
  27735. };
  27736. return RequestJSONPPromise.GET(config);
  27737. }
  27738. if (!this.urlIsLong(url)) {
  27739. return this._fetch(url, params, options, type);
  27740. } else {
  27741. return this._postSimulatie(type, url.substring(0, url.indexOf('?')), params, options);
  27742. }
  27743. },
  27744. /**
  27745. * @function FetchRequest.delete
  27746. * @description delete 请求。
  27747. * @param {string} url - 请求地址。
  27748. * @param {string} params - 请求参数。
  27749. * @param {Object} options -请求的配置属性。
  27750. * @returns {Promise} Promise 对象。
  27751. */
  27752. "delete": function _delete(url, params, options) {
  27753. options = options || {};
  27754. var type = 'DELETE';
  27755. url = Util_Util.urlAppend(url, this._getParameterString(params || {}));
  27756. url = this._processUrl(url, options);
  27757. if (!this.supportDirectRequest(url, options)) {
  27758. url = url.replace('.json', '.jsonp');
  27759. var config = {
  27760. url: url += "&_method=DELETE",
  27761. data: params
  27762. };
  27763. return RequestJSONPPromise.DELETE(config);
  27764. }
  27765. if (this.urlIsLong(url)) {
  27766. return this._postSimulatie(type, url.substring(0, url.indexOf('?')), params, options);
  27767. }
  27768. return this._fetch(url, params, options, type);
  27769. },
  27770. /**
  27771. * @function FetchRequest.post
  27772. * @description post 请求。
  27773. * @param {string} url - 请求地址。
  27774. * @param {string} params - 请求参数。
  27775. * @param {Object} options - 请求的配置属性。
  27776. * @returns {Promise} Promise 对象。
  27777. */
  27778. post: function post(url, params, options) {
  27779. options = options || {};
  27780. url = this._processUrl(url, options);
  27781. if (!this.supportDirectRequest(url, options)) {
  27782. url = url.replace('.json', '.jsonp');
  27783. var config = {
  27784. url: Util_Util.urlAppend(url, "_method=POST"),
  27785. data: params
  27786. };
  27787. return RequestJSONPPromise.POST(config);
  27788. }
  27789. return this._fetch(url, params, options, 'POST');
  27790. },
  27791. /**
  27792. * @function FetchRequest.put
  27793. * @description put 请求。
  27794. * @param {string} url - 请求地址。
  27795. * @param {string} params - 请求参数。
  27796. * @param {Object} options - 请求的配置属性。
  27797. * @returns {Promise} Promise 对象。
  27798. */
  27799. put: function put(url, params, options) {
  27800. options = options || {};
  27801. url = this._processUrl(url, options);
  27802. if (!this.supportDirectRequest(url, options)) {
  27803. url = url.replace('.json', '.jsonp');
  27804. var config = {
  27805. url: url += "&_method=PUT",
  27806. data: params
  27807. };
  27808. return RequestJSONPPromise.PUT(config);
  27809. }
  27810. return this._fetch(url, params, options, 'PUT');
  27811. },
  27812. /**
  27813. * @function FetchRequest.urlIsLong
  27814. * @description URL 的字节长度是否太长。
  27815. * @param {string} url - 请求地址。
  27816. * @returns {boolean} URL 的字节长度是否太长。
  27817. */
  27818. urlIsLong: function urlIsLong(url) {
  27819. //当前url的字节长度。
  27820. var totalLength = 0,
  27821. charCode = null;
  27822. for (var i = 0, len = url.length; i < len; i++) {
  27823. //转化为Unicode编码
  27824. charCode = url.charCodeAt(i);
  27825. if (charCode < 0x007f) {
  27826. totalLength++;
  27827. } else if (0x0080 <= charCode && charCode <= 0x07ff) {
  27828. totalLength += 2;
  27829. } else if (0x0800 <= charCode && charCode <= 0xffff) {
  27830. totalLength += 3;
  27831. }
  27832. }
  27833. return totalLength < 2000 ? false : true;
  27834. },
  27835. _postSimulatie: function _postSimulatie(type, url, params, options) {
  27836. var separator = url.indexOf('?') > -1 ? '&' : '?';
  27837. url += separator + '_method=' + type;
  27838. if (typeof params !== 'string') {
  27839. params = JSON.stringify(params);
  27840. }
  27841. return this.post(url, params, options);
  27842. },
  27843. _processUrl: function _processUrl(url, options) {
  27844. if (this._isMVTRequest(url)) {
  27845. return url;
  27846. }
  27847. if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
  27848. if (url.indexOf('?') < 0) {
  27849. url += '.json';
  27850. } else {
  27851. var urlArrays = url.split('?');
  27852. if (urlArrays.length === 2) {
  27853. url = urlArrays[0] + '.json?' + urlArrays[1];
  27854. }
  27855. }
  27856. }
  27857. if (options && options.proxy) {
  27858. if (typeof options.proxy === 'function') {
  27859. url = options.proxy(url);
  27860. } else {
  27861. url = decodeURIComponent(url);
  27862. url = options.proxy + encodeURIComponent(url);
  27863. }
  27864. }
  27865. return url;
  27866. },
  27867. _fetch: function _fetch(url, params, options, type) {
  27868. options = options || {};
  27869. options.headers = options.headers || {};
  27870. if (!options.headers['Content-Type'] && !FormData.prototype.isPrototypeOf(params)) {
  27871. options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  27872. }
  27873. if (options.timeout) {
  27874. return this._timeout(options.timeout, FetchRequest_fetch(url, {
  27875. method: type,
  27876. headers: options.headers,
  27877. body: type === 'PUT' || type === 'POST' ? params : undefined,
  27878. credentials: this._getWithCredentials(options),
  27879. mode: 'cors',
  27880. timeout: getRequestTimeout()
  27881. }).then(function (response) {
  27882. return response;
  27883. }));
  27884. }
  27885. return FetchRequest_fetch(url, {
  27886. method: type,
  27887. body: type === 'PUT' || type === 'POST' ? params : undefined,
  27888. headers: options.headers,
  27889. credentials: this._getWithCredentials(options),
  27890. mode: 'cors',
  27891. timeout: getRequestTimeout()
  27892. }).then(function (response) {
  27893. return response;
  27894. });
  27895. },
  27896. _getWithCredentials: function _getWithCredentials(options) {
  27897. if (options.withCredentials === true) {
  27898. return 'include';
  27899. }
  27900. if (options.withCredentials === false) {
  27901. return 'omit';
  27902. }
  27903. return 'same-origin';
  27904. },
  27905. _fetchJsonp: function _fetchJsonp(url, options) {
  27906. options = options || {};
  27907. return fetch_jsonp_default()(url, {
  27908. method: 'GET',
  27909. timeout: options.timeout
  27910. }).then(function (response) {
  27911. return response;
  27912. });
  27913. },
  27914. _timeout: function _timeout(seconds, promise) {
  27915. return new Promise(function (resolve, reject) {
  27916. setTimeout(function () {
  27917. reject(new Error('timeout'));
  27918. }, seconds);
  27919. promise.then(resolve, reject);
  27920. });
  27921. },
  27922. _getParameterString: function _getParameterString(params) {
  27923. var paramsArray = [];
  27924. for (var key in params) {
  27925. var value = params[key];
  27926. if (value != null && typeof value !== 'function') {
  27927. var encodedValue;
  27928. if (Array.isArray(value) || value.toString() === '[object Object]') {
  27929. encodedValue = encodeURIComponent(JSON.stringify(value));
  27930. } else {
  27931. encodedValue = encodeURIComponent(value);
  27932. }
  27933. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  27934. }
  27935. }
  27936. return paramsArray.join('&');
  27937. },
  27938. _isMVTRequest: function _isMVTRequest(url) {
  27939. return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
  27940. }
  27941. };
  27942. ;// CONCATENATED MODULE: ./src/common/security/SecurityManager.js
  27943. function SecurityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27944. 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); } }
  27945. 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; }
  27946. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  27947. * This program are made available under the terms of the Apache License, Version 2.0
  27948. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27949. /**
  27950. * @class SecurityManager
  27951. * @deprecatedclass SuperMap.SecurityManager
  27952. * @category Security
  27953. * @classdesc 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
  27954. * > 使用说明:
  27955. * > 创建任何一个服务之前调用 {@link SecurityManager.registerToken}或
  27956. * > {@link SecurityManager.registerKey}注册凭据。
  27957. * > 发送请求时根据 URL 或者服务 ID 获取相应的 key 或者 token 并自动添加到服务地址中。
  27958. * @usage
  27959. */
  27960. var SecurityManager = /*#__PURE__*/function () {
  27961. function SecurityManager() {
  27962. SecurityManager_classCallCheck(this, SecurityManager);
  27963. }
  27964. SecurityManager_createClass(SecurityManager, null, [{
  27965. key: "generateToken",
  27966. value:
  27967. /**
  27968. * @description 从服务器获取一个token,在此之前要注册服务器信息。
  27969. * @function SecurityManager.generateToken
  27970. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  27971. * @param {TokenServiceParameter} tokenParam - token 申请参数。
  27972. * @returns {Promise} 包含 token 信息的 Promise 对象。
  27973. */
  27974. function generateToken(url, tokenParam) {
  27975. var serverInfo = this.servers[url];
  27976. if (!serverInfo) {
  27977. return;
  27978. }
  27979. return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function (response) {
  27980. return response.text();
  27981. });
  27982. }
  27983. /**
  27984. * @description 注册安全服务器相关信息。
  27985. * @function SecurityManager.registerServers
  27986. * @param {ServerInfo} serverInfos - 服务器信息。
  27987. */
  27988. }, {
  27989. key: "registerServers",
  27990. value: function registerServers(serverInfos) {
  27991. this.servers = this.servers || {};
  27992. if (!Util_Util.isArray(serverInfos)) {
  27993. serverInfos = [serverInfos];
  27994. }
  27995. for (var i = 0; i < serverInfos.length; i++) {
  27996. var serverInfo = serverInfos[i];
  27997. this.servers[serverInfo.server] = serverInfo;
  27998. }
  27999. }
  28000. /**
  28001. * @description 服务请求都会自动带上这个 token。
  28002. * @function SecurityManager.registerToken
  28003. * @param {string} url -服务器域名+端口:如http://localhost:8090。
  28004. * @param {string} token - token。
  28005. */
  28006. }, {
  28007. key: "registerToken",
  28008. value: function registerToken(url, token) {
  28009. this.tokens = this.tokens || {};
  28010. if (!url || !token) {
  28011. return;
  28012. }
  28013. var domain = this._getTokenStorageKey(url);
  28014. this.tokens[domain] = token;
  28015. }
  28016. /**
  28017. * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
  28018. * @function SecurityManager.registerKey
  28019. * @param {Array} ids - 可以是服务 ID 数组或者 URL 地址数组或者 webAPI 类型数组。
  28020. * @param {string} key - key。
  28021. */
  28022. }, {
  28023. key: "registerKey",
  28024. value: function registerKey(ids, key) {
  28025. this.keys = this.keys || {};
  28026. if (!ids || ids.length < 1 || !key) {
  28027. return;
  28028. }
  28029. ids = Util_Util.isArray(ids) ? ids : [ids];
  28030. for (var i = 0; i < ids.length; i++) {
  28031. var id = this._getUrlRestString(ids[0]) || ids[0];
  28032. this.keys[id] = key;
  28033. }
  28034. }
  28035. /**
  28036. * @description 获取服务器信息。
  28037. * @function SecurityManager.getServerInfo
  28038. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  28039. * @returns {ServerInfo} 服务器信息。
  28040. */
  28041. }, {
  28042. key: "getServerInfo",
  28043. value: function getServerInfo(url) {
  28044. this.servers = this.servers || {};
  28045. return this.servers[url];
  28046. }
  28047. /**
  28048. * @description 根据 URL 获取token。
  28049. * @function SecurityManager.getToken
  28050. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  28051. * @returns {string} token。
  28052. */
  28053. }, {
  28054. key: "getToken",
  28055. value: function getToken(url) {
  28056. if (!url) {
  28057. return;
  28058. }
  28059. this.tokens = this.tokens || {};
  28060. var domain = this._getTokenStorageKey(url);
  28061. return this.tokens[domain];
  28062. }
  28063. /**
  28064. * @description 根据 URL 获取 key。
  28065. * @function SecurityManager.getKey
  28066. * @param {string} id - ID。
  28067. * @returns {string} key。
  28068. */
  28069. }, {
  28070. key: "getKey",
  28071. value: function getKey(id) {
  28072. this.keys = this.keys || {};
  28073. var key = this._getUrlRestString(id) || id;
  28074. return this.keys[key];
  28075. }
  28076. /**
  28077. * @description iServer 登录验证。
  28078. * @function SecurityManager.loginiServer
  28079. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  28080. * @param {string} username - 用户名。
  28081. * @param {string} password - 密码。
  28082. * @param {boolean} [rememberme=false] - 是否记住。
  28083. * @returns {Promise} 包含 iServer 登录请求结果的 Promise 对象。
  28084. */
  28085. }, {
  28086. key: "loginiServer",
  28087. value: function loginiServer(url, username, password, rememberme) {
  28088. url = Util_Util.urlPathAppend(url, 'services/security/login');
  28089. var loginInfo = {
  28090. username: username && username.toString(),
  28091. password: password && password.toString(),
  28092. rememberme: rememberme
  28093. };
  28094. loginInfo = JSON.stringify(loginInfo);
  28095. var requestOptions = {
  28096. headers: {
  28097. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  28098. }
  28099. };
  28100. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  28101. return response.json();
  28102. });
  28103. }
  28104. /**
  28105. * @description iServer登出。
  28106. * @function SecurityManager.logoutiServer
  28107. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  28108. * @returns {Promise} 是否登出成功。
  28109. */
  28110. }, {
  28111. key: "logoutiServer",
  28112. value: function logoutiServer(url) {
  28113. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  28114. var requestOptions = {
  28115. headers: {
  28116. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  28117. },
  28118. withoutFormatSuffix: true
  28119. };
  28120. return FetchRequest.get(url, '', requestOptions).then(function () {
  28121. return true;
  28122. })["catch"](function () {
  28123. return false;
  28124. });
  28125. }
  28126. /**
  28127. * @description Online 登录验证。
  28128. * @function SecurityManager.loginOnline
  28129. * @param {string} callbackLocation - 跳转位置。
  28130. * @param {boolean} [newTab=true] - 是否新窗口打开。
  28131. */
  28132. }, {
  28133. key: "loginOnline",
  28134. value: function loginOnline(callbackLocation, newTab) {
  28135. var loginUrl = SecurityManager.SSO + '/login?service=' + callbackLocation;
  28136. this._open(loginUrl, newTab);
  28137. }
  28138. /**
  28139. * @description iPortal登录验证。
  28140. * @function SecurityManager.loginiPortal
  28141. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  28142. * @param {string} username - 用户名。
  28143. * @param {string} password - 密码。
  28144. * @returns {Promise} 包含 iPortal 登录请求结果的 Promise 对象。
  28145. */
  28146. }, {
  28147. key: "loginiPortal",
  28148. value: function loginiPortal(url, username, password) {
  28149. url = Util_Util.urlPathAppend(url, 'web/login');
  28150. var loginInfo = {
  28151. username: username && username.toString(),
  28152. password: password && password.toString()
  28153. };
  28154. loginInfo = JSON.stringify(loginInfo);
  28155. var requestOptions = {
  28156. headers: {
  28157. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  28158. },
  28159. withCredentials: true
  28160. };
  28161. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  28162. return response.json();
  28163. });
  28164. }
  28165. /**
  28166. * @description iPortal 登出。
  28167. * @function SecurityManager.logoutiPortal
  28168. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  28169. * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
  28170. */
  28171. }, {
  28172. key: "logoutiPortal",
  28173. value: function logoutiPortal(url) {
  28174. url = Util_Util.urlPathAppend(url, 'services/security/logout');
  28175. var requestOptions = {
  28176. headers: {
  28177. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  28178. },
  28179. withCredentials: true,
  28180. withoutFormatSuffix: true
  28181. };
  28182. return FetchRequest.get(url, '', requestOptions).then(function () {
  28183. return true;
  28184. })["catch"](function () {
  28185. return false;
  28186. });
  28187. }
  28188. /**
  28189. * @description iManager 登录验证。
  28190. * @function SecurityManager.loginManager
  28191. * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
  28192. * @param {Object} [loginInfoParams] - iManager 登录参数。
  28193. * @param {string} loginInfoParams.userName - 用户名。
  28194. * @param {string} loginInfoParams.password - 密码。
  28195. * @param {Object} options
  28196. * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
  28197. * @returns {Promise} 包含 iManager 登录请求结果的 Promise 对象。
  28198. */
  28199. }, {
  28200. key: "loginManager",
  28201. value: function loginManager(url, loginInfoParams, options) {
  28202. if (!Util_Util.isInTheSameDomain(url)) {
  28203. var isNewTab = options ? options.isNewTab : true;
  28204. this._open(url, isNewTab);
  28205. return;
  28206. }
  28207. var requestUrl = Util_Util.urlPathAppend(url, 'icloud/security/tokens');
  28208. var params = loginInfoParams || {};
  28209. var loginInfo = {
  28210. username: params.userName && params.userName.toString(),
  28211. password: params.password && params.password.toString()
  28212. };
  28213. loginInfo = JSON.stringify(loginInfo);
  28214. var requestOptions = {
  28215. headers: {
  28216. Accept: '*/*',
  28217. 'Content-Type': 'application/json'
  28218. }
  28219. };
  28220. var me = this;
  28221. return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function (response) {
  28222. response.text().then(function (result) {
  28223. me.imanagerToken = result;
  28224. return result;
  28225. });
  28226. });
  28227. }
  28228. /**
  28229. * @description 清空全部验证信息。
  28230. * @function SecurityManager.destroyAllCredentials
  28231. */
  28232. }, {
  28233. key: "destroyAllCredentials",
  28234. value: function destroyAllCredentials() {
  28235. this.keys = null;
  28236. this.tokens = null;
  28237. this.servers = null;
  28238. }
  28239. /**
  28240. * @description 清空令牌信息。
  28241. * @function SecurityManager.destroyToken
  28242. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal。
  28243. */
  28244. }, {
  28245. key: "destroyToken",
  28246. value: function destroyToken(url) {
  28247. if (!url) {
  28248. return;
  28249. }
  28250. var domain = this._getTokenStorageKey(url);
  28251. this.tokens = this.tokens || {};
  28252. if (this.tokens[domain]) {
  28253. delete this.tokens[domain];
  28254. }
  28255. }
  28256. /**
  28257. * @description 清空服务授权码。
  28258. * @function SecurityManager.destroyKey
  28259. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  28260. */
  28261. }, {
  28262. key: "destroyKey",
  28263. value: function destroyKey(url) {
  28264. if (!url) {
  28265. return;
  28266. }
  28267. this.keys = this.keys || {};
  28268. var key = this._getUrlRestString(url) || url;
  28269. if (this.keys[key]) {
  28270. delete this.keys[key];
  28271. }
  28272. }
  28273. /**
  28274. * @description 服务URL追加授权信息,授权信息需先通过SecurityManager.registerKey或SecurityManager.registerToken注册。
  28275. * @version 10.1.2
  28276. * @function SecurityManager.appendCredential
  28277. * @param {string} url - 服务URL。
  28278. * @returns {string} 绑定了token或者key的服务URL。
  28279. */
  28280. }, {
  28281. key: "appendCredential",
  28282. value: function appendCredential(url) {
  28283. var newUrl = url;
  28284. var value = this.getToken(url);
  28285. var credential = value ? new Credential(value, 'token') : null;
  28286. if (!credential) {
  28287. value = this.getKey(url);
  28288. credential = value ? new Credential(value, 'key') : null;
  28289. }
  28290. if (credential) {
  28291. newUrl = Util_Util.urlAppend(newUrl, credential.getUrlParameters());
  28292. }
  28293. return newUrl;
  28294. }
  28295. }, {
  28296. key: "_open",
  28297. value: function _open(url, newTab) {
  28298. newTab = newTab != null ? newTab : true;
  28299. var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
  28300. var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
  28301. 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';
  28302. if (newTab) {
  28303. window.open(url, 'login');
  28304. } else {
  28305. window.open(url, 'login', options);
  28306. }
  28307. }
  28308. }, {
  28309. key: "_getTokenStorageKey",
  28310. value: function _getTokenStorageKey(url) {
  28311. var patten = /(.*?):\/\/([^\/]+)/i;
  28312. var result = url.match(patten);
  28313. if (!result) {
  28314. return url;
  28315. }
  28316. return result[0];
  28317. }
  28318. }, {
  28319. key: "_getUrlRestString",
  28320. value: function _getUrlRestString(url) {
  28321. if (!url) {
  28322. return url;
  28323. }
  28324. // var patten = /http:\/\/(.*\/rest)/i;
  28325. var patten = /(http|https):\/\/(.*\/rest)/i;
  28326. var result = url.match(patten);
  28327. if (!result) {
  28328. return url;
  28329. }
  28330. return result[0];
  28331. }
  28332. }]);
  28333. return SecurityManager;
  28334. }();
  28335. SecurityManager.INNER_WINDOW_WIDTH = 600;
  28336. SecurityManager.INNER_WINDOW_HEIGHT = 600;
  28337. SecurityManager.SSO = 'https://sso.supermap.com';
  28338. SecurityManager.ONLINE = 'https://www.supermapol.com';
  28339. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerServiceBase.js
  28340. function iManagerServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28341. 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); } }
  28342. 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; }
  28343. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28344. * This program are made available under the terms of the Apache License, Version 2.0
  28345. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28346. /**
  28347. * @class IManagerServiceBase
  28348. * @aliasclass iManagerServiceBase
  28349. * @deprecatedclass SuperMap.iManagerServiceBase
  28350. * @classdesc iManager 服务基类(有权限限制的类需要实现此类)。
  28351. * @category iManager
  28352. * @param {string} url - iManager 首页地址,如:http://localhost:8390/imanager。
  28353. * @param {Object} options - 可选参数。
  28354. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  28355. * @param {Object} [options.headers] - 请求头。
  28356. * @usage
  28357. */
  28358. var IManagerServiceBase = /*#__PURE__*/function () {
  28359. function IManagerServiceBase(url, options) {
  28360. iManagerServiceBase_classCallCheck(this, IManagerServiceBase);
  28361. if (url) {
  28362. var end = url.substr(url.length - 1, 1);
  28363. this.serviceUrl = end === "/" ? url.substr(0, url.length - 2) : url;
  28364. }
  28365. this.options = options || {};
  28366. this.CLASS_NAME = "SuperMap.iManagerServiceBase";
  28367. }
  28368. /**
  28369. * @function IManagerServiceBase.prototype.request
  28370. * @description 子类统一通过该方法发送请求。
  28371. * @param {string} url - 请求 URL。
  28372. * @param {string} [method='GET'] - 请求类型。
  28373. * @param {Object} [requestOptions] - 请求选项。
  28374. * @param {Object} param - 请求参数。
  28375. * @description 发送请求。
  28376. * @returns {Promise} Promise 对象。
  28377. */
  28378. iManagerServiceBase_createClass(IManagerServiceBase, [{
  28379. key: "request",
  28380. value: function request(method, url, param, requestOptions) {
  28381. requestOptions = requestOptions || {
  28382. headers: {
  28383. 'Accept': '*/*',
  28384. 'Content-Type': 'application/json'
  28385. }
  28386. };
  28387. if (!requestOptions.hasOwnProperty("withCredentials")) {
  28388. requestOptions['withCredentials'] = true;
  28389. }
  28390. requestOptions['crossOrigin'] = this.options.crossOrigin;
  28391. requestOptions['headers'] = this.options.headers;
  28392. var token = SecurityManager.imanagerToken;
  28393. if (token) {
  28394. if (!requestOptions.headers) {
  28395. requestOptions.headers = [];
  28396. }
  28397. requestOptions.headers['X-Auth-Token'] = token;
  28398. }
  28399. if (param) {
  28400. param = JSON.stringify(param);
  28401. }
  28402. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  28403. return response.json();
  28404. });
  28405. }
  28406. }]);
  28407. return IManagerServiceBase;
  28408. }();
  28409. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerCreateNodeParam.js
  28410. 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); } }
  28411. 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; }
  28412. function iManagerCreateNodeParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28413. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28414. * This program are made available under the terms of the Apache License, Version 2.0
  28415. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28416. /**
  28417. * @class IManagerCreateNodeParam
  28418. * @aliasclass iManagerCreateNodeParam
  28419. * @deprecatedclass SuperMap.iManagerCreateNodeParam
  28420. * @classdesc iManager 创建节点参数。
  28421. * @category iManager
  28422. * @param {Object} [params] - 节点参数。
  28423. * @usage
  28424. */
  28425. var IManagerCreateNodeParam = /*#__PURE__*/iManagerCreateNodeParam_createClass(function IManagerCreateNodeParam(params) {
  28426. iManagerCreateNodeParam_classCallCheck(this, IManagerCreateNodeParam);
  28427. params = params || {};
  28428. this.nodeSpec = 'SMALL'; //取值范围: ['SMALL','MEDIUM','LARGE'] 以及自定义的环境规格名称
  28429. this.nodeCount = 1; //要创建vm的个数
  28430. this.nodeName = ''; //vm名称
  28431. this.password = ''; //vm的密码,空表示随机分配
  28432. this.description = ''; //描述信息
  28433. this.physicalMachineName = ''; //vm所属的物理机名称.
  28434. this.ips = []; //vm的ip,空数组表示随机分配
  28435. this.userName = ''; //vm所属用户
  28436. Util_Util.extend(this, params);
  28437. });
  28438. ;// CONCATENATED MODULE: ./src/common/iManager/iManager.js
  28439. 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); }
  28440. function iManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28441. 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); } }
  28442. 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; }
  28443. 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); }
  28444. 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); }
  28445. 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); }; }
  28446. 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); }
  28447. function iManager_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28448. 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; } }
  28449. function iManager_getPrototypeOf(o) { iManager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iManager_getPrototypeOf(o); }
  28450. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28451. * This program are made available under the terms of the Apache License, Version 2.0
  28452. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28453. /**
  28454. * @class IManager
  28455. * @aliasclass iManager
  28456. * @deprecatedclass SuperMap.iManager
  28457. * @classdesc iManager 服务类。
  28458. * @category iManager
  28459. * @modulecategory Services
  28460. * @param {string} serviceUrl - iManager 首页地址。
  28461. * @usage
  28462. */
  28463. var IManager = /*#__PURE__*/function (_IManagerServiceBase) {
  28464. iManager_inherits(IManager, _IManagerServiceBase);
  28465. var _super = iManager_createSuper(IManager);
  28466. function IManager(iManagerUrl) {
  28467. iManager_classCallCheck(this, IManager);
  28468. return _super.call(this, iManagerUrl);
  28469. }
  28470. /**
  28471. * @function IManager.prototype.load
  28472. * @description 获取所有服务接口,验证是否已登录授权。
  28473. * @returns {Promise} Promise 对象。
  28474. */
  28475. iManager_createClass(IManager, [{
  28476. key: "load",
  28477. value: function load() {
  28478. return this.request("GET", this.serviceUrl + '/web/api/service.json');
  28479. }
  28480. /**
  28481. * @function IManager.prototype.createIServer
  28482. * @param {IManagerCreateNodeParam} createParam - 创建参数。
  28483. * @description 创建 iServer。
  28484. * @returns {Promise} Promise 对象。
  28485. */
  28486. }, {
  28487. key: "createIServer",
  28488. value: function createIServer(createParam) {
  28489. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/server.json', new IManagerCreateNodeParam(createParam));
  28490. }
  28491. /**
  28492. * @function IManager.prototype.createIPortal
  28493. * @param {IManagerCreateNodeParam} createParam - 创建参数。
  28494. * @description 创建 iPortal。
  28495. * @returns {Promise} Promise 对象。
  28496. */
  28497. }, {
  28498. key: "createIPortal",
  28499. value: function createIPortal(createParam) {
  28500. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/portal.json', new IManagerCreateNodeParam(createParam));
  28501. }
  28502. /**
  28503. * @function IManager.prototype.iServerList
  28504. * @description 获取所有创建的 iServer。
  28505. * @returns {Promise} Promise 对象。
  28506. */
  28507. }, {
  28508. key: "iServerList",
  28509. value: function iServerList() {
  28510. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/server.json');
  28511. }
  28512. /**
  28513. * @function IManager.prototype.iPortalList
  28514. * @description 获取所有创建的 iPortal。
  28515. * @returns {Promise} Promise 对象。
  28516. */
  28517. }, {
  28518. key: "iPortalList",
  28519. value: function iPortalList() {
  28520. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/portal.json');
  28521. }
  28522. /**
  28523. * @function IManager.prototype.startNodes
  28524. * @param {Array.<string>} ids - 需要启动节点的 ID 数组。e.g:['1']。
  28525. * @description 启动节点。
  28526. * @returns {Promise} Promise 对象。
  28527. */
  28528. }, {
  28529. key: "startNodes",
  28530. value: function startNodes(ids) {
  28531. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/started.json', ids);
  28532. }
  28533. /**
  28534. * @function IManager.prototype.stopNodes
  28535. * @param {Array.<string>} ids - 需要停止节点的 ID 数组。e.g:['1']。
  28536. * @description 停止节点。
  28537. * @returns {Promise} Promise 对象。
  28538. */
  28539. }, {
  28540. key: "stopNodes",
  28541. value: function stopNodes(ids) {
  28542. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/stopped.json', ids);
  28543. }
  28544. }]);
  28545. return IManager;
  28546. }(IManagerServiceBase);
  28547. ;// CONCATENATED MODULE: ./src/common/iManager/index.js
  28548. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28549. * This program are made available under the terms of the Apache License, Version 2.0
  28550. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28551. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalServiceBase.js
  28552. function iPortalServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28553. 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); } }
  28554. 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; }
  28555. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28556. * This program are made available under the terms of the Apache License, Version 2.0
  28557. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28558. /**
  28559. * @class IPortalServiceBase
  28560. * @aliasclass iPortalServiceBase
  28561. * @deprecatedclass SuperMap.iPortalServiceBase
  28562. * @classdesc iPortal 服务基类(有权限限制的类需要实现此类)。
  28563. * @category iPortal/Online Core
  28564. * @param {string} url - 服务地址。
  28565. * @param {Object} options - 可选参数。
  28566. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  28567. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  28568. * @param {Object} [options.headers] - 请求头。
  28569. * @usage
  28570. */
  28571. var IPortalServiceBase = /*#__PURE__*/function () {
  28572. function IPortalServiceBase(url, options) {
  28573. iPortalServiceBase_classCallCheck(this, IPortalServiceBase);
  28574. options = options || {};
  28575. this.serviceUrl = url;
  28576. this.CLASS_NAME = "SuperMap.iPortalServiceBase";
  28577. this.withCredentials = options.withCredentials || false;
  28578. this.crossOrigin = options.crossOrigin;
  28579. this.headers = options.headers;
  28580. }
  28581. /**
  28582. * @function IPortalServiceBase.prototype.request
  28583. * @description 子类统一通过该方法发送请求。
  28584. * @param {string} [method='GET'] - 请求类型。
  28585. * @param {string} url - 服务地址。
  28586. * @param {Object} param - 请求参数。
  28587. * @param {Object} [requestOptions] - fetch 请求配置项。
  28588. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  28589. */
  28590. iPortalServiceBase_createClass(IPortalServiceBase, [{
  28591. key: "request",
  28592. value: function request(method, url, param) {
  28593. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
  28594. headers: this.headers,
  28595. crossOrigin: this.crossOrigin,
  28596. withCredentials: this.withCredentials
  28597. };
  28598. url = SecurityManager.appendCredential(url);
  28599. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  28600. return response.json();
  28601. });
  28602. }
  28603. }]);
  28604. return IPortalServiceBase;
  28605. }();
  28606. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryParam.js
  28607. 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); } }
  28608. 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; }
  28609. function iPortalQueryParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28610. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28611. * This program are made available under the terms of the Apache License, Version 2.0
  28612. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28613. /**
  28614. * @class IPortalQueryParam
  28615. * @aliasclass iPortalQueryParam
  28616. * @deprecatedclass SuperMap.iPortalQueryParam
  28617. * @classdesc iPortal 资源查询参数。
  28618. * @version 10.0.1
  28619. * @category iPortal/Online Resources ResourcesQuery
  28620. * @param {Object} params - 可选参数。
  28621. * @param {ResourceType} [params.resourceType] - 资源类型。
  28622. * @param {number} [params.pageSize] - 分页中每页大小。
  28623. * @param {number} [params.currentPage] - 分页页码。
  28624. * @param {OrderBy} [params.orderBy] - 排序字段。
  28625. * @param {OrderType} [params.orderType] - 根据升序还是降序过滤。
  28626. * @param {SearchType} [params.searchType] - 根据查询的范围进行过滤。
  28627. * @param {Array} [params.tags] - 标签。
  28628. * @param {Array} [params.dirIds] - 目录 ID。
  28629. * @param {Array} [params.resourceSubTypes] - 根据资源的子类型进行过滤。
  28630. * @param {AggregationTypes} [params.aggregationTypes] - 聚合查询的类型。
  28631. * @param {string} [params.text] - 搜索的关键词。
  28632. * @param {Array} [params.groupIds] - 根据群组进行过滤。
  28633. * @param {Array} [params.departmentIds] - 根据部门进行过滤。
  28634. * @usage
  28635. */
  28636. var IPortalQueryParam = /*#__PURE__*/iPortalQueryParam_createClass(function IPortalQueryParam(params) {
  28637. iPortalQueryParam_classCallCheck(this, IPortalQueryParam);
  28638. params = params || {};
  28639. this.resourceType = ""; // 空为全部 MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  28640. this.pageSize = 12; // 每页多少条
  28641. this.currentPage = 1; // 第几页
  28642. this.orderBy = "UPDATETIME"; // UPDATETIME HEATLEVEL
  28643. this.orderType = "DESC"; // DESC ASC
  28644. this.searchType = "PUBLIC"; // PUBLIC SHARETOME_RES MYDEPARTMENT_RES MYGROUP_RES MY_RES
  28645. this.tags = []; // 标签
  28646. this.dirIds = []; // 类别
  28647. this.resourceSubTypes = []; // 类型
  28648. this.aggregationTypes = []; // TAG TYPE SUBTYPE
  28649. this.text = ""; // 搜索字段
  28650. this.groupIds = []; // 群组Id过滤
  28651. this.departmentIds = []; // 部门Id过滤
  28652. Util_Util.extend(this, params);
  28653. });
  28654. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryResult.js
  28655. 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); } }
  28656. 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; }
  28657. function iPortalQueryResult_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28658. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28659. * This program are made available under the terms of the Apache License, Version 2.0
  28660. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28661. /**
  28662. * @class IPortalQueryResult
  28663. * @aliasclass iPortalQueryResult
  28664. * @deprecatedclass SuperMap.iPortalQueryResult
  28665. * @classdesc iPortal 资源结果集封装类。
  28666. * @version 10.0.1
  28667. * @category iPortal/Online Resources ResourcesQuery
  28668. * @param {Object} queryResult - 可选参数。
  28669. * @param {Array} [queryResult.content] - 页面内容。
  28670. * @param {number} [queryResult.total] - 总记录数。
  28671. * @param {number} [queryResult.currentPage] - 当前第几页。
  28672. * @param {number} [queryResult.pageSize] - 每页大小。
  28673. * @param {Object} [queryResult.aggregations] - 聚合查询的结果。
  28674. * @usage
  28675. */
  28676. var IPortalQueryResult = /*#__PURE__*/iPortalQueryResult_createClass(function IPortalQueryResult(queryResult) {
  28677. iPortalQueryResult_classCallCheck(this, IPortalQueryResult);
  28678. queryResult = queryResult || {};
  28679. this.content = [];
  28680. this.total = 0;
  28681. this.currentPage = 1;
  28682. this.pageSize = 12;
  28683. this.aggregations = null;
  28684. Util_Util.extend(this, queryResult);
  28685. });
  28686. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalResource.js
  28687. 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); }
  28688. function iPortalResource_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28689. 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); } }
  28690. 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; }
  28691. 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); }
  28692. 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); }
  28693. 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); }; }
  28694. 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); }
  28695. function iPortalResource_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28696. 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; } }
  28697. function iPortalResource_getPrototypeOf(o) { iPortalResource_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalResource_getPrototypeOf(o); }
  28698. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28699. * This program are made available under the terms of the Apache License, Version 2.0
  28700. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28701. /**
  28702. * @class IPortalResource
  28703. * @aliasclass iPortalResource
  28704. * @deprecatedclass SuperMap.iPortalResource
  28705. * @classdesc iPortal 资源详情类。
  28706. * @version 10.0.1
  28707. * @category iPortal/Online Resources
  28708. * @param {string} portalUrl - 服务地址。
  28709. * @param {Object} resourceInfo - 可选参数。
  28710. * @param {Array} [resourceInfo.authorizeSetting] - 资源的授权信息。
  28711. * @param {string} [resourceInfo.bounds] - 资源的坐标范围。
  28712. * @param {string} [resourceInfo.bounds4326] - 资源的坐标范围,转换为EPSG 4326坐标系统后的地理范围。
  28713. * @param {string} [resourceInfo.checkStatus] - 资源的审核状态,可以是:空,SUCCESSFUL,UNCHECKED,FAILED。
  28714. * @param {Date} [resourceInfo.createTime] - 资源的创建时间。
  28715. * @param {string} [resourceInfo.description] - 资源描述。
  28716. * @param {number} [resourceInfo.dirId] - 资源所在的门户目录的ID。
  28717. * @param {number} [resourceInfo.epsgCode] - 门户资源基于的坐标系的EPSG值。
  28718. * @param {number} [resourceInfo.heatLevel] - 记录资源的访问量或下载量。
  28719. * @param {string} [resourceInfo.id] - 资源存储到ElasticSearch中的文档ID。
  28720. * @param {string} [resourceInfo.name] - 资源名称。
  28721. * @param {number} [resourceInfo.personalDirId] - 资源所在的个人目录的ID。
  28722. * @param {number} [resourceInfo.resourceId] - 资源表(maps,services等)里的ID。
  28723. * @param {string} [resourceInfo.resourceSubType] - 某类资源的具体子类型。
  28724. * @param {ResourceType} [resourceInfo.resourceType] - 资源类型。
  28725. * @param {number} [resourceInfo.serviceRootUrlId] - 批量注册服务时,服务根地址的ID。
  28726. * @param {Array} [resourceInfo.tags] - 资源的标签。
  28727. * @param {string} [resourceInfo.thumbnail] - 资源的缩略图。
  28728. * @param {Date} [resourceInfo.updateTime] - 资源的更新时间。
  28729. * @param {string} [resourceInfo.userName] - 搜索的关键词。
  28730. * @param {Object} [resourceInfo.sourceJSON] - 提供了门户项目返回的所有信息。
  28731. * @extends {IPortalServiceBase}
  28732. * @usage
  28733. */
  28734. var IPortalResource = /*#__PURE__*/function (_IPortalServiceBase) {
  28735. iPortalResource_inherits(IPortalResource, _IPortalServiceBase);
  28736. var _super = iPortalResource_createSuper(IPortalResource);
  28737. function IPortalResource(portalUrl, resourceInfo) {
  28738. var _this;
  28739. iPortalResource_classCallCheck(this, IPortalResource);
  28740. _this = _super.call(this, portalUrl);
  28741. resourceInfo = resourceInfo || {};
  28742. _this.authorizeSetting = [];
  28743. _this.bounds = "";
  28744. _this.bounds4326 = "";
  28745. _this.checkStatus = "";
  28746. _this.createTime = 0;
  28747. _this.description = null;
  28748. _this.dirId = null;
  28749. _this.epsgCode = 0;
  28750. _this.heatLevel = 0;
  28751. _this.id = 0;
  28752. _this.name = "";
  28753. _this.personalDirId = null;
  28754. _this.resourceId = 0;
  28755. _this.resourceSubType = null;
  28756. _this.resourceType = null;
  28757. _this.serviceRootUrlId = null;
  28758. _this.tags = null;
  28759. _this.thumbnail = null;
  28760. _this.updateTime = 0;
  28761. _this.userName = "";
  28762. _this.sourceJSON = {}; //返回门户资源详细信息
  28763. Util_Util.extend(iPortalResource_assertThisInitialized(_this), resourceInfo); // INSIGHTS_WORKSPACE MAP_DASHBOARD
  28764. _this.resourceUrl = portalUrl + "/web/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  28765. if (_this.withCredentials) {
  28766. _this.resourceUrl = portalUrl + "/web/mycontent/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  28767. }
  28768. // if (this.id) {
  28769. // this.mapUrl = mapUrl + "/" + this.id;
  28770. // }
  28771. return _this;
  28772. }
  28773. /**
  28774. * @function IPortalResource.prototype.load
  28775. * @description 加载资源信息。
  28776. * @returns {Promise} 返回 Promise 对象。如果成功,Promise 没有返回值,请求返回结果自动填充到该类的属性中;如果失败,Promise 返回值包含错误信息。
  28777. */
  28778. iPortalResource_createClass(IPortalResource, [{
  28779. key: "load",
  28780. value: function load() {
  28781. var me = this;
  28782. return me.request("GET", me.resourceUrl + ".json").then(function (resourceInfo) {
  28783. if (resourceInfo.error) {
  28784. return resourceInfo;
  28785. }
  28786. me.sourceJSON = resourceInfo;
  28787. });
  28788. }
  28789. /**
  28790. * @function IPortalResource.prototype.update
  28791. * @description 更新资源属性信息。
  28792. * @returns {Promise} 返回包含更新操作状态的 Promise 对象。
  28793. */
  28794. }, {
  28795. key: "update",
  28796. value: function update() {
  28797. var resourceName = this.resourceType.replace("_", "").toLowerCase();
  28798. var options = {
  28799. headers: {
  28800. 'Content-Type': 'application/x-www-form-urlencoded'
  28801. }
  28802. };
  28803. if (resourceName === 'data') {
  28804. this.resourceUrl = this.resourceUrl + "/attributes.json";
  28805. }
  28806. var entity = JSON.stringify(this.sourceJSON);
  28807. //对服务资源进行编辑时,请求体内容只留关键字字段(目前如果是全部字段 更新返回成功 但其实没有真正的更新)
  28808. if (resourceName === 'service') {
  28809. var serviceInfo = {
  28810. authorizeSetting: this.sourceJSON.authorizeSetting,
  28811. metadata: this.sourceJSON.metadata,
  28812. tags: this.sourceJSON.tags,
  28813. thumbnail: this.sourceJSON.thumbnail,
  28814. tokenRefreshUrl: this.sourceJSON.tokenRefreshUrl
  28815. };
  28816. entity = JSON.stringify(serviceInfo);
  28817. }
  28818. return this.request("PUT", this.resourceUrl, entity, options);
  28819. }
  28820. }]);
  28821. return IPortalResource;
  28822. }(IPortalServiceBase);
  28823. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareParam.js
  28824. 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); } }
  28825. 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; }
  28826. function iPortalShareParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28827. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28828. * This program are made available under the terms of the Apache License, Version 2.0
  28829. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28830. /**
  28831. * @class IPortalShareParam
  28832. * @aliasclass iPortalShareParam
  28833. * @deprecatedclass SuperMap.iPortalShareParam
  28834. * @classdesc iPortal 资源共享参数。
  28835. * @version 10.0.1
  28836. * @category iPortal/Online Resources ResourcesShare
  28837. * @param {Object} params - 可选参数。
  28838. * @param {ResourceType} [params.resourceType] - 资源类型。
  28839. * @param {Array} [params.ids] - 资源的ID数组。
  28840. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  28841. * @usage
  28842. */
  28843. var IPortalShareParam = /*#__PURE__*/iPortalShareParam_createClass(function IPortalShareParam(params) {
  28844. iPortalShareParam_classCallCheck(this, IPortalShareParam);
  28845. params = params || {};
  28846. this.ids = [];
  28847. this.entities = [];
  28848. this.resourceType = ""; // MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  28849. Util_Util.extend(this, params);
  28850. });
  28851. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortal.js
  28852. 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); }
  28853. function iPortal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28854. 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); } }
  28855. 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; }
  28856. 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); }
  28857. 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); }
  28858. 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); }; }
  28859. 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); }
  28860. function iPortal_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28861. 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; } }
  28862. function iPortal_getPrototypeOf(o) { iPortal_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortal_getPrototypeOf(o); }
  28863. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28864. * This program are made available under the terms of the Apache License, Version 2.0
  28865. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28866. /**
  28867. * @class IPortal
  28868. * @aliasclass iPortal
  28869. * @deprecatedclass SuperMap.iPortal
  28870. * @classdesc 对接 SuperMap iPortal 基础服务。
  28871. * @category iPortal/Online Resources
  28872. * @modulecategory Services
  28873. * @extends {IPortalServiceBase}
  28874. * @param {string} iportalUrl - 服务地址。
  28875. * @param {Object} options - 可选参数。
  28876. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  28877. * @usage
  28878. */
  28879. var IPortal = /*#__PURE__*/function (_IPortalServiceBase) {
  28880. iPortal_inherits(IPortal, _IPortalServiceBase);
  28881. var _super = iPortal_createSuper(IPortal);
  28882. function IPortal(iportalUrl, options) {
  28883. var _this;
  28884. iPortal_classCallCheck(this, IPortal);
  28885. _this = _super.call(this, iportalUrl, options);
  28886. _this.iportalUrl = iportalUrl;
  28887. options = options || {};
  28888. _this.withCredentials = options.withCredentials || false;
  28889. return _this;
  28890. }
  28891. /**
  28892. * @function IPortal.prototype.load
  28893. * @description 加载页面。
  28894. * @returns {Promise} 包含 iportal web 资源信息的 Promise 对象。
  28895. */
  28896. iPortal_createClass(IPortal, [{
  28897. key: "load",
  28898. value: function load() {
  28899. return FetchRequest.get(this.iportalUrl + "/web");
  28900. }
  28901. /**
  28902. * @function IPortal.prototype.queryResources
  28903. * @description 查询资源。
  28904. * @version 10.0.1
  28905. * @param {IPortalQueryParam} queryParams - 查询参数。
  28906. * @returns {Promise} 包含所有资源结果的 Promise 对象。
  28907. */
  28908. }, {
  28909. key: "queryResources",
  28910. value: function queryResources(queryParams) {
  28911. if (!(queryParams instanceof IPortalQueryParam)) {
  28912. return new Promise(function (resolve) {
  28913. resolve("queryParams is not instanceof iPortalQueryParam !");
  28914. });
  28915. }
  28916. var me = this;
  28917. var resourceUrl = this.iportalUrl + "/gateway/catalog/resource/search.json";
  28918. queryParams.t = new Date().getTime();
  28919. return this.request("GET", resourceUrl, queryParams).then(function (result) {
  28920. var content = [];
  28921. (result.content || []).forEach(function (item) {
  28922. content.push(new IPortalResource(me.iportalUrl, item));
  28923. });
  28924. var queryResult = new IPortalQueryResult();
  28925. queryResult.content = content;
  28926. queryResult.total = result.total;
  28927. queryResult.currentPage = result.currentPage;
  28928. queryResult.pageSize = result.pageSize;
  28929. queryResult.aggregations = result.aggregations;
  28930. return queryResult;
  28931. });
  28932. }
  28933. /**
  28934. * @function IPortal.prototype.updateResourcesShareSetting
  28935. * @description 更新共享设置。
  28936. * @version 10.0.1
  28937. * @param {IPortalShareParam} shareParams - 共享的参数。
  28938. * @returns {Promise} 包含共享资源结果的 Promise 对象。
  28939. */
  28940. }, {
  28941. key: "updateResourcesShareSetting",
  28942. value: function updateResourcesShareSetting(shareParams) {
  28943. if (!(shareParams instanceof IPortalShareParam)) {
  28944. return new Promise(function (resolve) {
  28945. resolve("shareParams is not instanceof iPortalShareParam !");
  28946. });
  28947. }
  28948. var resourceUrlName = shareParams.resourceType.replace("_", "").toLowerCase() + "s";
  28949. if (resourceUrlName === "datas") {
  28950. resourceUrlName = "mycontent/" + resourceUrlName;
  28951. }
  28952. var cloneShareParams = {
  28953. ids: shareParams.ids,
  28954. entities: shareParams.entities
  28955. };
  28956. var shareUrl = this.iportalUrl + "/web/" + resourceUrlName + "/sharesetting.json";
  28957. return this.request("PUT", shareUrl, JSON.stringify(cloneShareParams)).then(function (result) {
  28958. return result;
  28959. });
  28960. }
  28961. }]);
  28962. return IPortal;
  28963. }(IPortalServiceBase);
  28964. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareEntity.js
  28965. 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); } }
  28966. 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; }
  28967. function iPortalShareEntity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28968. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28969. * This program are made available under the terms of the Apache License, Version 2.0
  28970. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28971. /**
  28972. * @class IPortalShareEntity
  28973. * @aliasclass iPortalShareEntity
  28974. * @deprecatedclass SuperMap.iPortalShareEntity
  28975. * @classdesc iPortal 资源共享实体参数。
  28976. * @version 10.0.1
  28977. * @category iPortal/Online Resources ResourcesShare
  28978. * @param {Object} shareEntity - 可选参数。
  28979. * @param {PermissionType} [shareEntity.permissionType] - 权限类型。
  28980. * @param {EntityType} [shareEntity.entityType] - 实体类型。
  28981. * @param {string} [shareEntity.entityName] - 实体 Name。对应的 USER(用户)、ROLE(角色)、GROUP(用户组)、IPORTALGROUP(群组)的名称。
  28982. * @param {number} [shareEntity.entityId] - 实体的 ID。用于群组的授权。
  28983. * @usage
  28984. */
  28985. var IPortalShareEntity = /*#__PURE__*/iPortalShareEntity_createClass(function IPortalShareEntity(shareEntity) {
  28986. iPortalShareEntity_classCallCheck(this, IPortalShareEntity);
  28987. shareEntity = shareEntity || {};
  28988. this.permissionType = ""; // SEARCH READ READWRITE DOWNLOAD
  28989. this.entityType = ""; // USER DEPARTMENT IPORTALGROUP
  28990. this.entityName = "GUEST"; // GUEST or 具体用户 name
  28991. this.entityId = null;
  28992. Util_Util.extend(this, shareEntity);
  28993. });
  28994. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddResourceParam.js
  28995. 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); } }
  28996. 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; }
  28997. function iPortalAddResourceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28998. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  28999. * This program are made available under the terms of the Apache License, Version 2.0
  29000. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29001. /**
  29002. * @class IPortalAddResourceParam
  29003. * @aliasclass iPortalAddResourceParam
  29004. * @deprecatedclass SuperMap.iPortalAddResourceParam
  29005. * @classdesc iPortal 添加资源参数。
  29006. * @version 10.0.1
  29007. * @category iPortal/Online Resources ResourcesShare
  29008. * @param {Object} params - 可选参数。
  29009. * @param {string} [params.rootUrl] - 服务地址。
  29010. * @param {Array} [params.tags] - 标签。
  29011. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  29012. * @usage
  29013. */
  29014. var IPortalAddResourceParam = /*#__PURE__*/iPortalAddResourceParam_createClass(function IPortalAddResourceParam(params) {
  29015. iPortalAddResourceParam_classCallCheck(this, IPortalAddResourceParam);
  29016. params = params || {};
  29017. this.rootUrl = "";
  29018. this.tags = [];
  29019. this.entities = [];
  29020. Util_Util.extend(this, params);
  29021. });
  29022. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalRegisterServiceParam.js
  29023. 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); } }
  29024. 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; }
  29025. function iPortalRegisterServiceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29026. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29027. * This program are made available under the terms of the Apache License, Version 2.0
  29028. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29029. /**
  29030. * @class IPortalRegisterServiceParam
  29031. * @aliasclass iPortalRegisterServiceParam
  29032. * @deprecatedclass SuperMap.iPortalRegisterServiceParam
  29033. * @classdesc iPortal 注册服务参数。
  29034. * @version 10.0.1
  29035. * @category iPortal/Online Resources Data
  29036. * @param {Object} params - 可选参数。
  29037. * @param {string} [params.type] - 服务类型。
  29038. * @param {Array} [params.tags] - 服务标签。
  29039. * @param {IPortalShareEntity} [params.entities] - 资源的实体共享参数。
  29040. * @param {Object} [params.metadata] - 服务元信息。
  29041. * @param {Array} [params.addedMapNames] - 地图服务列表。
  29042. * @param {Array} [params.addedSceneNames] - 场景服务列表。
  29043. * @usage
  29044. */
  29045. var IPortalRegisterServiceParam = /*#__PURE__*/iPortalRegisterServiceParam_createClass(function IPortalRegisterServiceParam(params) {
  29046. iPortalRegisterServiceParam_classCallCheck(this, IPortalRegisterServiceParam);
  29047. params = params || {};
  29048. this.type = ""; // SUPERMAP_REST ARCGIS_REST WMS WFS WCS WPS WMTS OTHERS
  29049. this.tags = [];
  29050. this.entities = [];
  29051. this.metadata = {};
  29052. this.addedMapNames = [];
  29053. this.addedSceneNames = [];
  29054. Util_Util.extend(this, params);
  29055. });
  29056. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddDataParam.js
  29057. 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); } }
  29058. 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; }
  29059. function iPortalAddDataParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29060. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29061. * This program are made available under the terms of the Apache License, Version 2.0
  29062. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29063. /**
  29064. * @class IPortalAddDataParam
  29065. * @aliasclass iPortalAddDataParam
  29066. * @deprecatedclass SuperMap.iPortalAddDataParam
  29067. * @classdesc iPortal 上传/注册数据所需的参数。
  29068. * @version 10.0.1
  29069. * @category iPortal/Online Resources Data
  29070. * @param {Object} params - 参数。
  29071. * @param {string} params.fileName - 文件名称。
  29072. * @param {DataItemType} params.type - 数据类型。
  29073. * @param {Array} [params.tags] - 数据的标签。
  29074. * @param {IPortalDataMetaInfoParam} [params.dataMetaInfo] - 数据元信息。
  29075. * @usage
  29076. */
  29077. var IPortalAddDataParam = /*#__PURE__*/iPortalAddDataParam_createClass(function IPortalAddDataParam(params) {
  29078. iPortalAddDataParam_classCallCheck(this, IPortalAddDataParam);
  29079. params = params || {};
  29080. this.fileName = "";
  29081. this.type = "";
  29082. this.tags = [];
  29083. this.dataMetaInfo = {};
  29084. Util_Util.extend(this, params);
  29085. });
  29086. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataMetaInfoParam.js
  29087. 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); } }
  29088. 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; }
  29089. function iPortalDataMetaInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29090. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29091. * This program are made available under the terms of the Apache License, Version 2.0
  29092. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29093. /**
  29094. * @class IPortalDataMetaInfoParam
  29095. * @aliasclass iPortalDataMetaInfoParam
  29096. * @deprecatedclass SuperMap.iPortalDataMetaInfoParam
  29097. * @classdesc iPortal 上传数据/注册数据元信息所需的参数。
  29098. * @version 10.0.1
  29099. * @category iPortal/Online Resources Data
  29100. * @param {Object} params - 参数。
  29101. * @param {string} params.xField - X 坐标字段。
  29102. * @param {string} params.yField - Y 坐标字段。
  29103. * @param {number} params.xIndex - x所在列(关系型存储下CSV或EXCEL数据时必填)。
  29104. * @param {number} params.yIndex - y所在列(关系型存储下CSV或EXCEL数据时必填)。
  29105. * @param {Array.<string>} [params.fieldTypes] - 设置字段类型(关系型存储下CSV或EXCEL数据时可选填)。默认类型为:WTEXT。该参数按照CSV文件字段顺序从左到右依次设置,其中默认字段类型可省略不设置。例如,CSV文件中有10个字段,如果只需设定第1,2,4个字段,可设置为['a','b',,'c']。
  29106. * @param {string} params.separator - 分隔符(关系型存储下CSV数据时必填)。
  29107. * @param {boolean} params.firstRowIsHead - 是否带表头(关系型存储下CSV数据时必填)。
  29108. * @param {boolean} params.url - HDFS注册目录地址。
  29109. * @param {IPortalDataStoreInfoParam} params.dataStoreInfo - 注册数据时的数据存储信息。
  29110. * @usage
  29111. */
  29112. var IPortalDataMetaInfoParam = /*#__PURE__*/iPortalDataMetaInfoParam_createClass(function IPortalDataMetaInfoParam(params) {
  29113. iPortalDataMetaInfoParam_classCallCheck(this, IPortalDataMetaInfoParam);
  29114. params = params || {};
  29115. this.xField = "";
  29116. this.yField = "";
  29117. this.fileEncoding = "UTF-8";
  29118. this.xIndex = 1;
  29119. this.yIndex = 1;
  29120. this.fieldTypes = [];
  29121. this.separator = "";
  29122. this.firstRowIsHead = true;
  29123. this.url = "";
  29124. this.dataStoreInfo = {};
  29125. Util_Util.extend(this, params);
  29126. });
  29127. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataStoreInfoParam.js
  29128. 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); } }
  29129. 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; }
  29130. function iPortalDataStoreInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29131. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29132. * This program are made available under the terms of the Apache License, Version 2.0
  29133. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29134. /**
  29135. * @class IPortalDataStoreInfoParam
  29136. * @aliasclass iPortalDataStoreInfoParam
  29137. * @deprecatedclass SuperMap.iPortalDataStoreInfoParam
  29138. * @classdesc iPortal 注册一个HBASE HDFS数据存储类。
  29139. * @version 10.0.1
  29140. * @category iPortal/Online Resources Data
  29141. * @param {Object} params - 参数。
  29142. * @param {string} params.type - 大数据文件共享类型和空间数据库类型,包括大数据文件共享HDFS 目录(HDFS)和空间数据库HBASE。
  29143. * @param {string} params.url - HDFS数据存储目录地址。
  29144. * @param {IPortalDataConnectionInfoParam} [params.connectionInfo] - HBASE空间数据库服务的连接信息。
  29145. * @usage
  29146. */
  29147. var IPortalDataStoreInfoParam = /*#__PURE__*/iPortalDataStoreInfoParam_createClass(function IPortalDataStoreInfoParam(params) {
  29148. iPortalDataStoreInfoParam_classCallCheck(this, IPortalDataStoreInfoParam);
  29149. params = params || {};
  29150. this.type = "";
  29151. this.url = "";
  29152. this.connectionInfo = {};
  29153. Util_Util.extend(this, params);
  29154. });
  29155. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataConnectionInfoParam.js
  29156. 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); } }
  29157. 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; }
  29158. function iPortalDataConnectionInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29159. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29160. * This program are made available under the terms of the Apache License, Version 2.0
  29161. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29162. /**
  29163. * @class IPortalDataConnectionInfoParam
  29164. * @aliasclass iPortalDataConnectionInfoParam
  29165. * @deprecatedclass SuperMap.iPortalDataConnectionInfoParam
  29166. * @classdesc iPortal HBASE数据源连接信息类。
  29167. * @version 10.0.1
  29168. * @category iPortal/Online Resources Data
  29169. * @param {Object} params - 参数。
  29170. * @param {string} params.dataBase - 数据源连接的数据库名。
  29171. * @param {string} params.server - 服务地址。
  29172. * @usage
  29173. */
  29174. var IPortalDataConnectionInfoParam = /*#__PURE__*/iPortalDataConnectionInfoParam_createClass(function IPortalDataConnectionInfoParam(params) {
  29175. iPortalDataConnectionInfoParam_classCallCheck(this, IPortalDataConnectionInfoParam);
  29176. params = params || {};
  29177. this.dataBase = "";
  29178. this.server = "";
  29179. Util_Util.extend(this, params);
  29180. });
  29181. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalUser.js
  29182. 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); }
  29183. function iPortalUser_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29184. 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); } }
  29185. 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; }
  29186. 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); }
  29187. 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); }
  29188. 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); }; }
  29189. 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); }
  29190. function iPortalUser_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29191. 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; } }
  29192. function iPortalUser_getPrototypeOf(o) { iPortalUser_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalUser_getPrototypeOf(o); }
  29193. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29194. * This program are made available under the terms of the Apache License, Version 2.0
  29195. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29196. /**
  29197. * @class IPortalUser
  29198. * @aliasclass iPortalUser
  29199. * @deprecatedclass SuperMap.iPortalUser
  29200. * @classdesc iPortal 门户中用户信息的封装类。用于管理用户资源,包括可删除,添加资源。
  29201. * @version 10.0.1
  29202. * @category iPortal/Online Resources
  29203. * @param {string} iportalUrl - 服务地址。
  29204. * @extends {IPortalServiceBase}
  29205. * @usage
  29206. */
  29207. var IPortalUser = /*#__PURE__*/function (_IPortalServiceBase) {
  29208. iPortalUser_inherits(IPortalUser, _IPortalServiceBase);
  29209. var _super = iPortalUser_createSuper(IPortalUser);
  29210. function IPortalUser(iportalUrl) {
  29211. var _this;
  29212. iPortalUser_classCallCheck(this, IPortalUser);
  29213. _this = _super.call(this, iportalUrl);
  29214. _this.iportalUrl = iportalUrl;
  29215. return _this;
  29216. }
  29217. /**
  29218. * @function IPortalUser.prototype.deleteResources
  29219. * @description 删除资源。
  29220. * @param {Object} params - 删除资源所需的参数对象:{ids,resourceType}。
  29221. * @returns {Promise} 返回包含删除操作状态的 Promise 对象。
  29222. */
  29223. iPortalUser_createClass(IPortalUser, [{
  29224. key: "deleteResources",
  29225. value: function deleteResources(params) {
  29226. var resourceName = params.resourceType.replace("_", "").toLowerCase();
  29227. var deleteResourceUrl = this.iportalUrl + "/web/" + resourceName + "s.json?ids=" + encodeURI(JSON.stringify(params.ids));
  29228. if (resourceName === 'data') {
  29229. deleteResourceUrl = this.iportalUrl + "/web/mycontent/datas/delete.json";
  29230. return this.request("POST", deleteResourceUrl, JSON.stringify(params.ids));
  29231. }
  29232. return this.request("DELETE", deleteResourceUrl);
  29233. }
  29234. /**
  29235. * @function IPortalUser.prototype.addMap
  29236. * @description 添加地图。
  29237. * @version 10.1.0
  29238. * @param {IPortalAddResourceParam} addMapParams - 添加地图的参数。
  29239. * @returns {Promise} 返回包含添加地图结果的 Promise 对象。
  29240. */
  29241. }, {
  29242. key: "addMap",
  29243. value: function addMap(addMapParams) {
  29244. if (!(addMapParams instanceof IPortalAddResourceParam)) {
  29245. return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");
  29246. }
  29247. var cloneAddMapParams = {
  29248. rootUrl: addMapParams.rootUrl,
  29249. tags: addMapParams.tags,
  29250. authorizeSetting: addMapParams.entities
  29251. };
  29252. var addMapUrl = this.iportalUrl + "/web/maps/batchaddmaps.json";
  29253. return this.request("POST", addMapUrl, JSON.stringify(cloneAddMapParams)).then(function (result) {
  29254. return result;
  29255. });
  29256. }
  29257. /**
  29258. * @function IPortalUser.prototype.addScene
  29259. * @description 添加场景。
  29260. * @version 10.1.0
  29261. * @param {IPortalAddResourceParam} addSceneParams - 添加场景的参数。
  29262. * @returns {Promise} 返回包含添加场景结果的 Promise 对象。
  29263. */
  29264. }, {
  29265. key: "addScene",
  29266. value: function addScene(addSceneParams) {
  29267. if (!(addSceneParams instanceof IPortalAddResourceParam)) {
  29268. return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");
  29269. }
  29270. var cloneAddSceneParams = {
  29271. rootUrl: addSceneParams.rootUrl,
  29272. tags: addSceneParams.tags,
  29273. authorizeSetting: addSceneParams.entities
  29274. };
  29275. var addSceneUrl = this.iportalUrl + "/web/scenes/batchaddscenes.json";
  29276. return this.request("POST", addSceneUrl, JSON.stringify(cloneAddSceneParams)).then(function (result) {
  29277. return result;
  29278. });
  29279. }
  29280. /**
  29281. * @function IPortalUser.prototype.registerService
  29282. * @description 注册服务。
  29283. * @version 10.1.0
  29284. * @param {IPortalRegisterServiceParam} registerParams - 注册服务的参数。
  29285. * @returns {Promise} 返回包含注册服务结果的 Promise 对象。
  29286. */
  29287. }, {
  29288. key: "registerService",
  29289. value: function registerService(registerParams) {
  29290. if (!(registerParams instanceof IPortalRegisterServiceParam)) {
  29291. return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");
  29292. }
  29293. var cloneRegisterParams = {
  29294. type: registerParams.type,
  29295. tags: registerParams.tags,
  29296. authorizeSetting: registerParams.entities,
  29297. metadata: registerParams.metadata,
  29298. addedMapNames: registerParams.addedMapNames,
  29299. addedSceneNames: registerParams.addedSceneNames
  29300. };
  29301. var registerUrl = this.iportalUrl + "/web/services.json";
  29302. return this.request("POST", registerUrl, JSON.stringify(cloneRegisterParams)).then(function (result) {
  29303. return result;
  29304. });
  29305. }
  29306. /**
  29307. * @function IPortalUser.prototype.getErrMsgPromise
  29308. * @description 获取包含错误信息的Promise对象。
  29309. * @version 10.1.0
  29310. * @param {string} errMsg - 传入的错误信息。
  29311. * @returns {Promise} 返回包含错误信息的 Promise 对象。
  29312. */
  29313. }, {
  29314. key: "getErrMsgPromise",
  29315. value: function getErrMsgPromise(errMsg) {
  29316. return new Promise(function (resolve) {
  29317. resolve(errMsg);
  29318. });
  29319. }
  29320. /**
  29321. * @function IPortalUser.prototype.uploadDataRequest
  29322. * @description 上传数据。
  29323. * @version 10.1.0
  29324. * @param {number} id - 上传数据的资源ID。
  29325. * @param {Object} formData - 请求体为文本数据流。
  29326. * @returns {Promise} 返回包含上传数据操作的 Promise 对象。
  29327. */
  29328. }, {
  29329. key: "uploadDataRequest",
  29330. value: function uploadDataRequest(id, formData) {
  29331. var uploadDataUrl = this.iportalUrl + "/web/mycontent/datas/" + id + "/upload.json";
  29332. return this.request("POST", uploadDataUrl, formData);
  29333. }
  29334. /**
  29335. * @function IPortalUser.prototype.addData
  29336. * @description 上传/注册数据。
  29337. * @version 10.1.0
  29338. * @param {IPortalAddDataParam} params - 上传/注册数据所需的参数。
  29339. * @param {Object} [formData] - 请求体为文本数据流(上传数据时传入)。
  29340. * @returns {Promise} 返回上传/注册数据的 Promise 对象。
  29341. */
  29342. }, {
  29343. key: "addData",
  29344. value: function addData(params, formData) {
  29345. var _this2 = this;
  29346. if (!(params instanceof IPortalAddDataParam)) {
  29347. return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");
  29348. }
  29349. var datasUrl = this.iportalUrl + "/web/mycontent/datas.json";
  29350. var entity = {
  29351. fileName: params.fileName,
  29352. tags: params.tags,
  29353. type: params.type
  29354. };
  29355. var type = params.type.toLowerCase();
  29356. var dataMetaInfo;
  29357. if (type === "excel" || type === "csv") {
  29358. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  29359. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  29360. }
  29361. dataMetaInfo = {
  29362. xField: params.dataMetaInfo.xField,
  29363. yField: params.dataMetaInfo.yField
  29364. };
  29365. if (type === 'csv') {
  29366. dataMetaInfo.fileEncoding = params.dataMetaInfo.fileEncoding;
  29367. }
  29368. entity.coordType = "WGS84";
  29369. entity.dataMetaInfo = dataMetaInfo;
  29370. } else if (type === "hdfs" || type === "hbase") {
  29371. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  29372. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  29373. }
  29374. if (!(params.dataMetaInfo.dataStoreInfo instanceof IPortalDataStoreInfoParam)) {
  29375. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");
  29376. }
  29377. var dataStoreInfo = {
  29378. type: params.dataMetaInfo.dataStoreInfo.type
  29379. };
  29380. switch (type) {
  29381. case "hdfs":
  29382. dataStoreInfo.url = params.dataMetaInfo.dataStoreInfo.url;
  29383. dataMetaInfo = {
  29384. url: params.dataMetaInfo.url,
  29385. dataStoreInfo: dataStoreInfo
  29386. };
  29387. break;
  29388. case "hbase":
  29389. if (!(params.dataMetaInfo.dataStoreInfo.connectionInfo instanceof IPortalDataConnectionInfoParam)) {
  29390. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");
  29391. }
  29392. dataStoreInfo.connectionInfo = {
  29393. dataBase: params.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,
  29394. server: params.dataMetaInfo.dataStoreInfo.connectionInfo.server,
  29395. engineType: 'HBASE'
  29396. };
  29397. dataStoreInfo.datastoreType = "SPATIAL"; //该字段SPATIAL表示HBASE注册
  29398. dataMetaInfo = {
  29399. dataStoreInfo: dataStoreInfo
  29400. };
  29401. break;
  29402. }
  29403. entity.dataMetaInfo = dataMetaInfo;
  29404. }
  29405. return this.request("POST", datasUrl, JSON.stringify(entity)).then(function (res) {
  29406. if (type === "hdfs" || type === "hbase") {
  29407. return res;
  29408. } else {
  29409. if (res.childID) {
  29410. return _this2.uploadDataRequest(res.childID, formData);
  29411. } else {
  29412. return res.customResult;
  29413. }
  29414. }
  29415. });
  29416. }
  29417. /**
  29418. * @function IPortalUser.prototype.publishOrUnpublish
  29419. * @description 发布/取消发布。
  29420. * @version 10.1.0
  29421. * @param {Object} options - 发布/取消发布数据服务所需的参数。
  29422. * @param {Object} options.dataId - 数据项ID。
  29423. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  29424. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  29425. * @param {boolean} forPublish - 是否取消发布。
  29426. * @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
  29427. */
  29428. }, {
  29429. key: "publishOrUnpublish",
  29430. value: function publishOrUnpublish(option, forPublish) {
  29431. if (!option.dataId || !option.serviceType) {
  29432. return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
  29433. }
  29434. var dataId = option.dataId;
  29435. var dataServiceId = option.dataServiceId;
  29436. var serviceType = option.serviceType;
  29437. var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
  29438. if (dataServiceId) {
  29439. publishUrl += "&dataServiceId=" + dataServiceId;
  29440. }
  29441. return this.request("PUT", publishUrl, JSON.stringify(forPublish)).then(function (res) {
  29442. // 发起服务状态查询
  29443. if (forPublish) {
  29444. // 发布服务的结果异步处理
  29445. // var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
  29446. if (!dataServiceId) {
  29447. // 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
  29448. dataServiceId = res.customResult;
  29449. }
  29450. return dataServiceId;
  29451. } else {
  29452. // 取消发布的结果同步处理
  29453. return res;
  29454. }
  29455. });
  29456. }
  29457. /**
  29458. * @function IPortalUser.prototype.getDataPublishedStatus
  29459. * @description 查询服务状态,发起服务状态查询。
  29460. * @version 10.1.0
  29461. * @param {number} dataId - 查询服务状态的数据项ID。
  29462. * @param {string} dataServiceId - 发布的服务ID。
  29463. * @returns {Promise} 返回查询服务状态的 Promise 对象。
  29464. */
  29465. }, {
  29466. key: "getDataPublishedStatus",
  29467. value: function getDataPublishedStatus(dataId, dataServiceId) {
  29468. var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId=" + dataServiceId + "&forPublish=true";
  29469. return this.request("GET", publishStateUrl);
  29470. }
  29471. /**
  29472. * @function IPortalUser.prototype.unPublishedDataService
  29473. * @description 取消发布。
  29474. * @version 10.1.0
  29475. * @param {Object} options - 取消发布服务具体参数。
  29476. * @param {Object} options.dataId - 数据项ID。
  29477. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  29478. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  29479. * @returns {Promise} 返回取消发布数据服务的 Promise 对象。
  29480. */
  29481. }, {
  29482. key: "unPublishDataService",
  29483. value: function unPublishDataService(option) {
  29484. return this.publishOrUnpublish(option, false);
  29485. }
  29486. /**
  29487. * @function IPortalUser.prototype.publishedDataService
  29488. * @description 发布数据服务。
  29489. * @version 10.1.0
  29490. * @param {Object} options - 发布数据服务具体参数。
  29491. * @param {Object} options.dataId - 数据项ID。
  29492. * @param {Object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  29493. * @param {Object} [options.dataServiceId] - 发布的服务 ID。
  29494. * @returns {Promise} 返回发布数据服务的 Promise 对象。
  29495. */
  29496. }, {
  29497. key: "publishDataService",
  29498. value: function publishDataService(option) {
  29499. return this.publishOrUnpublish(option, true);
  29500. }
  29501. }]);
  29502. return IPortalUser;
  29503. }(IPortalServiceBase);
  29504. ;// CONCATENATED MODULE: ./src/common/iPortal/index.js
  29505. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29506. * This program are made available under the terms of the Apache License, Version 2.0
  29507. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29508. ;// CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
  29509. 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); }
  29510. function CommonServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29511. 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); } }
  29512. 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; }
  29513. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29514. * This program are made available under the terms of the Apache License, Version 2.0
  29515. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29516. /**
  29517. * @class CommonServiceBase
  29518. * @deprecatedclass SuperMap.CommonServiceBase
  29519. * @category iServer Core
  29520. * @classdesc 对接 iServer 各种服务的 Service 的基类。
  29521. * @param {string} url - 服务地址。
  29522. * @param {Object} options - 参数。
  29523. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  29524. * @param {string} [options.proxy] - 服务代理地址。
  29525. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  29526. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29527. * @param {Object} [options.headers] - 请求头。
  29528. * @usage
  29529. */
  29530. var CommonServiceBase = /*#__PURE__*/function () {
  29531. function CommonServiceBase(url, options) {
  29532. CommonServiceBase_classCallCheck(this, CommonServiceBase);
  29533. var me = this;
  29534. this.EVENT_TYPES = ['processCompleted', 'processFailed'];
  29535. this.events = null;
  29536. this.eventListeners = null;
  29537. this.url = null;
  29538. this.urls = null;
  29539. this.proxy = null;
  29540. this.index = null;
  29541. this.length = null;
  29542. this.totalTimes = null;
  29543. this.POLLING_TIMES = 3;
  29544. this.isInTheSameDomain = null;
  29545. this.withCredentials = false;
  29546. if (Util_Util.isArray(url)) {
  29547. me.urls = url;
  29548. me.length = url.length;
  29549. me.totalTimes = me.length;
  29550. if (me.length === 1) {
  29551. me.url = url[0];
  29552. } else {
  29553. me.index = parseInt(Math.random() * me.length);
  29554. me.url = url[me.index];
  29555. }
  29556. } else {
  29557. me.totalTimes = 1;
  29558. me.url = url;
  29559. }
  29560. if (Util_Util.isArray(url) && !me.isServiceSupportPolling()) {
  29561. me.url = url[0];
  29562. me.totalTimes = 1;
  29563. }
  29564. options = options || {};
  29565. this.crossOrigin = options.crossOrigin;
  29566. this.headers = options.headers;
  29567. Util_Util.extend(this, options);
  29568. me.isInTheSameDomain = Util_Util.isInTheSameDomain(me.url);
  29569. me.events = new Events(me, null, me.EVENT_TYPES, true);
  29570. if (me.eventListeners instanceof Object) {
  29571. me.events.on(me.eventListeners);
  29572. }
  29573. this.CLASS_NAME = 'SuperMap.CommonServiceBase';
  29574. }
  29575. /**
  29576. * @function CommonServiceBase.prototype.destroy
  29577. * @description 释放资源,将引用的资源属性置空。
  29578. */
  29579. CommonServiceBase_createClass(CommonServiceBase, [{
  29580. key: "destroy",
  29581. value: function destroy() {
  29582. var me = this;
  29583. if (Util_Util.isArray(me.urls)) {
  29584. me.urls = null;
  29585. me.index = null;
  29586. me.length = null;
  29587. me.totalTimes = null;
  29588. }
  29589. me.url = null;
  29590. me._processSuccess = null;
  29591. me._processFailed = null;
  29592. me.isInTheSameDomain = null;
  29593. me.EVENT_TYPES = null;
  29594. if (me.events) {
  29595. me.events.destroy();
  29596. me.events = null;
  29597. }
  29598. if (me.eventListeners) {
  29599. me.eventListeners = null;
  29600. }
  29601. }
  29602. /**
  29603. * @function CommonServiceBase.prototype.request
  29604. * @description: 该方法用于向服务发送请求。
  29605. * @param {Object} options - 参数。
  29606. * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
  29607. * @param {string} [options.url] - 发送请求的地址。
  29608. * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
  29609. * @param {string} [options.data] - 发送到服务器的数据。
  29610. * @param {function} options.success - 请求成功后的回调函数。
  29611. * @param {function} options.failure - 请求失败后的回调函数。
  29612. * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
  29613. * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
  29614. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  29615. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29616. * @param {Object} [options.headers] - 请求头。
  29617. */
  29618. }, {
  29619. key: "request",
  29620. value: function request(options) {
  29621. var format = options.scope.format;
  29622. if (format && !this.supportDataFormat(format)) {
  29623. throw new Error("".concat(this.CLASS_NAME, " is not surport ").concat(format, " format!"));
  29624. }
  29625. var me = this;
  29626. options.url = options.url || me.url;
  29627. if (this._returnContent(options) && !options.url.includes('returnContent=true')) {
  29628. options.url = Util_Util.urlAppend(options.url, 'returnContent=true');
  29629. }
  29630. options.proxy = options.proxy || me.proxy;
  29631. options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
  29632. options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
  29633. options.headers = options.headers || me.headers;
  29634. options.isInTheSameDomain = me.isInTheSameDomain;
  29635. options.withoutFormatSuffix = options.scope.withoutFormatSuffix || false;
  29636. //为url添加安全认证信息片段
  29637. options.url = SecurityManager.appendCredential(options.url);
  29638. me.calculatePollingTimes();
  29639. options.scope = me;
  29640. var success = options.scope ? options.success.bind(options.scope) : options.success;
  29641. var failure = options.scope ? options.failure.bind(options.scope) : options.failure;
  29642. options.success = me.getUrlCompleted(success, options);
  29643. options.failure = me.getUrlFailed(failure, options);
  29644. me._commit(options);
  29645. }
  29646. /**
  29647. * @function CommonServiceBase.prototype.getUrlCompleted
  29648. * @description 请求成功后执行此方法。
  29649. * @param {Object} cb - 成功回调函数。
  29650. * @param {Object} options - 请求参数对象。
  29651. * @private
  29652. */
  29653. }, {
  29654. key: "getUrlCompleted",
  29655. value: function getUrlCompleted(cb, options) {
  29656. // @param {Object} result - 服务器返回的结果对象。
  29657. return function (result) {
  29658. cb && cb(result, options);
  29659. };
  29660. }
  29661. /**
  29662. * @function CommonServiceBase.prototype.getUrlFailed
  29663. * @description 请求失败后执行此方法。
  29664. * @param {Object} cb - 失败回调函数。
  29665. * @param {Object} options - 请求参数对象。
  29666. * @private
  29667. */
  29668. }, {
  29669. key: "getUrlFailed",
  29670. value: function getUrlFailed(cb, options) {
  29671. var me = this;
  29672. // @param {Object} result - 服务器返回的结果对象。
  29673. return function (result) {
  29674. if (me.totalTimes > 0) {
  29675. me.totalTimes--;
  29676. me.ajaxPolling(options);
  29677. } else {
  29678. cb && cb(result, options);
  29679. }
  29680. };
  29681. }
  29682. /**
  29683. *
  29684. * @function CommonServiceBase.prototype.ajaxPolling
  29685. * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求。
  29686. * @param {Object} options - 请求参数对象。
  29687. * @private
  29688. */
  29689. }, {
  29690. key: "ajaxPolling",
  29691. value: function ajaxPolling(options) {
  29692. var me = this,
  29693. url = options.url,
  29694. re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
  29695. me.index = parseInt(Math.random() * me.length);
  29696. me.url = me.urls[me.index];
  29697. url = url.replace(re, re.exec(me.url)[0]);
  29698. options.url = url;
  29699. options.isInTheSameDomain = Util_Util.isInTheSameDomain(url);
  29700. me._commit(options);
  29701. }
  29702. /**
  29703. * @function CommonServiceBase.prototype.calculatePollingTimes
  29704. * @description 计算剩余请求失败执行次数。
  29705. */
  29706. }, {
  29707. key: "calculatePollingTimes",
  29708. value: function calculatePollingTimes() {
  29709. var me = this;
  29710. if (me.times) {
  29711. if (me.totalTimes > me.POLLING_TIMES) {
  29712. if (me.times > me.POLLING_TIMES) {
  29713. me.totalTimes = me.POLLING_TIMES;
  29714. } else {
  29715. me.totalTimes = me.times;
  29716. }
  29717. } else {
  29718. if (me.times < me.totalTimes) {
  29719. me.totalTimes = me.times;
  29720. }
  29721. }
  29722. } else {
  29723. if (me.totalTimes > me.POLLING_TIMES) {
  29724. me.totalTimes = me.POLLING_TIMES;
  29725. }
  29726. }
  29727. me.totalTimes--;
  29728. }
  29729. /**
  29730. * @function CommonServiceBase.prototype.isServiceSupportPolling
  29731. * @description 判断服务是否支持轮询。
  29732. */
  29733. }, {
  29734. key: "isServiceSupportPolling",
  29735. value: function isServiceSupportPolling() {
  29736. var me = this;
  29737. return !(me.CLASS_NAME === 'SuperMap.REST.ThemeService' || me.CLASS_NAME === 'SuperMap.REST.EditFeaturesService');
  29738. }
  29739. /**
  29740. * @function CommonServiceBase.prototype.serviceProcessCompleted
  29741. * @description 状态完成,执行此方法。
  29742. * @param {Object} result - 服务器返回的结果对象。
  29743. * @param {Object} options - 请求参数对象。
  29744. * @private
  29745. */
  29746. }, {
  29747. key: "serviceProcessCompleted",
  29748. value: function serviceProcessCompleted(result, options) {
  29749. result = Util_Util.transformResult(result);
  29750. this.events.triggerEvent('processCompleted', {
  29751. result: result,
  29752. options: options
  29753. });
  29754. }
  29755. /**
  29756. * @function CommonServiceBase.prototype.serviceProcessFailed
  29757. * @description 状态失败,执行此方法。
  29758. * @param {Object} result - 服务器返回的结果对象。
  29759. * @param {Object} options - 请求参数对象。对象
  29760. * @private
  29761. */
  29762. }, {
  29763. key: "serviceProcessFailed",
  29764. value: function serviceProcessFailed(result, options) {
  29765. result = Util_Util.transformResult(result);
  29766. var error = result.error || result;
  29767. this.events.triggerEvent('processFailed', {
  29768. error: error,
  29769. options: options
  29770. });
  29771. }
  29772. }, {
  29773. key: "_returnContent",
  29774. value: function _returnContent(options) {
  29775. if (options.scope.format === DataFormat.FGB) {
  29776. return false;
  29777. }
  29778. if (options.scope.returnContent) {
  29779. return true;
  29780. }
  29781. return false;
  29782. }
  29783. }, {
  29784. key: "supportDataFormat",
  29785. value: function supportDataFormat(foramt) {
  29786. return this.dataFormat().includes(foramt);
  29787. }
  29788. }, {
  29789. key: "dataFormat",
  29790. value: function dataFormat() {
  29791. return [DataFormat.GEOJSON, DataFormat.ISERVER];
  29792. }
  29793. }, {
  29794. key: "_commit",
  29795. value: function _commit(options) {
  29796. if (options.method === 'POST' || options.method === 'PUT' || options.method === 'PATCH') {
  29797. if (options.params) {
  29798. options.url = Util_Util.urlAppend(options.url, Util_Util.getParameterString(options.params || {}));
  29799. }
  29800. if (CommonServiceBase_typeof(options.data) === 'object') {
  29801. try {
  29802. options.params = Util_Util.toJSON(options.data);
  29803. } catch (e) {
  29804. console.log('不是json对象');
  29805. }
  29806. } else {
  29807. options.params = options.data;
  29808. }
  29809. }
  29810. FetchRequest.commit(options.method, options.url, options.params, {
  29811. headers: options.headers,
  29812. withoutFormatSuffix: options.withoutFormatSuffix,
  29813. withCredentials: options.withCredentials,
  29814. crossOrigin: options.crossOrigin,
  29815. timeout: options.async ? 0 : null,
  29816. proxy: options.proxy
  29817. }).then(function (response) {
  29818. if (response.text) {
  29819. return response.text();
  29820. }
  29821. if (response.json) {
  29822. return response.json();
  29823. }
  29824. return response;
  29825. }).then(function (text) {
  29826. var requestResult = text;
  29827. if (typeof text === 'string') {
  29828. requestResult = new JSONFormat().read(text);
  29829. }
  29830. if (!requestResult || requestResult.error || requestResult.code >= 300 && requestResult.code !== 304) {
  29831. if (requestResult && requestResult.error) {
  29832. requestResult = {
  29833. error: requestResult.error
  29834. };
  29835. } else {
  29836. requestResult = {
  29837. error: requestResult
  29838. };
  29839. }
  29840. }
  29841. if (requestResult && options.scope.format === DataFormat.FGB) {
  29842. requestResult.newResourceLocation = requestResult.newResourceLocation.replace('.json', '') + '.fgb';
  29843. }
  29844. return requestResult;
  29845. })["catch"](function (e) {
  29846. return {
  29847. error: e
  29848. };
  29849. }).then(function (requestResult) {
  29850. if (requestResult.error) {
  29851. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  29852. failure(requestResult);
  29853. } else {
  29854. requestResult.succeed = requestResult.succeed == undefined ? true : requestResult.succeed;
  29855. var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
  29856. success(requestResult);
  29857. }
  29858. });
  29859. }
  29860. }]);
  29861. return CommonServiceBase;
  29862. }();
  29863. /**
  29864. * 服务器请求回调函数。
  29865. * @callback RequestCallback
  29866. * @category BaseTypes Util
  29867. * @example
  29868. * var requestCallback = function (serviceResult){
  29869. * console.log(serviceResult.result);
  29870. * }
  29871. * new QueryService(url).queryByBounds(param, requestCallback);
  29872. * @param {Object} serviceResult
  29873. * @param {Object} serviceResult.result 服务器返回结果。
  29874. * @param {Object} serviceResult.object 发布应用程序事件的对象。
  29875. * @param {Object} serviceResult.type 事件类型。
  29876. * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
  29877. * @param {Object} serviceResult.options 请求参数。
  29878. */
  29879. ;// CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
  29880. function GeoCodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29881. 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); } }
  29882. 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; }
  29883. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29884. * This program are made available under the terms of the Apache License, Version 2.0
  29885. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29886. /**
  29887. * @class GeoCodingParameter
  29888. * @deprecatedclass SuperMap.GeoCodingParameter
  29889. * @category iServer AddressMatch
  29890. * @classdesc 地理正向匹配参数类。
  29891. * @param {Object} options - 参数。
  29892. * @param {string} options.address - 地点关键词。
  29893. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  29894. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  29895. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  29896. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  29897. * @param {number} [options.maxReturn] - 最大返回结果数。
  29898. * @usage
  29899. */
  29900. var GeoCodingParameter = /*#__PURE__*/function () {
  29901. function GeoCodingParameter(options) {
  29902. GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
  29903. if (options.filters && typeof options.filters === 'string') {
  29904. options.filters = options.filters.split(',');
  29905. }
  29906. /**
  29907. * @member {string} GeoCodingParameter.prototype.address
  29908. * @description 地点关键词。
  29909. */
  29910. this.address = null;
  29911. /**
  29912. * @member {number} [GeoCodingParameter.prototype.fromIndex]
  29913. * @description 设置返回对象的起始索引值。
  29914. */
  29915. this.fromIndex = null;
  29916. /**
  29917. * @member {number} [GeoCodingParameter.prototype.toIndex]
  29918. * @description 设置返回对象的结束索引值。
  29919. */
  29920. this.toIndex = null;
  29921. /**
  29922. * @member {Array.<string>} [GeoCodingParameter.prototype.filters]
  29923. * @description 过滤字段,限定查询区域。
  29924. */
  29925. this.filters = null;
  29926. /**
  29927. * @member {string} [GeoCodingParameter.prototype.prjCoordSys]
  29928. * @description 查询结果的坐标系。
  29929. */
  29930. this.prjCoordSys = null;
  29931. /**
  29932. * @member {number} [GeoCodingParameter.prototype.maxReturn]
  29933. * @description 最大返回结果数。
  29934. */
  29935. this.maxReturn = null;
  29936. Util_Util.extend(this, options);
  29937. }
  29938. /**
  29939. * @function GeoCodingParameter.prototype.destroy
  29940. * @description 释放资源,将引用资源的属性置空。
  29941. */
  29942. GeoCodingParameter_createClass(GeoCodingParameter, [{
  29943. key: "destroy",
  29944. value: function destroy() {
  29945. this.address = null;
  29946. this.fromIndex = null;
  29947. this.toIndex = null;
  29948. this.filters = null;
  29949. this.prjCoordSys = null;
  29950. this.maxReturn = null;
  29951. }
  29952. }]);
  29953. return GeoCodingParameter;
  29954. }();
  29955. ;// CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
  29956. function GeoDecodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29957. 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); } }
  29958. 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; }
  29959. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  29960. * This program are made available under the terms of the Apache License, Version 2.0
  29961. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29962. /**
  29963. * @class GeoDecodingParameter
  29964. * @deprecatedclass SuperMap.GeoDecodingParameter
  29965. * @category iServer AddressMatch
  29966. * @classdesc 地理反向匹配参数类。
  29967. * @param {Object} options - 参数。
  29968. * @param {number} options.x - 查询位置的横坐标。
  29969. * @param {number} options.y - 查询位置的纵坐标。
  29970. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  29971. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  29972. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  29973. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  29974. * @param {number} [options.maxReturn] - 最大返回结果数。
  29975. * @param {number} [options.geoDecodingRadius] - 查询半径。
  29976. * @usage
  29977. */
  29978. var GeoDecodingParameter = /*#__PURE__*/function () {
  29979. function GeoDecodingParameter(options) {
  29980. GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
  29981. if (options.filters) {
  29982. options.filters = options.filters.split(',');
  29983. }
  29984. /**
  29985. * @member {number} GeoDecodingParameter.prototype.x
  29986. * @description 查询位置的横坐标。
  29987. */
  29988. this.x = null;
  29989. /**
  29990. * @member {number} GeoDecodingParameter.prototype.y
  29991. * @description 查询位置的纵坐标。
  29992. */
  29993. this.y = null;
  29994. /**
  29995. * @member {number} [GeoDecodingParameter.prototype.fromIndex]
  29996. * @description 设置返回对象的起始索引值。
  29997. */
  29998. this.fromIndex = null;
  29999. /**
  30000. * @member {number} [GeoDecodingParameter.prototype.toIndex]
  30001. * @description 设置返回对象的结束索引值。
  30002. */
  30003. this.toIndex = null;
  30004. /**
  30005. * @member {Array.<string>} [GeoDecodingParameter.prototype.filters]
  30006. * @description 过滤字段,限定查询区域。
  30007. */
  30008. this.filters = null;
  30009. /**
  30010. * @member {string} [GeoDecodingParameter.prototype.prjCoordSys]
  30011. * @description 查询结果的坐标系。
  30012. */
  30013. this.prjCoordSys = null;
  30014. /**
  30015. * @member {number} [GeoDecodingParameter.prototype.maxReturn]
  30016. * @description 最大返回结果数。
  30017. */
  30018. this.maxReturn = null;
  30019. /**
  30020. * @member {number} GeoDecodingParameter.prototype.geoDecodingRadius
  30021. * @description 查询半径。
  30022. */
  30023. this.geoDecodingRadius = null;
  30024. Util_Util.extend(this, options);
  30025. }
  30026. /**
  30027. * @function GeoDecodingParameter.prototype.destroy
  30028. * @description 释放资源,将引用资源的属性置空。
  30029. */
  30030. GeoDecodingParameter_createClass(GeoDecodingParameter, [{
  30031. key: "destroy",
  30032. value: function destroy() {
  30033. this.x = null;
  30034. this.y = null;
  30035. this.fromIndex = null;
  30036. this.toIndex = null;
  30037. this.filters = null;
  30038. this.prjCoordSys = null;
  30039. this.maxReturn = null;
  30040. this.geoDecodingRadius = null;
  30041. }
  30042. }]);
  30043. return GeoDecodingParameter;
  30044. }();
  30045. ;// CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
  30046. 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); }
  30047. function AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30048. 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); } }
  30049. 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; }
  30050. 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); }
  30051. function AddressMatchService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AddressMatchService_getPrototypeOf(object); if (object === null) break; } return object; }
  30052. 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); }
  30053. 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); }
  30054. 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); }; }
  30055. 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); }
  30056. function AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30057. 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; } }
  30058. function AddressMatchService_getPrototypeOf(o) { AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AddressMatchService_getPrototypeOf(o); }
  30059. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30060. * This program are made available under the terms of the Apache License, Version 2.0
  30061. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30062. /**
  30063. * @class AddressMatchService
  30064. * @deprecatedclass SuperMap.AddressMatchService
  30065. * @category iServer AddressMatch
  30066. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  30067. * @param {string} url - 服务地址。
  30068. * @param {Object} options - 可选参数。
  30069. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30070. * @param {Object} [options.headers] - 请求头。
  30071. * @usage
  30072. */
  30073. var AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
  30074. AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
  30075. var _super = AddressMatchService_createSuper(AddressMatchService);
  30076. function AddressMatchService(url, options) {
  30077. var _this;
  30078. AddressMatchService_classCallCheck(this, AddressMatchService);
  30079. _this = _super.call(this, url, options);
  30080. _this.options = options || {};
  30081. _this.eventCount = 0;
  30082. _this.CLASS_NAME = 'SuperMap.AddressMatchService';
  30083. return _this;
  30084. }
  30085. /**
  30086. * @function AddressMatchService.prototype.destroy
  30087. * @override
  30088. */
  30089. AddressMatchService_createClass(AddressMatchService, [{
  30090. key: "destroy",
  30091. value: function destroy() {
  30092. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "destroy", this).call(this);
  30093. }
  30094. /**
  30095. * @function AddressMatchService.prototype.code
  30096. * @param {string} url - 正向地址匹配服务地址。
  30097. * @param {GeoCodingParameter} params - 正向地址匹配服务参数。
  30098. */
  30099. }, {
  30100. key: "code",
  30101. value: function code(url, params, callback) {
  30102. if (!(params instanceof GeoCodingParameter)) {
  30103. return;
  30104. }
  30105. this.processAsync(url, params, callback);
  30106. }
  30107. /**
  30108. * @function AddressMatchService.prototype.decode
  30109. * @param {string} url - 反向地址匹配服务地址。
  30110. * @param {GeoDecodingParameter} params - 反向地址匹配服务参数。
  30111. */
  30112. }, {
  30113. key: "decode",
  30114. value: function decode(url, params, callback) {
  30115. if (!(params instanceof GeoDecodingParameter)) {
  30116. return;
  30117. }
  30118. this.processAsync(url, params, callback);
  30119. }
  30120. /**
  30121. * @function AddressMatchService.prototype.processAsync
  30122. * @description 负责将客户端的动态分段服务参数传递到服务端。
  30123. * @param {string} url - 服务地址。
  30124. * @param {Object} params - 参数。
  30125. */
  30126. }, {
  30127. key: "processAsync",
  30128. value: function processAsync(url, params, callback) {
  30129. var eventId = ++this.eventCount;
  30130. var eventListeners = {
  30131. scope: this,
  30132. processCompleted: function processCompleted(result) {
  30133. if (eventId === result.result.eventId && callback) {
  30134. delete result.result.eventId;
  30135. callback(result);
  30136. this.events && this.events.un(eventListeners);
  30137. return false;
  30138. }
  30139. },
  30140. processFailed: function processFailed(result) {
  30141. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  30142. callback(result);
  30143. this.events && this.events.un(eventListeners);
  30144. return false;
  30145. }
  30146. }
  30147. };
  30148. this.events.on(eventListeners);
  30149. this.request({
  30150. method: 'GET',
  30151. url: url,
  30152. params: params,
  30153. scope: this,
  30154. success: function success(result, options) {
  30155. result.eventId = eventId;
  30156. this.serviceProcessCompleted(result, options);
  30157. },
  30158. failure: function failure(result, options) {
  30159. if (result.error) {
  30160. result.error.eventId = eventId;
  30161. }
  30162. result.eventId = eventId;
  30163. this.serviceProcessFailed(result, options);
  30164. }
  30165. });
  30166. }
  30167. /**
  30168. * @function AddressMatchService.prototype.serviceProcessCompleted
  30169. * @param {Object} result - 服务器返回的结果对象。
  30170. * @description 服务流程是否完成
  30171. */
  30172. }, {
  30173. key: "serviceProcessCompleted",
  30174. value: function serviceProcessCompleted(result, options) {
  30175. if (result.succeed) {
  30176. delete result.succeed;
  30177. }
  30178. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessCompleted", this).call(this, result, options);
  30179. }
  30180. /**
  30181. * @function AddressMatchService.prototype.serviceProcessCompleted
  30182. * @param {Object} result - 服务器返回的结果对象。
  30183. * @description 服务流程是否失败
  30184. */
  30185. }, {
  30186. key: "serviceProcessFailed",
  30187. value: function serviceProcessFailed(result, options) {
  30188. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessFailed", this).call(this, result, options);
  30189. }
  30190. }]);
  30191. return AddressMatchService;
  30192. }(CommonServiceBase);
  30193. ;// CONCATENATED MODULE: ./src/common/iServer/AggregationParameter.js
  30194. function AggregationParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30195. 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); } }
  30196. 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; }
  30197. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30198. * This program are made available under the terms of the Apache License, Version 2.0
  30199. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30200. /**
  30201. * @class AggregationParameter
  30202. * @deprecatedclass SuperMap.AggregationParameter
  30203. * @classdesc 聚合查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  30204. * @category iServer Data FeatureResults
  30205. * @param {Object} options - 参数。
  30206. * @param {string} options.aggName - 聚合名称。
  30207. * @param {string} options.aggFieldName - 聚合字段。
  30208. * @usage
  30209. */
  30210. var AggregationParameter = /*#__PURE__*/function () {
  30211. function AggregationParameter(options) {
  30212. AggregationParameter_classCallCheck(this, AggregationParameter);
  30213. /**
  30214. * @member {string} AggregationParameter.prototype.aggName
  30215. * @description 聚合名称。
  30216. */
  30217. this.aggName = null;
  30218. /**
  30219. * @member {string} AggregationParameter.prototype.aggFieldName
  30220. * @description 聚合字段。
  30221. */
  30222. this.aggFieldName = null;
  30223. this.CLASS_NAME = 'SuperMap.AggregationParameter';
  30224. Util_Util.extend(this, options);
  30225. }
  30226. AggregationParameter_createClass(AggregationParameter, [{
  30227. key: "destroy",
  30228. value: function destroy() {
  30229. var me = this;
  30230. me.aggName = null;
  30231. me.aggFieldName = null;
  30232. me.aggType = null;
  30233. }
  30234. }]);
  30235. return AggregationParameter;
  30236. }();
  30237. ;// CONCATENATED MODULE: ./src/common/iServer/BucketAggParameter.js
  30238. 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); }
  30239. function BucketAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30240. 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); } }
  30241. 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; }
  30242. 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); }
  30243. 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); }
  30244. 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); }; }
  30245. 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); }
  30246. function BucketAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30247. 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; } }
  30248. function BucketAggParameter_getPrototypeOf(o) { BucketAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BucketAggParameter_getPrototypeOf(o); }
  30249. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30250. * This program are made available under the terms of the Apache License, Version 2.0
  30251. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30252. /**
  30253. * @class BucketAggParameter
  30254. * @deprecatedclass SuperMap.BucketAggParameter
  30255. * @classdesc 子聚合类查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  30256. * @category iServer Data FeatureResults
  30257. * @param {Object} options - 参数。
  30258. * @param {Array.<MetricsAggParameter>} options.subAggs - 子聚合类集合。
  30259. * @extends {AggregationParameter}
  30260. * @usage
  30261. */
  30262. var BucketAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  30263. BucketAggParameter_inherits(BucketAggParameter, _AggregationParameter);
  30264. var _super = BucketAggParameter_createSuper(BucketAggParameter);
  30265. function BucketAggParameter(options) {
  30266. var _this;
  30267. BucketAggParameter_classCallCheck(this, BucketAggParameter);
  30268. _this = _super.call(this);
  30269. /**
  30270. * @member {Array.<MetricsAggParameter>} BucketAggParameter.prototype.subAggs
  30271. * @description 子聚合类集合。
  30272. */
  30273. _this.subAggs = null;
  30274. _this.aggType = null;
  30275. _this.CLASS_NAME = 'SuperMap.BucketAggParameter';
  30276. Util_Util.extend(BucketAggParameter_assertThisInitialized(_this), options);
  30277. return _this;
  30278. }
  30279. BucketAggParameter_createClass(BucketAggParameter, [{
  30280. key: "destroy",
  30281. value: function destroy() {
  30282. var me = this;
  30283. if (me.subAggs) {
  30284. me.subAggs = null;
  30285. }
  30286. }
  30287. }]);
  30288. return BucketAggParameter;
  30289. }(AggregationParameter);
  30290. ;// CONCATENATED MODULE: ./src/common/iServer/MetricsAggParameter.js
  30291. 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); }
  30292. function MetricsAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30293. 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); } }
  30294. 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; }
  30295. 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); }
  30296. function MetricsAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MetricsAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  30297. 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); }
  30298. 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); }
  30299. 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); }; }
  30300. 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); }
  30301. function MetricsAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30302. 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; } }
  30303. function MetricsAggParameter_getPrototypeOf(o) { MetricsAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MetricsAggParameter_getPrototypeOf(o); }
  30304. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30305. * This program are made available under the terms of the Apache License, Version 2.0
  30306. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30307. /**
  30308. * @class MetricsAggParameter
  30309. * @deprecatedclass SuperMap.MetricsAggParameter
  30310. * @classdesc 指标聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  30311. * @category iServer Data FeatureResults
  30312. * @param {Object} options - 可选参数。
  30313. * @param {MetricsAggType} [options.aggType = 'avg'] - 聚合类型。
  30314. * @extends {AggregationParameter}
  30315. * @usage
  30316. */
  30317. var MetricsAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  30318. MetricsAggParameter_inherits(MetricsAggParameter, _AggregationParameter);
  30319. var _super = MetricsAggParameter_createSuper(MetricsAggParameter);
  30320. function MetricsAggParameter(option) {
  30321. var _this;
  30322. MetricsAggParameter_classCallCheck(this, MetricsAggParameter);
  30323. _this = _super.call(this);
  30324. /**
  30325. * @member {MetricsAggType} [MetricsAggParameter.prototype.aggType=MetricsAggType.AVG]
  30326. * @description 指标聚合类型。
  30327. */
  30328. _this.aggType = MetricsAggType.AVG;
  30329. Util_Util.extend(MetricsAggParameter_assertThisInitialized(_this), option);
  30330. _this.CLASS_NAME = 'SuperMap.MetricsAggParameter';
  30331. return _this;
  30332. }
  30333. MetricsAggParameter_createClass(MetricsAggParameter, [{
  30334. key: "destroy",
  30335. value: function destroy() {
  30336. MetricsAggParameter_get(MetricsAggParameter_getPrototypeOf(MetricsAggParameter.prototype), "destroy", this).call(this);
  30337. var me = this;
  30338. me.aggType = null;
  30339. }
  30340. }]);
  30341. return MetricsAggParameter;
  30342. }(AggregationParameter);
  30343. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationParameters.js
  30344. function AreaSolarRadiationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30345. 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); } }
  30346. 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; }
  30347. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30348. * This program are made available under the terms of the Apache License, Version 2.0
  30349. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30350. /**
  30351. * @class AreaSolarRadiationParameters
  30352. * @deprecatedclass SuperMap.AreaSolarRadiationParameters
  30353. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  30354. * @classdesc 地区太阳辐射参数类。
  30355. * @param {Object} options - 参数。
  30356. * @param {string} options.dataset - 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"的形式来表示,例如:JingjinTerrain@Jingjin。
  30357. * @param {string} options.targetDatasourceName - 指定的存储结果数据集的数据源名称, 例如:"Jingjin"。
  30358. * @param {string} options.totalGridName - 指定地区太阳辐射总辐射量数据集的名称。
  30359. * @param {string} options.diffuseDatasetGridName - 指定地区太阳辐射散射辐射量数据集的名称。
  30360. * @param {string} options.durationDatasetGridName - 指定地区太阳辐射太阳直射持续时间数据集的名称。
  30361. * @param {string} options.directDatasetGridName - 指定地区太阳辐射直射辐射量数据集的名称。
  30362. * @param {number} options.latitude - 待计算区域的纬度值。
  30363. * @param {string} [options.timeMode = 'MULTIDAYS'] - 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  30364. * @param {number} options.dayStart - 起始日期(年内的第几天)。
  30365. * @param {number} options.dayEnd - 结束日期(年内的第几天)。
  30366. * @param {number} [options.hourStart] - 起始时间(一天中的第几个小时)。
  30367. * @param {number} [options.hourEnd] - 结束时间(一天中的第几个小时)。
  30368. * @param {number} [options.transmittance] - 太阳辐射穿过大气的透射率。
  30369. * @param {number} [options.hourInterval=0.5] - 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确,如果修改此参数,必须使用整数)。
  30370. * @param {number} [options.dayInterval=5] - 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确,必须使用整数)。
  30371. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  30372. * @usage
  30373. */
  30374. var AreaSolarRadiationParameters = /*#__PURE__*/function () {
  30375. function AreaSolarRadiationParameters(options) {
  30376. AreaSolarRadiationParameters_classCallCheck(this, AreaSolarRadiationParameters);
  30377. /**
  30378. * @member {string} AreaSolarRadiationParameters.prototype.dataset
  30379. * @description 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示,例如:JingjinTerrain@Jingjin。注:地区太阳辐射数据必须为栅格数据集。
  30380. */
  30381. this.dataset = null;
  30382. /**
  30383. * @member {string} AreaSolarRadiationParameters.prototype.targetDatasourceName
  30384. * @description 指定的存储结果数据集的数据源名称,例如:"Jingjin"。
  30385. */
  30386. this.targetDatasourceName = null;
  30387. /**
  30388. * @member {string} AreaSolarRadiationParameters.prototype.totalGridName
  30389. * @description 指定地区太阳辐射总辐射量数据集的名称。
  30390. */
  30391. this.totalGridName = null;
  30392. /**
  30393. * @member {string} AreaSolarRadiationParameters.prototype.diffuseDatasetGridName
  30394. * @description 指定地区太阳辐射散射辐射量数据集的名称。
  30395. */
  30396. this.diffuseDatasetGridName = null;
  30397. /**
  30398. * @member {string} AreaSolarRadiationParameters.prototype.durationDatasetGridName
  30399. * @description 指定地区太阳辐射太阳直射持续时间数据集的名称。
  30400. */
  30401. this.durationDatasetGridName = null;
  30402. /**
  30403. * @member {string} AreaSolarRadiationParameters.prototype.directDatasetGridName
  30404. * @description 指定地区太阳辐射直射辐射量数据集的名称。
  30405. */
  30406. this.directDatasetGridName = null;
  30407. /**
  30408. * @member {number} AreaSolarRadiationParameters.prototype.latitude
  30409. * @description 待计算区域的纬度值。
  30410. */
  30411. this.latitude = null;
  30412. /**
  30413. * @member {string} [AreaSolarRadiationParameters.prototype.timeMode='MULTIDAYS']
  30414. * @description 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  30415. */
  30416. this.timeMode = "MULTIDAYS";
  30417. /**
  30418. * @member {number} AreaSolarRadiationParameters.prototype.dayStart
  30419. * @description 起始日期(年内的第几天)。
  30420. */
  30421. this.dayStart = null;
  30422. /**
  30423. * @member {number} AreaSolarRadiationParameters.prototype.dayEnd
  30424. * @description 结束日期(年内的第几天)。
  30425. */
  30426. this.dayEnd = null;
  30427. /**
  30428. * @member {number} [AreaSolarRadiationParameters.prototype.hourStart]
  30429. * @description 起始时间(一天中的第几个小时)。
  30430. */
  30431. this.hourStart = null;
  30432. /**
  30433. * @member {number} [AreaSolarRadiationParameters.prototype.hourEnd]
  30434. * @description 结束时间(一天中的第几个小时)。
  30435. */
  30436. this.hourEnd = null;
  30437. /**
  30438. * @member {number} [AreaSolarRadiationParameters.prototype.transmittance]
  30439. * @description 太阳辐射穿过大气的透射率。
  30440. */
  30441. this.transmittance = null;
  30442. /**
  30443. * @member {number} [AreaSolarRadiationParameters.prototype.hourInterval=0.5]
  30444. * @description 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确, 如果修改此参数,必须使用整数)
  30445. */
  30446. this.hourInterval = null;
  30447. /**
  30448. * @member {number} [AreaSolarRadiationParameters.prototype.dayInterval=5]
  30449. * @description 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确, 必须使用整数)
  30450. */
  30451. this.dayInterval = null;
  30452. /**
  30453. * @member {boolean} [AreaSolarRadiationParameters.prototype.deleteExistResultDataset=false]
  30454. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  30455. */
  30456. this.deleteExistResultDataset = false;
  30457. Util_Util.extend(this, options);
  30458. this.CLASS_NAME = "SuperMap.AreaSolarRadiationParameters";
  30459. }
  30460. /**
  30461. * @function AreaSolarRadiationParameters.prototype.destroy
  30462. * @description 释放资源,将引用资源的属性置空。
  30463. */
  30464. AreaSolarRadiationParameters_createClass(AreaSolarRadiationParameters, [{
  30465. key: "destroy",
  30466. value: function destroy() {
  30467. var me = this;
  30468. me.dataset = null;
  30469. me.zFactor = 1.0;
  30470. me.averageCurvatureName = null;
  30471. me.profileCurvatureName = null;
  30472. me.planCurvatureName = null;
  30473. me.deleteExistResultDataset = true;
  30474. }
  30475. /**
  30476. * @function AreaSolarRadiationParameters.toObject
  30477. * @param {AreaSolarRadiationParameters} param - 地区太阳辐射参数类。
  30478. * @param {AreaSolarRadiationParameters} tempObj - 地区太阳辐射参数对象。
  30479. * @returns {Object} JSON对象。
  30480. * @description 将AreaSolarRadiationParameters对象转换成JSON对象。
  30481. */
  30482. }], [{
  30483. key: "toObject",
  30484. value: function toObject(param, tempObj) {
  30485. var parameter = {};
  30486. for (var name in param) {
  30487. if (name !== "dataset") {
  30488. var name1 = name === "latitude" || name === "timeMode" || name === "dayStart";
  30489. var name2 = name === "dayEnd" || name === "hourStart" || name === "hourEnd";
  30490. var name3 = name === "transmittance" || name === "hourInterval" || name === "dayInterval";
  30491. if (name1 || name2 || name3) {
  30492. parameter[name] = param[name];
  30493. } else {
  30494. tempObj[name] = param[name];
  30495. }
  30496. }
  30497. }
  30498. tempObj["parameter"] = parameter;
  30499. }
  30500. }]);
  30501. return AreaSolarRadiationParameters;
  30502. }();
  30503. ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystBase.js
  30504. 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); }
  30505. function SpatialAnalystBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30506. 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); } }
  30507. 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; }
  30508. 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); }
  30509. function SpatialAnalystBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SpatialAnalystBase_getPrototypeOf(object); if (object === null) break; } return object; }
  30510. 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); }
  30511. 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); }
  30512. 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); }; }
  30513. 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); }
  30514. function SpatialAnalystBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30515. 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; } }
  30516. function SpatialAnalystBase_getPrototypeOf(o) { SpatialAnalystBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystBase_getPrototypeOf(o); }
  30517. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30518. * This program are made available under the terms of the Apache License, Version 2.0
  30519. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30520. /**
  30521. * @class SpatialAnalystBase
  30522. * @deprecatedclass SuperMap.SpatialAnalystBase
  30523. * @category iServer Core
  30524. * @classdesc 空间分析服务基类。
  30525. * @param {string} url - 地址。
  30526. * @param {Object} options - 可选参数。
  30527. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30528. * @param {Object} [options.headers] - 请求头。
  30529. * @extends {CommonServiceBase}
  30530. * @usage
  30531. */
  30532. var SpatialAnalystBase = /*#__PURE__*/function (_CommonServiceBase) {
  30533. SpatialAnalystBase_inherits(SpatialAnalystBase, _CommonServiceBase);
  30534. var _super = SpatialAnalystBase_createSuper(SpatialAnalystBase);
  30535. function SpatialAnalystBase(url, options) {
  30536. var _this;
  30537. SpatialAnalystBase_classCallCheck(this, SpatialAnalystBase);
  30538. _this = _super.call(this, url, options);
  30539. /**
  30540. * @member {DataFormat} [SpatialAnalystBase.prototype.format=DataFormat.GEOJSON]
  30541. * @description 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  30542. */
  30543. _this.format = options.format || DataFormat.GEOJSON;
  30544. _this.CLASS_NAME = "SuperMap.SpatialAnalystBase";
  30545. return _this;
  30546. }
  30547. /**
  30548. * @function SpatialAnalystBase.prototype.destroy
  30549. * @override
  30550. */
  30551. SpatialAnalystBase_createClass(SpatialAnalystBase, [{
  30552. key: "destroy",
  30553. value: function destroy() {
  30554. SpatialAnalystBase_get(SpatialAnalystBase_getPrototypeOf(SpatialAnalystBase.prototype), "destroy", this).call(this);
  30555. this.format = null;
  30556. }
  30557. /**
  30558. * @function SpatialAnalystBase.prototype.serviceProcessCompleted
  30559. * @description 分析完成,执行此方法。
  30560. * @param {Object} result - 服务器返回的结果对象。
  30561. */
  30562. }, {
  30563. key: "serviceProcessCompleted",
  30564. value: function serviceProcessCompleted(result, options) {
  30565. var me = this,
  30566. analystResult;
  30567. result = Util_Util.transformResult(result);
  30568. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  30569. //批量分析时会返回多个结果
  30570. if (Util_Util.isArray(result)) {
  30571. for (var i = 0; i < result.length; i++) {
  30572. result[i] = me.toGeoJSONResult(result[i]);
  30573. }
  30574. analystResult = result;
  30575. } else {
  30576. analystResult = me.toGeoJSONResult(result);
  30577. }
  30578. }
  30579. if (!analystResult) {
  30580. analystResult = result;
  30581. }
  30582. me.events.triggerEvent("processCompleted", {
  30583. result: analystResult,
  30584. options: options
  30585. });
  30586. }
  30587. /**
  30588. * @function SpatialAnalystBase.prototype.toGeoJSONResult
  30589. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  30590. * @param {Object} result - 服务器返回的结果对象。
  30591. *
  30592. */
  30593. }, {
  30594. key: "toGeoJSONResult",
  30595. value: function toGeoJSONResult(result) {
  30596. if (!result) {
  30597. return null;
  30598. }
  30599. //批量叠加分析时结果这样处理
  30600. if (result.result && result.result.resultGeometry) {
  30601. result = result.result;
  30602. }
  30603. var geoJSONFormat = new GeoJSON();
  30604. if (result.recordsets) {
  30605. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  30606. if (recordsets[i].features) {
  30607. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  30608. }
  30609. }
  30610. } else if (result.recordset && result.recordset.features) {
  30611. result.recordset.features = geoJSONFormat.toGeoJSON(result.recordset.features);
  30612. }
  30613. if (result.resultGeometry) {
  30614. result.resultGeometry = geoJSONFormat.toGeoJSON(result.resultGeometry);
  30615. }
  30616. if (result.regions) {
  30617. result.regions = geoJSONFormat.toGeoJSON(result.regions);
  30618. }
  30619. return result;
  30620. }
  30621. }]);
  30622. return SpatialAnalystBase;
  30623. }(CommonServiceBase);
  30624. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationService.js
  30625. 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); }
  30626. function AreaSolarRadiationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30627. 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); } }
  30628. 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; }
  30629. 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); }
  30630. function AreaSolarRadiationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AreaSolarRadiationService_getPrototypeOf(object); if (object === null) break; } return object; }
  30631. 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); }
  30632. 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); }
  30633. 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); }; }
  30634. 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); }
  30635. function AreaSolarRadiationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30636. 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; } }
  30637. function AreaSolarRadiationService_getPrototypeOf(o) { AreaSolarRadiationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AreaSolarRadiationService_getPrototypeOf(o); }
  30638. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30639. * This program are made available under the terms of the Apache License, Version 2.0
  30640. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30641. /**
  30642. * @class AreaSolarRadiationService
  30643. * @deprecatedclass SuperMap.AreaSolarRadiationService
  30644. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  30645. * @classdesc 地区太阳辐射服务类。
  30646. * @param {string} url - 服务的访问地址。如:</br>http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst。</br>
  30647. * @param {Object} options - 参数。</br>
  30648. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  30649. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30650. * @param {Object} [options.headers] - 请求头。
  30651. * @extends {SpatialAnalystBase}
  30652. * @example 例如:
  30653. * (start code)
  30654. * var myAreaSolarRadiationService = new AreaSolarRadiationService(url);
  30655. * myAreaSolarRadiationService.on({
  30656. * "processCompleted": processCompleted,
  30657. * "processFailed": processFailed
  30658. * }
  30659. * );
  30660. * (end)
  30661. * @usage
  30662. */
  30663. var AreaSolarRadiationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  30664. AreaSolarRadiationService_inherits(AreaSolarRadiationService, _SpatialAnalystBase);
  30665. var _super = AreaSolarRadiationService_createSuper(AreaSolarRadiationService);
  30666. function AreaSolarRadiationService(url, options) {
  30667. var _this;
  30668. AreaSolarRadiationService_classCallCheck(this, AreaSolarRadiationService);
  30669. _this = _super.call(this, url, options);
  30670. _this.CLASS_NAME = "SuperMap.AreaSolarRadiationService";
  30671. return _this;
  30672. }
  30673. /**
  30674. * @function AreaSolarRadiationService.prototype.destroy
  30675. * @override
  30676. */
  30677. AreaSolarRadiationService_createClass(AreaSolarRadiationService, [{
  30678. key: "destroy",
  30679. value: function destroy() {
  30680. AreaSolarRadiationService_get(AreaSolarRadiationService_getPrototypeOf(AreaSolarRadiationService.prototype), "destroy", this).call(this);
  30681. }
  30682. /**
  30683. * @function AreaSolarRadiationService.prototype.processAsync
  30684. * @description 负责将客户端的查询参数传递到服务端。
  30685. * @param {AreaSolarRadiationParameters} parameter - 地区太阳辐射参数。
  30686. */
  30687. }, {
  30688. key: "processAsync",
  30689. value: function processAsync(parameter) {
  30690. if (!(parameter instanceof AreaSolarRadiationParameters)) {
  30691. return;
  30692. }
  30693. var me = this;
  30694. var parameterObject = {};
  30695. if (parameter instanceof AreaSolarRadiationParameters) {
  30696. me.url = Util_Util.urlPathAppend(me.url, "datasets/".concat(parameter.dataset, "/solarradiation"));
  30697. }
  30698. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  30699. AreaSolarRadiationParameters.toObject(parameter, parameterObject);
  30700. var jsonParameters = Util_Util.toJSON(parameterObject);
  30701. me.request({
  30702. method: 'POST',
  30703. data: jsonParameters,
  30704. scope: me,
  30705. success: me.serviceProcessCompleted,
  30706. failure: me.serviceProcessFailed
  30707. });
  30708. }
  30709. }]);
  30710. return AreaSolarRadiationService;
  30711. }(SpatialAnalystBase);
  30712. ;// CONCATENATED MODULE: ./src/common/iServer/BufferDistance.js
  30713. function BufferDistance_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30714. 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); } }
  30715. 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; }
  30716. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30717. * This program are made available under the terms of the Apache License, Version 2.0
  30718. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30719. /**
  30720. * @class BufferDistance
  30721. * @deprecatedclass SuperMap.BufferDistance
  30722. * @category iServer SpatialAnalyst BufferAnalyst
  30723. * @classdesc 缓冲区分析的缓冲距离类。通过该类可以设置缓冲区分析的缓冲距离,距离可以是数值也可以是数值型的字段表达式。
  30724. * @param {Object} options - 可选参数。
  30725. * @param {string} [options.exp] - 以数值型的字段表达式作为缓冲区分析的距离值。
  30726. * @param {number} [options.value=100] - 以数值作为缓冲区分析的距离值。单位:米。
  30727. * @usage
  30728. */
  30729. var BufferDistance = /*#__PURE__*/function () {
  30730. function BufferDistance(options) {
  30731. BufferDistance_classCallCheck(this, BufferDistance);
  30732. /**
  30733. * @member {string} [BufferDistance.prototype.exp]
  30734. * @description 以数值型的字段表达式作为缓冲区分析的距离值。
  30735. */
  30736. this.exp = null;
  30737. /**
  30738. * @member {number} [BufferDistance.prototype.value=100]
  30739. * @description 以数值作为缓冲区分析的距离值。单位:米。
  30740. */
  30741. this.value = 100;
  30742. Util_Util.extend(this, options);
  30743. this.CLASS_NAME = "SuperMap.BufferDistance";
  30744. }
  30745. /**
  30746. * @function BufferDistance.prototype.destroy
  30747. * @description 释放资源,将引用资源的属性置空。
  30748. */
  30749. BufferDistance_createClass(BufferDistance, [{
  30750. key: "destroy",
  30751. value: function destroy() {
  30752. this.exp = null;
  30753. this.value = null;
  30754. }
  30755. }]);
  30756. return BufferDistance;
  30757. }();
  30758. ;// CONCATENATED MODULE: ./src/common/iServer/BufferSetting.js
  30759. function BufferSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30760. 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); } }
  30761. 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; }
  30762. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30763. * This program are made available under the terms of the Apache License, Version 2.0
  30764. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30765. /**
  30766. * @class BufferSetting
  30767. * @deprecatedclass SuperMap.BufferSetting
  30768. * @category iServer SpatialAnalyst BufferAnalyst
  30769. * @classdesc 缓冲区分析通用设置类。
  30770. * @param {Object} options - 可选参数。
  30771. * @param {BufferEndType} [options.endType=BufferEndType.FLAT] - 缓冲区端点枚举值。
  30772. * @param {BufferDistance} [options.leftDistance=100] - 左侧缓冲距离。
  30773. * @param {BufferDistance} [options.rightDistance=100] - 右侧缓冲距离。
  30774. * @param {number} [options.semicircleLineSegment=4] - 圆头缓冲圆弧处线段的个数。
  30775. * @param {BufferRadiusUnit} [options.radiusUnit=BufferRadiusUnit.METER] - 缓冲半径单位。
  30776. * @usage
  30777. */
  30778. var BufferSetting = /*#__PURE__*/function () {
  30779. function BufferSetting(options) {
  30780. BufferSetting_classCallCheck(this, BufferSetting);
  30781. /**
  30782. * @member {BufferEndType} [BufferSetting.prototype.endType = BufferEndType.FLAT]
  30783. * @description 缓冲区端点枚举值。分为平头和圆头两种。
  30784. */
  30785. this.endType = BufferEndType.FLAT;
  30786. /**
  30787. * @member {BufferDistance} [BufferSetting.prototype.leftDistance=100]
  30788. * @description 左侧缓冲距离。
  30789. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  30790. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  30791. */
  30792. this.leftDistance = new BufferDistance();
  30793. /**
  30794. * @member {BufferDistance} [BufferSetting.prototype.rightDistance=100]
  30795. * @description 右侧缓冲距离。
  30796. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  30797. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting#radiusUnit}设置(默认全部为米)。
  30798. */
  30799. this.rightDistance = new BufferDistance();
  30800. /**
  30801. * @member {number} [BufferSetting.prototype.semicircleLineSegment=4]
  30802. * @description 圆头缓冲圆弧处线段的个数。即用多少个线段来模拟一个半圆。
  30803. */
  30804. this.semicircleLineSegment = 4;
  30805. /**
  30806. * @member {BufferRadiusUnit} [BufferSetting.prototype.radiusUnit = BufferRadiusUnit.METER]
  30807. * @description 缓冲半径单位,可以是{@link BufferRadiusUnit.METER}、{@link BufferRadiusUnit.MILLIMETER}、
  30808. * {@link BufferRadiusUnit.CENTIMETER}、{@link BufferRadiusUnit.DECIMETER}、{@link BufferRadiusUnit.KILOMETER}、
  30809. * {@link BufferRadiusUnit.FOOT}、{@link BufferRadiusUnit.INCH}、{@link BufferRadiusUnit.MILE}、{@link BufferRadiusUnit.YARD}。
  30810. * 仅对BufferAnalyst有效。
  30811. */
  30812. this.radiusUnit = BufferRadiusUnit.METER;
  30813. if (options) {
  30814. Util_Util.extend(this, options);
  30815. }
  30816. this.CLASS_NAME = "SuperMap.BufferSetting";
  30817. }
  30818. /**
  30819. * @function BufferSetting.prototype.destroy
  30820. * @description 释放资源,将引用资源的属性置空。
  30821. */
  30822. BufferSetting_createClass(BufferSetting, [{
  30823. key: "destroy",
  30824. value: function destroy() {
  30825. var me = this;
  30826. me.endType = null;
  30827. if (me.leftDistance) {
  30828. me.leftDistance.destroy();
  30829. me.leftDistance = null;
  30830. }
  30831. if (me.rightDistance) {
  30832. me.rightDistance.destroy();
  30833. me.rightDistance = null;
  30834. }
  30835. me.semicircleLineSegment = null;
  30836. me.radiusUnit = null;
  30837. }
  30838. }]);
  30839. return BufferSetting;
  30840. }();
  30841. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystParameters.js
  30842. function BufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30843. 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); } }
  30844. 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; }
  30845. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30846. * This program are made available under the terms of the Apache License, Version 2.0
  30847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30848. /**
  30849. * @class BufferAnalystParameters
  30850. * @deprecatedclass SuperMap.BufferAnalystParameters
  30851. * @category iServer SpatialAnalyst BufferAnalyst
  30852. * @classdesc 缓冲区分析参数基类。
  30853. * @param {Object} options - 参数。
  30854. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  30855. * @usage
  30856. */
  30857. var BufferAnalystParameters = /*#__PURE__*/function () {
  30858. function BufferAnalystParameters(options) {
  30859. BufferAnalystParameters_classCallCheck(this, BufferAnalystParameters);
  30860. var me = this;
  30861. /**
  30862. * @member {BufferSetting} [BufferAnalystParameters.prototype.bufferSetting]
  30863. * @description 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  30864. */
  30865. me.bufferSetting = new BufferSetting();
  30866. Util_Util.extend(this, options);
  30867. this.CLASS_NAME = "SuperMap.BufferAnalystParameters";
  30868. }
  30869. /**
  30870. * @function BufferAnalystParameters.prototype.destroy
  30871. * @description 释放资源,将引用资源的属性置空。
  30872. */
  30873. BufferAnalystParameters_createClass(BufferAnalystParameters, [{
  30874. key: "destroy",
  30875. value: function destroy() {
  30876. var me = this;
  30877. if (me.bufferSetting) {
  30878. me.bufferSetting.destroy();
  30879. me.bufferSetting = null;
  30880. }
  30881. }
  30882. }]);
  30883. return BufferAnalystParameters;
  30884. }();
  30885. ;// CONCATENATED MODULE: ./src/common/iServer/DataReturnOption.js
  30886. function DataReturnOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30887. 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); } }
  30888. 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; }
  30889. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30890. * This program are made available under the terms of the Apache License, Version 2.0
  30891. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30892. /**
  30893. * @class DataReturnOption
  30894. * @deprecatedclass SuperMap.DataReturnOption
  30895. * @category iServer Data Dataset
  30896. * @classdesc 数据返回设置类。
  30897. * @param {Object} options - 参数。
  30898. * @param {number} [options.expectCount=1000] - 设置返回的最大记录数,小于或者等于 0 时表示返回所有记录数。
  30899. * @param {string} [options.dataset] - 设置结果数据集标识,当 dataReturnMode 为 {@link DataReturnMode.DATASET_ONLY}或{@link DataReturnMode.DATASET_AND_RECORDSET}时有效,
  30900. * 作为返回数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  30901. * @param {DataReturnMode} [options.dataReturnMode=DataReturnMode.RECORDSET_ONLY] - 数据返回模式。
  30902. * @param {boolean} [options.deleteExistResultDataset=true] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  30903. * @usage
  30904. */
  30905. var DataReturnOption = /*#__PURE__*/function () {
  30906. function DataReturnOption(options) {
  30907. DataReturnOption_classCallCheck(this, DataReturnOption);
  30908. /**
  30909. * @member {number} [DataReturnOption.prototype.expectCount=1000]
  30910. * @description 设置返回的最大记录数,小于或者等于0时表示返回所有记录数。
  30911. */
  30912. this.expectCount = 1000;
  30913. /**
  30914. * @member {string} [DataReturnOption.prototype.dataset]
  30915. * @description 设置结果数据集标识,当dataReturnMode为 {@link DataReturnMode.DATASET_ONLY}
  30916. * 或{@link DataReturnMode.DATASET_AND_RECORDSET}时有效,
  30917. * 作为返回数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  30918. */
  30919. this.dataset = null;
  30920. /**
  30921. * @member {DataReturnMode} [DataReturnOption.prototype.dataReturnMode=DataReturnMode.RECORDSET_ONLY]
  30922. * @description 数据返回模式。
  30923. */
  30924. this.dataReturnMode = DataReturnMode.RECORDSET_ONLY;
  30925. /**
  30926. * @member {boolean} [DataReturnOption.prototype.deleteExistResultDataset=true]
  30927. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  30928. */
  30929. this.deleteExistResultDataset = true;
  30930. Util_Util.extend(this, options);
  30931. this.CLASS_NAME = "SuperMap.DataReturnOption";
  30932. }
  30933. /**
  30934. * @function DataReturnOption.prototype.destroy
  30935. * @description 释放资源,将引用资源的属性置空。
  30936. */
  30937. DataReturnOption_createClass(DataReturnOption, [{
  30938. key: "destroy",
  30939. value: function destroy() {
  30940. var me = this;
  30941. me.expectCount = null;
  30942. me.dataset = null;
  30943. me.dataReturnMode = null;
  30944. me.deleteExistResultDataset = null;
  30945. }
  30946. }]);
  30947. return DataReturnOption;
  30948. }();
  30949. ;// CONCATENATED MODULE: ./src/common/iServer/FilterParameter.js
  30950. function FilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30951. 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); } }
  30952. 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; }
  30953. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  30954. * This program are made available under the terms of the Apache License, Version 2.0
  30955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30956. /**
  30957. * @class FilterParameter
  30958. * @deprecatedclass SuperMap.FilterParameter
  30959. * @category iServer Data FeatureResults
  30960. * @classdesc 查询过滤条件参数类。该类用于设置查询数据集的查询过滤参数。
  30961. * @param {Object} options - 参数。
  30962. * @param {string} options.attributeFilter - 属性过滤条件。
  30963. * @param {string} options.name - 查询数据集名称或者图层名称。
  30964. * @param {Array.<JoinItem>} [options.joinItems] - 与外部表的连接信息 JoinItem 数组。
  30965. * @param {Array.<LinkItem>} [options.linkItems] - 与外部表的关联信息 LinkItem 数组。
  30966. * @param {Array.<string>} [options.ids] - 查询 id 数组,即属性表中的 SmID 值。
  30967. * @param {string} [options.orderBy] - 查询排序的字段,orderBy 的字段须为数值型的。
  30968. * @param {string} [options.groupBy] - 查询分组条件的字段。
  30969. * @param {Array.<string>} [options.fields] - 查询字段数组。
  30970. * @usage
  30971. */
  30972. var FilterParameter = /*#__PURE__*/function () {
  30973. function FilterParameter(options) {
  30974. FilterParameter_classCallCheck(this, FilterParameter);
  30975. /**
  30976. * @member {string} FilterParameter.prototype.attributeFilter
  30977. * @description 属性过滤条件。
  30978. * 相当于 SQL 语句中的 WHERE 子句,其格式为:WHERE <条件表达式>,
  30979. * attributeFilter 就是其中的“条件表达式”。
  30980. * 该字段的用法为 attributeFilter = "过滤条件"。
  30981. * 例如,要查询字段 fieldValue 小于100的记录,设置 attributeFilter = "fieldValue < 100";
  30982. * 要查询字段 name 的值为“酒店”的记录,设置 attributeFilter = "name like '%酒店%'",等等。
  30983. */
  30984. this.attributeFilter = null;
  30985. /**
  30986. * @member {string} FilterParameter.prototype.name
  30987. * @description 查询数据集名称或者图层名称,根据实际的查询对象而定。
  30988. * 一般情况下该字段为数据集名称,但在进行与地图相关功能的操作时,
  30989. * 需要设置为图层名称(图层名称格式:数据集名称@数据源别名)。
  30990. * 因为一个地图的图层可能是来自于不同数据源的数据集,
  30991. * 而不同的数据源中可能存在同名的数据集,
  30992. * 使用数据集名称不能唯一的确定数据集,
  30993. * 所以在进行与地图相关功能的操作时,该值需要设置为图层名称。
  30994. */
  30995. this.name = null;
  30996. /**
  30997. * @member {Array.<JoinItem>} [FilterParameter.prototype.joinItems]
  30998. * @description 与外部表的连接信息 JoinItem 数组。
  30999. */
  31000. this.joinItems = null;
  31001. /**
  31002. * @member {Array.<LinkItem>} [FilterParameter.prototype.linkItems]
  31003. * @description 与外部表的关联信息 LinkItem 数组。
  31004. */
  31005. this.linkItems = null;
  31006. /**
  31007. * @member {Array.<string>} [FilterParameter.prototype.ids]
  31008. * @description 查询 id 数组,即属性表中的 SmID 值。
  31009. */
  31010. this.ids = null;
  31011. /**
  31012. * @member {string} [FilterParameter.prototype.orderBy]
  31013. * @description 查询排序的字段,orderBy的字段须为数值型的。
  31014. * 相当于 SQL 语句中的 ORDER BY 子句,其格式为:ORDER BY <列名>,
  31015. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  31016. * 对单个字段排序时,该字段的用法为 orderBy = "字段名";
  31017. * 对多个字段排序时,字段之间以英文逗号进行分割,用法为 orderBy = "字段名1, 字段名2"。
  31018. * 例如,现有一个国家数据集,它有两个字段分别为“SmArea”和“pop_1994”,
  31019. * 分别表示国家的面积和1994年的各国人口数量。
  31020. * 如果要按照各国人口数量对记录进行排序,则 orderBy = "pop_1994";
  31021. * 如果要以面积和人口进行排序,则 orderBy = "SmArea, pop_1994"。
  31022. */
  31023. this.orderBy = null;
  31024. /**
  31025. * @member {string} [FilterParameter.prototype.groupBy]
  31026. * @description 查询分组条件的字段。
  31027. * 相当于 SQL 语句中的 GROUP BY 子句,其格式为:GROUP BY <列名>,
  31028. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  31029. * 对单个字段分组时,该字段的用法为 groupBy = "字段名";
  31030. * 对多个字段分组时,字段之间以英文逗号进行分割,用法为 groupBy = "字段名1, 字段名2"。
  31031. * 例如,现有一个全球城市数据集,该数据集有两个字段分别为“Continent”和“Country”,
  31032. * 分别表示某个城市所属的洲和国家。
  31033. * 如果要按照国家对全球的城市进行分组,可以设置 groupBy = "Country";
  31034. * 如果以洲和国家对城市进行分组,设置 groupBy = "Continent, Country"。
  31035. */
  31036. this.groupBy = null;
  31037. /**
  31038. * @member {Array.<string>} [FilterParameter.prototype.fields]
  31039. * @description 查询字段数组,如果不设置则使用系统返回的所有字段。
  31040. */
  31041. this.fields = null;
  31042. if (options) {
  31043. Util_Util.extend(this, options);
  31044. }
  31045. this.CLASS_NAME = "SuperMap.FilterParameter";
  31046. }
  31047. /**
  31048. * @function FilterParameter.prototype.destroy
  31049. * @description 释放资源,将引用资源的属性置空。
  31050. */
  31051. FilterParameter_createClass(FilterParameter, [{
  31052. key: "destroy",
  31053. value: function destroy() {
  31054. var me = this;
  31055. me.attributeFilter = null;
  31056. me.name = null;
  31057. if (me.joinItems) {
  31058. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  31059. joinItems[i].destroy();
  31060. }
  31061. me.joinItems = null;
  31062. }
  31063. if (me.linkItems) {
  31064. for (var _i2 = 0, linkItems = me.linkItems, _len2 = linkItems.length; _i2 < _len2; _i2++) {
  31065. linkItems[_i2].destroy();
  31066. }
  31067. me.linkItems = null;
  31068. }
  31069. me.ids = null;
  31070. me.orderBy = null;
  31071. me.groupBy = null;
  31072. me.fields = null;
  31073. }
  31074. }]);
  31075. return FilterParameter;
  31076. }();
  31077. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetBufferAnalystParameters.js
  31078. 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); }
  31079. function DatasetBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31080. 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); } }
  31081. 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; }
  31082. 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); }
  31083. function DatasetBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31084. 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); }
  31085. 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); }
  31086. 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); }; }
  31087. 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); }
  31088. function DatasetBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31089. 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; } }
  31090. function DatasetBufferAnalystParameters_getPrototypeOf(o) { DatasetBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetBufferAnalystParameters_getPrototypeOf(o); }
  31091. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31092. * This program are made available under the terms of the Apache License, Version 2.0
  31093. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31094. /**
  31095. * @class DatasetBufferAnalystParameters
  31096. * @deprecatedclass SuperMap.DatasetBufferAnalystParameters
  31097. * @category iServer SpatialAnalyst BufferAnalyst
  31098. * @classdesc 数据集缓冲区分析参数类。
  31099. * @param {Object} options - 参数。
  31100. * @param {string} options.dataset - 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  31101. * @param {FilterParameter} [options.filterQueryParameter] - 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  31102. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  31103. * @param {boolean} [options.isAttributeRetained=true] - 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  31104. * @param {boolean} [options.isUnion=false] - 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  31105. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  31106. *
  31107. * @extends {BufferAnalystParameters}
  31108. * @usage
  31109. */
  31110. var DatasetBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  31111. DatasetBufferAnalystParameters_inherits(DatasetBufferAnalystParameters, _BufferAnalystParamet);
  31112. var _super = DatasetBufferAnalystParameters_createSuper(DatasetBufferAnalystParameters);
  31113. function DatasetBufferAnalystParameters(options) {
  31114. var _this;
  31115. DatasetBufferAnalystParameters_classCallCheck(this, DatasetBufferAnalystParameters);
  31116. _this = _super.call(this, options);
  31117. /**
  31118. * @member {string} DatasetBufferAnalystParameters.prototype.dataset
  31119. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  31120. */
  31121. _this.dataset = null;
  31122. /**
  31123. * @member {FilterParameter} [DatasetBufferAnalystParameters.prototype.filterQueryParameter]
  31124. * @description 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  31125. */
  31126. _this.filterQueryParameter = new FilterParameter();
  31127. /**
  31128. * @member {DataReturnOption} [DatasetBufferAnalystParameters.prototype.resultSetting]
  31129. * @description 结果返回设置类。
  31130. */
  31131. _this.resultSetting = new DataReturnOption();
  31132. /**
  31133. * @member {boolean} [DatasetBufferAnalystParameters.prototype.isAttributeRetained=true]
  31134. * @description 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  31135. */
  31136. _this.isAttributeRetained = true;
  31137. /**
  31138. * @member {boolean} [DatasetBufferAnalystParameters.prototype.isUnion=false]
  31139. * @description 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  31140. */
  31141. _this.isUnion = false;
  31142. Util_Util.extend(DatasetBufferAnalystParameters_assertThisInitialized(_this), options);
  31143. _this.CLASS_NAME = "SuperMap.DatasetBufferAnalystParameters";
  31144. return _this;
  31145. }
  31146. /**
  31147. * @function DatasetBufferAnalystParameters.prototype.destroy
  31148. * @override
  31149. */
  31150. DatasetBufferAnalystParameters_createClass(DatasetBufferAnalystParameters, [{
  31151. key: "destroy",
  31152. value: function destroy() {
  31153. DatasetBufferAnalystParameters_get(DatasetBufferAnalystParameters_getPrototypeOf(DatasetBufferAnalystParameters.prototype), "destroy", this).call(this);
  31154. var me = this;
  31155. me.dataset = null;
  31156. if (me.filterQueryParameter) {
  31157. me.filterQueryParameter.destroy();
  31158. me.filterQueryParameter = null;
  31159. }
  31160. if (me.resultSetting) {
  31161. me.resultSetting.destroy();
  31162. me.resultSetting = null;
  31163. }
  31164. me.isAttributeRetained = null;
  31165. me.isUnion = null;
  31166. }
  31167. /**
  31168. * @function DatasetBufferAnalystParameters.toObject
  31169. * @param {DatasetBufferAnalystParameters} datasetBufferAnalystParameters - 数据集缓冲区分析参数类。
  31170. * @param {DatasetBufferAnalystParameters} tempObj - 数据集缓冲区分析参数对象。
  31171. * @description 将数据集缓冲区分析参数对象转换为 JSON 对象。
  31172. * @returns {Object} JSON 对象。
  31173. */
  31174. }], [{
  31175. key: "toObject",
  31176. value: function toObject(datasetBufferAnalystParameters, tempObj) {
  31177. for (var name in datasetBufferAnalystParameters) {
  31178. if (name === "bufferSetting") {
  31179. datasetBufferAnalystParameters.bufferSetting.radiusUnit = datasetBufferAnalystParameters.bufferSetting.radiusUnit.toUpperCase();
  31180. tempObj.bufferAnalystParameter = datasetBufferAnalystParameters.bufferSetting;
  31181. } else if (name === "resultSetting") {
  31182. tempObj.dataReturnOption = datasetBufferAnalystParameters.resultSetting;
  31183. } else if (name === "dataset") {
  31184. continue;
  31185. } else {
  31186. tempObj[name] = datasetBufferAnalystParameters[name];
  31187. }
  31188. }
  31189. }
  31190. }]);
  31191. return DatasetBufferAnalystParameters;
  31192. }(BufferAnalystParameters);
  31193. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBufferAnalystParameters.js
  31194. 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); }
  31195. function GeometryBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31196. 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); } }
  31197. 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; }
  31198. 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); }
  31199. function GeometryBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31200. 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); }
  31201. 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); }
  31202. 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); }; }
  31203. 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); }
  31204. function GeometryBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31205. 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; } }
  31206. function GeometryBufferAnalystParameters_getPrototypeOf(o) { GeometryBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBufferAnalystParameters_getPrototypeOf(o); }
  31207. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31208. * This program are made available under the terms of the Apache License, Version 2.0
  31209. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31210. /**
  31211. * @class GeometryBufferAnalystParameters
  31212. * @deprecatedclass SuperMap.GeometryBufferAnalystParameters
  31213. * @category iServer SpatialAnalyst BufferAnalyst
  31214. * @classdesc 几何对象缓冲区分析参数类。
  31215. * 对指定的某个几何对象做缓冲区分析。通过该类可以指定要做缓冲区分析的几何对象、缓冲区参数等。
  31216. * @param {Object} options - 参数。
  31217. * @param {GeoJSONObject} options.sourceGeometry - 要做缓冲区分析的几何对象。
  31218. * @param {number} options.sourceGeometrySRID - 缓冲区几何对象投影坐标参数, 如 4326,3857。
  31219. * @param {BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  31220. * @extends {BufferAnalystParameters}
  31221. * @usage
  31222. */
  31223. var GeometryBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  31224. GeometryBufferAnalystParameters_inherits(GeometryBufferAnalystParameters, _BufferAnalystParamet);
  31225. var _super = GeometryBufferAnalystParameters_createSuper(GeometryBufferAnalystParameters);
  31226. function GeometryBufferAnalystParameters(options) {
  31227. var _this;
  31228. GeometryBufferAnalystParameters_classCallCheck(this, GeometryBufferAnalystParameters);
  31229. _this = _super.call(this, options);
  31230. /**
  31231. * @member {GeoJSONObject} GeometryBufferAnalystParameters.prototype.sourceGeometry
  31232. * @description 要做缓冲区分析的几何对象。<br>
  31233. * 点类型可以是:{@link GeometryPoint}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  31234. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  31235. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  31236. */
  31237. _this.sourceGeometry = null;
  31238. /**
  31239. * @member {number} GeometryBufferAnalystParameters.prototype.sourceGeometrySRID
  31240. * @description 缓冲区几何对象投影坐标参数, 如 4326,3857。
  31241. */
  31242. _this.sourceGeometrySRID = null;
  31243. if (options) {
  31244. Util_Util.extend(GeometryBufferAnalystParameters_assertThisInitialized(_this), options);
  31245. }
  31246. _this.CLASS_NAME = " SuperMap.GeometryBufferAnalystParameters";
  31247. return _this;
  31248. }
  31249. /**
  31250. * @function GeometryBufferAnalystParameters.prototype.destroy
  31251. * @override
  31252. */
  31253. GeometryBufferAnalystParameters_createClass(GeometryBufferAnalystParameters, [{
  31254. key: "destroy",
  31255. value: function destroy() {
  31256. GeometryBufferAnalystParameters_get(GeometryBufferAnalystParameters_getPrototypeOf(GeometryBufferAnalystParameters.prototype), "destroy", this).call(this);
  31257. var me = this;
  31258. if (me.sourceGeometry) {
  31259. me.sourceGeometry.destroy();
  31260. me.sourceGeometry = null;
  31261. }
  31262. }
  31263. /**
  31264. * @function GeometryBufferAnalystParameters.toObject
  31265. * @param {GeometryBufferAnalystParameters} geometryBufferAnalystParameters - 几何对象缓冲区分析参数类。
  31266. * @param {GeometryBufferAnalystParameters} tempObj - 几何对象缓冲区分析参数对象。
  31267. * @description 将几何对象缓冲区分析参数对象转换为 JSON 对象。
  31268. * @returns {Object} JSON 对象。
  31269. */
  31270. }], [{
  31271. key: "toObject",
  31272. value: function toObject(geometryBufferAnalystParameters, tempObj) {
  31273. for (var name in geometryBufferAnalystParameters) {
  31274. if (name === "bufferSetting") {
  31275. var tempBufferSetting = {};
  31276. for (var key in geometryBufferAnalystParameters.bufferSetting) {
  31277. tempBufferSetting[key] = geometryBufferAnalystParameters.bufferSetting[key];
  31278. }
  31279. tempObj.analystParameter = tempBufferSetting;
  31280. } else if (name === "sourceGeometry") {
  31281. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryBufferAnalystParameters.sourceGeometry);
  31282. } else {
  31283. tempObj[name] = geometryBufferAnalystParameters[name];
  31284. }
  31285. }
  31286. }
  31287. }]);
  31288. return GeometryBufferAnalystParameters;
  31289. }(BufferAnalystParameters);
  31290. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystService.js
  31291. 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); }
  31292. function BufferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31293. 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); } }
  31294. 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; }
  31295. 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); }
  31296. function BufferAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BufferAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  31297. 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); }
  31298. 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); }
  31299. 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); }; }
  31300. 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); }
  31301. function BufferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31302. 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; } }
  31303. function BufferAnalystService_getPrototypeOf(o) { BufferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BufferAnalystService_getPrototypeOf(o); }
  31304. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31305. * This program are made available under the terms of the Apache License, Version 2.0
  31306. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31307. /**
  31308. * @class BufferAnalystService
  31309. * @deprecatedclass SuperMap.BufferAnalystService
  31310. * @category iServer SpatialAnalyst BufferAnalyst
  31311. * @classdesc 缓冲区分析服务类。
  31312. * 该类负责将客户设置的缓冲区分析参数传递给服务端,并接收服务端返回的缓冲区分析结果数据。
  31313. * 缓冲区分析结果通过该类支持的事件的监听函数参数获取。
  31314. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  31315. * @param {Object} options - 参数。
  31316. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31317. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31318. * @param {Object} [options.headers] - 请求头。
  31319. * @extends {SpatialAnalystBase}
  31320. * @example 例如:
  31321. * (start code)
  31322. * var myBufferAnalystService = new BufferAnalystService(url, {
  31323. * eventListeners: {
  31324. * "processCompleted": bufferCompleted,
  31325. * "processFailed": bufferFailed
  31326. * }
  31327. * });
  31328. * (end)
  31329. * @usage
  31330. */
  31331. var BufferAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  31332. BufferAnalystService_inherits(BufferAnalystService, _SpatialAnalystBase);
  31333. var _super = BufferAnalystService_createSuper(BufferAnalystService);
  31334. function BufferAnalystService(url, options) {
  31335. var _this;
  31336. BufferAnalystService_classCallCheck(this, BufferAnalystService);
  31337. _this = _super.call(this, url, options);
  31338. /**
  31339. * @member {string} BufferAnalystService.prototype.mode
  31340. * @description 缓冲区分析类型
  31341. */
  31342. _this.mode = null;
  31343. if (options) {
  31344. Util_Util.extend(BufferAnalystService_assertThisInitialized(_this), options);
  31345. }
  31346. _this.CLASS_NAME = "SuperMap.BufferAnalystService";
  31347. return _this;
  31348. }
  31349. /**
  31350. * @function BufferAnalystService.prototype.destroy
  31351. * @override
  31352. */
  31353. BufferAnalystService_createClass(BufferAnalystService, [{
  31354. key: "destroy",
  31355. value: function destroy() {
  31356. BufferAnalystService_get(BufferAnalystService_getPrototypeOf(BufferAnalystService.prototype), "destroy", this).call(this);
  31357. this.mode = null;
  31358. }
  31359. /**
  31360. * @method BufferAnalystService.prototype.processAsync
  31361. * @description 负责将客户端的查询参数传递到服务端。
  31362. * @param {BufferAnalystParameters} parameter - 缓冲区分析参数
  31363. */
  31364. }, {
  31365. key: "processAsync",
  31366. value: function processAsync(parameter) {
  31367. var parameterObject = {};
  31368. var me = this;
  31369. if (parameter instanceof DatasetBufferAnalystParameters) {
  31370. me.mode = 'datasets';
  31371. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/buffer');
  31372. DatasetBufferAnalystParameters.toObject(parameter, parameterObject);
  31373. } else if (parameter instanceof GeometryBufferAnalystParameters) {
  31374. me.mode = 'geometry';
  31375. me.url = Util_Util.urlPathAppend(me.url, 'geometry/buffer');
  31376. GeometryBufferAnalystParameters.toObject(parameter, parameterObject);
  31377. }
  31378. var jsonParameters = Util_Util.toJSON(parameterObject);
  31379. this.returnContent = true;
  31380. me.request({
  31381. method: "POST",
  31382. data: jsonParameters,
  31383. scope: me,
  31384. success: me.serviceProcessCompleted,
  31385. failure: me.serviceProcessFailed
  31386. });
  31387. }
  31388. }, {
  31389. key: "dataFormat",
  31390. value: function dataFormat() {
  31391. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  31392. }
  31393. }]);
  31394. return BufferAnalystService;
  31395. }(SpatialAnalystBase);
  31396. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
  31397. function DatasourceConnectionInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31398. 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); } }
  31399. 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; }
  31400. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31401. * This program are made available under the terms of the Apache License, Version 2.0
  31402. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31403. // eslint-disable-line no-unused-vars
  31404. /**
  31405. * @class DatasourceConnectionInfo
  31406. * @deprecatedclass SuperMap.DatasourceConnectionInfo
  31407. * @category iServer Data Datasource
  31408. * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
  31409. * 当保存为工作空间时,工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
  31410. * 所以在使用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
  31411. * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
  31412. * @param {Object} options - 参数。
  31413. * @param {string} options.alias - 数据源别名。
  31414. * @param {string} options.dataBase - 数据源连接的数据库名。
  31415. * @param {boolean} [options.connect] - 数据源是否自动连接数据。
  31416. * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
  31417. * @param {EngineType} [options.engineType] - 数据源连接的引擎类型。
  31418. * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
  31419. * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  31420. * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
  31421. * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
  31422. * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
  31423. * @param {string} [options.user] - 登录数据库的用户名。
  31424. * @usage
  31425. */
  31426. var DatasourceConnectionInfo = /*#__PURE__*/function () {
  31427. function DatasourceConnectionInfo(options) {
  31428. DatasourceConnectionInfo_classCallCheck(this, DatasourceConnectionInfo);
  31429. /**
  31430. * @member {string} DatasourceConnectionInfo.prototype.alias
  31431. * @description 数据源别名。
  31432. */
  31433. this.alias = null;
  31434. /**
  31435. * @member {boolean} [DatasourceConnectionInfo.prototype.connect]
  31436. * @description 数据源是否自动连接数据。
  31437. */
  31438. this.connect = null;
  31439. /**
  31440. * @member {string} DatasourceConnectionInfo.prototype.dataBase
  31441. * @description 数据源连接的数据库名。
  31442. */
  31443. this.dataBase = null;
  31444. /**
  31445. * @member {string} [DatasourceConnectionInfo.prototype.driver]
  31446. * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
  31447. * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
  31448. * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
  31449. * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
  31450. */
  31451. this.driver = null;
  31452. /**
  31453. * @member {EngineType} [DatasourceConnectionInfo.prototype.engineType]
  31454. * @description 数据源连接的引擎类型。
  31455. */
  31456. this.engineType = null;
  31457. /**
  31458. * @member {boolean} [DatasourceConnectionInfo.prototype.exclusive]
  31459. * @description 是否以独占方式打开数据源。
  31460. */
  31461. this.exclusive = null;
  31462. /**
  31463. * @member {boolean} [DatasourceConnectionInfo.prototype.OpenLinkTable]
  31464. * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  31465. */
  31466. this.OpenLinkTable = null;
  31467. /**
  31468. * @member {string} [DatasourceConnectionInfo.prototype.password]
  31469. * @description 登录数据源连接的数据库或文件的密码。
  31470. */
  31471. this.password = null;
  31472. /**
  31473. * @member {boolean} [DatasourceConnectionInfo.prototype.readOnly]
  31474. * @description 是否以只读方式打开数据源。
  31475. */
  31476. this.readOnly = null;
  31477. /**
  31478. * @member {string} [DatasourceConnectionInfo.prototype.server]
  31479. * @description 数据库服务器名、文件名或服务地址。
  31480. * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
  31481. * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
  31482. * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
  31483. * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
  31484. * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
  31485. * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
  31486. * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
  31487. * 8.对于 SuperMapCould 数据源,为其服务地址。
  31488. * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
  31489. * 10.对于 OGC 和 REST 数据源,为其服务地址。
  31490. */
  31491. this.server = null;
  31492. /**
  31493. * @member {string} DatasourceConnectionInfo.prototype.user
  31494. * @description 登录数据库的用户名。
  31495. */
  31496. this.user = null;
  31497. if (options) {
  31498. Util_Util.extend(this, options);
  31499. }
  31500. this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
  31501. }
  31502. /**
  31503. * @function DatasourceConnectionInfo.prototype.destroy
  31504. * @description 释放资源,将引用资源的属性置空。
  31505. */
  31506. DatasourceConnectionInfo_createClass(DatasourceConnectionInfo, [{
  31507. key: "destroy",
  31508. value: function destroy() {
  31509. var me = this;
  31510. me.alias = null;
  31511. me.connect = null;
  31512. me.dataBase = null;
  31513. me.driver = null;
  31514. me.engineType = null;
  31515. me.exclusive = null;
  31516. me.OpenLinkTable = null;
  31517. me.password = null;
  31518. me.readOnly = null;
  31519. me.server = null;
  31520. me.user = null;
  31521. }
  31522. }]);
  31523. return DatasourceConnectionInfo;
  31524. }();
  31525. ;// CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
  31526. function OutputSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31527. 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); } }
  31528. 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; }
  31529. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31530. * This program are made available under the terms of the Apache License, Version 2.0
  31531. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31532. /**
  31533. * @class OutputSetting
  31534. * @deprecatedclass SuperMap.OutputSetting
  31535. * @category iServer ProcessingService
  31536. * @classdesc 分布式分析输出类型设置类。
  31537. * @param {Object} options - 参数。
  31538. * @param {DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
  31539. * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
  31540. * @param {OutputType} [options.type=OutputType.UDB] - 输出类型。
  31541. * @param {string} [options.outputPath] - 分析结果输出路径。
  31542. * @usage
  31543. */
  31544. var OutputSetting = /*#__PURE__*/function () {
  31545. function OutputSetting(options) {
  31546. OutputSetting_classCallCheck(this, OutputSetting);
  31547. /**
  31548. * @member {OutputType} OutputSetting.prototype.type
  31549. * @description 分布式分析的输出类型。
  31550. */
  31551. this.type = OutputType.UDB;
  31552. /**
  31553. * @member {string} [OutputSetting.prototype.datasetName='analystResult']
  31554. * @description 分布式分析的输出结果数据集名称。
  31555. */
  31556. this.datasetName = "analystResult";
  31557. /**
  31558. * @member {DatasourceConnectionInfo} OutputSetting.prototype.datasourceInfo
  31559. * @description 分布式分析的输出结果数据源连接信息。
  31560. */
  31561. this.datasourceInfo = null;
  31562. /**
  31563. * @member {string} [OutputSetting.prototype.outputPath]
  31564. * @description 分布式分析的分析结果输出路径。
  31565. */
  31566. this.outputPath = "";
  31567. Util_Util.extend(this, options);
  31568. this.CLASS_NAME = "SuperMap.OutputSetting";
  31569. }
  31570. /**
  31571. * @function OutputSetting.prototype.destroy
  31572. * @description 释放资源,将引用资源的属性置空。
  31573. */
  31574. OutputSetting_createClass(OutputSetting, [{
  31575. key: "destroy",
  31576. value: function destroy() {
  31577. var me = this;
  31578. me.type = null;
  31579. me.datasetName = null;
  31580. me.outputPath = null;
  31581. if (me.datasourceInfo instanceof DatasourceConnectionInfo) {
  31582. me.datasourceInfo.destroy();
  31583. me.datasourceInfo = null;
  31584. }
  31585. }
  31586. }]);
  31587. return OutputSetting;
  31588. }();
  31589. ;// CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
  31590. function MappingParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31591. 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); } }
  31592. 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; }
  31593. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31594. * This program are made available under the terms of the Apache License, Version 2.0
  31595. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31596. /**
  31597. * @class MappingParameters
  31598. * @deprecatedclass SuperMap.MappingParameters
  31599. * @category iServer ProcessingService
  31600. * @classdesc 分析后结果可视化的参数类。
  31601. * @param {Object} options - 参数。
  31602. * @param {Array.<ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
  31603. * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  31604. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 专题图分段模式。
  31605. * @param {number} [options.rangeCount] - 专题图分段个数。
  31606. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
  31607. * @usage
  31608. */
  31609. var MappingParameters = /*#__PURE__*/function () {
  31610. function MappingParameters(options) {
  31611. MappingParameters_classCallCheck(this, MappingParameters);
  31612. /**
  31613. * @member {Array.<ThemeGridRangeItem>} [MappingParameters.prototype.items]
  31614. * @description 栅格分段专题图子项数组。
  31615. */
  31616. this.items = null;
  31617. /**
  31618. * @member {number} [MappingParameters.prototype.numericPrecision=1]
  31619. * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  31620. */
  31621. this.numericPrecision = 1;
  31622. /**
  31623. * @member {RangeMode} [MappingParameters.prototype.RangeMode=RangeMode.EQUALINTERVAL]
  31624. * @description 专题图分段模式。
  31625. */
  31626. this.rangeMode = RangeMode.EQUALINTERVAL;
  31627. /**
  31628. * @member {number} [MappingParameters.prototype.rangeCount]
  31629. * @description 专题图分段个数。
  31630. */
  31631. this.rangeCount = "";
  31632. /**
  31633. * @member {ColorGradientType} [MappingParameters.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  31634. * @description 专题图颜色渐变模式。
  31635. */
  31636. this.colorGradientType = ColorGradientType.YELLOW_RED;
  31637. Util_Util.extend(this, options);
  31638. this.CLASS_NAME = "SuperMap.MappingParameters";
  31639. }
  31640. /**
  31641. * @function MappingParameters.prototype.destroy
  31642. * @description 释放资源,将引用资源的属性置空。
  31643. */
  31644. MappingParameters_createClass(MappingParameters, [{
  31645. key: "destroy",
  31646. value: function destroy() {
  31647. var me = this;
  31648. if (me.items) {
  31649. if (me.items.length > 0) {
  31650. for (var item in me.items) {
  31651. me.items[item].destroy();
  31652. me.items[item] = null;
  31653. }
  31654. }
  31655. me.items = null;
  31656. }
  31657. me.numericPrecision = null;
  31658. me.rangeMode = null;
  31659. me.rangeCount = null;
  31660. me.colorGradientType = null;
  31661. }
  31662. }]);
  31663. return MappingParameters;
  31664. }();
  31665. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
  31666. function BuffersAnalystJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31667. 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); } }
  31668. 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; }
  31669. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31670. * This program are made available under the terms of the Apache License, Version 2.0
  31671. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31672. /**
  31673. * @class BuffersAnalystJobsParameter
  31674. * @deprecatedclass SuperMap.BuffersAnalystJobsParameter
  31675. * @category iServer ProcessingService BufferAnalyst
  31676. * @classdesc 缓冲区分析任务参数类。
  31677. * @param {Object} options - 参数。
  31678. * @param {string} options.datasetName - 数据集名。
  31679. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.bounds] - 分析范围(默认为全图范围)。
  31680. * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
  31681. * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
  31682. * @param {AnalystSizeUnit} [options.distanceUnit=AnalystSizeUnit.METER] - 缓冲距离单位单位。
  31683. * @param {OutputSetting} [options.output] - 输出参数设置。
  31684. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  31685. * @usage
  31686. */
  31687. var BuffersAnalystJobsParameter = /*#__PURE__*/function () {
  31688. function BuffersAnalystJobsParameter(options) {
  31689. BuffersAnalystJobsParameter_classCallCheck(this, BuffersAnalystJobsParameter);
  31690. /**
  31691. * @member {string} BuffersAnalystJobsParameter.prototype.datasetName
  31692. * @description 数据集名。
  31693. */
  31694. this.datasetName = '';
  31695. /**
  31696. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} BuffersAnalystJobsParameter.prototype.bounds
  31697. * @description 分析范围。
  31698. */
  31699. this.bounds = '';
  31700. /**
  31701. * @member {string} [BuffersAnalystJobsParameter.prototype.distance='15']
  31702. * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段为空时,此参数有效。
  31703. */
  31704. this.distance = '';
  31705. /**
  31706. * @member {string} [BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
  31707. * @description 缓冲距离字段。
  31708. */
  31709. this.distanceField = '';
  31710. /**
  31711. * @member {AnalystSizeUnit} [BuffersAnalystJobsParameter.prototype.distanceUnit=AnalystSizeUnit.METER]
  31712. * @description 缓冲距离单位。
  31713. */
  31714. this.distanceUnit = AnalystSizeUnit.METER;
  31715. /**
  31716. * @member {string} BuffersAnalystJobsParameter.prototype.dissolveField
  31717. * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
  31718. */
  31719. this.dissolveField = '';
  31720. /**
  31721. * @member {OutputSetting} [BuffersAnalystJobsParameter.prototype.output]
  31722. * @description 输出参数设置类。
  31723. */
  31724. this.output = null;
  31725. /**
  31726. * @member {MappingParameters} [BuffersAnalystJobsParameter.prototype.mappingParameters]
  31727. * @description 分析后结果可视化的参数类。
  31728. */
  31729. this.mappingParameters = null;
  31730. if (!options) {
  31731. return this;
  31732. }
  31733. Util_Util.extend(this, options);
  31734. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
  31735. }
  31736. /**
  31737. * @function BuffersAnalystJobsParameter.prototype.destroy
  31738. * @description 释放资源,将引用资源的属性置空。
  31739. */
  31740. BuffersAnalystJobsParameter_createClass(BuffersAnalystJobsParameter, [{
  31741. key: "destroy",
  31742. value: function destroy() {
  31743. this.datasetName = null;
  31744. this.bounds = null;
  31745. this.distance = null;
  31746. this.distanceField = null;
  31747. this.distanceUnit = null;
  31748. this.dissolveField = null;
  31749. if (this.output instanceof OutputSetting) {
  31750. this.output.destroy();
  31751. this.output = null;
  31752. }
  31753. if (this.mappingParameters instanceof MappingParameters) {
  31754. this.mappingParameters.destroy();
  31755. this.mappingParameters = null;
  31756. }
  31757. }
  31758. /**
  31759. * @function BuffersAnalystJobsParameter.toObject
  31760. * @param {BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
  31761. * @param {Object} tempObj - 目标对象。
  31762. * @description 生成缓冲区分析任务对象。
  31763. */
  31764. }], [{
  31765. key: "toObject",
  31766. value: function toObject(_BuffersAnalystJobsParameter, tempObj) {
  31767. for (var name in _BuffersAnalystJobsParameter) {
  31768. if (name === 'datasetName') {
  31769. tempObj['input'] = tempObj['input'] || {};
  31770. tempObj['input'][name] = _BuffersAnalystJobsParameter[name];
  31771. continue;
  31772. }
  31773. if (name === 'output') {
  31774. tempObj['output'] = tempObj['output'] || {};
  31775. tempObj['output'] = _BuffersAnalystJobsParameter[name];
  31776. continue;
  31777. }
  31778. tempObj['analyst'] = tempObj['analyst'] || {};
  31779. if (name === 'bounds' && _BuffersAnalystJobsParameter[name]) {
  31780. tempObj['analyst'][name] = _BuffersAnalystJobsParameter[name].toBBOX();
  31781. } else {
  31782. tempObj['analyst'][name] = _BuffersAnalystJobsParameter[name];
  31783. }
  31784. if (name === 'mappingParameters') {
  31785. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  31786. tempObj['analyst']['mappingParameters'] = _BuffersAnalystJobsParameter[name];
  31787. }
  31788. }
  31789. }
  31790. }]);
  31791. return BuffersAnalystJobsParameter;
  31792. }();
  31793. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
  31794. 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); }
  31795. function ProcessingServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31796. 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); } }
  31797. 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; }
  31798. 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); }
  31799. function ProcessingServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ProcessingServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  31800. 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); }
  31801. 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); }
  31802. 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); }; }
  31803. 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); }
  31804. function ProcessingServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31805. 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; } }
  31806. function ProcessingServiceBase_getPrototypeOf(o) { ProcessingServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingServiceBase_getPrototypeOf(o); }
  31807. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31808. * This program are made available under the terms of the Apache License, Version 2.0
  31809. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31810. /**
  31811. * @class ProcessingServiceBase
  31812. * @deprecatedclass SuperMap.ProcessingServiceBase
  31813. * @category iServer Core
  31814. * @classdesc 分布式分析服务基类
  31815. * @extends {CommonServiceBase}
  31816. * @param {string} url - 服务地址。
  31817. * @param {Object} options - 参数。
  31818. * @param {Events} options.events - 处理所有事件的对象。
  31819. * @param {number} options.index - 服务访问地址在数组中的位置。
  31820. * @param {number} options.length - 服务访问地址数组长度。
  31821. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  31822. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31823. * @param {Object} [options.headers] - 请求头。
  31824. * @usage
  31825. */
  31826. var ProcessingServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  31827. ProcessingServiceBase_inherits(ProcessingServiceBase, _CommonServiceBase);
  31828. var _super = ProcessingServiceBase_createSuper(ProcessingServiceBase);
  31829. function ProcessingServiceBase(url, options) {
  31830. var _this;
  31831. ProcessingServiceBase_classCallCheck(this, ProcessingServiceBase);
  31832. options = options || {};
  31833. /*
  31834. * Constant: EVENT_TYPES
  31835. * {Array.<string>}
  31836. * 此类支持的事件类型
  31837. * - *processCompleted* 创建成功后触发的事件。
  31838. * - *processFailed* 创建失败后触发的事件 。
  31839. * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
  31840. */
  31841. options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
  31842. _this = _super.call(this, url, options);
  31843. _this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
  31844. return _this;
  31845. }
  31846. /**
  31847. * @function ProcessingServiceBase.prototype.destroy
  31848. * @override
  31849. */
  31850. ProcessingServiceBase_createClass(ProcessingServiceBase, [{
  31851. key: "destroy",
  31852. value: function destroy() {
  31853. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "destroy", this).call(this);
  31854. }
  31855. /**
  31856. * @function ProcessingServiceBase.prototype.getJobs
  31857. * @description 获取分布式分析任务。
  31858. * @param {string} url - 资源地址。
  31859. */
  31860. }, {
  31861. key: "getJobs",
  31862. value: function getJobs(url) {
  31863. var me = this;
  31864. FetchRequest.get(SecurityManager.appendCredential(url), null, {
  31865. proxy: me.proxy
  31866. }).then(function (response) {
  31867. return response.json();
  31868. }).then(function (result) {
  31869. me.events.triggerEvent("processCompleted", {
  31870. result: result
  31871. });
  31872. })["catch"](function (e) {
  31873. me.eventListeners.processFailed({
  31874. error: e
  31875. });
  31876. });
  31877. }
  31878. /**
  31879. * @function ProcessingServiceBase.prototype.addJob
  31880. * @description 添加分布式分析任务。
  31881. * @param {string} url - 资源根地址。
  31882. * @param {Object} params - 创建一个空间分析的请求参数。
  31883. * @param {string} paramType - 请求参数类型。
  31884. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  31885. */
  31886. }, {
  31887. key: "addJob",
  31888. value: function addJob(url, params, paramType, seconds) {
  31889. var me = this,
  31890. parameterObject = null;
  31891. if (params && params instanceof paramType) {
  31892. parameterObject = new Object();
  31893. paramType.toObject(params, parameterObject);
  31894. }
  31895. var headers = Object.assign({
  31896. 'Content-Type': 'application/x-www-form-urlencoded'
  31897. }, me.headers || {});
  31898. var options = {
  31899. proxy: me.proxy,
  31900. headers: headers,
  31901. withCredentials: me.withCredentials,
  31902. crossOrigin: me.crossOrigin,
  31903. isInTheSameDomain: me.isInTheSameDomain
  31904. };
  31905. FetchRequest.post(SecurityManager.appendCredential(url), JSON.stringify(parameterObject), options).then(function (response) {
  31906. return response.json();
  31907. }).then(function (result) {
  31908. if (result.succeed) {
  31909. me.serviceProcessCompleted(result, seconds);
  31910. } else {
  31911. me.serviceProcessFailed(result);
  31912. }
  31913. })["catch"](function (e) {
  31914. me.serviceProcessFailed({
  31915. error: e
  31916. });
  31917. });
  31918. }
  31919. }, {
  31920. key: "serviceProcessCompleted",
  31921. value: function serviceProcessCompleted(result, seconds) {
  31922. result = Util_Util.transformResult(result);
  31923. seconds = seconds || 1000;
  31924. var me = this;
  31925. if (result) {
  31926. var id = setInterval(function () {
  31927. FetchRequest.get(SecurityManager.appendCredential(result.newResourceLocation), {
  31928. _t: new Date().getTime()
  31929. }).then(function (response) {
  31930. return response.json();
  31931. }).then(function (job) {
  31932. me.events.triggerEvent("processRunning", {
  31933. id: job.id,
  31934. state: job.state
  31935. });
  31936. if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
  31937. clearInterval(id);
  31938. me.events.triggerEvent("processFailed", {
  31939. error: job.state.errorMsg,
  31940. state: job.state.runState
  31941. });
  31942. }
  31943. if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
  31944. clearInterval(id);
  31945. me.events.triggerEvent("processCompleted", {
  31946. result: job
  31947. });
  31948. }
  31949. })["catch"](function (e) {
  31950. clearInterval(id);
  31951. me.events.triggerEvent("processFailed", {
  31952. error: e
  31953. });
  31954. });
  31955. }, seconds);
  31956. }
  31957. }
  31958. }, {
  31959. key: "serviceProcessFailed",
  31960. value: function serviceProcessFailed(result) {
  31961. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "serviceProcessFailed", this).call(this, result);
  31962. }
  31963. }]);
  31964. return ProcessingServiceBase;
  31965. }(CommonServiceBase);
  31966. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
  31967. 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); }
  31968. function BuffersAnalystJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31969. 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); } }
  31970. 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; }
  31971. 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); }
  31972. function BuffersAnalystJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BuffersAnalystJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  31973. 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); }
  31974. 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); }
  31975. 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); }; }
  31976. 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); }
  31977. function BuffersAnalystJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31978. 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; } }
  31979. function BuffersAnalystJobsService_getPrototypeOf(o) { BuffersAnalystJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BuffersAnalystJobsService_getPrototypeOf(o); }
  31980. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  31981. * This program are made available under the terms of the Apache License, Version 2.0
  31982. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31983. /**
  31984. * @class BuffersAnalystJobsService
  31985. * @deprecatedclass SuperMap.BuffersAnalystJobsService
  31986. * @category iServer ProcessingService BufferAnalyst
  31987. * @classdesc 缓冲区分析服务类。
  31988. * @extends {ProcessingServiceBase}
  31989. * @param {string} url - 服务地址。
  31990. * @param {Object} options - 参数。
  31991. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31992. * @param {Object} [options.headers] - 请求头。
  31993. * @usage
  31994. */
  31995. var BuffersAnalystJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  31996. BuffersAnalystJobsService_inherits(BuffersAnalystJobsService, _ProcessingServiceBas);
  31997. var _super = BuffersAnalystJobsService_createSuper(BuffersAnalystJobsService);
  31998. function BuffersAnalystJobsService(url, options) {
  31999. var _this;
  32000. BuffersAnalystJobsService_classCallCheck(this, BuffersAnalystJobsService);
  32001. _this = _super.call(this, url, options);
  32002. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/buffers');
  32003. _this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
  32004. return _this;
  32005. }
  32006. /**
  32007. *@override
  32008. */
  32009. BuffersAnalystJobsService_createClass(BuffersAnalystJobsService, [{
  32010. key: "destroy",
  32011. value: function destroy() {
  32012. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "destroy", this).call(this);
  32013. }
  32014. /**
  32015. * @function BuffersAnalystJobsService.prototype.getBufferJobs
  32016. * @description 获取缓冲区分析所有任务
  32017. */
  32018. }, {
  32019. key: "getBuffersJobs",
  32020. value: function getBuffersJobs() {
  32021. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, this.url);
  32022. }
  32023. /**
  32024. * @function BuffersAnalystJobsService.prototype.getBufferJob
  32025. * @description 获取指定id的缓冲区分析服务
  32026. * @param {string} id - 指定要获取数据的id。
  32027. */
  32028. }, {
  32029. key: "getBuffersJob",
  32030. value: function getBuffersJob(id) {
  32031. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  32032. }
  32033. /**
  32034. * @function BuffersAnalystJobsService.prototype.addBufferJob
  32035. * @description 新建缓冲区分析服务
  32036. * @param {BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  32037. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  32038. */
  32039. }, {
  32040. key: "addBuffersJob",
  32041. value: function addBuffersJob(params, seconds) {
  32042. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "addJob", this).call(this, this.url, params, BuffersAnalystJobsParameter, seconds);
  32043. }
  32044. }]);
  32045. return BuffersAnalystJobsService;
  32046. }(ProcessingServiceBase);
  32047. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystParameters.js
  32048. function BurstPipelineAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32049. 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); } }
  32050. 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; }
  32051. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32052. * This program are made available under the terms of the Apache License, Version 2.0
  32053. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32054. /**
  32055. * @class BurstPipelineAnalystParameters
  32056. * @deprecatedclass SuperMap.BurstPipelineAnalystParameters
  32057. * @category iServer NetworkAnalyst BurstAnalyse
  32058. * @classdesc 爆管分析参数类。
  32059. * @param {Object} options - 参数。
  32060. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  32061. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  32062. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  32063. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  32064. * @usage
  32065. */
  32066. var BurstPipelineAnalystParameters = /*#__PURE__*/function () {
  32067. function BurstPipelineAnalystParameters(options) {
  32068. BurstPipelineAnalystParameters_classCallCheck(this, BurstPipelineAnalystParameters);
  32069. var me = this;
  32070. /**
  32071. * @member {Array.<number>} BurstPipelineAnalystParameters.prototype.sourceNodeIDs
  32072. * @description 指定的设施点 ID 数组。
  32073. */
  32074. this.sourceNodeIDs = null;
  32075. /**
  32076. * @member {number} [BurstPipelineAnalystParameters.prototype.edgeID]
  32077. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  32078. */
  32079. this.edgeID = null;
  32080. /**
  32081. * @member {number} [BurstPipelineAnalystParameters.prototype.nodeID]
  32082. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  32083. */
  32084. this.nodeID = null;
  32085. /**
  32086. * @member {boolean} [BurstPipelineAnalystParameters.prototype.isUncertainDirectionValid=false]
  32087. * @description 指定不确定流向是否有效。
  32088. * 指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行。
  32089. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  32090. */
  32091. this.isUncertainDirectionValid = false;
  32092. Util_Util.extend(me, options);
  32093. this.CLASS_NAME = "SuperMap.BurstPipelineAnalystParameters";
  32094. }
  32095. /**
  32096. * @function BurstPipelineAnalystParameters.prototype.destroy
  32097. * @description 释放资源,将引用资源的属性置空。
  32098. */
  32099. BurstPipelineAnalystParameters_createClass(BurstPipelineAnalystParameters, [{
  32100. key: "destroy",
  32101. value: function destroy() {
  32102. var me = this;
  32103. me.sourceNodeIDs = null;
  32104. me.edgeID = null;
  32105. me.nodeID = null;
  32106. me.isUncertainDirectionValid = null;
  32107. }
  32108. }]);
  32109. return BurstPipelineAnalystParameters;
  32110. }();
  32111. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystServiceBase.js
  32112. 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); }
  32113. function NetworkAnalystServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32114. 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); } }
  32115. 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; }
  32116. 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); }
  32117. function NetworkAnalystServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NetworkAnalystServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  32118. 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); }
  32119. 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); }
  32120. 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); }; }
  32121. 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); }
  32122. function NetworkAnalystServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32123. 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; } }
  32124. function NetworkAnalystServiceBase_getPrototypeOf(o) { NetworkAnalystServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystServiceBase_getPrototypeOf(o); }
  32125. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32126. * This program are made available under the terms of the Apache License, Version 2.0
  32127. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32128. /**
  32129. * @class NetworkAnalystServiceBase
  32130. * @deprecatedclass SuperMap.NetworkAnalystServiceBase
  32131. * @category iServer Core
  32132. * @classdesc 网络分析服务基类。
  32133. * @extends {CommonServiceBase}
  32134. * @param {string} url - 服务地址。
  32135. * @param {Object} options - 可选参数。
  32136. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32137. * @param {Object} [options.headers] - 请求头。
  32138. * @usage
  32139. */
  32140. var NetworkAnalystServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  32141. NetworkAnalystServiceBase_inherits(NetworkAnalystServiceBase, _CommonServiceBase);
  32142. var _super = NetworkAnalystServiceBase_createSuper(NetworkAnalystServiceBase);
  32143. function NetworkAnalystServiceBase(url, options) {
  32144. var _this;
  32145. NetworkAnalystServiceBase_classCallCheck(this, NetworkAnalystServiceBase);
  32146. _this = _super.call(this, url, options);
  32147. /**
  32148. * @member {DataFormat} [NetworkAnalystServiceBase.prototype.format=DataFormat.GEOJSON]
  32149. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"
  32150. */
  32151. _this.format = DataFormat.GEOJSON;
  32152. _this.CLASS_NAME = "SuperMap.NetworkAnalystServiceBase";
  32153. return _this;
  32154. }
  32155. /**
  32156. * @function NetworkAnalystServiceBase.prototype.destroy
  32157. * @description 释放资源,将引用的资源属性置空。
  32158. */
  32159. NetworkAnalystServiceBase_createClass(NetworkAnalystServiceBase, [{
  32160. key: "destroy",
  32161. value: function destroy() {
  32162. NetworkAnalystServiceBase_get(NetworkAnalystServiceBase_getPrototypeOf(NetworkAnalystServiceBase.prototype), "destroy", this).call(this);
  32163. this.format = null;
  32164. }
  32165. /**
  32166. * @function NetworkAnalystServiceBase.prototype.serviceProcessCompleted
  32167. * @description 分析完成,执行此方法。
  32168. * @param {Object} result - 服务器返回的结果对象。
  32169. */
  32170. }, {
  32171. key: "serviceProcessCompleted",
  32172. value: function serviceProcessCompleted(result, options) {
  32173. var me = this,
  32174. analystResult;
  32175. result = Util_Util.transformResult(result);
  32176. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  32177. analystResult = me.toGeoJSONResult(result);
  32178. }
  32179. if (!analystResult) {
  32180. analystResult = result;
  32181. }
  32182. me.events.triggerEvent("processCompleted", {
  32183. result: analystResult,
  32184. options: options
  32185. });
  32186. }
  32187. /**
  32188. * @function NetworkAnalystServiceBase.prototype.toGeoJSONResult
  32189. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。只处理结果中的路由,由子类实现。
  32190. * @param {Object} result - 服务器返回的结果对象。
  32191. * @returns {GeoJSONObject} GeoJSON 对象。
  32192. */
  32193. }, {
  32194. key: "toGeoJSONResult",
  32195. value: function toGeoJSONResult(result) {
  32196. // eslint-disable-line no-unused-vars
  32197. return null;
  32198. }
  32199. }]);
  32200. return NetworkAnalystServiceBase;
  32201. }(CommonServiceBase);
  32202. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystService.js
  32203. 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); }
  32204. function BurstPipelineAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32205. 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); } }
  32206. 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; }
  32207. 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); }
  32208. function BurstPipelineAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BurstPipelineAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  32209. 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); }
  32210. 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); }
  32211. 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); }; }
  32212. 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); }
  32213. function BurstPipelineAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32214. 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; } }
  32215. function BurstPipelineAnalystService_getPrototypeOf(o) { BurstPipelineAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BurstPipelineAnalystService_getPrototypeOf(o); }
  32216. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32217. * This program are made available under the terms of the Apache License, Version 2.0
  32218. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32219. /**
  32220. * @class BurstPipelineAnalystService
  32221. * @deprecatedclass SuperMap.BurstPipelineAnalystService
  32222. * @category iServer NetworkAnalyst BurstAnalyse
  32223. * @classdesc 爆管分析服务类。即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组、普通结点 ID 数组及其上下游弧段 ID 数组。
  32224. * @extends {NetworkAnalystServiceBase}
  32225. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  32226. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源},
  32227. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  32228. * @param {Object} options - 参数。
  32229. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32230. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32231. * @param {Object} [options.headers] - 请求头。
  32232. * @usage
  32233. */
  32234. var BurstPipelineAnalystService = /*#__PURE__*/function (_NetworkAnalystServic) {
  32235. BurstPipelineAnalystService_inherits(BurstPipelineAnalystService, _NetworkAnalystServic);
  32236. var _super = BurstPipelineAnalystService_createSuper(BurstPipelineAnalystService);
  32237. function BurstPipelineAnalystService(url, options) {
  32238. var _this;
  32239. BurstPipelineAnalystService_classCallCheck(this, BurstPipelineAnalystService);
  32240. _this = _super.call(this, url, options);
  32241. _this.CLASS_NAME = "SuperMap.BurstPipelineAnalystService";
  32242. return _this;
  32243. }
  32244. /**
  32245. * @function BurstPipelineAnalystService.prototype.destroy
  32246. * @override
  32247. */
  32248. BurstPipelineAnalystService_createClass(BurstPipelineAnalystService, [{
  32249. key: "destroy",
  32250. value: function destroy() {
  32251. BurstPipelineAnalystService_get(BurstPipelineAnalystService_getPrototypeOf(BurstPipelineAnalystService.prototype), "destroy", this).call(this);
  32252. }
  32253. /**
  32254. * @function BurstPipelineAnalystService.prototype.processAsync
  32255. * @description 负责将客户端的查询参数传递到服务端。
  32256. * @params {BurstPipelineAnalystParameters} params - 爆管分析参数类
  32257. */
  32258. }, {
  32259. key: "processAsync",
  32260. value: function processAsync(params) {
  32261. if (!(params instanceof BurstPipelineAnalystParameters)) {
  32262. return null;
  32263. }
  32264. var me = this,
  32265. jsonObject;
  32266. me.url = Util_Util.urlPathAppend(me.url, 'burstAnalyse');
  32267. jsonObject = {
  32268. sourceNodeIDs: params.sourceNodeIDs,
  32269. isUncertainDirectionValid: params.isUncertainDirectionValid
  32270. };
  32271. //必传参数不正确,就终止
  32272. if (params.edgeID !== null && params.nodeID !== null) {
  32273. throw new Error('edgeID and nodeID cannot be null at the same time.');
  32274. }
  32275. if (params.edgeID === null && params.nodeID === null) {
  32276. throw new Error('edgeID and nodeID cannot be null at the same time.');
  32277. }
  32278. if (params.edgeID !== null) {
  32279. jsonObject.edgeID = params.edgeID;
  32280. } else {
  32281. jsonObject.nodeID = params.nodeID;
  32282. }
  32283. me.request({
  32284. method: "GET",
  32285. params: jsonObject,
  32286. scope: me,
  32287. success: me.serviceProcessCompleted,
  32288. failure: me.serviceProcessFailed
  32289. });
  32290. }
  32291. }]);
  32292. return BurstPipelineAnalystService;
  32293. }(NetworkAnalystServiceBase);
  32294. ;// CONCATENATED MODULE: ./src/common/iServer/ChartFeatureInfoSpecsService.js
  32295. 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); }
  32296. function ChartFeatureInfoSpecsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32297. 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); } }
  32298. 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; }
  32299. 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); }
  32300. function ChartFeatureInfoSpecsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ChartFeatureInfoSpecsService_getPrototypeOf(object); if (object === null) break; } return object; }
  32301. 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); }
  32302. 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); }
  32303. 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); }; }
  32304. 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); }
  32305. function ChartFeatureInfoSpecsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32306. 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; } }
  32307. function ChartFeatureInfoSpecsService_getPrototypeOf(o) { ChartFeatureInfoSpecsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartFeatureInfoSpecsService_getPrototypeOf(o); }
  32308. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32309. * This program are made available under the terms of the Apache License, Version 2.0
  32310. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32311. /**
  32312. * @class ChartFeatureInfoSpecsService
  32313. * @deprecatedclass SuperMap.ChartFeatureInfoSpecsService
  32314. * @category iServer Map Chart
  32315. * @classdesc 海图物标信息服务类,通过该服务类可以查询到服务端支持的所有海图物标信息。
  32316. * 用户可以通过两种方式获取查询结果:
  32317. * 一种是通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件;
  32318. * 另一种是使用 AsyncResponder 类实现异步处理。
  32319. * @extends {CommonServiceBase}
  32320. * @param {string} url - 地图(特指海图)服务地址。
  32321. * 如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  32322. * 发送请求格式类似于:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图/chartFeatureInfoSpecs.json"。
  32323. * @param {Object} options - 参数。
  32324. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  32325. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
  32326. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32327. * @param {Object} [options.headers] - 请求头。
  32328. * @usage
  32329. */
  32330. var ChartFeatureInfoSpecsService = /*#__PURE__*/function (_CommonServiceBase) {
  32331. ChartFeatureInfoSpecsService_inherits(ChartFeatureInfoSpecsService, _CommonServiceBase);
  32332. var _super = ChartFeatureInfoSpecsService_createSuper(ChartFeatureInfoSpecsService);
  32333. function ChartFeatureInfoSpecsService(url, options) {
  32334. var _this;
  32335. ChartFeatureInfoSpecsService_classCallCheck(this, ChartFeatureInfoSpecsService);
  32336. _this = _super.call(this, url, options);
  32337. _this.CLASS_NAME = "SuperMap.ChartFeatureInfoSpecsService";
  32338. return _this;
  32339. }
  32340. /**
  32341. * @function ChartFeatureInfoSpecsService.prototype.destroy
  32342. * @override
  32343. */
  32344. ChartFeatureInfoSpecsService_createClass(ChartFeatureInfoSpecsService, [{
  32345. key: "destroy",
  32346. value: function destroy() {
  32347. ChartFeatureInfoSpecsService_get(ChartFeatureInfoSpecsService_getPrototypeOf(ChartFeatureInfoSpecsService.prototype), "destroy", this).call(this);
  32348. Util_Util.reset(this);
  32349. }
  32350. /**
  32351. * @function ChartFeatureInfoSpecsService.prototype.processAsync
  32352. * @description 根据地图(特指海图)服务地址与服务端完成异步通讯,获取物标信息。
  32353. * 当查询物标信息成功时,将触发 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE
  32354. * 事件。用可以通过户两种方式获取图层信息:
  32355. * 1. 通过 AsyncResponder 类获取(推荐使用);
  32356. * 2. 通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件获取。
  32357. */
  32358. }, {
  32359. key: "processAsync",
  32360. value: function processAsync() {
  32361. var me = this,
  32362. method = "GET";
  32363. if (!me.isTempLayers) {
  32364. Util_Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  32365. }
  32366. me.request({
  32367. method: method,
  32368. params: null,
  32369. scope: me,
  32370. success: me.serviceProcessCompleted,
  32371. failure: me.serviceProcessFailed
  32372. });
  32373. }
  32374. }]);
  32375. return ChartFeatureInfoSpecsService;
  32376. }(CommonServiceBase);
  32377. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryFilterParameter.js
  32378. function ChartQueryFilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32379. 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); } }
  32380. 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; }
  32381. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32382. * This program are made available under the terms of the Apache License, Version 2.0
  32383. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32384. /**
  32385. * @class ChartQueryFilterParameter
  32386. * @deprecatedclass SuperMap.ChartQueryFilterParameter
  32387. * @category iServer Map Chart
  32388. * @classdesc 海图查询过滤参数类,用于设置海图查询的过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  32389. * @param {Object} options - 参数。
  32390. * @param {string} options.attributeFilter - 属性字段过滤条件。
  32391. * @param {number} options.chartFeatureInfoSpecCode - 查询的物标代号。
  32392. * @param {boolean} [options.isQueryPoint] - 是否查询点。
  32393. * @param {boolean} [options.isQueryLine] - 是否查询线。
  32394. * @param {boolean} [options.isQueryRegion] - 是否查询面。
  32395. * @usage
  32396. */
  32397. var ChartQueryFilterParameter = /*#__PURE__*/function () {
  32398. function ChartQueryFilterParameter(options) {
  32399. ChartQueryFilterParameter_classCallCheck(this, ChartQueryFilterParameter);
  32400. /**
  32401. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryPoint]
  32402. * @description 是否查询点。
  32403. */
  32404. this.isQueryPoint = null;
  32405. /**
  32406. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryLine]
  32407. * @description 是否查询线。
  32408. */
  32409. this.isQueryLine = null;
  32410. /**
  32411. * @member {boolean} [ChartQueryFilterParameter.prototype.isQueryRegion]
  32412. * @description 是否查询面。
  32413. */
  32414. this.isQueryRegion = null;
  32415. /**
  32416. * @member {string} ChartQueryFilterParameter.prototype.attributeFilter
  32417. * @description 属性字段过滤条件。
  32418. */
  32419. this.attributeFilter = null;
  32420. /**
  32421. * @member {number} ChartQueryFilterParameter.prototype.chartFeatureInfoSpecCode
  32422. * @description 查询的物标代号。
  32423. */
  32424. this.chartFeatureInfoSpecCode = null;
  32425. Util_Util.extend(this, options);
  32426. this.CLASS_NAME = "SuperMap.ChartQueryFilterParameter";
  32427. }
  32428. /**
  32429. * @function ChartQueryFilterParameter.prototype.destroy
  32430. * @description 释放资源,将引用资源的属性置空。
  32431. */
  32432. ChartQueryFilterParameter_createClass(ChartQueryFilterParameter, [{
  32433. key: "destroy",
  32434. value: function destroy() {
  32435. var me = this;
  32436. me.isQueryPoint = null;
  32437. me.isQueryLine = null;
  32438. me.isQueryRegion = null;
  32439. me.attributeFilter = null;
  32440. me.chartFeatureInfoSpecCode = null;
  32441. }
  32442. /**
  32443. * @function ChartQueryFilterParameter.prototype.toJson
  32444. * @description 将属性信息转化成 JSON 格式字符串。
  32445. */
  32446. }, {
  32447. key: "toJson",
  32448. value: function toJson() {
  32449. var json = "";
  32450. json += "\"isQueryPoint\":" + this.isQueryPoint + ",";
  32451. json += "\"isQueryLine\":" + this.isQueryLine + ",";
  32452. json += "\"isQueryRegion\":" + this.isQueryRegion + ",";
  32453. if (this.attributeFilter) {
  32454. json += "\"attributeFilter\": \"" + this.attributeFilter + "\",";
  32455. }
  32456. json += "\"chartFeatureInfoSpecCode\":" + this.chartFeatureInfoSpecCode;
  32457. json = "{" + json + "}";
  32458. return json;
  32459. }
  32460. }]);
  32461. return ChartQueryFilterParameter;
  32462. }();
  32463. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryParameters.js
  32464. function ChartQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32465. 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); } }
  32466. 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; }
  32467. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32468. * This program are made available under the terms of the Apache License, Version 2.0
  32469. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32470. /**
  32471. * @class ChartQueryParameters
  32472. * @deprecatedclass SuperMap.ChartQueryParameters
  32473. * @category iServer Map Chart
  32474. * @classdesc 海图查询参数类,该类用于设置海图查询时的相关参数,海图查询分为海图属性查询和海图范围查询两类,通过属性 queryMode 指定查询模式。
  32475. * 必设属性有:queryMode、chartLayerNames、chartQueryFilterParameters。当进行海图范围查询时,必设属性还包括 bounds。
  32476. * @param {Object} options - 参数。
  32477. * @param {string} options.queryMode - 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  32478. * @param {Array.<string>} options.chartLayerNames - 查询的海图图层的名称。
  32479. * @param {Array.<ChartQueryFilterParameter>} options.chartQueryFilterParameters - 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  32480. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 海图查询范围。当进行海图范围查询时,此为必选参数。
  32481. * @param {boolean} [options.returnContent=true] - 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  32482. * @param {number} [options.startRecord=0] - 查询起始记录位置。
  32483. * @param {number} [options.expectCount] - 期望查询结果返回的记录数,该值大于0。
  32484. * @usage
  32485. */
  32486. var ChartQueryParameters = /*#__PURE__*/function () {
  32487. function ChartQueryParameters(options) {
  32488. ChartQueryParameters_classCallCheck(this, ChartQueryParameters);
  32489. /**
  32490. * @member {string} ChartQueryParameters.prototype.queryMode
  32491. * @description 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  32492. */
  32493. this.queryMode = null;
  32494. /**
  32495. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} ChartQueryParameters.prototype.bounds
  32496. * @description 海图查询范围。
  32497. */
  32498. this.bounds = null;
  32499. /**
  32500. * @member {Array.<string>} ChartQueryParameters.prototype.chartLayerNames
  32501. * @description 查询的海图图层的名称。
  32502. */
  32503. this.chartLayerNames = null;
  32504. /**
  32505. * @member {Array.<ChartQueryFilterParameter>} ChartQueryParameters.prototype.chartQueryFilterParameters
  32506. * @description 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  32507. */
  32508. this.chartQueryFilterParameters = null;
  32509. /**
  32510. * @member {boolean} [ChartQueryParameters.prototype.returnContent=true]
  32511. * @description 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  32512. */
  32513. this.returnContent = true;
  32514. /**
  32515. * @member {number} [ChartQueryParameters.prototype.startRecord=0]
  32516. * @description 查询起始记录位置。
  32517. */
  32518. this.startRecord = 0;
  32519. /**
  32520. * @member {number} [ChartQueryParameters.prototype.expectCount]
  32521. * @description 期望查询结果返回的记录数,该值大于0。
  32522. */
  32523. this.expectCount = null;
  32524. Util_Util.extend(this, options);
  32525. this.CLASS_NAME = "SuperMap.ChartQueryParameters";
  32526. }
  32527. /**
  32528. * @function ChartQueryParameters.prototype.destroy
  32529. * @description 释放资源,将引用资源的属性置空。
  32530. */
  32531. ChartQueryParameters_createClass(ChartQueryParameters, [{
  32532. key: "destroy",
  32533. value: function destroy() {
  32534. var me = this;
  32535. me.queryMode = null;
  32536. me.bounds = null;
  32537. me.chartLayerNames = null;
  32538. me.chartQueryFilterParameters = null;
  32539. me.returnContent = true;
  32540. me.startRecord = 0;
  32541. me.expectCount = null;
  32542. }
  32543. /**
  32544. * @function ChartQueryParameters.prototype.getVariablesJson
  32545. * @description 将属性信息转换成能够被服务识别的 JSON 格式字符串。
  32546. * @returns {string} JSON 字符串。
  32547. */
  32548. }, {
  32549. key: "getVariablesJson",
  32550. value: function getVariablesJson() {
  32551. var json = "";
  32552. json += "\"queryMode\":\"" + this.queryMode + "\",";
  32553. if (this.chartLayerNames && this.chartLayerNames.length) {
  32554. var chartLayersArray = [];
  32555. var layerLength = this.chartLayerNames.length;
  32556. for (var i = 0; i < layerLength; i++) {
  32557. chartLayersArray.push("\"" + this.chartLayerNames[i] + "\"");
  32558. }
  32559. var layerNames = "[" + chartLayersArray.join(",") + "]";
  32560. json += "\"chartLayerNames\":" + layerNames + ",";
  32561. }
  32562. if (this.queryMode === "ChartBoundsQuery" && this.bounds) {
  32563. json += "\"bounds\":" + "{" + "\"leftBottom\":" + "{" + "\"x\":" + this.bounds.left + "," + "\"y\":" + this.bounds.bottom + "}" + "," + "\"rightTop\":" + "{" + "\"x\":" + this.bounds.right + "," + "\"y\":" + this.bounds.top + "}" + "},";
  32564. }
  32565. if (this.chartQueryFilterParameters && this.chartQueryFilterParameters.length) {
  32566. var chartParamArray = [];
  32567. var chartLength = this.chartQueryFilterParameters.length;
  32568. for (var j = 0; j < chartLength; j++) {
  32569. var chartQueryFilterParameter = this.chartQueryFilterParameters[j];
  32570. if (!(chartQueryFilterParameter instanceof ChartQueryFilterParameter)) {
  32571. continue;
  32572. }
  32573. chartParamArray.push(chartQueryFilterParameter.toJson());
  32574. }
  32575. var chartParamsJson = "[" + chartParamArray.join(",") + "]";
  32576. chartParamsJson = "\"chartQueryParams\":" + chartParamsJson + ",";
  32577. chartParamsJson += "\"startRecord\":" + this.startRecord + ",";
  32578. chartParamsJson += "\"expectCount\":" + this.expectCount;
  32579. chartParamsJson = "{" + chartParamsJson + "}";
  32580. json += "\"chartQueryParameters\":" + chartParamsJson;
  32581. }
  32582. json = "{" + json + "}";
  32583. return json;
  32584. }
  32585. }]);
  32586. return ChartQueryParameters;
  32587. }();
  32588. ;// CONCATENATED MODULE: ./src/common/iServer/QueryParameters.js
  32589. function QueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32590. 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); } }
  32591. 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; }
  32592. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32593. * This program are made available under the terms of the Apache License, Version 2.0
  32594. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32595. /**
  32596. * @class QueryParameters
  32597. * @deprecatedclass SuperMap.QueryParameters
  32598. * @category iServer Map QueryResults
  32599. * @classdesc 查询参数基类。距离查询、SQL 查询、几何地物查询等各自的参数均继承此类。
  32600. * @param {Object} options - 参数。
  32601. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  32602. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  32603. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  32604. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  32605. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  32606. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  32607. * @param {number} [options.startRecord=0] - 查询起始记录号。
  32608. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  32609. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  32610. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  32611. * @usage
  32612. */
  32613. var QueryParameters = /*#__PURE__*/function () {
  32614. function QueryParameters(options) {
  32615. QueryParameters_classCallCheck(this, QueryParameters);
  32616. if (!options) {
  32617. return;
  32618. }
  32619. /**
  32620. * @member {string} [QueryParameters.prototype.customParams]
  32621. * @description 自定义参数,供扩展使用。
  32622. */
  32623. this.customParams = null;
  32624. /**
  32625. * @member {Object} [QueryParameters.prototype.prjCoordSys]
  32626. * @description 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}
  32627. */
  32628. this.prjCoordSys = null;
  32629. /**
  32630. * @member {number} [QueryParameters.prototype.expectCount=100000]
  32631. * @description 期望返回结果记录个数,默认返回100000条查询记录,
  32632. * 如果实际不足100000条则返回实际记录条数。
  32633. */
  32634. this.expectCount = 100000;
  32635. /**
  32636. * @member {GeometryType} [QueryParameters.prototype.networkType=GeometryType.LINE]
  32637. * @description 网络数据集对应的查询类型,分为点和线两种类型。
  32638. */
  32639. this.networkType = REST_GeometryType.LINE;
  32640. /**
  32641. * @member {QueryOption} [QueryParameters.prototype.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY]
  32642. * @description 查询结果类型枚举类。
  32643. * 该类描述查询结果返回类型,包括只返回属性、
  32644. * 只返回几何实体以及返回属性和几何实体。
  32645. */
  32646. this.queryOption = QueryOption.ATTRIBUTEANDGEOMETRY;
  32647. /**
  32648. * @member {Array.<FilterParameter>} QueryParameters.prototype.queryParams
  32649. * @description 查询过滤条件参数数组。
  32650. * 该类用于设置查询数据集的查询过滤参数。
  32651. */
  32652. this.queryParams = null;
  32653. /**
  32654. * @member {number} [QueryParameters.prototype.startRecord=0]
  32655. * @description 查询起始记录号。
  32656. */
  32657. this.startRecord = 0;
  32658. /**
  32659. * @member {number} [QueryParameters.prototype.holdTime=10]
  32660. * @description 资源在服务端保存的时间,单位为分钟。
  32661. */
  32662. this.holdTime = 10;
  32663. /**
  32664. * @member {boolean} [QueryParameters.prototype.returnCustomResult=false]
  32665. * @description 仅供三维使用。
  32666. */
  32667. this.returnCustomResult = false;
  32668. /**
  32669. * @member {boolean} [QueryParameters.prototype.returnFeatureWithFieldCaption=false]
  32670. * @description 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  32671. */
  32672. this.returnFeatureWithFieldCaption = false;
  32673. Util_Util.extend(this, options);
  32674. this.CLASS_NAME = "SuperMap.QueryParameters";
  32675. }
  32676. /**
  32677. * @function QueryParameters.prototype.destroy
  32678. * @description 释放资源,将引用资源的属性置空。
  32679. */
  32680. QueryParameters_createClass(QueryParameters, [{
  32681. key: "destroy",
  32682. value: function destroy() {
  32683. var me = this;
  32684. me.customParams = null;
  32685. me.expectCount = null;
  32686. me.networkType = null;
  32687. me.queryOption = null;
  32688. if (me.queryParams) {
  32689. for (var i = 0, qps = me.queryParams, len = qps.length; i < len; i++) {
  32690. qps[i].destroy();
  32691. }
  32692. me.queryParams = null;
  32693. }
  32694. me.startRecord = null;
  32695. me.holdTime = null;
  32696. me.returnCustomResult = null;
  32697. me.prjCoordSys = null;
  32698. }
  32699. }]);
  32700. return QueryParameters;
  32701. }();
  32702. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryService.js
  32703. 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); }
  32704. function ChartQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32705. 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); } }
  32706. 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; }
  32707. 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); }
  32708. 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); }
  32709. 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); }; }
  32710. 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); }
  32711. function ChartQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32712. 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; } }
  32713. function ChartQueryService_getPrototypeOf(o) { ChartQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartQueryService_getPrototypeOf(o); }
  32714. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32715. * This program are made available under the terms of the Apache License, Version 2.0
  32716. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32717. /**
  32718. * @class ChartQueryService
  32719. * @deprecatedclass SuperMap.ChartQueryService
  32720. * @category iServer Map Chart
  32721. * @classdesc 海图查询服务类。该类负责将海图查询所需参数(ChartQueryParameters)传递至服务端,并获取服务端的返回结果。
  32722. * 用户可以通过两种方式获取查询结果:
  32723. * 1.通过 AsyncResponder 类获取(推荐使用);
  32724. * 2.通过监听 QueryEvent.PROCESS_COMPLETE 事件获取。
  32725. * @extends {CommonServiceBase}
  32726. * @param {string} url - 地图查询服务访问地址。如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  32727. * @param {Object} options - 参数。
  32728. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  32729. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
  32730. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32731. * @param {Object} [options.headers] - 请求头。
  32732. * @example
  32733. * 下面示例显示了如何进行海图属性查询:
  32734. * var nameArray = ["GB4X0000_52000"];
  32735. * var chartQueryFilterParameter = new ChartQueryFilterParameter({
  32736. * isQueryPoint:true,
  32737. * isQueryLine:true,
  32738. * isQueryRegion:true,
  32739. * attributeFilter:"SmID<10",
  32740. * chartFeatureInfoSpecCode:1
  32741. * });
  32742. *
  32743. * var chartQueryParameters = new ChartQueryParameters({
  32744. * queryMode:"ChartAttributeQuery",
  32745. * chartLayerNames:nameArray,
  32746. * returnContent:true,
  32747. * chartQueryFilterParameters:[chartQueryFilterParameter]
  32748. * });
  32749. *
  32750. * var chartQueryService = new ChartQueryService(url);
  32751. *
  32752. * chartQueryService.events.on({
  32753. * "processCompleted":processCompleted,
  32754. * "processFailed":processFailed
  32755. * });
  32756. * chartQueryService.processAsync(chartQueryParameters);
  32757. * @usage
  32758. */
  32759. var ChartQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  32760. ChartQueryService_inherits(ChartQueryService, _CommonServiceBase);
  32761. var _super = ChartQueryService_createSuper(ChartQueryService);
  32762. function ChartQueryService(url, options) {
  32763. var _this;
  32764. ChartQueryService_classCallCheck(this, ChartQueryService);
  32765. _this = _super.call(this, url, options);
  32766. options = options || {};
  32767. /**
  32768. * @member {boolean} ChartQueryService.prototype.returnContent
  32769. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  32770. */
  32771. _this.returnContent = null;
  32772. /**
  32773. * @member {DataFormat} ChartQueryService.prototype.format
  32774. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式
  32775. * 参数格式为"ISERVER","GEOJSON",GEOJSON
  32776. */
  32777. _this.format = DataFormat.GEOJSON;
  32778. Util_Util.extend(ChartQueryService_assertThisInitialized(_this), options);
  32779. var me = ChartQueryService_assertThisInitialized(_this);
  32780. if (options.format) {
  32781. me.format = options.format.toUpperCase();
  32782. }
  32783. if (!me.url) {
  32784. return ChartQueryService_possibleConstructorReturn(_this);
  32785. }
  32786. me.url = Util_Util.urlPathAppend(me.url, 'queryResults');
  32787. _this.CLASS_NAME = "SuperMap.ChartQueryService";
  32788. return _this;
  32789. }
  32790. /**
  32791. * @function ChartQueryService.prototype.destroy
  32792. * @override
  32793. */
  32794. ChartQueryService_createClass(ChartQueryService, [{
  32795. key: "destroy",
  32796. value: function destroy() {
  32797. var me = this;
  32798. CommonServiceBase.prototype.destroy.apply(this, arguments);
  32799. me.returnContent = null;
  32800. me.format = null;
  32801. }
  32802. /**
  32803. * @function ChartQueryService.prototype.processAsync
  32804. * @description 使用服务地址 URL 实例化 ChartQueryService 对象。
  32805. * @param {ChartQueryParameters} params - 查询参数。
  32806. */
  32807. }, {
  32808. key: "processAsync",
  32809. value: function processAsync(params) {
  32810. //todo重点需要添加代码的地方
  32811. if (!(params instanceof ChartQueryParameters)) {
  32812. return;
  32813. }
  32814. var me = this,
  32815. jsonParameters;
  32816. me.returnContent = params.returnContent;
  32817. jsonParameters = params.getVariablesJson();
  32818. if (me.returnContent) {
  32819. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  32820. }
  32821. me.request({
  32822. method: "POST",
  32823. data: jsonParameters,
  32824. scope: me,
  32825. success: me.serviceProcessCompleted,
  32826. failure: me.serviceProcessFailed
  32827. });
  32828. }
  32829. /**
  32830. * @function ChartQueryService.prototype.serviceProcessCompleted
  32831. * @description 查询完成,执行此方法。
  32832. * @param {Object} result - 服务器返回的结果对象。
  32833. */
  32834. }, {
  32835. key: "serviceProcessCompleted",
  32836. value: function serviceProcessCompleted(result, options) {
  32837. var me = this;
  32838. result = Util_Util.transformResult(result);
  32839. if (result && result.recordsets && me.format === DataFormat.GEOJSON) {
  32840. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  32841. if (recordsets[i].features) {
  32842. var geoJSONFormat = new GeoJSON();
  32843. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  32844. }
  32845. }
  32846. }
  32847. me.events.triggerEvent("processCompleted", {
  32848. result: result,
  32849. options: options
  32850. });
  32851. }
  32852. /**
  32853. * @function ChartQueryService.prototype.getQueryParameters
  32854. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  32855. * @param {Object} params - JSON 字符串表示的查询参数。
  32856. * @returns {QueryParameters} 返回查询结果
  32857. */
  32858. }, {
  32859. key: "getQueryParameters",
  32860. value: function getQueryParameters(params) {
  32861. return new QueryParameters({
  32862. queryMode: params.queryMode,
  32863. bounds: params.bounds,
  32864. chartLayerNames: params.chartLayerNames,
  32865. chartQueryFilterParameters: params.chartQueryFilterParameters,
  32866. returnContent: params.returnContent
  32867. });
  32868. }
  32869. }]);
  32870. return ChartQueryService;
  32871. }(CommonServiceBase);
  32872. ;// CONCATENATED MODULE: ./src/common/iServer/ClipParameter.js
  32873. function ClipParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32874. 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); } }
  32875. 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; }
  32876. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32877. * This program are made available under the terms of the Apache License, Version 2.0
  32878. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32879. /**
  32880. * @class ClipParameter
  32881. * @deprecatedclass SuperMap.ClipParameter
  32882. * @category iServer SpatialAnalyst InterpolationAnalyst
  32883. * @classdesc 用于裁剪的参数。优先使用用户指定的裁剪区域多边形进行裁剪,也可以通过指定数据源和数据集名,从而使用指定数据集的边界多边形进行裁剪。
  32884. * @param {Object} options - 可选参数。
  32885. * @param {string} [options.clipDatasetName] - 裁剪的数据集名。
  32886. * @param {string} [options.clipDatasourceName] - 裁剪的数据集所在数据源的名字。
  32887. * @param {GeometryPolygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON|GeoJSONObject} [options.clipRegion] - 用户指定的裁剪区域。
  32888. * @param {boolean} [options.isClipInRegion=true] - 是否对裁剪区内的数据集进行裁剪。
  32889. * @param {boolean} [options.isExactClip=true] - 是否使用精确裁剪。
  32890. * @usage
  32891. */
  32892. var ClipParameter = /*#__PURE__*/function () {
  32893. function ClipParameter(options) {
  32894. ClipParameter_classCallCheck(this, ClipParameter);
  32895. /**
  32896. * @member {string} ClipParameter.prototype.clipDatasetName
  32897. * @description 用于裁剪的数据集名,clipDatasetName 与 clipRegion 必须设置一个。
  32898. */
  32899. this.clipDatasetName = null;
  32900. /**
  32901. * @member {string} ClipParameter.prototype.clipDatasourceName
  32902. * @description 用于裁剪的数据集所在数据源的名字。当 clipRegion 不设置时起作用。
  32903. */
  32904. this.clipDatasourceName = null;
  32905. /**
  32906. * @member {GeometryPolygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON|GeoJSONObject} ClipParameter.prototype.clipRegion
  32907. * @description 用户指定的裁剪区域,优先使用,clipDatasetName 与 clipRegion 必须设置一个。
  32908. */
  32909. this.clipRegion = null;
  32910. /**
  32911. * @member {boolean} [ClipParameter.prototype.isClipInRegion=true]
  32912. * @description 是否对裁剪区内的数据集进行裁剪。若为 true,则对裁剪区域内的结果进行裁剪,若为 false,则对裁剪区域外的结果进行裁剪。
  32913. */
  32914. this.isClipInRegion = true;
  32915. /**
  32916. * @member {boolean} [ClipParameter.prototype.isExactClip=true]
  32917. * @description 是否使用精确裁剪。
  32918. */
  32919. this.isExactClip = null;
  32920. if (options) {
  32921. Util_Util.extend(this, options);
  32922. }
  32923. this.CLASS_NAME = "SuperMap.ClipParameter";
  32924. }
  32925. /**
  32926. * @function ClipParameter.prototype.destroy
  32927. * @description 释放资源,将引用资源的属性置空。
  32928. */
  32929. ClipParameter_createClass(ClipParameter, [{
  32930. key: "destroy",
  32931. value: function destroy() {
  32932. var me = this;
  32933. me.clipDatasetName = null;
  32934. me.clipDatasourceName = null;
  32935. me.clipRegion = null;
  32936. me.isClipInRegion = null;
  32937. me.isExactClip = null;
  32938. }
  32939. /**
  32940. * @function ClipParameter.prototype.toJSON
  32941. * @description 将 ClipParameter 对象转化为 JSON 字符串。
  32942. * @returns {string} 返回转换后的 JSON 字符串。
  32943. */
  32944. }, {
  32945. key: "toJSON",
  32946. value: function toJSON() {
  32947. return Util_Util.toJSON({
  32948. isClipInRegion: this.isClipInRegion,
  32949. clipDatasetName: this.clipDatasetName,
  32950. clipDatasourceName: this.clipDatasourceName,
  32951. isExactClip: this.isExactClip,
  32952. clipRegion: ServerGeometry.fromGeometry(this.clipRegion)
  32953. });
  32954. }
  32955. }]);
  32956. return ClipParameter;
  32957. }();
  32958. ;// CONCATENATED MODULE: ./src/common/iServer/ColorDictionary.js
  32959. function ColorDictionary_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32960. 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); } }
  32961. 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; }
  32962. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  32963. * This program are made available under the terms of the Apache License, Version 2.0
  32964. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32965. /**
  32966. * @class ColorDictionary
  32967. * @deprecatedclass SuperMap.ColorDictionary
  32968. * @category iServer Map Theme
  32969. * @classdesc 颜色对照表类。颜色对照表中的键名为具体的高程值,键值表示该高程值要显示的颜色。
  32970. * 对于栅格图层中高程值小于颜色对照表中高程最小值的点使用颜色对照表中高程最小值对应的颜色,
  32971. * 对于栅格图层中高程值大于颜色对照表中高程最大值的点使用颜色对照表中高程最大值对应的颜色,
  32972. * 对于栅格图层中高程值在颜色对照表中没有对应颜色的点,则查找颜色对照表中与当前高程值相邻的两个高程对应的颜色,
  32973. * 然后通过渐变运算要显示的颜色。如果设置了颜色对照表的话,则颜色表设置无效。
  32974. * @param {Object} options - 参数。
  32975. * @param {number} options.elevation - 高程值。
  32976. * @param {ServerColor} options.color - 服务端颜色类。
  32977. * @usage
  32978. */
  32979. var ColorDictionary = /*#__PURE__*/function () {
  32980. function ColorDictionary(options) {
  32981. ColorDictionary_classCallCheck(this, ColorDictionary);
  32982. options = options || {};
  32983. /**
  32984. * @member {number} ColorDictionary.prototype.elevation
  32985. * @description 高程值。
  32986. */
  32987. this.elevation = null;
  32988. /**
  32989. * @member {ServerColor} ColorDictionary.prototype.color
  32990. * @description 服务端颜色类。
  32991. */
  32992. this.color = null;
  32993. Util_Util.extend(this, options);
  32994. var me = this,
  32995. c = me.color;
  32996. if (c) {
  32997. me.color = new ServerColor(c.red, c.green, c.blue);
  32998. }
  32999. this.CLASS_NAME = "SuperMap.ColorDictionary";
  33000. }
  33001. /**
  33002. * @function ColorDictionary.prototype.destroy
  33003. * @description 释放资源,将引用资源的属性置空。
  33004. */
  33005. ColorDictionary_createClass(ColorDictionary, [{
  33006. key: "destroy",
  33007. value: function destroy() {
  33008. Util_Util.reset(this);
  33009. }
  33010. /**
  33011. * @function ColorDictionary.prototype.toServerJSONObject
  33012. * @description 转换成对应的 JSON 格式对象。
  33013. * @returns {Object} JSON 对象。
  33014. */
  33015. }, {
  33016. key: "toServerJSONObject",
  33017. value: function toServerJSONObject() {
  33018. var dataObj = {};
  33019. dataObj = Util_Util.copyAttributes(dataObj, this);
  33020. return dataObj;
  33021. }
  33022. }]);
  33023. return ColorDictionary;
  33024. }();
  33025. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystResultSetting.js
  33026. function TransportationAnalystResultSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33027. 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); } }
  33028. 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; }
  33029. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33030. * This program are made available under the terms of the Apache License, Version 2.0
  33031. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33032. /**
  33033. * @class TransportationAnalystResultSetting
  33034. * @deprecatedclass SuperMap.TransportationAnalystResultSetting
  33035. * @category iServer NetworkAnalyst
  33036. * @classdesc 交通网络分析结果参数类。通过该类设置交通网络分析返回的结果,包括是否返回图片、是否返回弧段空间信息、是否返回结点空间信息等。
  33037. * @param {Object} options - 可选参数。
  33038. * @param {boolean} [options.returnEdgeFeatures=false] - 是否在分析结果中包含弧段要素集合。
  33039. * @param {boolean} [options.returnEdgeGeometry=false] - 返回的弧段要素集合中是否包含几何对象信息。
  33040. * @param {boolean} [options.returnEdgeIDs=false] - 返回结果中是否包含经过弧段 ID 集合。
  33041. * @param {boolean} [options.returnNodeFeatures=false] - 是否在分析结果中包含结点要素集合。
  33042. * @param {boolean} [options.returnNodeGeometry=false] - 返回的结点要素集合中是否包含几何对象信息。
  33043. * @param {boolean} [options.returnNodeIDs=false] - 返回结果中是否包含经过结点 ID 集合。
  33044. * @param {boolean} [options.returnPathGuides=false] - 返回分析结果中是否包含行驶导引集合。
  33045. * @param {boolean} [options.returnRoutes=false] - 返回分析结果中是否包含路由对象的集合。
  33046. * @usage
  33047. */
  33048. var TransportationAnalystResultSetting = /*#__PURE__*/function () {
  33049. function TransportationAnalystResultSetting(options) {
  33050. TransportationAnalystResultSetting_classCallCheck(this, TransportationAnalystResultSetting);
  33051. if (!options) {
  33052. return;
  33053. }
  33054. /**
  33055. * @member {boolean} TransportationAnalystResultSetting.prototype.returnEdgeFeatures
  33056. * @description 是否在分析结果中包含弧段要素集合。弧段要素包括弧段的空间信息和属性信息。
  33057. */
  33058. this.returnEdgeFeatures = false;
  33059. /**
  33060. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnEdgeGeometry=false]
  33061. * @description 返回的弧段要素集合中是否包含几何对象信息。
  33062. */
  33063. this.returnEdgeGeometry = false;
  33064. /**
  33065. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnEdgeIDs=false]
  33066. * @description 返回结果中是否包含经过弧段 ID 集合。
  33067. */
  33068. this.returnEdgeIDs = false;
  33069. /**
  33070. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeFeatures=false]
  33071. * @description 是否在分析结果中包含结点要素集合。
  33072. * 结点要素包括结点的空间信息和属性信息。其中返回的结点要素是否包含空间信息可通过 returnNodeGeometry 字段设置。
  33073. */
  33074. this.returnNodeFeatures = false;
  33075. /**
  33076. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeGeometry=false]
  33077. * @description 返回的结点要素集合中是否包含几何对象信息。
  33078. */
  33079. this.returnNodeGeometry = false;
  33080. /**
  33081. * @member {boolean} [TransportationAnalystResultSetting.prototype.returnNodeIDs=false]
  33082. * @description 返回结果中是否包含经过结点 ID 集合。
  33083. */
  33084. this.returnNodeIDs = false;
  33085. /**
  33086. * @member {boolean} TransportationAnalystResultSetting.prototype.returnPathGuides
  33087. * @description 返回分析结果中是否包含行驶导引集合。
  33088. */
  33089. this.returnPathGuides = false;
  33090. /**
  33091. * @member {boolean} TransportationAnalystResultSetting.prototype.returnRoutes
  33092. * @description 返回分析结果中是否包含路由对象的集合。
  33093. */
  33094. this.returnRoutes = false;
  33095. Util_Util.extend(this, options);
  33096. this.CLASS_NAME = "SuperMap.TransportationAnalystResultSetting";
  33097. }
  33098. /**
  33099. * @function TransportationAnalystResultSetting.prototype.destroy
  33100. * @description 释放资源,将引用资源的属性置空。
  33101. */
  33102. TransportationAnalystResultSetting_createClass(TransportationAnalystResultSetting, [{
  33103. key: "destroy",
  33104. value: function destroy() {
  33105. var me = this;
  33106. me.returnEdgeFeatures = null;
  33107. me.returnEdgeGeometry = null;
  33108. me.returnEdgeIDs = null;
  33109. me.returnNodeFeatures = null;
  33110. me.returnNodeGeometry = null;
  33111. me.returnNodeIDs = null;
  33112. me.returnPathGuides = null;
  33113. me.returnRoutes = null;
  33114. }
  33115. }]);
  33116. return TransportationAnalystResultSetting;
  33117. }();
  33118. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystParameter.js
  33119. function TransportationAnalystParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33120. 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); } }
  33121. 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; }
  33122. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33123. * This program are made available under the terms of the Apache License, Version 2.0
  33124. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33125. /**
  33126. * @class TransportationAnalystParameter
  33127. * @deprecatedclass SuperMap.TransportationAnalystParameter
  33128. * @category iServer NetworkAnalyst
  33129. * @classdesc 交通网络分析通用参数类。该类主要用来提供交通网络分析所需的通用参数。
  33130. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息,还可以对分析结果包含的内容进行一些设置。
  33131. * @param {Object} options - 参数。
  33132. * @param {Array.<number>} options.barrierEdgeIDs - 网络分析中障碍弧段的 ID 数组。
  33133. * @param {Array.<number>} options.barrierNodeIDs - 网络分析中障碍点的 ID 数组。
  33134. * @param {string} options.turnWeightField - 转向权重字段的名称。
  33135. * @param {TransportationAnalystResultSetting} options.resultSetting - 分析结果返回内容。
  33136. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} [options.barrierPoints] - 网络分析中 Point2D 类型的障碍点数组。
  33137. * @param {string} [options.weightFieldName] - 阻力字段的名称。
  33138. * @usage
  33139. */
  33140. var TransportationAnalystParameter = /*#__PURE__*/function () {
  33141. function TransportationAnalystParameter(options) {
  33142. TransportationAnalystParameter_classCallCheck(this, TransportationAnalystParameter);
  33143. if (!options) {
  33144. return;
  33145. }
  33146. /**
  33147. * @member {Array.<number>} TransportationAnalystParameter.prototype.barrierEdgeIDs
  33148. * @description 网络分析中障碍弧段的 ID 数组。弧段设置为障碍边之后,表示双向都不通。
  33149. */
  33150. this.barrierEdgeIDs = null;
  33151. /**
  33152. * @member {Array.<number>} TransportationAnalystParameter.prototype.barrierNodeIDs
  33153. * @description 网络分析中障碍点的 ID 数组。结点设置为障碍点之后,表示任何方向都不能通过此结点。
  33154. */
  33155. this.barrierNodeIDs = null;
  33156. /**
  33157. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} TransportationAnalystParameter.prototype.barrierPoints
  33158. * @description 网络分析中 Point2D 类型的障碍点数组。障碍点表示任何方向都不能通过此点。</br>
  33159. * 当各网络分析参数类中的 isAnalyzeById 属性设置为 false 时,该属性才生效。
  33160. */
  33161. this.barrierPoints = null;
  33162. /**
  33163. * @member {string} [TransportationAnalystParameter.prototype.weightFieldName]
  33164. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段,例如表示时间、长度等的字段都可以用作阻力字段。
  33165. * 该字段默值为服务器发布的所有耗费字段的第一个字段。
  33166. */
  33167. this.weightFieldName = null;
  33168. /**
  33169. * @member {string} TransportationAnalystParameter.prototype.turnWeightField
  33170. * @description 转向权重字段的名称。
  33171. */
  33172. this.turnWeightField = null;
  33173. /**
  33174. * @member {TransportationAnalystResultSetting} TransportationAnalystParameter.prototype.resultSetting
  33175. * @description 分析结果返回内容。
  33176. */
  33177. this.resultSetting = new TransportationAnalystResultSetting();
  33178. Util_Util.extend(this, options);
  33179. this.CLASS_NAME = "SuperMap.TransportationAnalystParameter";
  33180. }
  33181. /**
  33182. * @function TransportationAnalystParameter.prototype.destroy
  33183. * @description 释放资源,将引用资源的属性置空。
  33184. */
  33185. TransportationAnalystParameter_createClass(TransportationAnalystParameter, [{
  33186. key: "destroy",
  33187. value: function destroy() {
  33188. var me = this;
  33189. me.barrierEdgeIDs = null;
  33190. me.barrierNodeIDs = null;
  33191. me.weightFieldName = null;
  33192. me.turnWeightField = null;
  33193. if (me.resultSetting) {
  33194. me.resultSetting.destroy();
  33195. me.resultSetting = null;
  33196. }
  33197. if (me.barrierPoints && me.barrierPoints.length) {
  33198. for (var i in me.barrierPoints) {
  33199. me.barrierPoints[i].destroy();
  33200. }
  33201. }
  33202. me.barrierPoints = null;
  33203. }
  33204. }]);
  33205. return TransportationAnalystParameter;
  33206. }();
  33207. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixParameters.js
  33208. function ComputeWeightMatrixParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33209. 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); } }
  33210. 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; }
  33211. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33212. * This program are made available under the terms of the Apache License, Version 2.0
  33213. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33214. /**
  33215. * @class ComputeWeightMatrixParameters
  33216. * @deprecatedclass SuperMap.ComputeWeightMatrixParameters
  33217. * @category iServer NetworkAnalyst WeightMatrix
  33218. * @classdesc 耗费矩阵分析参数类。根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  33219. * @param {Object} options - 参数。
  33220. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  33221. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.nodes - 要计算耗费矩阵的点数组。
  33222. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  33223. * @usage
  33224. */
  33225. var ComputeWeightMatrixParameters = /*#__PURE__*/function () {
  33226. function ComputeWeightMatrixParameters(options) {
  33227. ComputeWeightMatrixParameters_classCallCheck(this, ComputeWeightMatrixParameters);
  33228. /**
  33229. * @member {boolean} [ComputeWeightMatrixParameters.prototype.isAnalyzeById=false]
  33230. * @description 是否通过节点 ID 指定路径分析的结点,即通过坐标点指定。
  33231. */
  33232. this.isAnalyzeById = false;
  33233. /**
  33234. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} ComputeWeightMatrixParameters.prototype.nodes
  33235. * @description 要计算耗费矩阵的点数组。
  33236. * 当 {@link ComputeWeightMatrixParameters.isAnalyzeById} = false 时,nodes 应为点的坐标数组;
  33237. * 当 {@link ComputeWeightMatrixParameters.isAnalyzeById} = true 时,nodes 应为点的 ID 数组。
  33238. */
  33239. this.nodes = null;
  33240. /**
  33241. * @member {TransportationAnalystParameter} ComputeWeightMatrixParameters.prototype.parameter
  33242. * @description 交通网络分析通用参数。
  33243. */
  33244. this.parameter = new TransportationAnalystParameter();
  33245. Util_Util.extend(this, options);
  33246. this.CLASS_NAME = "SuperMap.ComputeWeightMatrixParameters";
  33247. }
  33248. /**
  33249. * @function ComputeWeightMatrixParameters.prototype.destroy
  33250. * @description 释放资源,将引用资源的属性置空。
  33251. */
  33252. ComputeWeightMatrixParameters_createClass(ComputeWeightMatrixParameters, [{
  33253. key: "destroy",
  33254. value: function destroy() {
  33255. var me = this;
  33256. me.isAnalyzeById = null;
  33257. me.nodes = null;
  33258. if (me.parameter) {
  33259. me.parameter.destroy();
  33260. me.parameter = null;
  33261. }
  33262. }
  33263. }]);
  33264. return ComputeWeightMatrixParameters;
  33265. }();
  33266. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixService.js
  33267. 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); }
  33268. function ComputeWeightMatrixService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33269. 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); } }
  33270. 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; }
  33271. 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); }
  33272. function ComputeWeightMatrixService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ComputeWeightMatrixService_getPrototypeOf(object); if (object === null) break; } return object; }
  33273. 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); }
  33274. 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); }
  33275. 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); }; }
  33276. 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); }
  33277. function ComputeWeightMatrixService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33278. 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; } }
  33279. function ComputeWeightMatrixService_getPrototypeOf(o) { ComputeWeightMatrixService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ComputeWeightMatrixService_getPrototypeOf(o); }
  33280. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33281. * This program are made available under the terms of the Apache License, Version 2.0
  33282. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33283. /**
  33284. * @class ComputeWeightMatrixService
  33285. * @deprecatedclass SuperMap.ComputeWeightMatrixService
  33286. * @category iServer NetworkAnalyst WeightMatrix
  33287. * @classdesc 耗费矩阵分析服务类。
  33288. * 耗费矩阵是根据交通网络分析参数中的耗费字段来计算一个二维数组,
  33289. * 用来存储指定的任意两点间的资源消耗。
  33290. * 耗费矩阵分析结果通过该类支持的事件的监听函数参数获取
  33291. * @extends {NetworkAnalystServiceBase}
  33292. * @example
  33293. * var mycomputeWeightMatrixService = new ComputeWeightMatrixService(url,{
  33294. * eventListeners: {
  33295. * "processCompleted": computeWeightMatrixCompleted,
  33296. * "processFailed": computeWeightMatrixnError
  33297. * }
  33298. * });
  33299. * @param {string} url - 耗费矩阵分析服务地址。请求服务的URL应为:
  33300. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  33301. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  33302. * @param {Object} options - 参数。
  33303. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33304. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33305. * @param {Object} [options.headers] - 请求头。
  33306. * @usage
  33307. */
  33308. var ComputeWeightMatrixService = /*#__PURE__*/function (_NetworkAnalystServic) {
  33309. ComputeWeightMatrixService_inherits(ComputeWeightMatrixService, _NetworkAnalystServic);
  33310. var _super = ComputeWeightMatrixService_createSuper(ComputeWeightMatrixService);
  33311. function ComputeWeightMatrixService(url, options) {
  33312. var _this;
  33313. ComputeWeightMatrixService_classCallCheck(this, ComputeWeightMatrixService);
  33314. _this = _super.call(this, url, options);
  33315. _this.CLASS_NAME = "SuperMap.ComputeWeightMatrixService";
  33316. return _this;
  33317. }
  33318. /**
  33319. * @function ComputeWeightMatrixService.prototype.destroy
  33320. * @override
  33321. */
  33322. ComputeWeightMatrixService_createClass(ComputeWeightMatrixService, [{
  33323. key: "destroy",
  33324. value: function destroy() {
  33325. ComputeWeightMatrixService_get(ComputeWeightMatrixService_getPrototypeOf(ComputeWeightMatrixService.prototype), "destroy", this).call(this);
  33326. }
  33327. /**
  33328. * @function ComputeWeightMatrixService.prototype.processAsync
  33329. * @description 负责将客户端的查询参数传递到服务端。
  33330. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析参数类
  33331. */
  33332. }, {
  33333. key: "processAsync",
  33334. value: function processAsync(params) {
  33335. if (!(params instanceof ComputeWeightMatrixParameters)) {
  33336. return;
  33337. }
  33338. var me = this,
  33339. jsonObject;
  33340. me.url = Util_Util.urlPathAppend(me.url, 'weightmatrix');
  33341. jsonObject = {
  33342. parameter: Util_Util.toJSON(params.parameter),
  33343. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  33344. };
  33345. me.request({
  33346. method: "GET",
  33347. params: jsonObject,
  33348. scope: me,
  33349. success: me.serviceProcessCompleted,
  33350. failure: me.serviceProcessFailed
  33351. });
  33352. }
  33353. /**
  33354. * @function ComputeWeightMatrixService.prototype.getJson
  33355. * @description 将对象转化为JSON字符串。
  33356. * @param {boolean} isAnalyzeById - 是否通过id分析
  33357. * @param {Array.<ComputeWeightMatrixParameters>} params - 分析参数数组
  33358. * @returns {string} 转化后的JSON字符串。
  33359. */
  33360. }, {
  33361. key: "getJson",
  33362. value: function getJson(isAnalyzeById, params) {
  33363. var jsonString = "[",
  33364. len = params ? params.length : 0;
  33365. if (isAnalyzeById === false) {
  33366. for (var i = 0; i < len; i++) {
  33367. if (i > 0) {
  33368. jsonString += ",";
  33369. }
  33370. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  33371. }
  33372. } else if (isAnalyzeById === true) {
  33373. for (var _i2 = 0; _i2 < len; _i2++) {
  33374. if (_i2 > 0) {
  33375. jsonString += ",";
  33376. }
  33377. jsonString += params[_i2];
  33378. }
  33379. }
  33380. jsonString += ']';
  33381. return jsonString;
  33382. }
  33383. }]);
  33384. return ComputeWeightMatrixService;
  33385. }(NetworkAnalystServiceBase);
  33386. ;// CONCATENATED MODULE: ./src/common/iServer/DataFlowService.js
  33387. 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); }
  33388. function DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33389. 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); } }
  33390. 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; }
  33391. 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); }
  33392. 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); }
  33393. 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); }; }
  33394. 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); }
  33395. function DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33396. 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; } }
  33397. function DataFlowService_getPrototypeOf(o) { DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlowService_getPrototypeOf(o); }
  33398. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33399. * This program are made available under the terms of the Apache License, Version 2.0
  33400. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33401. /**
  33402. * @class DataFlowService
  33403. * @deprecatedclass SuperMap.DataFlowService
  33404. * @category iServer DataFlow
  33405. * @classdesc 数据流服务类。
  33406. * @extends {CommonServiceBase}
  33407. * @param {string} url - 数据流服务地址。
  33408. * @param {Object} options - 参数。
  33409. * @param {function} options.style - 设置数据加载样式。
  33410. * @param {function} [options.onEachFeature] - 设置每个数据加载popup等。
  33411. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  33412. * @param {Object} [options.excludeField] - 排除字段。
  33413. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33414. * @param {Object} [options.headers] - 请求头。
  33415. * @usage
  33416. */
  33417. var DataFlowService = /*#__PURE__*/function (_CommonServiceBase) {
  33418. DataFlowService_inherits(DataFlowService, _CommonServiceBase);
  33419. var _super = DataFlowService_createSuper(DataFlowService);
  33420. function DataFlowService(url, options) {
  33421. var _this;
  33422. DataFlowService_classCallCheck(this, DataFlowService);
  33423. options = options || {};
  33424. /*
  33425. * @constant EVENT_TYPES
  33426. * {Array.<string>}
  33427. * 此类支持的事件类型
  33428. */
  33429. options.EVENT_TYPES = ["broadcastSocketConnected", "broadcastSocketClosed", "broadcastSocketError", "broadcastFailed", "broadcastSucceeded", "subscribeSocketConnected", "subscribeSocketClosed", "subscribeSocketError", "messageSucceeded", "setFilterParamSucceeded"];
  33430. _this = _super.call(this, url, options);
  33431. /**
  33432. * @member {GeoJSONObject} DataFlowService.prototype.geometry
  33433. * @description 指定几何范围,该范围内的要素才能被订阅。
  33434. */
  33435. _this.geometry = null;
  33436. /**
  33437. * @member {Object} DataFlowService.prototype.prjCoordSys
  33438. * @description 动态投影参数。
  33439. */
  33440. _this.prjCoordSys = null;
  33441. /**
  33442. * @member {Object} DataFlowService.prototype.excludeField
  33443. * @description 排除字段。
  33444. */
  33445. _this.excludeField = null;
  33446. Util_Util.extend(DataFlowService_assertThisInitialized(_this), options);
  33447. _this.CLASS_NAME = "SuperMap.DataFlowService";
  33448. return _this;
  33449. }
  33450. /**
  33451. * @function DataFlowService.prototype.initBroadcast
  33452. * @description 初始化广播。
  33453. * @returns {DataFlowService}
  33454. */
  33455. DataFlowService_createClass(DataFlowService, [{
  33456. key: "initBroadcast",
  33457. value: function initBroadcast() {
  33458. var me = this;
  33459. this.broadcastWebSocket = this._connect(Util_Util.urlPathAppend(me.url, 'broadcast'));
  33460. this.broadcastWebSocket.onopen = function (e) {
  33461. me.broadcastWebSocket.isOpen = true;
  33462. e.eventType = 'broadcastSocketConnected';
  33463. me.events.triggerEvent('broadcastSocketConnected', e);
  33464. };
  33465. this.broadcastWebSocket.onclose = function (e) {
  33466. if (me.broadcastWebSocket) {
  33467. me.broadcastWebSocket.isOpen = false;
  33468. }
  33469. e.eventType = 'broadcastSocketClosed';
  33470. me.events.triggerEvent('broadcastSocketClosed', e);
  33471. };
  33472. this.broadcastWebSocket.onerror = function (e) {
  33473. e.eventType = 'broadcastSocketError';
  33474. me.events.triggerEvent('broadcastSocketError', e);
  33475. };
  33476. return this;
  33477. }
  33478. /**
  33479. * @function DataFlowService.prototype.broadcast
  33480. * @description 加载广播数据。
  33481. * @param {GeoJSONObject} geoJSONFeature - JSON 格式的要素数据。
  33482. */
  33483. }, {
  33484. key: "broadcast",
  33485. value: function broadcast(geoJSONFeature) {
  33486. if (!this.broadcastWebSocket || !this.broadcastWebSocket.isOpen) {
  33487. this.events.triggerEvent('broadcastFailed');
  33488. return;
  33489. }
  33490. this.broadcastWebSocket.send(JSON.stringify(geoJSONFeature));
  33491. this.events.triggerEvent('broadcastSucceeded');
  33492. }
  33493. /**
  33494. * @function DataFlowService.prototype.initSubscribe
  33495. * @description 初始化订阅数据。
  33496. * @returns {DataFlowService} DataFlowService的实例对象。
  33497. */
  33498. }, {
  33499. key: "initSubscribe",
  33500. value: function initSubscribe() {
  33501. var me = this;
  33502. this.subscribeWebSocket = this._connect(Util_Util.urlPathAppend(me.url, 'subscribe'));
  33503. this.subscribeWebSocket.onopen = function (e) {
  33504. me.subscribeWebSocket.send(me._getFilterParams());
  33505. e.eventType = 'subscribeSocketConnected';
  33506. me.events.triggerEvent('subscribeSocketConnected', e);
  33507. };
  33508. this.subscribeWebSocket.onclose = function (e) {
  33509. e.eventType = 'subscribeWebSocketClosed';
  33510. me.events.triggerEvent('subscribeWebSocketClosed', e);
  33511. };
  33512. this.subscribeWebSocket.onerror = function (e) {
  33513. e.eventType = 'subscribeSocketError';
  33514. me.events.triggerEvent('subscribeSocketError', e);
  33515. };
  33516. this.subscribeWebSocket.onmessage = function (e) {
  33517. me._onMessage(e);
  33518. };
  33519. return this;
  33520. }
  33521. /**
  33522. * @function DataFlowService.prototype.setExcludeField
  33523. * @description 设置排除字段。
  33524. * @param {Object} excludeField - 排除字段。
  33525. * @returns {DataFlowService} DataFlowService的实例对象。
  33526. */
  33527. }, {
  33528. key: "setExcludeField",
  33529. value: function setExcludeField(excludeField) {
  33530. this.excludeField = excludeField;
  33531. this.subscribeWebSocket.send(this._getFilterParams());
  33532. return this;
  33533. }
  33534. /**
  33535. * @function DataFlowService.prototype.setGeometry
  33536. * @description 设置添加的几何要素数据。
  33537. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  33538. * @returns {DataFlowService} DataFlowService的实例对象。
  33539. */
  33540. }, {
  33541. key: "setGeometry",
  33542. value: function setGeometry(geometry) {
  33543. this.geometry = geometry;
  33544. this.subscribeWebSocket.send(this._getFilterParams());
  33545. return this;
  33546. }
  33547. /**
  33548. * @function DataFlowService.prototype.unSubscribe
  33549. * @description 结束订阅数据。
  33550. */
  33551. }, {
  33552. key: "unSubscribe",
  33553. value: function unSubscribe() {
  33554. if (!this.subscribeWebSocket) {
  33555. return;
  33556. }
  33557. this.subscribeWebSocket.close();
  33558. this.subscribeWebSocket = null;
  33559. }
  33560. /**
  33561. * @function DataFlowService.prototype.unBroadcast
  33562. * @description 结束加载广播。
  33563. */
  33564. }, {
  33565. key: "unBroadcast",
  33566. value: function unBroadcast() {
  33567. if (!this.broadcastWebSocket) {
  33568. return;
  33569. }
  33570. this.broadcastWebSocket.close();
  33571. this.broadcastWebSocket = null;
  33572. }
  33573. /**
  33574. * @function DataFlowService.prototype.destroy
  33575. * @override
  33576. */
  33577. }, {
  33578. key: "destroy",
  33579. value: function destroy() {
  33580. CommonServiceBase.prototype.destroy.apply(this, arguments);
  33581. var me = this;
  33582. me.geometry = null;
  33583. me.prjCoordSys = null;
  33584. me.excludeField = null;
  33585. this.unBroadcast();
  33586. this.unSubscribe();
  33587. }
  33588. }, {
  33589. key: "_getFilterParams",
  33590. value: function _getFilterParams() {
  33591. var filter = {
  33592. filterParam: {
  33593. prjCoordSys: this.prjCoordSys,
  33594. excludeField: this.excludeField,
  33595. geometry: this.geometry
  33596. }
  33597. };
  33598. return Util_Util.toJSON(filter);
  33599. }
  33600. }, {
  33601. key: "_onMessage",
  33602. value: function _onMessage(e) {
  33603. if (e.data && e.data.indexOf("filterParam") >= 0) {
  33604. var filterParam = JSON.parse(e.data);
  33605. e.filterParam = filterParam;
  33606. e.eventType = 'setFilterParamSucceeded';
  33607. this.events.triggerEvent('setFilterParamSucceeded', e);
  33608. return;
  33609. }
  33610. var feature = JSON.parse(e.data);
  33611. e.featureResult = feature;
  33612. e.eventType = 'messageSucceeded';
  33613. this.events.triggerEvent('messageSucceeded', e);
  33614. }
  33615. }, {
  33616. key: "_connect",
  33617. value: function _connect(url) {
  33618. url = SecurityManager.appendCredential(url);
  33619. if ("WebSocket" in window) {
  33620. return new WebSocket(url);
  33621. } else if ("MozWebSocket" in window) {
  33622. var mozWebSocket = window.MozWebSocket;
  33623. return new mozWebSocket(url);
  33624. } else {
  33625. console.log("no WebSocket");
  33626. return null;
  33627. }
  33628. }
  33629. }]);
  33630. return DataFlowService;
  33631. }(CommonServiceBase);
  33632. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetInfo.js
  33633. function DatasetInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33634. 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); } }
  33635. 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; }
  33636. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33637. * This program are made available under the terms of the Apache License, Version 2.0
  33638. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33639. /**
  33640. * @class DatasetInfo
  33641. * @deprecatedclass SuperMap.DatasetInfo
  33642. * @category iServer Data Dataset
  33643. * @classdesc 数据集信息类。
  33644. * 数据集一般为存储在一起的相关数据的集合;根据数据类型的不同,分为矢量数据集、栅格数据集(griddataset)和
  33645. * 影像数据集(image dataset),以及为了处理特定问题而设计的数据集,如拓扑数据集,网络数据集等。
  33646. * 数据集是 GIS 数据组织的最小单位。其中矢量数据集是由同种类型空间要素组成的集合,
  33647. * 所以也可以称为要素集。根据要素的空间特征的不同,矢量数据集又分为点数据集,
  33648. * 线数据集,面数据集等,各矢量数据集是空间特征和性质相同的数据组织起来的集合。
  33649. * 目前版本支持的数据集主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、
  33650. * 网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  33651. * @param {Object} options - 参数。
  33652. * @param {Bounds} [options.bounds] - 数据集范围。
  33653. * @param {string} [options.dataSourceName] - 数据源名称。
  33654. * @param {string} [options.description] - 数据集的描述信息。
  33655. * @param {string} [options.encodeType] - 数据集存储时的压缩编码方式。
  33656. * @param {boolean} [options.isReadOnly] - 数据集是否为只读。
  33657. * @param {string} options.name - 数据集名称。
  33658. * @param {Object} [options.prjCoordSys] - 数据集的投影信息。如:prjCoordSys={"epsgCode":3857}。
  33659. * @param {string} [options.tableName] - 表名。
  33660. * @param {string} options.type - 数据集类型。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  33661. * @usage
  33662. */
  33663. var DatasetInfo = /*#__PURE__*/function () {
  33664. function DatasetInfo(options) {
  33665. DatasetInfo_classCallCheck(this, DatasetInfo);
  33666. options = options || {};
  33667. /**
  33668. * @member {Bounds} [DatasetInfo.prototype.bounds]
  33669. * @description 数据集范围,该字段只读。
  33670. */
  33671. this.bounds = null;
  33672. /**
  33673. * @member {string} [DatasetInfo.prototype.dataSourceName]
  33674. * @description 数据源名称,该字段只读。
  33675. */
  33676. this.dataSourceName = null;
  33677. /**
  33678. * @member {string} [DatasetInfo.prototype.description]
  33679. * @description 数据集的描述信息。
  33680. */
  33681. this.description = null;
  33682. /**
  33683. * @member {string} [DatasetInfo.prototype.encodeType]
  33684. * @description 数据集存储时的压缩编码方式,该字段只读。
  33685. */
  33686. this.encodeType = null;
  33687. /**
  33688. * @member {boolean} [DatasetInfo.prototype.isReadOnly]
  33689. * @description 数据集是否为只读。
  33690. */
  33691. this.isReadOnly = null;
  33692. /**
  33693. * @member {string} DatasetInfo.prototype.name
  33694. * @description 数据集名称,该字段必须且只读。
  33695. */
  33696. this.name = null;
  33697. /**
  33698. * @member {Object} [DatasetInfo.prototype.prjCoordSys]
  33699. * @description 数据集的投影信息。
  33700. */
  33701. this.prjCoordSys = null;
  33702. /**
  33703. * @member {string} [DatasetInfo.prototype.tableName]
  33704. * @description 表名,该字段只读。
  33705. */
  33706. this.tableName = null;
  33707. /**
  33708. * @member {string} DatasetInfo.prototype.type
  33709. * @description 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  33710. */
  33711. this.type = null;
  33712. Util_Util.extend(this, options);
  33713. var b = this.bounds;
  33714. if (b) {
  33715. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  33716. }
  33717. this.CLASS_NAME = "SuperMap.DatasetInfo";
  33718. }
  33719. /**
  33720. * @function DatasetInfo.prototype.destroy
  33721. * @description 释放资源,将引用资源的属性置空。
  33722. */
  33723. DatasetInfo_createClass(DatasetInfo, [{
  33724. key: "destroy",
  33725. value: function destroy() {
  33726. Util_Util.reset(this);
  33727. }
  33728. /**
  33729. * @function DatasetInfo.prototype.toServerJSONObject
  33730. * @description 转换成对应的 JSON 格式对象。
  33731. * @returns {Object} JSON 对象。
  33732. */
  33733. }, {
  33734. key: "toServerJSONObject",
  33735. value: function toServerJSONObject() {
  33736. var dataObj = {};
  33737. dataObj = Util_Util.copyAttributes(dataObj, this);
  33738. if (dataObj.bounds) {
  33739. if (dataObj.bounds.toServerJSONObject) {
  33740. dataObj.bounds = dataObj.bounds.toServerJSONObject();
  33741. }
  33742. }
  33743. return dataObj;
  33744. }
  33745. }]);
  33746. return DatasetInfo;
  33747. }();
  33748. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystParameters.js
  33749. function OverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33750. 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); } }
  33751. 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; }
  33752. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33753. * This program are made available under the terms of the Apache License, Version 2.0
  33754. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33755. /**
  33756. * @class OverlayAnalystParameters
  33757. * @deprecatedclass SuperMap.OverlayAnalystParameters
  33758. * @category iServer SpatialAnalyst OverlayAnalyst
  33759. * @classdesc 叠加分析参数基类。数据集叠加分析参数和几何对象叠加分析参数均继承此基类。
  33760. * @param {Object} options - 参数。
  33761. * @usage
  33762. */
  33763. var OverlayAnalystParameters = /*#__PURE__*/function () {
  33764. function OverlayAnalystParameters(options) {
  33765. OverlayAnalystParameters_classCallCheck(this, OverlayAnalystParameters);
  33766. /**
  33767. * @member {OverlayOperationType} [OverlayAnalystParameters.prototype.operation=OverlayOperationType.UNION]
  33768. * @description 指定叠加分析操作类型。
  33769. */
  33770. this.operation = OverlayOperationType.UNION;
  33771. if (options) {
  33772. Util_Util.extend(this, options);
  33773. }
  33774. this.CLASS_NAME = "SuperMap.OverlayAnalystParameters";
  33775. }
  33776. /**
  33777. * @function OverlayAnalystParameters.prototype.destroy
  33778. * @description 释放资源,将引用资源的属性置空。
  33779. */
  33780. OverlayAnalystParameters_createClass(OverlayAnalystParameters, [{
  33781. key: "destroy",
  33782. value: function destroy() {
  33783. var me = this;
  33784. me.operation = null;
  33785. }
  33786. }]);
  33787. return OverlayAnalystParameters;
  33788. }();
  33789. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetOverlayAnalystParameters.js
  33790. 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); }
  33791. function DatasetOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33792. 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); } }
  33793. 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; }
  33794. 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); }
  33795. function DatasetOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  33796. 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); }
  33797. 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); }
  33798. 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); }; }
  33799. 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); }
  33800. function DatasetOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33801. 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; } }
  33802. function DatasetOverlayAnalystParameters_getPrototypeOf(o) { DatasetOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetOverlayAnalystParameters_getPrototypeOf(o); }
  33803. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33804. * This program are made available under the terms of the Apache License, Version 2.0
  33805. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33806. /**
  33807. * @class DatasetOverlayAnalystParameters
  33808. * @deprecatedclass SuperMap.DatasetOverlayAnalystParameters
  33809. * @category iServer SpatialAnalyst OverlayAnalyst
  33810. * @classdesc 数据集叠加分析参数类。
  33811. * @param {Object} options - 参数。
  33812. * @param {string} options.operateDataset -数据集名称。
  33813. * @param {string} options.sourceDataset - 源数据集名称。
  33814. * @param {Array.<string>} [options.operateDatasetFields] - 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  33815. * @param {FilterParameter} [options.operateDatasetFilter] - 设置操作数据集中空间对象过滤条件。
  33816. * @param {Array.<GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject>} [options.operateRegions] - 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  33817. * @param {Array.<string>} [options.sourceDatasetFields] - 叠加分析中源数据集保留在结果数据集中的字段名列表。
  33818. * @param {FilterParameter} [options.sourceDatasetFilter] - 设置源数据集中空间对象过滤条件。
  33819. * @param {number} [options.tolerance=0] - 容限。
  33820. * @param {OverlayOperationType} options.operation - 叠加操作枚举值。
  33821. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  33822. * @extends {GetFeaturesParametersBase}
  33823. * @usage
  33824. */
  33825. var DatasetOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  33826. DatasetOverlayAnalystParameters_inherits(DatasetOverlayAnalystParameters, _OverlayAnalystParame);
  33827. var _super = DatasetOverlayAnalystParameters_createSuper(DatasetOverlayAnalystParameters);
  33828. function DatasetOverlayAnalystParameters(options) {
  33829. var _this;
  33830. DatasetOverlayAnalystParameters_classCallCheck(this, DatasetOverlayAnalystParameters);
  33831. _this = _super.call(this, options);
  33832. /**
  33833. * @member {string} DatasetOverlayAnalystParameters.prototype.operateDataset
  33834. * @description 叠加分析中操作数据集的名称。
  33835. */
  33836. _this.operateDataset = null;
  33837. /**
  33838. * @member {Array.<string>} [DatasetOverlayAnalystParameters.prototype.operateDatasetFields]
  33839. * @description 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  33840. */
  33841. _this.operateDatasetFields = [];
  33842. /**
  33843. * @member {FilterParameter} DatasetOverlayAnalystParameters.prototype.operateDatasetFilter
  33844. * @description 设置操作数据集中空间对象过滤条件。
  33845. */
  33846. _this.operateDatasetFilter = new FilterParameter();
  33847. /**
  33848. * @member {Array.<GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject>} [DatasetOverlayAnalystParameters.prototype.operateRegions]
  33849. * @description 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  33850. */
  33851. _this.operateRegions = [];
  33852. /**
  33853. * @member {string} DatasetOverlayAnalystParameters.prototype.sourceDataset
  33854. * @description 叠加分析中源数据集的名称。
  33855. */
  33856. _this.sourceDataset = null;
  33857. /**
  33858. * @member {Array.<string>} [DatasetOverlayAnalystParameters.prototype.sourceDatasetFields]
  33859. * @description 叠加分析中源数据集保留在结果数据集中的字段名列表。
  33860. */
  33861. _this.sourceDatasetFields = [];
  33862. /**
  33863. * @member {FilterParameter} [DatasetOverlayAnalystParameters.prototype.filterQueryParameter]
  33864. * @description 设置源数据集中空间对象过滤条件。
  33865. */
  33866. _this.sourceDatasetFilter = new FilterParameter();
  33867. /**
  33868. * @member {number} [DatasetOverlayAnalystParameters.prototype.tolerance=0]
  33869. * @description 容限。
  33870. */
  33871. _this.tolerance = 0;
  33872. /**
  33873. * @member {DataReturnOption} [DatasetOverlayAnalystParameters.prototype.resultSetting]
  33874. * @description 结果返回设置类。
  33875. */
  33876. _this.resultSetting = new DataReturnOption();
  33877. Util_Util.extend(DatasetOverlayAnalystParameters_assertThisInitialized(_this), options);
  33878. _this.CLASS_NAME = "SuperMap.DatasetOverlayAnalystParameters";
  33879. return _this;
  33880. }
  33881. /**
  33882. * @function DatasetOverlayAnalystParameters.prototype.destroy
  33883. * @override
  33884. */
  33885. DatasetOverlayAnalystParameters_createClass(DatasetOverlayAnalystParameters, [{
  33886. key: "destroy",
  33887. value: function destroy() {
  33888. DatasetOverlayAnalystParameters_get(DatasetOverlayAnalystParameters_getPrototypeOf(DatasetOverlayAnalystParameters.prototype), "destroy", this).call(this);
  33889. var me = this;
  33890. me.operateDataset = null;
  33891. me.operateDatasetFields = null;
  33892. if (me.operateDatasetFilter) {
  33893. me.operateDatasetFilter.destroy();
  33894. me.operateDatasetFilter = null;
  33895. }
  33896. if (me.operateRegions) {
  33897. for (var i = 0, opRegions = me.operateRegions, len = opRegions.length; i < len; i++) {
  33898. opRegions[i].destroy();
  33899. }
  33900. me.operateRegions = null;
  33901. }
  33902. me.sourceDataset = null;
  33903. me.sourceDatasetFields = null;
  33904. if (me.sourceDatasetFilter) {
  33905. me.sourceDatasetFilter.destroy();
  33906. me.sourceDatasetFilter = null;
  33907. }
  33908. me.tolerance = null;
  33909. if (me.resultSetting) {
  33910. me.resultSetting.destroy();
  33911. me.resultSetting = null;
  33912. }
  33913. }
  33914. /**
  33915. * @function DatasetOverlayAnalystParameters.toObject
  33916. * @param {DatasetOverlayAnalystParameters} datasetOverlayAnalystParameters - 数据集叠加分析参数类。
  33917. * @param {DatasetOverlayAnalystParameters} tempObj - 数据集叠加分析参数对象。
  33918. * @description 将数据集叠加分析参数类转换为 JSON 对象。
  33919. * @returns {Object} JSON 对象。
  33920. */
  33921. }], [{
  33922. key: "toObject",
  33923. value: function toObject(datasetOverlayAnalystParameters, tempObj) {
  33924. for (var name in datasetOverlayAnalystParameters) {
  33925. if (name === "sourceDataset") {
  33926. continue;
  33927. } else if (name === "operateRegions") {
  33928. tempObj.operateRegions = [];
  33929. var ors = datasetOverlayAnalystParameters.operateRegions;
  33930. for (var index in ors) {
  33931. if (ors.hasOwnProperty(index)) {
  33932. //icl542
  33933. tempObj.operateRegions[index] = ServerGeometry.fromGeometry(ors[index]);
  33934. }
  33935. }
  33936. } else if (name === "resultSetting") {
  33937. tempObj.dataReturnOption = datasetOverlayAnalystParameters.resultSetting;
  33938. } else {
  33939. tempObj[name] = datasetOverlayAnalystParameters[name];
  33940. }
  33941. }
  33942. }
  33943. }]);
  33944. return DatasetOverlayAnalystParameters;
  33945. }(OverlayAnalystParameters);
  33946. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParametersSetting.js
  33947. function SurfaceAnalystParametersSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33948. 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); } }
  33949. 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; }
  33950. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  33951. * This program are made available under the terms of the Apache License, Version 2.0
  33952. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33953. /**
  33954. * @class SurfaceAnalystParametersSetting
  33955. * @deprecatedclass SuperMap.SurfaceAnalystParametersSetting
  33956. * @category iServer SpatialAnalyst SurfaceAnalyst
  33957. * @classdesc 表面分析参数设置类。
  33958. * 通过该类可以设置表面分析提取等值线、提取等值面的一些参数,包括基准值、等值距、光滑度、光滑方法等。
  33959. * @param {Object} options - 参数。
  33960. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.clipRegion] - 裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  33961. * @param {number} [options.datumValue=0] - 提取等值线、提取等值面的基准值。
  33962. * @param {Array.<number>} options.expectedZValues - 期望分析结果的 Z 值集合。
  33963. * @param {number} [options.interval=0] - 等值距。等值距是两条等值线之间的间隔值。
  33964. * @param {number} [options.resampleTolerance=0] - 重采样容限。
  33965. * @param {SmoothMethod} [options.smoothMethod=SmoothMethod.BSPLINE] - 光滑处理所使用的方法。
  33966. * @param {number} [options.smoothness=0] - 等值线或等值面的边界线的光滑度。
  33967. * @usage
  33968. */
  33969. var SurfaceAnalystParametersSetting = /*#__PURE__*/function () {
  33970. function SurfaceAnalystParametersSetting(options) {
  33971. SurfaceAnalystParametersSetting_classCallCheck(this, SurfaceAnalystParametersSetting);
  33972. /**
  33973. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [SurfaceAnalystParametersSetting.prototype.clipRegion]
  33974. * @description 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  33975. */
  33976. this.clipRegion = null;
  33977. /**
  33978. * @member {number} [SurfaceAnalystParametersSetting.prototype.datumValue=0]
  33979. * @description 获取或设置表面分析中提取等值线、提取等值面的基准值。
  33980. * 基准值是作为一个生成等值线的初始起算值,并不一定是最小等值线的值。例如,高程范围为 220 -1550 的 DEM 栅格数据,
  33981. * 如果设基准值为 0,等值距为 50,则提取等值线时,以基准值 0 为起点,等值距 50 为间隔提取等值线,
  33982. * 因为给定高程的最小值是 220,所以,在给定范围内提取等值线的最小高程是 250。
  33983. * 提取等值线的结果是:最小等值线值为 250,最大等值线值为 1550。
  33984. */
  33985. this.datumValue = 0;
  33986. /**
  33987. * @member {Array.<number>} SurfaceAnalystParametersSetting.prototype.expectedZValues
  33988. * @description 获取或设置期望分析结果的 Z 值集合。
  33989. * Z 值集合存储一系列数值,该数值为待提取等值线的值。即仅高程值在 Z 值集合中的等值线会被提取。
  33990. */
  33991. this.expectedZValues = null;
  33992. /**
  33993. * @member {number} [SurfaceAnalystParametersSetting.prototype.interval=0]
  33994. * @description 获取或设置等值距。等值距是两条等值线之间的间隔值。
  33995. */
  33996. this.interval = 0;
  33997. /**
  33998. * @member {number} [SurfaceAnalystParametersSetting.prototype.resampleTolerance=0]
  33999. * @description 获取或设置重采样容限。
  34000. * 容限值越大,采样结果数据越简化。当分析结果出现交叉时,可通过调整重采样容限为较小的值来处理。
  34001. */
  34002. this.resampleTolerance = 0;
  34003. /**
  34004. * @member {SmoothMethod} [SurfaceAnalystParametersSetting.prototype.smoothMethod=SmoothMethod.BSPLINE]
  34005. * @description 获取或设置光滑处理所使用的方法。
  34006. */
  34007. this.smoothMethod = SmoothMethod.BSPLINE;
  34008. /**
  34009. * @member {number} [SurfaceAnalystParametersSetting.prototype.smoothness=0]
  34010. * @description 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  34011. * 以为 0-5 为例,光滑度为 0 表示不进行光滑操作,值越大表示光滑度越高。
  34012. * 随着光滑度的增加,提取的等值线越光滑,当然光滑度越大,
  34013. * 计算所需的时间和占用的内存也就越大。而且,当等值距较小时,
  34014. * 光滑度太高会出现等值线相交的问题。
  34015. */
  34016. this.smoothness = 0;
  34017. if (options) {
  34018. Util_Util.extend(this, options);
  34019. }
  34020. this.CLASS_NAME = "SuperMap.SurfaceAnalystParametersSetting";
  34021. }
  34022. /**
  34023. * @function SurfaceAnalystParametersSetting.prototype.destroy
  34024. * @description 释放资源,将引用资源的属性置空。
  34025. */
  34026. SurfaceAnalystParametersSetting_createClass(SurfaceAnalystParametersSetting, [{
  34027. key: "destroy",
  34028. value: function destroy() {
  34029. var me = this;
  34030. if (me.clipRegion) {
  34031. me.clipRegion.destroy();
  34032. me.clipRegion = null;
  34033. }
  34034. me.datumValue = null;
  34035. me.expectedZValues = null;
  34036. me.interval = null;
  34037. me.resampleTolerance = null;
  34038. me.smoothMethod = null;
  34039. me.smoothness = null;
  34040. }
  34041. /**
  34042. * @function SurfaceAnalystParametersSetting.prototype.toJSON
  34043. * @description 将对象转化为 JSON 字符串。
  34044. * @returns {string} 对象 JSON 字符串。
  34045. */
  34046. }, {
  34047. key: "toJSON",
  34048. value: function toJSON() {
  34049. var json = "'datumValue':" + Util_Util.toJSON(this.datumValue);
  34050. json += ",'interval':" + Util_Util.toJSON(this.interval);
  34051. json += ",'resampleTolerance':" + Util_Util.toJSON(this.resampleTolerance);
  34052. json += ",'smoothMethod':" + Util_Util.toJSON(this.smoothMethod);
  34053. json += ",'smoothness':" + Util_Util.toJSON(this.smoothness);
  34054. if (this.expectedZValues != null) {
  34055. json += "," + "'expectedZValues':" + Util_Util.toJSON(this.expectedZValues);
  34056. }
  34057. if (this.clipRegion != null) {
  34058. var serverGeometry = this.clipRegion;
  34059. if (this.clipRegion instanceof Geometry_Geometry && this.clipRegion.components) {
  34060. serverGeometry = ServerGeometry.fromGeometry(this.clipRegion);
  34061. }
  34062. json += ",'clipRegion':" + Util_Util.toJSON(serverGeometry);
  34063. }
  34064. return "{" + json + "}";
  34065. }
  34066. }]);
  34067. return SurfaceAnalystParametersSetting;
  34068. }();
  34069. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParameters.js
  34070. function SurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34071. 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); } }
  34072. 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; }
  34073. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34074. * This program are made available under the terms of the Apache License, Version 2.0
  34075. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34076. /**
  34077. * @class SurfaceAnalystParameters
  34078. * @deprecatedclass SuperMap.SurfaceAnalystParameters
  34079. * @category iServer SpatialAnalyst SurfaceAnalyst
  34080. * @classdesc 表面分析提取操作参数类。通过该类可以为进行表面分析提供参数信息,包括表面分析的方法提取等值线、提取等值面和中间结果的分辨率,
  34081. * {@link DatasetSurfaceAnalystParameters} 和 {@link GeometrySurfaceAnalystParameters} 继承自该类。
  34082. * @param {Object} options - 参数。
  34083. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。
  34084. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  34085. * @param {DataReturnOption} options.resultSetting - 结果返回设置类。
  34086. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  34087. * @usage
  34088. */
  34089. var SurfaceAnalystParameters = /*#__PURE__*/function () {
  34090. function SurfaceAnalystParameters(options) {
  34091. SurfaceAnalystParameters_classCallCheck(this, SurfaceAnalystParameters);
  34092. /**
  34093. * @member {number} SurfaceAnalystParameters.prototype.resolution
  34094. * @description 获取或设置指定中间结果(栅格数据集)的分辨率。
  34095. */
  34096. this.resolution = 0;
  34097. /**
  34098. * @member {SurfaceAnalystParametersSetting} SurfaceAnalystParameters.prototype.extractParameter
  34099. * @description 获取或设置表面分析参数。
  34100. * 在进行点数据集进行提取等值面分析时,暂时不支持 SurfaceAnalystParametersSetting 类中的 expectedZValues 字段。
  34101. */
  34102. this.extractParameter = new SurfaceAnalystParametersSetting();
  34103. /**
  34104. * @member {DataReturnOption} SurfaceAnalystParameters.prototype.resultSetting
  34105. * @description 结果返回设置类。
  34106. */
  34107. this.resultSetting = new DataReturnOption();
  34108. /**
  34109. * @member {SurfaceAnalystMethod} [SurfaceAnalystParameters.prototype.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE]
  34110. * @description 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  34111. */
  34112. this.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE;
  34113. if (options) {
  34114. Util_Util.extend(this, options);
  34115. }
  34116. this.CLASS_NAME = "SuperMap.SurfaceAnalystParameters";
  34117. }
  34118. /**
  34119. * @function SurfaceAnalystParameters.prototype.destroy
  34120. * @description 释放资源,将引用资源的属性置空。
  34121. */
  34122. SurfaceAnalystParameters_createClass(SurfaceAnalystParameters, [{
  34123. key: "destroy",
  34124. value: function destroy() {
  34125. var me = this;
  34126. me.resolution = null;
  34127. if (me.extractParameter) {
  34128. me.extractParameter.destroy();
  34129. me.extractParameter = null;
  34130. }
  34131. if (me.resultSetting) {
  34132. me.resultSetting.destroy();
  34133. me.resultSetting = null;
  34134. }
  34135. me.surfaceAnalystMethod = null;
  34136. }
  34137. }]);
  34138. return SurfaceAnalystParameters;
  34139. }();
  34140. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetSurfaceAnalystParameters.js
  34141. 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); }
  34142. function DatasetSurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34143. 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); } }
  34144. 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; }
  34145. 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); }
  34146. function DatasetSurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetSurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  34147. 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); }
  34148. 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); }
  34149. 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); }; }
  34150. 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); }
  34151. function DatasetSurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34152. 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; } }
  34153. function DatasetSurfaceAnalystParameters_getPrototypeOf(o) { DatasetSurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetSurfaceAnalystParameters_getPrototypeOf(o); }
  34154. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34155. * This program are made available under the terms of the Apache License, Version 2.0
  34156. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34157. /**
  34158. * @class DatasetSurfaceAnalystParameters
  34159. * @deprecatedclass SuperMap.DatasetSurfaceAnalystParameters
  34160. * @category iServer SpatialAnalyst SurfaceAnalyst
  34161. * @classdesc 数据集表面分析参数类。该类对数据集表面分析所用到的参数进行设置。
  34162. * @param {Object} options - 参数。
  34163. * @param {string} options.dataset - 数据集名称。
  34164. * @param {string} options.zValueFieldName - 字段名称。
  34165. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  34166. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。获取或设置表面分析参数。
  34167. * @param {FilterParameter} [options.filterQueryParameter] - 查询过滤条件参数。
  34168. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  34169. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod=SurfaceAnalystMethod.ISOLINE] - 表面分析的提取方法,提取等值线和提取等值面。
  34170. * @extends {SurfaceAnalystParameters}
  34171. * @usage
  34172. */
  34173. var DatasetSurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  34174. DatasetSurfaceAnalystParameters_inherits(DatasetSurfaceAnalystParameters, _SurfaceAnalystParame);
  34175. var _super = DatasetSurfaceAnalystParameters_createSuper(DatasetSurfaceAnalystParameters);
  34176. function DatasetSurfaceAnalystParameters(options) {
  34177. var _this;
  34178. DatasetSurfaceAnalystParameters_classCallCheck(this, DatasetSurfaceAnalystParameters);
  34179. _this = _super.call(this, options);
  34180. /**
  34181. * @member {string} DatasetSurfaceAnalystParameters.prototype.dataset
  34182. * @description 要用来做数据集表面分析的数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Country@World。
  34183. */
  34184. _this.dataset = null;
  34185. /**
  34186. * @member {FilterParameter} DatasetSurfaceAnalystParameters.prototype.filterQueryParameter
  34187. * @description 获取或设置查询过滤条件参数。
  34188. */
  34189. _this.filterQueryParameter = new FilterParameter();
  34190. /**
  34191. * @member {string} DatasetSurfaceAnalystParameters.prototype.zValueFieldName
  34192. * @description 获取或设置用于提取操作的字段名称。提取等值线时,将使用该字段中的值,对点记录集中的点数据进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  34193. */
  34194. _this.zValueFieldName = null;
  34195. if (options) {
  34196. Util_Util.extend(DatasetSurfaceAnalystParameters_assertThisInitialized(_this), options);
  34197. }
  34198. _this.CLASS_NAME = "SuperMap.DatasetSurfaceAnalystParameters";
  34199. return _this;
  34200. }
  34201. /**
  34202. * @function DatasetSurfaceAnalystParameters.prototype.destroy
  34203. * @override
  34204. */
  34205. DatasetSurfaceAnalystParameters_createClass(DatasetSurfaceAnalystParameters, [{
  34206. key: "destroy",
  34207. value: function destroy() {
  34208. DatasetSurfaceAnalystParameters_get(DatasetSurfaceAnalystParameters_getPrototypeOf(DatasetSurfaceAnalystParameters.prototype), "destroy", this).call(this);
  34209. var me = this;
  34210. me.dataset = null;
  34211. if (me.filterQueryParameter) {
  34212. me.filterQueryParameter.destroy();
  34213. me.filterQueryParameter = null;
  34214. }
  34215. me.zValueFieldName = null;
  34216. }
  34217. /**
  34218. * @function DatasetSurfaceAnalystParameters.toObject
  34219. * @param {DatasetSurfaceAnalystParameters} datasetSurfaceAnalystParameters - 数据集表面分析参数类。
  34220. * @param {DatasetSurfaceAnalystParameters} tempObj - 数据集表面分析参数对象。
  34221. * @description 将数据集表面分析参数对象转换为 JSON 对象。
  34222. * @returns JSON 对象。
  34223. */
  34224. }], [{
  34225. key: "toObject",
  34226. value: function toObject(datasetSurfaceAnalystParameters, tempObj) {
  34227. for (var name in datasetSurfaceAnalystParameters) {
  34228. if (name === "filterQueryParameter") {
  34229. tempObj.filterQueryParameter = datasetSurfaceAnalystParameters.filterQueryParameter;
  34230. }
  34231. if (name === "extractParameter") {
  34232. if (datasetSurfaceAnalystParameters.extractParameter.clipRegion instanceof Geometry_Geometry && datasetSurfaceAnalystParameters.extractParameter.clipRegion.components) {
  34233. datasetSurfaceAnalystParameters.extractParameter.clipRegion = ServerGeometry.fromGeometry(datasetSurfaceAnalystParameters.extractParameter.clipRegion);
  34234. }
  34235. tempObj.extractParameter = datasetSurfaceAnalystParameters.extractParameter;
  34236. } else if (name === "dataset") {
  34237. continue;
  34238. } else if (name === "surfaceAnalystMethod") {
  34239. continue;
  34240. } else {
  34241. tempObj[name] = datasetSurfaceAnalystParameters[name];
  34242. }
  34243. }
  34244. }
  34245. }]);
  34246. return DatasetSurfaceAnalystParameters;
  34247. }(SurfaceAnalystParameters);
  34248. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystParameters.js
  34249. function ThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34250. 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); } }
  34251. 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; }
  34252. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34253. * This program are made available under the terms of the Apache License, Version 2.0
  34254. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34255. /**
  34256. * @class ThiessenAnalystParameters
  34257. * @deprecatedclass SuperMap.ThiessenAnalystParameters
  34258. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  34259. * @classdesc 泰森多边形分析参数基类。
  34260. * @param {Object} options - 可选参数。
  34261. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.clipRegion] - 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  34262. * @param {boolean} [options.createResultDataset=false] - 是否返回结果数据集。
  34263. * @param {string} [options.resultDatasetName] - 指定结果数据集名称。
  34264. * @param {string} [options.resultDatasourceName] - 指定结果数据集所在数据源,默认为当前数据源。
  34265. * @param {boolean} [options.returnResultRegion=true] - 是否返回分析得到的多边形面数组。
  34266. * @usage
  34267. */
  34268. var ThiessenAnalystParameters = /*#__PURE__*/function () {
  34269. function ThiessenAnalystParameters(options) {
  34270. ThiessenAnalystParameters_classCallCheck(this, ThiessenAnalystParameters);
  34271. if (!options) {
  34272. return;
  34273. }
  34274. /**
  34275. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [ThiessenAnalystParameters.prototype.clipRegion]
  34276. * @description 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  34277. */
  34278. this.clipRegion = null;
  34279. /**
  34280. * @member {boolean} [ThiessenAnalystParameters.prototype.createResultDataset=false]
  34281. * @description 是否返回结果数据集。如果为 true,则必须设置属性 resultDatasetName 和 resultDatasourceName。
  34282. */
  34283. this.createResultDataset = false;
  34284. /**
  34285. * @member {string} ThiessenAnalystParameters.prototype.resultDatasetName
  34286. * @description 指定结果数据集名称。
  34287. */
  34288. this.resultDatasetName = null;
  34289. /**
  34290. * @member {string} ThiessenAnalystParameters.prototype.resultDatasourceName
  34291. * @description 指定结果数据集所在数据源。
  34292. */
  34293. this.resultDatasourceName = null;
  34294. /**
  34295. * @member {boolean} ThiessenAnalystParameters.prototype.returnResultRegion
  34296. * @description 是否返回分析得到的多边形面数组。
  34297. */
  34298. this.returnResultRegion = true;
  34299. Util_Util.extend(this, options);
  34300. this.CLASS_NAME = "SuperMap.ThiessenAnalystParameters";
  34301. }
  34302. /**
  34303. * @function ThiessenAnalystParameters.prototype.destroy
  34304. * @description 释放资源,将引用资源的属性置空。
  34305. */
  34306. ThiessenAnalystParameters_createClass(ThiessenAnalystParameters, [{
  34307. key: "destroy",
  34308. value: function destroy() {
  34309. var me = this;
  34310. if (me.clipRegion) {
  34311. me.clipRegion.destroy();
  34312. me.clipRegion = null;
  34313. }
  34314. me.createResultDataset = null;
  34315. me.resultDatasetName = null;
  34316. me.resultDatasourceName = null;
  34317. me.returnResultRegion = null;
  34318. }
  34319. }]);
  34320. return ThiessenAnalystParameters;
  34321. }();
  34322. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetThiessenAnalystParameters.js
  34323. 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); }
  34324. function DatasetThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34325. 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); } }
  34326. 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; }
  34327. 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); }
  34328. function DatasetThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  34329. 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); }
  34330. 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); }
  34331. 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); }; }
  34332. 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); }
  34333. function DatasetThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34334. 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; } }
  34335. function DatasetThiessenAnalystParameters_getPrototypeOf(o) { DatasetThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetThiessenAnalystParameters_getPrototypeOf(o); }
  34336. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34337. * This program are made available under the terms of the Apache License, Version 2.0
  34338. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34339. /**
  34340. * @class DatasetThiessenAnalystParameters
  34341. * @deprecatedclass SuperMap.DatasetThiessenAnalystParameters
  34342. * @category iServer SpatialAnalyst ThiessenAnalyst
  34343. * @classdesc 数据集泰森多边形分析参数类。
  34344. * @param {Object} options - 参数。
  34345. * @param {FilterParameter} [options.filterQueryParameter] - 过滤参数类,即对数据集中的所有点进行分析。
  34346. * @extends {ThiessenAnalystParameters}
  34347. * @usage
  34348. */
  34349. var DatasetThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  34350. DatasetThiessenAnalystParameters_inherits(DatasetThiessenAnalystParameters, _ThiessenAnalystParam);
  34351. var _super = DatasetThiessenAnalystParameters_createSuper(DatasetThiessenAnalystParameters);
  34352. function DatasetThiessenAnalystParameters(options) {
  34353. var _this;
  34354. DatasetThiessenAnalystParameters_classCallCheck(this, DatasetThiessenAnalystParameters);
  34355. _this = _super.call(this, options);
  34356. /**
  34357. * @member {FilterParameter} [DatasetThiessenAnalystParameters.prototype.filterQueryParameter]
  34358. * @description 过滤条件,对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  34359. * @example
  34360. * var filterQueryParameter = new FilterParameter({
  34361. * name: "Countries@World",
  34362. * attributeFilter: "SmID>100"
  34363. * });
  34364. */
  34365. _this.filterQueryParameter = null;
  34366. /**
  34367. * @member {string} DatasetThiessenAnalystParameters.prototype.dataset
  34368. * @description 数据集名称待分析的数据集名称,请使用 "datasetName@datasourceName" 格式来表示。
  34369. */
  34370. _this.dataset = null;
  34371. if (options) {
  34372. Util_Util.extend(DatasetThiessenAnalystParameters_assertThisInitialized(_this), options);
  34373. }
  34374. _this.CLASS_NAME = "SuperMap.DatasetThiessenAnalystParameters";
  34375. return _this;
  34376. }
  34377. /**
  34378. * @function DatasetThiessenAnalystParameters.prototype.destroy
  34379. * @override
  34380. */
  34381. DatasetThiessenAnalystParameters_createClass(DatasetThiessenAnalystParameters, [{
  34382. key: "destroy",
  34383. value: function destroy() {
  34384. DatasetThiessenAnalystParameters_get(DatasetThiessenAnalystParameters_getPrototypeOf(DatasetThiessenAnalystParameters.prototype), "destroy", this).call(this);
  34385. var me = this;
  34386. if (me.filterQueryParameter) {
  34387. me.filterQueryParameter.destroy();
  34388. me.filterQueryParameter = null;
  34389. }
  34390. }
  34391. /**
  34392. * @function DatasetThiessenAnalystParameters.toObject
  34393. * @param {DatasetThiessenAnalystParameters} datasetThiessenAnalystParameters - 泰森多边形分析服务参数类。
  34394. * @param {DatasetThiessenAnalystParameters} tempObj - 泰森多边形分析服务参数对象。
  34395. * @description 将泰森多边形分析服务参数对象转换为 JSON 对象。
  34396. * @returns JSON 对象。
  34397. */
  34398. }], [{
  34399. key: "toObject",
  34400. value: function toObject(datasetThiessenAnalystParameters, tempObj) {
  34401. for (var name in datasetThiessenAnalystParameters) {
  34402. if (name === "clipRegion") {
  34403. tempObj.clipRegion = ServerGeometry.fromGeometry(datasetThiessenAnalystParameters.clipRegion);
  34404. } else {
  34405. tempObj[name] = datasetThiessenAnalystParameters[name];
  34406. }
  34407. }
  34408. }
  34409. }]);
  34410. return DatasetThiessenAnalystParameters;
  34411. }(ThiessenAnalystParameters);
  34412. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceService.js
  34413. 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); }
  34414. function DatasourceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34415. 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); } }
  34416. 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; }
  34417. 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); }
  34418. function DatasourceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasourceService_getPrototypeOf(object); if (object === null) break; } return object; }
  34419. 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); }
  34420. 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); }
  34421. 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); }; }
  34422. 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); }
  34423. function DatasourceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34424. 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; } }
  34425. function DatasourceService_getPrototypeOf(o) { DatasourceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasourceService_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 DatasourceService
  34431. * @deprecatedclass SuperMap.DatasourceService
  34432. * @category iServer Data Datasource
  34433. * @classdesc 数据源查询服务类。
  34434. * @param {string} url - 服务地址。如访问World Data服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  34435. * @param {Object} options - 参数。
  34436. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  34437. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  34438. * @param {string} options.datasource - 要查询的数据集所在的数据源名称。
  34439. * @param {string} options.dataset - 要查询的数据集名称。
  34440. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34441. * @param {Object} [options.headers] - 请求头。
  34442. * @extends {CommonServiceBase}
  34443. * @usage
  34444. */
  34445. var DatasourceService = /*#__PURE__*/function (_CommonServiceBase) {
  34446. DatasourceService_inherits(DatasourceService, _CommonServiceBase);
  34447. var _super = DatasourceService_createSuper(DatasourceService);
  34448. function DatasourceService(url, options) {
  34449. var _this;
  34450. DatasourceService_classCallCheck(this, DatasourceService);
  34451. _this = _super.call(this, url, options);
  34452. if (options) {
  34453. Util_Util.extend(DatasourceService_assertThisInitialized(_this), options);
  34454. }
  34455. _this.eventCount = 0;
  34456. _this.CLASS_NAME = "SuperMap.DatasourceService";
  34457. return _this;
  34458. }
  34459. /**
  34460. * @function DatasourceService.prototype.destroy
  34461. * @override
  34462. */
  34463. DatasourceService_createClass(DatasourceService, [{
  34464. key: "destroy",
  34465. value: function destroy() {
  34466. this.eventCount = 0;
  34467. DatasourceService_get(DatasourceService_getPrototypeOf(DatasourceService.prototype), "destroy", this).call(this);
  34468. }
  34469. /**
  34470. * @function DatasourceService.prototype.getDatasourceService
  34471. * @description 获取指定数据源信息。
  34472. */
  34473. }, {
  34474. key: "getDatasourceService",
  34475. value: function getDatasourceService(datasourceName, callback) {
  34476. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName));
  34477. this.processAsync(url, "GET", callback);
  34478. }
  34479. /**
  34480. * @function DatasourceService.prototype.getDatasourcesService
  34481. * @description 获取所有数据源信息。
  34482. */
  34483. }, {
  34484. key: "getDatasourcesService",
  34485. value: function getDatasourcesService(callback) {
  34486. var url = Util_Util.urlPathAppend(this.url, "datasources");
  34487. this.processAsync(url, "GET", callback);
  34488. }
  34489. /**
  34490. * @function DatasourceService.prototype.setDatasourceService
  34491. * @description 更新数据源信息。
  34492. */
  34493. }, {
  34494. key: "setDatasourceService",
  34495. value: function setDatasourceService(params, callback) {
  34496. if (!params) {
  34497. return;
  34498. }
  34499. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params.datasourceName));
  34500. this.processAsync(url, "PUT", callback, params);
  34501. }
  34502. }, {
  34503. key: "processAsync",
  34504. value: function processAsync(url, method, callback, params) {
  34505. var eventId = ++this.eventCount;
  34506. var eventListeners = {
  34507. scope: this,
  34508. processCompleted: function processCompleted(result) {
  34509. if (eventId === result.result.eventId && callback) {
  34510. delete result.result.eventId;
  34511. callback(result);
  34512. this.events && this.events.un(eventListeners);
  34513. return false;
  34514. }
  34515. },
  34516. processFailed: function processFailed(result) {
  34517. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  34518. callback(result);
  34519. this.events && this.events.un(eventListeners);
  34520. return false;
  34521. }
  34522. }
  34523. };
  34524. this.events.on(eventListeners);
  34525. var me = this;
  34526. var requestConfig = {
  34527. url: url,
  34528. method: method,
  34529. scope: me,
  34530. success: function success(result, options) {
  34531. result.eventId = eventId;
  34532. this.serviceProcessCompleted(result, options);
  34533. },
  34534. failure: function failure(result, options) {
  34535. if (result.error) {
  34536. result.error.eventId = eventId;
  34537. }
  34538. result.eventId = eventId;
  34539. this.serviceProcessFailed(result, options);
  34540. }
  34541. };
  34542. params && (requestConfig.data = Util_Util.toJSON(params));
  34543. me.request(requestConfig);
  34544. }
  34545. }]);
  34546. return DatasourceService;
  34547. }(CommonServiceBase);
  34548. ;// CONCATENATED MODULE: ./src/common/iServer/DensityKernelAnalystParameters.js
  34549. function DensityKernelAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34550. 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); } }
  34551. 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; }
  34552. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34553. * This program are made available under the terms of the Apache License, Version 2.0
  34554. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34555. /**
  34556. * @class DensityKernelAnalystParameters
  34557. * @deprecatedclass SuperMap.DensityKernelAnalystParameters
  34558. * @category iServer SpatialAnalyst DensityAnalyst
  34559. * @classdesc 核密度分析参数类。
  34560. * @param {Object} options - 参数。
  34561. * @param {string} options.dataset - 要用来做核密度分析数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:BaseMap_P@Jingjin。
  34562. * @param {string} options.fieldName - 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  34563. * @param {string} options.resultGridName - 指定结果数据集名称。
  34564. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.bounds] - 核密度分析的范围,用于确定结果栅格数据集的范围。如果缺省,则默认为原数据集的范围。
  34565. * @param {number} [options.searchRadius] - 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  34566. * @param {number} [options.resultGridDatasetResolution] - 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  34567. * @param {string} [options.targetDatasource] - 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  34568. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  34569. * @usage
  34570. */
  34571. var DensityKernelAnalystParameters = /*#__PURE__*/function () {
  34572. function DensityKernelAnalystParameters(options) {
  34573. DensityKernelAnalystParameters_classCallCheck(this, DensityKernelAnalystParameters);
  34574. /**
  34575. * @member {string} DensityKernelAnalystParameters.prototype.dataset
  34576. * @description 要用来做核密度分析数据源中数据集的名称。
  34577. * 该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Railway@Changchun。
  34578. * 注:核密度分析支持点数据集和线数据集。
  34579. */
  34580. this.dataset = null;
  34581. /**
  34582. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [DensityKernelAnalystParameters.prototype.bounds]
  34583. * @description 核密度分析的范围,用于确定结果栅格数据集的范围。
  34584. * 如果缺省,则默认为原数据集的范围。
  34585. */
  34586. this.bounds = null;
  34587. /**
  34588. * @member {string} DensityKernelAnalystParameters.prototype.fieldName
  34589. * @description 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  34590. */
  34591. this.fieldName = null;
  34592. /**
  34593. * @member {number} [DensityKernelAnalystParameters.prototype.resultGridDatasetResolution]
  34594. * @description 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  34595. */
  34596. this.resultGridDatasetResolution = null;
  34597. /**
  34598. * @member {number} [DensityKernelAnalystParameters.prototype.searchRadius]
  34599. * @description 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  34600. */
  34601. this.searchRadius = null;
  34602. /**
  34603. * @member {string} [DensityKernelAnalystParameters.prototype.targetDatasource]
  34604. * @description 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  34605. */
  34606. this.targetDatasource = null;
  34607. /**
  34608. * @member {string} DensityKernelAnalystParameters.prototype.resultGridName
  34609. * @description 指定结果数据集名称。
  34610. */
  34611. this.resultGridName = null;
  34612. /**
  34613. * @member {boolean} [DensityKernelAnalystParameters.prototype.deleteExistResultDataset=false]
  34614. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  34615. */
  34616. this.deleteExistResultDataset = false;
  34617. Util_Util.extend(this, options);
  34618. this.CLASS_NAME = "SuperMap.DensityKernelAnalystParameters";
  34619. }
  34620. /**
  34621. * @function DensityKernelAnalystParameters.prototype.destroy
  34622. * @description 释放资源,将引用资源的属性置空。
  34623. */
  34624. DensityKernelAnalystParameters_createClass(DensityKernelAnalystParameters, [{
  34625. key: "destroy",
  34626. value: function destroy() {
  34627. var me = this;
  34628. me.dataset = null;
  34629. me.bounds = null;
  34630. me.fieldName = null;
  34631. me.resultGridDatasetResolution = null;
  34632. me.searchRadius = null;
  34633. me.targetDatasource = null;
  34634. me.resultGridName = null;
  34635. me.deleteExistResultDataset = null;
  34636. }
  34637. /**
  34638. * @function DensityKernelAnalystParameters.toObject
  34639. * @param {DensityKernelAnalystParameters} densityKernelAnalystParameters -核密度分析参数类。
  34640. * @param {DensityKernelAnalystParameters} tempObj - 核密度分析参数对象。
  34641. * @description 将核密度分析参数对象转换成 JSON 对象。
  34642. * @returns JSON 对象。
  34643. */
  34644. }], [{
  34645. key: "toObject",
  34646. value: function toObject(densityKernelAnalystParameters, tempObj) {
  34647. for (var name in densityKernelAnalystParameters) {
  34648. if (name !== "dataset") {
  34649. tempObj[name] = densityKernelAnalystParameters[name];
  34650. }
  34651. }
  34652. }
  34653. }]);
  34654. return DensityKernelAnalystParameters;
  34655. }();
  34656. ;// CONCATENATED MODULE: ./src/common/iServer/DensityAnalystService.js
  34657. 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); }
  34658. function DensityAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34659. 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); } }
  34660. 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; }
  34661. 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); }
  34662. function DensityAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DensityAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  34663. 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); }
  34664. 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); }
  34665. 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); }; }
  34666. 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); }
  34667. function DensityAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34668. 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; } }
  34669. function DensityAnalystService_getPrototypeOf(o) { DensityAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DensityAnalystService_getPrototypeOf(o); }
  34670. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34671. * This program are made available under the terms of the Apache License, Version 2.0
  34672. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34673. /**
  34674. * @class DensityAnalystService
  34675. * @deprecatedclass SuperMap.DensityAnalystService
  34676. * @category iServer SpatialAnalyst DensityAnalyst
  34677. * @classdesc
  34678. * 密度分析服务类,密度分析可计算每个输出栅格像元周围圆形邻域内输入的点或线对象的密度。
  34679. * 密度分析,在某种意义上来说,相当于在表面上将输入的点线对象的测量值散开来,将每个点或线对象的测量量分布在整个研究区域,并计算输出栅格中每个像元的密度值。目前提供1种密度分析:核密度分析(Kernel)。
  34680. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  34681. * @param {Object} options - 参数。
  34682. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34683. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34684. * @param {Object} [options.headers] - 请求头。
  34685. * @extends {SpatialAnalystBase}
  34686. * @example 例如:
  34687. * var myDensityAnalystService = new DensityAnalystService(url);
  34688. * myDensityAnalystService.on({
  34689. * "processCompleted": processCompleted,
  34690. * "processFailed": processFailed
  34691. * }
  34692. * );
  34693. * @usage
  34694. */
  34695. var DensityAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  34696. DensityAnalystService_inherits(DensityAnalystService, _SpatialAnalystBase);
  34697. var _super = DensityAnalystService_createSuper(DensityAnalystService);
  34698. function DensityAnalystService(url, options) {
  34699. var _this;
  34700. DensityAnalystService_classCallCheck(this, DensityAnalystService);
  34701. _this = _super.call(this, url, options);
  34702. /**
  34703. * @member {string} DensityAnalystService.prototype.mode
  34704. * @description 密度分析类型。
  34705. */
  34706. _this.mode = null;
  34707. if (options) {
  34708. Util_Util.extend(DensityAnalystService_assertThisInitialized(_this), options);
  34709. }
  34710. _this.CLASS_NAME = "SuperMap.DensityAnalystService";
  34711. return _this;
  34712. }
  34713. /**
  34714. * @function DensityAnalystService.prototype.destroy
  34715. * @description 释放资源,将引用资源的属性置空。
  34716. */
  34717. DensityAnalystService_createClass(DensityAnalystService, [{
  34718. key: "destroy",
  34719. value: function destroy() {
  34720. DensityAnalystService_get(DensityAnalystService_getPrototypeOf(DensityAnalystService.prototype), "destroy", this).call(this);
  34721. this.mode = null;
  34722. }
  34723. /**
  34724. * @function DensityAnalystService.prototype.processAsync
  34725. * @description 负责将客户端的查询参数传递到服务端。
  34726. * @param {DensityKernelAnalystParameters} parameter - 核密度分析参数。
  34727. */
  34728. }, {
  34729. key: "processAsync",
  34730. value: function processAsync(parameter) {
  34731. var me = this;
  34732. var parameterObject = new Object();
  34733. if (parameter instanceof DensityKernelAnalystParameters) {
  34734. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/densityanalyst/kernel');
  34735. me.mode = "kernel";
  34736. }
  34737. DensityKernelAnalystParameters.toObject(parameter, parameterObject);
  34738. var jsonParameters = Util_Util.toJSON(parameterObject);
  34739. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  34740. me.request({
  34741. method: "POST",
  34742. data: jsonParameters,
  34743. scope: me,
  34744. success: me.serviceProcessCompleted,
  34745. failure: me.serviceProcessFailed
  34746. });
  34747. }
  34748. }]);
  34749. return DensityAnalystService;
  34750. }(SpatialAnalystBase);
  34751. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesParameters.js
  34752. function EditFeaturesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34753. 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); } }
  34754. 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; }
  34755. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34756. * This program are made available under the terms of the Apache License, Version 2.0
  34757. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34758. /**
  34759. * @class EditFeaturesParameters
  34760. * @deprecatedclass SuperMap.EditFeaturesParameters
  34761. * @category iServer Data Feature
  34762. * @classdesc 数据集添加、修改、删除参数类。
  34763. * @param {Object} options - 参数。
  34764. * @param {Array.<FeatureVector|GeoJSONObject|ol.Feature>} options.features - 当前需要创建或者是修改的要素集。
  34765. * @param {boolean} [options.returnContent=false] - 是否返回要素内容。如果为true则返回创建要素的 ID 数组,否则返回 featureResult 资源的 URI。
  34766. * @param {EditType} [options.editType=EditType.ADD] - POST 动作类型 (ADD、UPDATE、DELETE)。
  34767. * @param {Array.<string|number>} [options.IDs] - 删除要素时的要素的 ID 数组。
  34768. * @usage
  34769. */
  34770. var EditFeaturesParameters = /*#__PURE__*/function () {
  34771. function EditFeaturesParameters(options) {
  34772. EditFeaturesParameters_classCallCheck(this, EditFeaturesParameters);
  34773. /**
  34774. * @member {string} EditFeaturesParameters.prototype.dataSourceName
  34775. * @description 当前需要创建或者是修改的要素的数据源。
  34776. */
  34777. this.dataSourceName = null;
  34778. /**
  34779. * @member {string} EditFeaturesParameters.prototype.dataSetName
  34780. * @description 当前需要创建或者是修改的要素的数据集。
  34781. */
  34782. this.dataSetName = null;
  34783. /**
  34784. * @member {Array.<FeatureVector|GeoJSONObject|ol.Feature>} EditFeaturesParameters.prototype.features
  34785. * @description 当前需要创建或者是修改的要素集。
  34786. */
  34787. this.features = null;
  34788. /**
  34789. * @member {EditType} [EditFeaturesParameters.prototype.editType=EditType.ADD]
  34790. * @description 要素集更新类型 (add、update、delete)。
  34791. */
  34792. this.editType = EditType.ADD;
  34793. /**
  34794. * @member {Array.<string|number>} [EditFeaturesParameters.prototype.IDs]
  34795. * @description 执行删除时要素集 ID 集合。
  34796. */
  34797. this.IDs = null;
  34798. /**
  34799. * @member {boolean} [EditFeaturesParameters.prototype.returnContent=false]
  34800. * @description 要素添加时,isUseBatch 不传或传为 false 的情况下有效。
  34801. * true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  34802. */
  34803. this.returnContent = false;
  34804. /**
  34805. * @member {boolean} [EditFeaturesParameters.prototype.isUseBatch=false]
  34806. * @description 是否使用批量添加要素功能,要素添加时有效。批量添加能够提高要素编辑效率。true 表示批量添加;false 表示不使用批量添加。
  34807. */
  34808. this.isUseBatch = false;
  34809. Util_Util.extend(this, options);
  34810. this.CLASS_NAME = "SuperMap.EditFeaturesParameters";
  34811. }
  34812. /**
  34813. * @function EditFeaturesParameters.prototype.destroy
  34814. * @description 释放资源,将引用资源的属性置空。
  34815. */
  34816. EditFeaturesParameters_createClass(EditFeaturesParameters, [{
  34817. key: "destroy",
  34818. value: function destroy() {
  34819. var me = this;
  34820. me.dataSourceName = null;
  34821. me.dataSetName = null;
  34822. me.features = null;
  34823. me.editType = null;
  34824. me.IDs = null;
  34825. me.returnContent = null;
  34826. }
  34827. /**
  34828. * @function EditFeaturesParameters.prototype.toJsonParameters
  34829. * @description 将 EditFeaturesParameters 对象参数转换为 JSON 字符串。
  34830. * @param {EditFeaturesParameters} params - 地物编辑参数。
  34831. * @returns {string} JSON 字符串。
  34832. */
  34833. }], [{
  34834. key: "toJsonParameters",
  34835. value: function toJsonParameters(params) {
  34836. var feature,
  34837. len,
  34838. features,
  34839. editType = params.editType;
  34840. if (editType === EditType.DELETE) {
  34841. if (params.IDs === null) {
  34842. return;
  34843. }
  34844. features = {
  34845. ids: params.IDs
  34846. };
  34847. } else {
  34848. features = [];
  34849. if (params.features) {
  34850. len = params.features.length;
  34851. for (var i = 0; i < len; i++) {
  34852. feature = params.features[i];
  34853. feature.geometry = ServerGeometry.fromGeometry(feature.geometry);
  34854. features.push(feature);
  34855. }
  34856. }
  34857. }
  34858. return Util_Util.toJSON(features);
  34859. }
  34860. }]);
  34861. return EditFeaturesParameters;
  34862. }();
  34863. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesService.js
  34864. 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); }
  34865. function EditFeaturesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34866. 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); } }
  34867. 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; }
  34868. 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); }
  34869. function EditFeaturesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = EditFeaturesService_getPrototypeOf(object); if (object === null) break; } return object; }
  34870. 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); }
  34871. 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); }
  34872. 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); }; }
  34873. 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); }
  34874. function EditFeaturesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34875. 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; } }
  34876. function EditFeaturesService_getPrototypeOf(o) { EditFeaturesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return EditFeaturesService_getPrototypeOf(o); }
  34877. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  34878. * This program are made available under the terms of the Apache License, Version 2.0
  34879. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34880. /**
  34881. * @class EditFeaturesService
  34882. * @deprecatedclass SuperMap.EditFeaturesService
  34883. * @category iServer Data Feature
  34884. * @classdesc 数据服务中数据集添加、更新、删除服务类。
  34885. * @extends {CommonServiceBase}
  34886. * @param {string} url - 服务端的数据服务资源地址。请求数据服务中数据集编辑服务,URL 应为:</br>
  34887. * http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/datasources/name/{数据源名}/datasets/name/{数据集名} 。</br>
  34888. * 例如:http://localhost:8090/iserver/services/data-jingjin/rest/data/datasources/name/Jingjin/datasets/name/Landuse_R
  34889. * @param {Object} options - 参数。
  34890. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  34891. * @param {DataFormat} [format] -查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  34892. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34893. * @param {Object} [options.headers] - 请求头。
  34894. * @example
  34895. * var myService = new EditFeaturesService(url, {eventListeners: {
  34896. * "processCompleted": editFeatureCompleted,
  34897. * "processFailed": editFeatureError
  34898. * }
  34899. * };
  34900. * @usage
  34901. */
  34902. var EditFeaturesService = /*#__PURE__*/function (_CommonServiceBase) {
  34903. EditFeaturesService_inherits(EditFeaturesService, _CommonServiceBase);
  34904. var _super = EditFeaturesService_createSuper(EditFeaturesService);
  34905. function EditFeaturesService(url, options) {
  34906. var _this;
  34907. EditFeaturesService_classCallCheck(this, EditFeaturesService);
  34908. _this = _super.call(this, url, options);
  34909. /**
  34910. * @member {boolean} [EditFeaturesService.prototype.returnContent=false]
  34911. * @description要素添加时,isUseBatch 不传或传为 false 的情况下有效。true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  34912. */
  34913. _this.returnContent = false;
  34914. /**
  34915. * @member {boolean} [EditFeaturesService.prototype.isUseBatch=false]
  34916. * @description 是否使用批量添加要素功能,要素添加时有效。
  34917. * 批量添加能够提高要素编辑效率。
  34918. * true 表示批量添加;false 表示不使用批量添加。
  34919. */
  34920. _this.isUseBatch = false;
  34921. if (options) {
  34922. Util_Util.extend(EditFeaturesService_assertThisInitialized(_this), options);
  34923. }
  34924. _this.url = Util_Util.urlPathAppend(_this.url, 'features');
  34925. _this.CLASS_NAME = "SuperMap.EditFeaturesService";
  34926. return _this;
  34927. }
  34928. /**
  34929. * @function EditFeaturesService.prototype.destroy
  34930. * @override
  34931. */
  34932. EditFeaturesService_createClass(EditFeaturesService, [{
  34933. key: "destroy",
  34934. value: function destroy() {
  34935. EditFeaturesService_get(EditFeaturesService_getPrototypeOf(EditFeaturesService.prototype), "destroy", this).call(this);
  34936. var me = this;
  34937. me.returnContent = null;
  34938. me.isUseBatch = null;
  34939. me.fromIndex = null;
  34940. me.toIndex = null;
  34941. }
  34942. /**
  34943. * @function EditFeaturesService.prototype.processAsync
  34944. * @description 负责将客户端的更新参数传递到服务端。
  34945. * @param {EditFeaturesParameters} params - 编辑要素参数。
  34946. */
  34947. }, {
  34948. key: "processAsync",
  34949. value: function processAsync(params) {
  34950. if (!(params instanceof EditFeaturesParameters)) {
  34951. return;
  34952. }
  34953. var me = this,
  34954. method = "POST",
  34955. ids = "",
  34956. editType = params.editType,
  34957. jsonParameters = null;
  34958. me.returnContent = params.returnContent;
  34959. me.isUseBatch = params.isUseBatch;
  34960. jsonParameters = EditFeaturesParameters.toJsonParameters(params);
  34961. if (editType === EditType.DELETE) {
  34962. ids = Util_Util.toJSON(params.IDs);
  34963. jsonParameters = ids;
  34964. var urlWithIds = Util_Util.urlAppend(me.url, Util_Util.getParameterString({
  34965. ids: ids
  34966. }));
  34967. if (FetchRequest.urlIsLong(urlWithIds)) {
  34968. me.url = Util_Util.urlAppend(me.url, Util_Util.getParameterString({
  34969. _method: 'DELETE'
  34970. }));
  34971. method = "POST";
  34972. } else {
  34973. me.url = urlWithIds;
  34974. method = "DELETE";
  34975. }
  34976. } else if (editType === EditType.UPDATE) {
  34977. method = "PUT";
  34978. } else {
  34979. if (me.isUseBatch) {
  34980. me.url = Util_Util.urlAppend(me.url, "isUseBatch=".concat(me.isUseBatch));
  34981. me.returnContent = false;
  34982. }
  34983. if (me.returnContent) {
  34984. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  34985. method = "POST";
  34986. }
  34987. }
  34988. me.request({
  34989. method: method,
  34990. data: jsonParameters,
  34991. scope: me,
  34992. success: me.serviceProcessCompleted,
  34993. failure: me.serviceProcessFailed
  34994. });
  34995. }
  34996. }]);
  34997. return EditFeaturesService;
  34998. }(CommonServiceBase);
  34999. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalyst3DParameters.js
  35000. function FacilityAnalyst3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35001. 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); } }
  35002. 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; }
  35003. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35004. * This program are made available under the terms of the Apache License, Version 2.0
  35005. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35006. /**
  35007. * @class FacilityAnalyst3DParameters
  35008. * @deprecatedclass SuperMap.FacilityAnalyst3DParameters
  35009. * @category iServer FacilityAnalyst3D
  35010. * @classdesc 最近设施分析参数基类。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  35011. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,
  35012. * 超过 10 分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  35013. * @param {Object} options - 参数。
  35014. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  35015. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  35016. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  35017. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  35018. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  35019. * @usage
  35020. */
  35021. var FacilityAnalyst3DParameters = /*#__PURE__*/function () {
  35022. function FacilityAnalyst3DParameters(options) {
  35023. FacilityAnalyst3DParameters_classCallCheck(this, FacilityAnalyst3DParameters);
  35024. /**
  35025. * @member {number} [FacilityAnalyst3DParameters.prototype.edgeID]
  35026. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  35027. */
  35028. this.edgeID = null;
  35029. /**
  35030. * @member {number} [FacilityAnalyst3DParameters.prototype.nodeID]
  35031. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  35032. */
  35033. this.nodeID = null;
  35034. /**
  35035. * @member {string} FacilityAnalyst3DParameters.prototype.weightName
  35036. * @description 指定的权值字段信息对象的名称。
  35037. */
  35038. this.weightName = null;
  35039. /**
  35040. * @member {boolean} [FacilityAnalyst3DParameters.prototype.isUncertainDirectionValid=false]
  35041. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  35042. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  35043. */
  35044. this.isUncertainDirectionValid = false;
  35045. Util_Util.extend(this, options);
  35046. this.CLASS_NAME = "SuperMap.FacilityAnalyst3DParameters";
  35047. }
  35048. /**
  35049. * @function FacilityAnalyst3DParameters.prototype.destroy
  35050. * @description 释放资源,将资源的属性置空。
  35051. */
  35052. FacilityAnalyst3DParameters_createClass(FacilityAnalyst3DParameters, [{
  35053. key: "destroy",
  35054. value: function destroy() {
  35055. var me = this;
  35056. me.edgeID = null;
  35057. me.nodeID = null;
  35058. me.weightName = null;
  35059. me.isUncertainDirectionValid = null;
  35060. }
  35061. }]);
  35062. return FacilityAnalyst3DParameters;
  35063. }();
  35064. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DParameters.js
  35065. 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); }
  35066. function FacilityAnalystSinks3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35067. 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); } }
  35068. 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; }
  35069. 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); }
  35070. function FacilityAnalystSinks3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSinks3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  35071. 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); }
  35072. 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); }
  35073. 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); }; }
  35074. 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); }
  35075. function FacilityAnalystSinks3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35076. 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; } }
  35077. function FacilityAnalystSinks3DParameters_getPrototypeOf(o) { FacilityAnalystSinks3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DParameters_getPrototypeOf(o); }
  35078. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35079. * This program are made available under the terms of the Apache License, Version 2.0
  35080. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35081. /**
  35082. * @class FacilityAnalystSinks3DParameters
  35083. * @deprecatedclass SuperMap.FacilityAnalystSinks3DParameters
  35084. * @category iServer FacilityAnalyst3D Sinks
  35085. * @classdesc 最近设施分析参数类(汇查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  35086. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  35087. * @extends {FacilityAnalyst3DParameters}
  35088. * @param {Object} options - 参数。
  35089. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  35090. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  35091. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  35092. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  35093. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  35094. * @usage
  35095. */
  35096. var FacilityAnalystSinks3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  35097. FacilityAnalystSinks3DParameters_inherits(FacilityAnalystSinks3DParameters, _FacilityAnalyst3DPar);
  35098. var _super = FacilityAnalystSinks3DParameters_createSuper(FacilityAnalystSinks3DParameters);
  35099. function FacilityAnalystSinks3DParameters(options) {
  35100. var _this;
  35101. FacilityAnalystSinks3DParameters_classCallCheck(this, FacilityAnalystSinks3DParameters);
  35102. _this = _super.call(this, options);
  35103. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DParameters";
  35104. return _this;
  35105. }
  35106. /**
  35107. * @function FacilityAnalystSinks3DParameters.prototype.destroy
  35108. * @override
  35109. */
  35110. FacilityAnalystSinks3DParameters_createClass(FacilityAnalystSinks3DParameters, [{
  35111. key: "destroy",
  35112. value: function destroy() {
  35113. FacilityAnalystSinks3DParameters_get(FacilityAnalystSinks3DParameters_getPrototypeOf(FacilityAnalystSinks3DParameters.prototype), "destroy", this).call(this);
  35114. }
  35115. }]);
  35116. return FacilityAnalystSinks3DParameters;
  35117. }(FacilityAnalyst3DParameters);
  35118. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DService.js
  35119. 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); }
  35120. function FacilityAnalystSinks3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35121. 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); } }
  35122. 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; }
  35123. 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); }
  35124. 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); }
  35125. 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); }; }
  35126. 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); }
  35127. function FacilityAnalystSinks3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35128. 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; } }
  35129. function FacilityAnalystSinks3DService_getPrototypeOf(o) { FacilityAnalystSinks3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DService_getPrototypeOf(o); }
  35130. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35131. * This program are made available under the terms of the Apache License, Version 2.0
  35132. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35133. /**
  35134. * @class FacilityAnalystSinks3DService
  35135. * @deprecatedclass SuperMap.FacilityAnalystSinks3DService
  35136. * @category iServer FacilityAnalyst3D Sinks
  35137. * @classdesc 最近设施分析服务类(汇查找资源)<br>
  35138. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  35139. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  35140. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  35141. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  35142. * @extends {CommonServiceBase}
  35143. * @example
  35144. * var myFacilityAnalystSinks3DService = new FacilityAnalystSinks3DService(url, {
  35145. * eventListeners: {
  35146. * "processCompleted": facilityAnalystSinks3DCompleted,
  35147. * "processFailed": facilityAnalystSinks3DError
  35148. * }
  35149. * });
  35150. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:<br>
  35151. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
  35152. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。<br>
  35153. * @param {Object} options - 参数。
  35154. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35155. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35156. * @param {Object} [options.headers] - 请求头。
  35157. * @usage
  35158. */
  35159. var FacilityAnalystSinks3DService = /*#__PURE__*/function (_CommonServiceBase) {
  35160. FacilityAnalystSinks3DService_inherits(FacilityAnalystSinks3DService, _CommonServiceBase);
  35161. var _super = FacilityAnalystSinks3DService_createSuper(FacilityAnalystSinks3DService);
  35162. function FacilityAnalystSinks3DService(url, options) {
  35163. var _this;
  35164. FacilityAnalystSinks3DService_classCallCheck(this, FacilityAnalystSinks3DService);
  35165. _this = _super.call(this, url, options);
  35166. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DService";
  35167. return _this;
  35168. }
  35169. /**
  35170. * @function FacilityAnalystSinks3DService.prototype.destroy
  35171. * @override
  35172. */
  35173. FacilityAnalystSinks3DService_createClass(FacilityAnalystSinks3DService, [{
  35174. key: "destroy",
  35175. value: function destroy() {
  35176. CommonServiceBase.prototype.destroy.apply(this, arguments);
  35177. }
  35178. /**
  35179. * @function FacilityAnalystSinks3DService.prototype.processAsync
  35180. * @description 负责将客户端的查询参数传递到服务端。
  35181. * @param {FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)
  35182. */
  35183. }, {
  35184. key: "processAsync",
  35185. value: function processAsync(params) {
  35186. if (!(params instanceof FacilityAnalystSinks3DParameters)) {
  35187. return;
  35188. }
  35189. var me = this,
  35190. jsonObject;
  35191. me.url = Util_Util.urlPathAppend(me.url, 'sinks');
  35192. jsonObject = {
  35193. edgeID: params.edgeID,
  35194. nodeID: params.nodeID,
  35195. weightName: params.weightName,
  35196. isUncertainDirectionValid: params.isUncertainDirectionValid
  35197. };
  35198. me.request({
  35199. method: "GET",
  35200. params: jsonObject,
  35201. scope: me,
  35202. success: me.serviceProcessCompleted,
  35203. failure: me.serviceProcessFailed
  35204. });
  35205. }
  35206. }]);
  35207. return FacilityAnalystSinks3DService;
  35208. }(CommonServiceBase);
  35209. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DParameters.js
  35210. 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); }
  35211. function FacilityAnalystSources3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35212. 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); } }
  35213. 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; }
  35214. 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); }
  35215. function FacilityAnalystSources3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  35216. 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); }
  35217. 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); }
  35218. 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); }; }
  35219. 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); }
  35220. function FacilityAnalystSources3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35221. 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; } }
  35222. function FacilityAnalystSources3DParameters_getPrototypeOf(o) { FacilityAnalystSources3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DParameters_getPrototypeOf(o); }
  35223. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35224. * This program are made available under the terms of the Apache License, Version 2.0
  35225. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35226. /**
  35227. * @class FacilityAnalystSources3DParameters
  35228. * @deprecatedclass SuperMap.FacilityAnalystSources3DParameters
  35229. * @category iServer FacilityAnalyst3D Sources
  35230. * @classdesc 最近设施分析参数类(源查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  35231. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  35232. * @extends {FacilityAnalyst3DParameters}
  35233. * @param {Object} options - 参数。
  35234. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  35235. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  35236. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  35237. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  35238. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  35239. * @usage
  35240. */
  35241. var FacilityAnalystSources3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  35242. FacilityAnalystSources3DParameters_inherits(FacilityAnalystSources3DParameters, _FacilityAnalyst3DPar);
  35243. var _super = FacilityAnalystSources3DParameters_createSuper(FacilityAnalystSources3DParameters);
  35244. function FacilityAnalystSources3DParameters(options) {
  35245. var _this;
  35246. FacilityAnalystSources3DParameters_classCallCheck(this, FacilityAnalystSources3DParameters);
  35247. _this = _super.call(this, options);
  35248. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DParameters";
  35249. return _this;
  35250. }
  35251. /**
  35252. * @function FacilityAnalystSources3DParameters.prototype.destroy
  35253. * @override
  35254. */
  35255. FacilityAnalystSources3DParameters_createClass(FacilityAnalystSources3DParameters, [{
  35256. key: "destroy",
  35257. value: function destroy() {
  35258. FacilityAnalystSources3DParameters_get(FacilityAnalystSources3DParameters_getPrototypeOf(FacilityAnalystSources3DParameters.prototype), "destroy", this).call(this);
  35259. }
  35260. }]);
  35261. return FacilityAnalystSources3DParameters;
  35262. }(FacilityAnalyst3DParameters);
  35263. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DService.js
  35264. 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); }
  35265. function FacilityAnalystSources3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35266. 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); } }
  35267. 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; }
  35268. 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); }
  35269. function FacilityAnalystSources3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  35270. 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); }
  35271. 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); }
  35272. 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); }; }
  35273. 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); }
  35274. function FacilityAnalystSources3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35275. 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; } }
  35276. function FacilityAnalystSources3DService_getPrototypeOf(o) { FacilityAnalystSources3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DService_getPrototypeOf(o); }
  35277. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35278. * This program are made available under the terms of the Apache License, Version 2.0
  35279. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35280. /**
  35281. * @class FacilityAnalystSources3DService
  35282. * @deprecatedclass SuperMap.FacilityAnalystSources3DService
  35283. * @category iServer FacilityAnalyst3D Sources
  35284. * @classdesc 最近设施分析服务类(源查找资源)
  35285. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  35286. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  35287. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  35288. * 最近设施分析结果通过该类支持的事件的监听函数参数获取。
  35289. * @extends {CommonServiceBase}
  35290. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  35291. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  35292. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  35293. * @param {Object} options - 参数。
  35294. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35295. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35296. * @param {Object} [options.headers] - 请求头。
  35297. * @usage
  35298. */
  35299. var FacilityAnalystSources3DService = /*#__PURE__*/function (_CommonServiceBase) {
  35300. FacilityAnalystSources3DService_inherits(FacilityAnalystSources3DService, _CommonServiceBase);
  35301. var _super = FacilityAnalystSources3DService_createSuper(FacilityAnalystSources3DService);
  35302. function FacilityAnalystSources3DService(url, options) {
  35303. var _this;
  35304. FacilityAnalystSources3DService_classCallCheck(this, FacilityAnalystSources3DService);
  35305. _this = _super.call(this, url, options);
  35306. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DService";
  35307. return _this;
  35308. }
  35309. /**
  35310. * @function FacilityAnalystSources3DService.prototype.destroy
  35311. * @override
  35312. */
  35313. FacilityAnalystSources3DService_createClass(FacilityAnalystSources3DService, [{
  35314. key: "destroy",
  35315. value: function destroy() {
  35316. FacilityAnalystSources3DService_get(FacilityAnalystSources3DService_getPrototypeOf(FacilityAnalystSources3DService.prototype), "destroy", this).call(this);
  35317. }
  35318. /**
  35319. * @function FacilityAnalystSources3DService.prototype.processAsync
  35320. * @description 负责将客户端的查询参数传递到服务端。
  35321. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找资源)
  35322. */
  35323. }, {
  35324. key: "processAsync",
  35325. value: function processAsync(params) {
  35326. if (!(params instanceof FacilityAnalystSources3DParameters)) {
  35327. return;
  35328. }
  35329. var me = this,
  35330. jsonObject;
  35331. me.url = Util_Util.urlPathAppend(me.url, 'sources');
  35332. jsonObject = {
  35333. edgeID: params.edgeID,
  35334. nodeID: params.nodeID,
  35335. weightName: params.weightName,
  35336. isUncertainDirectionValid: params.isUncertainDirectionValid
  35337. };
  35338. me.request({
  35339. method: "GET",
  35340. params: jsonObject,
  35341. scope: me,
  35342. success: me.serviceProcessCompleted,
  35343. failure: me.serviceProcessFailed
  35344. });
  35345. }
  35346. }]);
  35347. return FacilityAnalystSources3DService;
  35348. }(CommonServiceBase);
  35349. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamParameters.js
  35350. function FacilityAnalystStreamParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35351. 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); } }
  35352. 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; }
  35353. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35354. * This program are made available under the terms of the Apache License, Version 2.0
  35355. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35356. /**
  35357. * @class FacilityAnalystStreamParameters
  35358. * @deprecatedclass SuperMap.FacilityAnalystStreamParameters
  35359. * @category iServer NetworkAnalyst UpstreamCirticalFaclilities
  35360. * @classdesc 上游/下游关键设施查找资源参数类。
  35361. * @param {Object} options - 参数。
  35362. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  35363. * @param {number} options.queryType - 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  35364. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  35365. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  35366. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  35367. * @usage
  35368. */
  35369. var FacilityAnalystStreamParameters = /*#__PURE__*/function () {
  35370. function FacilityAnalystStreamParameters(options) {
  35371. FacilityAnalystStreamParameters_classCallCheck(this, FacilityAnalystStreamParameters);
  35372. /**
  35373. * @member {Array.<number>} [FacilityAnalystStreamParameters.prototype.sourceNodeIDs]
  35374. * @description 指定的设施点 ID 数组。
  35375. */
  35376. this.sourceNodeIDs = null;
  35377. /**
  35378. * @member {number} [FacilityAnalystStreamParameters.prototype.edgeID]
  35379. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  35380. */
  35381. this.edgeID = null;
  35382. /**
  35383. * @member {number} [FacilityAnalystStreamParameters.prototype.nodeID]
  35384. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  35385. */
  35386. this.nodeID = null;
  35387. /**
  35388. * @member {boolean} [FacilityAnalystStreamParameters.prototype.isUncertainDirectionValid=false]
  35389. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  35390. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  35391. */
  35392. this.isUncertainDirectionValid = false;
  35393. /**
  35394. * @member {number} FacilityAnalystStreamParameters.prototype.queryType
  35395. * @description 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  35396. */
  35397. this.queryType = null;
  35398. Util_Util.extend(this, options);
  35399. this.CLASS_NAME = "SuperMap.FacilityAnalystStreamParameters";
  35400. }
  35401. /**
  35402. * @function FacilityAnalystStreamParameters.prototype.destroy
  35403. * @description 释放资源,将引用资源的属性置空。
  35404. */
  35405. FacilityAnalystStreamParameters_createClass(FacilityAnalystStreamParameters, [{
  35406. key: "destroy",
  35407. value: function destroy() {
  35408. var me = this;
  35409. me.edgeID = null;
  35410. me.nodeID = null;
  35411. me.weightName = null;
  35412. me.isUncertainDirectionValid = null;
  35413. me.type = null;
  35414. }
  35415. }]);
  35416. return FacilityAnalystStreamParameters;
  35417. }();
  35418. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamService.js
  35419. 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); }
  35420. function FacilityAnalystStreamService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35421. 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); } }
  35422. 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; }
  35423. 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); }
  35424. function FacilityAnalystStreamService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystStreamService_getPrototypeOf(object); if (object === null) break; } return object; }
  35425. 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); }
  35426. 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); }
  35427. 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); }; }
  35428. 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); }
  35429. function FacilityAnalystStreamService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35430. 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; } }
  35431. function FacilityAnalystStreamService_getPrototypeOf(o) { FacilityAnalystStreamService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystStreamService_getPrototypeOf(o); }
  35432. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35433. * This program are made available under the terms of the Apache License, Version 2.0
  35434. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35435. /**
  35436. * @class FacilityAnalystStreamService
  35437. * @deprecatedclass SuperMap.FacilityAnalystStreamService
  35438. * @category iServer NetworkAnalyst UpstreamCirticalFaclilities
  35439. * @classdesc 上游/下游 关键设施查找资源服务类:即查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  35440. * @extends NetworkAnalystServiceBase
  35441. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  35442. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  35443. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet";
  35444. * @param {Object} options - 参数。
  35445. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35446. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35447. * @param {Object} [options.headers] - 请求头。
  35448. * @usage
  35449. */
  35450. var FacilityAnalystStreamService = /*#__PURE__*/function (_NetworkAnalystServic) {
  35451. FacilityAnalystStreamService_inherits(FacilityAnalystStreamService, _NetworkAnalystServic);
  35452. var _super = FacilityAnalystStreamService_createSuper(FacilityAnalystStreamService);
  35453. function FacilityAnalystStreamService(url, options) {
  35454. var _this;
  35455. FacilityAnalystStreamService_classCallCheck(this, FacilityAnalystStreamService);
  35456. _this = _super.call(this, url, options);
  35457. _this.CLASS_NAME = "SuperMap.FacilityAnalystStreamService";
  35458. return _this;
  35459. }
  35460. /**
  35461. * @function FacilityAnalystStreamService.prototype.destroy
  35462. * @override
  35463. */
  35464. FacilityAnalystStreamService_createClass(FacilityAnalystStreamService, [{
  35465. key: "destroy",
  35466. value: function destroy() {
  35467. FacilityAnalystStreamService_get(FacilityAnalystStreamService_getPrototypeOf(FacilityAnalystStreamService.prototype), "destroy", this).call(this);
  35468. }
  35469. /**
  35470. * @function FacilityAnalystStreamService.prototype.processAsync
  35471. * @description 负责将客户端的查询参数传递到服务端。
  35472. * @param {FacilityAnalystStreamParameters} params - 上游/下游关键设施查找资源参数类。
  35473. */
  35474. }, {
  35475. key: "processAsync",
  35476. value: function processAsync(params) {
  35477. if (!(params instanceof FacilityAnalystStreamParameters)) {
  35478. return;
  35479. }
  35480. var me = this,
  35481. jsonObject;
  35482. //URL 通过参数类型来判断是 上游 还是下游 查询
  35483. if (params.queryType === 0) {
  35484. me.url = Util_Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  35485. } else if (params.queryType === 1) {
  35486. me.url = Util_Util.urlPathAppend(me.url, 'downstreamcirticalfaclilities');
  35487. } else {
  35488. return;
  35489. }
  35490. jsonObject = {
  35491. sourceNodeIDs: params.sourceNodeIDs,
  35492. isUncertainDirectionValid: params.isUncertainDirectionValid
  35493. };
  35494. if (params.edgeID !== null && params.nodeID !== null) {
  35495. return;
  35496. }
  35497. if (params.edgeID === null && params.nodeID === null) {
  35498. return;
  35499. }
  35500. if (params.edgeID !== null) {
  35501. jsonObject.edgeID = params.edgeID;
  35502. } else {
  35503. jsonObject.nodeID = params.nodeID;
  35504. }
  35505. me.request({
  35506. method: "GET",
  35507. params: jsonObject,
  35508. scope: me,
  35509. success: me.serviceProcessCompleted,
  35510. failure: me.serviceProcessFailed
  35511. });
  35512. }
  35513. }]);
  35514. return FacilityAnalystStreamService;
  35515. }(NetworkAnalystServiceBase);
  35516. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DParameters.js
  35517. 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); }
  35518. function FacilityAnalystTracedown3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35519. 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); } }
  35520. 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; }
  35521. 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); }
  35522. function FacilityAnalystTracedown3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  35523. 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); }
  35524. 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); }
  35525. 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); }; }
  35526. 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); }
  35527. function FacilityAnalystTracedown3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35528. 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; } }
  35529. function FacilityAnalystTracedown3DParameters_getPrototypeOf(o) { FacilityAnalystTracedown3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DParameters_getPrototypeOf(o); }
  35530. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35531. * This program are made available under the terms of the Apache License, Version 2.0
  35532. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35533. /**
  35534. * @class FacilityAnalystTracedown3DParameters
  35535. * @deprecatedclass SuperMap.FacilityAnalystTracedown3DParameters
  35536. * @category iServer FacilityAnalyst3D TraceDownResult
  35537. * @classdesc 下游追踪资源参数类。
  35538. * @extends {FacilityAnalyst3DParameters}
  35539. * @param {Object} options - 参数。
  35540. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  35541. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  35542. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  35543. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  35544. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  35545. * @usage
  35546. */
  35547. var FacilityAnalystTracedown3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  35548. FacilityAnalystTracedown3DParameters_inherits(FacilityAnalystTracedown3DParameters, _FacilityAnalyst3DPar);
  35549. var _super = FacilityAnalystTracedown3DParameters_createSuper(FacilityAnalystTracedown3DParameters);
  35550. function FacilityAnalystTracedown3DParameters(options) {
  35551. var _this;
  35552. FacilityAnalystTracedown3DParameters_classCallCheck(this, FacilityAnalystTracedown3DParameters);
  35553. _this = _super.call(this, options);
  35554. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DParameters";
  35555. return _this;
  35556. }
  35557. /**
  35558. * @function FacilityAnalystTracedown3DParameters.prototype.destroy
  35559. * @override
  35560. */
  35561. FacilityAnalystTracedown3DParameters_createClass(FacilityAnalystTracedown3DParameters, [{
  35562. key: "destroy",
  35563. value: function destroy() {
  35564. FacilityAnalystTracedown3DParameters_get(FacilityAnalystTracedown3DParameters_getPrototypeOf(FacilityAnalystTracedown3DParameters.prototype), "destroy", this).call(this);
  35565. }
  35566. }]);
  35567. return FacilityAnalystTracedown3DParameters;
  35568. }(FacilityAnalyst3DParameters);
  35569. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DService.js
  35570. 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); }
  35571. function FacilityAnalystTracedown3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35572. 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); } }
  35573. 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; }
  35574. 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); }
  35575. function FacilityAnalystTracedown3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  35576. 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); }
  35577. 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); }
  35578. 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); }; }
  35579. 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); }
  35580. function FacilityAnalystTracedown3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35581. 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; } }
  35582. function FacilityAnalystTracedown3DService_getPrototypeOf(o) { FacilityAnalystTracedown3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DService_getPrototypeOf(o); }
  35583. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35584. * This program are made available under the terms of the Apache License, Version 2.0
  35585. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35586. /**
  35587. * @class FacilityAnalystTracedown3DService
  35588. * @deprecatedclass SuperMap.FacilityAnalystTracedown3DService
  35589. * @category iServer FacilityAnalyst3D TraceDownResult
  35590. * @classdesc 下游追踪资源服务类
  35591. * @extends {CommonServiceBase}
  35592. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  35593. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  35594. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  35595. * @param {Object} options - 参数。
  35596. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35597. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35598. * @param {Object} [options.headers] - 请求头。
  35599. * @usage
  35600. */
  35601. var FacilityAnalystTracedown3DService = /*#__PURE__*/function (_CommonServiceBase) {
  35602. FacilityAnalystTracedown3DService_inherits(FacilityAnalystTracedown3DService, _CommonServiceBase);
  35603. var _super = FacilityAnalystTracedown3DService_createSuper(FacilityAnalystTracedown3DService);
  35604. function FacilityAnalystTracedown3DService(url, options) {
  35605. var _this;
  35606. FacilityAnalystTracedown3DService_classCallCheck(this, FacilityAnalystTracedown3DService);
  35607. _this = _super.call(this, url, options);
  35608. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DService";
  35609. return _this;
  35610. }
  35611. /**
  35612. * @function FacilityAnalystTracedown3DService.prototype.destroy
  35613. * @override
  35614. */
  35615. FacilityAnalystTracedown3DService_createClass(FacilityAnalystTracedown3DService, [{
  35616. key: "destroy",
  35617. value: function destroy() {
  35618. FacilityAnalystTracedown3DService_get(FacilityAnalystTracedown3DService_getPrototypeOf(FacilityAnalystTracedown3DService.prototype), "destroy", this).call(this);
  35619. }
  35620. /**
  35621. * @function FacilityAnalystTracedown3DService.prototype.processAsync
  35622. * @description 负责将客户端的查询参数传递到服务端。
  35623. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源参数类。
  35624. */
  35625. }, {
  35626. key: "processAsync",
  35627. value: function processAsync(params) {
  35628. if (!(params instanceof FacilityAnalystTracedown3DParameters)) {
  35629. return;
  35630. }
  35631. var me = this,
  35632. jsonObject;
  35633. me.url = Util_Util.urlPathAppend(me.url, 'tracedownresult');
  35634. jsonObject = {
  35635. edgeID: params.edgeID,
  35636. nodeID: params.nodeID,
  35637. weightName: params.weightName,
  35638. isUncertainDirectionValid: params.isUncertainDirectionValid
  35639. };
  35640. me.request({
  35641. method: "GET",
  35642. params: jsonObject,
  35643. scope: me,
  35644. success: me.serviceProcessCompleted,
  35645. failure: me.serviceProcessFailed
  35646. });
  35647. }
  35648. }]);
  35649. return FacilityAnalystTracedown3DService;
  35650. }(CommonServiceBase);
  35651. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DParameters.js
  35652. 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); }
  35653. function FacilityAnalystTraceup3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35654. 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); } }
  35655. 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; }
  35656. 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); }
  35657. function FacilityAnalystTraceup3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  35658. 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); }
  35659. 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); }
  35660. 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); }; }
  35661. 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); }
  35662. function FacilityAnalystTraceup3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35663. 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; } }
  35664. function FacilityAnalystTraceup3DParameters_getPrototypeOf(o) { FacilityAnalystTraceup3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DParameters_getPrototypeOf(o); }
  35665. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35666. * This program are made available under the terms of the Apache License, Version 2.0
  35667. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35668. /**
  35669. * @class FacilityAnalystTraceup3DParameters
  35670. * @deprecatedclass SuperMap.FacilityAnalystTraceup3DParameters
  35671. * @category iServer FacilityAnalyst3D TraceUpResult
  35672. * @classdesc 上游追踪资源参数类。
  35673. * @extends {FacilityAnalyst3DParameters}
  35674. * @param {Object} options - 参数。
  35675. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  35676. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  35677. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  35678. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  35679. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  35680. * @usage
  35681. */
  35682. var FacilityAnalystTraceup3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  35683. FacilityAnalystTraceup3DParameters_inherits(FacilityAnalystTraceup3DParameters, _FacilityAnalyst3DPar);
  35684. var _super = FacilityAnalystTraceup3DParameters_createSuper(FacilityAnalystTraceup3DParameters);
  35685. function FacilityAnalystTraceup3DParameters(options) {
  35686. var _this;
  35687. FacilityAnalystTraceup3DParameters_classCallCheck(this, FacilityAnalystTraceup3DParameters);
  35688. _this = _super.call(this, options);
  35689. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DParameters";
  35690. return _this;
  35691. }
  35692. /**
  35693. * @function FacilityAnalystTraceup3DParameters.prototype.destroy
  35694. * @override
  35695. */
  35696. FacilityAnalystTraceup3DParameters_createClass(FacilityAnalystTraceup3DParameters, [{
  35697. key: "destroy",
  35698. value: function destroy() {
  35699. FacilityAnalystTraceup3DParameters_get(FacilityAnalystTraceup3DParameters_getPrototypeOf(FacilityAnalystTraceup3DParameters.prototype), "destroy", this).call(this);
  35700. }
  35701. }]);
  35702. return FacilityAnalystTraceup3DParameters;
  35703. }(FacilityAnalyst3DParameters);
  35704. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DService.js
  35705. 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); }
  35706. function FacilityAnalystTraceup3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35707. 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); } }
  35708. 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; }
  35709. 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); }
  35710. function FacilityAnalystTraceup3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  35711. 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); }
  35712. 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); }
  35713. 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); }; }
  35714. 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); }
  35715. function FacilityAnalystTraceup3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35716. 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; } }
  35717. function FacilityAnalystTraceup3DService_getPrototypeOf(o) { FacilityAnalystTraceup3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DService_getPrototypeOf(o); }
  35718. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35719. * This program are made available under the terms of the Apache License, Version 2.0
  35720. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35721. /**
  35722. * @class FacilityAnalystTraceup3DService
  35723. * @deprecatedclass SuperMap.FacilityAnalystTraceup3DService
  35724. * @category iServer FacilityAnalyst3D TraceUpResult
  35725. * @classdesc 上游追踪资源服务类
  35726. * @extends {CommonServiceBase}
  35727. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  35728. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  35729. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  35730. * @param {Object} options - 参数。
  35731. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35732. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35733. * @param {Object} [options.headers] - 请求头。
  35734. * @usage
  35735. */
  35736. var FacilityAnalystTraceup3DService = /*#__PURE__*/function (_CommonServiceBase) {
  35737. FacilityAnalystTraceup3DService_inherits(FacilityAnalystTraceup3DService, _CommonServiceBase);
  35738. var _super = FacilityAnalystTraceup3DService_createSuper(FacilityAnalystTraceup3DService);
  35739. function FacilityAnalystTraceup3DService(url, options) {
  35740. var _this;
  35741. FacilityAnalystTraceup3DService_classCallCheck(this, FacilityAnalystTraceup3DService);
  35742. _this = _super.call(this, url, options);
  35743. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DService";
  35744. return _this;
  35745. }
  35746. /**
  35747. * @function FacilityAnalystTraceup3DService.prototype.destroy
  35748. * @override
  35749. */
  35750. FacilityAnalystTraceup3DService_createClass(FacilityAnalystTraceup3DService, [{
  35751. key: "destroy",
  35752. value: function destroy() {
  35753. FacilityAnalystTraceup3DService_get(FacilityAnalystTraceup3DService_getPrototypeOf(FacilityAnalystTraceup3DService.prototype), "destroy", this).call(this);
  35754. }
  35755. /**
  35756. * @function FacilityAnalystTraceup3DService.prototype.processAsync
  35757. * @description 负责将客户端的查询参数传递到服务端。
  35758. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类
  35759. */
  35760. }, {
  35761. key: "processAsync",
  35762. value: function processAsync(params) {
  35763. if (!(params instanceof FacilityAnalystTraceup3DParameters)) {
  35764. return;
  35765. }
  35766. var me = this,
  35767. jsonObject;
  35768. me.url = Util_Util.urlPathAppend(me.url, 'traceupresult');
  35769. jsonObject = {
  35770. edgeID: params.edgeID,
  35771. nodeID: params.nodeID,
  35772. weightName: params.weightName,
  35773. isUncertainDirectionValid: params.isUncertainDirectionValid
  35774. };
  35775. me.request({
  35776. method: "GET",
  35777. params: jsonObject,
  35778. scope: me,
  35779. success: me.serviceProcessCompleted,
  35780. failure: me.serviceProcessFailed
  35781. });
  35782. }
  35783. }]);
  35784. return FacilityAnalystTraceup3DService;
  35785. }(CommonServiceBase);
  35786. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DParameters.js
  35787. 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); }
  35788. function FacilityAnalystUpstream3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35789. 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); } }
  35790. 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; }
  35791. 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); }
  35792. function FacilityAnalystUpstream3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  35793. 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); }
  35794. 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); }
  35795. 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); }; }
  35796. 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); }
  35797. function FacilityAnalystUpstream3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35798. 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; } }
  35799. function FacilityAnalystUpstream3DParameters_getPrototypeOf(o) { FacilityAnalystUpstream3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DParameters_getPrototypeOf(o); }
  35800. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35801. * This program are made available under the terms of the Apache License, Version 2.0
  35802. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35803. /**
  35804. * @class FacilityAnalystUpstream3DParameters
  35805. * @deprecatedclass SuperMap.FacilityAnalystUpstream3DParameters
  35806. * @category iServer FacilityAnalyst3D UpstreamCirticalFaclilities
  35807. * @classdesc 上游关键设施查找资源参数类。
  35808. * @extends {FacilityAnalyst3DParameters}
  35809. * @param {Object} options - 参数。
  35810. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  35811. * @param {number} [options.edgeID] - 指定的弧段ID。edgeID 与 nodeID 必须指定一个。
  35812. * @param {number} [options.nodeID] - 指定的结点ID。edgeID 与 edgeID 必须指定一个。
  35813. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  35814. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  35815. * @usage
  35816. */
  35817. var FacilityAnalystUpstream3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  35818. FacilityAnalystUpstream3DParameters_inherits(FacilityAnalystUpstream3DParameters, _FacilityAnalyst3DPar);
  35819. var _super = FacilityAnalystUpstream3DParameters_createSuper(FacilityAnalystUpstream3DParameters);
  35820. function FacilityAnalystUpstream3DParameters(options) {
  35821. var _this;
  35822. FacilityAnalystUpstream3DParameters_classCallCheck(this, FacilityAnalystUpstream3DParameters);
  35823. _this = _super.call(this, options);
  35824. options = options || {};
  35825. _this.sourceNodeIDs = null;
  35826. Util_Util.extend(FacilityAnalystUpstream3DParameters_assertThisInitialized(_this), options);
  35827. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DParameters";
  35828. return _this;
  35829. }
  35830. /**
  35831. * @function FacilityAnalystUpstream3DParameters.prototype.destroy
  35832. * @override
  35833. */
  35834. FacilityAnalystUpstream3DParameters_createClass(FacilityAnalystUpstream3DParameters, [{
  35835. key: "destroy",
  35836. value: function destroy() {
  35837. FacilityAnalystUpstream3DParameters_get(FacilityAnalystUpstream3DParameters_getPrototypeOf(FacilityAnalystUpstream3DParameters.prototype), "destroy", this).call(this);
  35838. this.sourceNodeIDs = null;
  35839. }
  35840. }]);
  35841. return FacilityAnalystUpstream3DParameters;
  35842. }(FacilityAnalyst3DParameters);
  35843. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DService.js
  35844. 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); }
  35845. function FacilityAnalystUpstream3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35846. 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); } }
  35847. 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; }
  35848. 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); }
  35849. function FacilityAnalystUpstream3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  35850. 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); }
  35851. 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); }
  35852. 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); }; }
  35853. 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); }
  35854. function FacilityAnalystUpstream3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35855. 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; } }
  35856. function FacilityAnalystUpstream3DService_getPrototypeOf(o) { FacilityAnalystUpstream3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DService_getPrototypeOf(o); }
  35857. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35858. * This program are made available under the terms of the Apache License, Version 2.0
  35859. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35860. /**
  35861. * @class FacilityAnalystUpstream3DService
  35862. * @deprecatedclass SuperMap.FacilityAnalystUpstream3DService
  35863. * @category iServer FacilityAnalyst3D UpstreamCirticalFaclilities
  35864. * @classdesc 上游关键设施查找资源服务类
  35865. * @extends {CommonServiceBase}
  35866. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  35867. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  35868. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  35869. * @param {Object} options - 参数。
  35870. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35871. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35872. * @param {Object} [options.headers] - 请求头。
  35873. * @usage
  35874. */
  35875. var FacilityAnalystUpstream3DService = /*#__PURE__*/function (_CommonServiceBase) {
  35876. FacilityAnalystUpstream3DService_inherits(FacilityAnalystUpstream3DService, _CommonServiceBase);
  35877. var _super = FacilityAnalystUpstream3DService_createSuper(FacilityAnalystUpstream3DService);
  35878. function FacilityAnalystUpstream3DService(url, options) {
  35879. var _this;
  35880. FacilityAnalystUpstream3DService_classCallCheck(this, FacilityAnalystUpstream3DService);
  35881. _this = _super.call(this, url, options);
  35882. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DService";
  35883. return _this;
  35884. }
  35885. /**
  35886. * @function FacilityAnalystUpstream3DService.prototype.destroy
  35887. * @override
  35888. */
  35889. FacilityAnalystUpstream3DService_createClass(FacilityAnalystUpstream3DService, [{
  35890. key: "destroy",
  35891. value: function destroy() {
  35892. FacilityAnalystUpstream3DService_get(FacilityAnalystUpstream3DService_getPrototypeOf(FacilityAnalystUpstream3DService.prototype), "destroy", this).call(this);
  35893. }
  35894. /**
  35895. * @function FacilityAnalystUpstream3DService.prototype.processAsync
  35896. * @description 负责将客户端的查询参数传递到服务端。
  35897. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找资源参数类
  35898. */
  35899. }, {
  35900. key: "processAsync",
  35901. value: function processAsync(params) {
  35902. if (!(params instanceof FacilityAnalystUpstream3DParameters)) {
  35903. return;
  35904. }
  35905. var me = this,
  35906. jsonObject;
  35907. me.url = Util_Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  35908. jsonObject = {
  35909. sourceNodeIDs: params.sourceNodeIDs,
  35910. edgeID: params.edgeID,
  35911. nodeID: params.nodeID,
  35912. isUncertainDirectionValid: params.isUncertainDirectionValid
  35913. };
  35914. me.request({
  35915. method: "GET",
  35916. params: jsonObject,
  35917. scope: me,
  35918. success: me.serviceProcessCompleted,
  35919. failure: me.serviceProcessFailed
  35920. });
  35921. }
  35922. }]);
  35923. return FacilityAnalystUpstream3DService;
  35924. }(CommonServiceBase);
  35925. ;// CONCATENATED MODULE: ./src/common/iServer/FieldParameters.js
  35926. function FieldParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35927. 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); } }
  35928. 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; }
  35929. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35930. * This program are made available under the terms of the Apache License, Version 2.0
  35931. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35932. /**
  35933. * @class FieldParameters
  35934. * @deprecatedclass SuperMap.FieldParameters
  35935. * @category iServer Data Field
  35936. * @classdesc 字段信息查询参数类。
  35937. * @param {Object} options - 参数。
  35938. * @param {string} options.datasource - 数据源名称。
  35939. * @param {string} options.dataset - 数据集名称。
  35940. * @usage
  35941. */
  35942. var FieldParameters = /*#__PURE__*/function () {
  35943. function FieldParameters(options) {
  35944. FieldParameters_classCallCheck(this, FieldParameters);
  35945. /**
  35946. * @member {string} FieldParameters.prototype.datasource
  35947. * @description 要查询的数据集所在的数据源名称。
  35948. */
  35949. this.datasource = null;
  35950. /**
  35951. * @member {string} FieldParameters.prototype.dataset
  35952. * @description 要查询的数据集名称。
  35953. */
  35954. this.dataset = null;
  35955. if (options) {
  35956. Util_Util.extend(this, options);
  35957. }
  35958. this.CLASS_NAME = "SuperMap.FieldParameters";
  35959. }
  35960. /**
  35961. * @function FieldParameters.prototype.destroy
  35962. * @description 释放资源,将引用资源的属性置空。
  35963. */
  35964. FieldParameters_createClass(FieldParameters, [{
  35965. key: "destroy",
  35966. value: function destroy() {
  35967. var me = this;
  35968. me.datasource = null;
  35969. me.dataset = null;
  35970. }
  35971. }]);
  35972. return FieldParameters;
  35973. }();
  35974. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticsParameters.js
  35975. 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); }
  35976. function FieldStatisticsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35977. 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); } }
  35978. 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; }
  35979. 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); }
  35980. 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); }
  35981. 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); }; }
  35982. 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); }
  35983. function FieldStatisticsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35984. 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; } }
  35985. function FieldStatisticsParameters_getPrototypeOf(o) { FieldStatisticsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticsParameters_getPrototypeOf(o); }
  35986. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  35987. * This program are made available under the terms of the Apache License, Version 2.0
  35988. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35989. /**
  35990. * @class FieldStatisticsParameters
  35991. * @deprecatedclass SuperMap.FieldStatisticsParameters
  35992. * @category iServer Data Field
  35993. * @classdesc 字段统计信息查询参数类。
  35994. * @param {Object} options - 参数。
  35995. * @param {string} options.datasource - 数据源名称。
  35996. * @param {string} options.dataset - 数据集名称。
  35997. * @param {string} options.fieldName - 字段名。
  35998. * @param {(string.<StatisticMode>|Array.<string.<StatisticMode>>)} statisticMode - 字段统计方法类型。
  35999. * @extends {FieldParameters}
  36000. * @usage
  36001. */
  36002. var FieldStatisticsParameters = /*#__PURE__*/function (_FieldParameters) {
  36003. FieldStatisticsParameters_inherits(FieldStatisticsParameters, _FieldParameters);
  36004. var _super = FieldStatisticsParameters_createSuper(FieldStatisticsParameters);
  36005. function FieldStatisticsParameters(options) {
  36006. var _this;
  36007. FieldStatisticsParameters_classCallCheck(this, FieldStatisticsParameters);
  36008. _this = _super.call(this, options);
  36009. /**
  36010. * @member {string} FieldStatisticsParameters.prototype.fieldName
  36011. * @description 字段名。
  36012. */
  36013. _this.fieldName = null;
  36014. /**
  36015. * @member {(string.<StatisticMode>|Array.<string.<StatisticMode>>)} FieldStatisticsParameters.prototype.statisticMode
  36016. * @description 字段统计方法类型。
  36017. */
  36018. _this.statisticMode = null;
  36019. if (options) {
  36020. Util_Util.extend(FieldStatisticsParameters_assertThisInitialized(_this), options);
  36021. }
  36022. _this.CLASS_NAME = "SuperMap.FieldStatisticsParameters";
  36023. return _this;
  36024. }
  36025. /**
  36026. * @function FieldStatisticsParameters.prototype.destroy
  36027. * @description 释放资源,将引用资源的属性置空。
  36028. */
  36029. FieldStatisticsParameters_createClass(FieldStatisticsParameters, [{
  36030. key: "destroy",
  36031. value: function destroy() {
  36032. var me = this;
  36033. me.fieldName = null;
  36034. me.statisticMode = null;
  36035. }
  36036. }]);
  36037. return FieldStatisticsParameters;
  36038. }(FieldParameters);
  36039. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticService.js
  36040. 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); }
  36041. function FieldStatisticService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36042. 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); } }
  36043. 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; }
  36044. 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); }
  36045. function FieldStatisticService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FieldStatisticService_getPrototypeOf(object); if (object === null) break; } return object; }
  36046. 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); }
  36047. 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); }
  36048. 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); }; }
  36049. 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); }
  36050. function FieldStatisticService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36051. 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; } }
  36052. function FieldStatisticService_getPrototypeOf(o) { FieldStatisticService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticService_getPrototypeOf(o); }
  36053. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36054. * This program are made available under the terms of the Apache License, Version 2.0
  36055. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36056. /**
  36057. * @class FieldStatisticService
  36058. * @deprecatedclass SuperMap.FieldStatisticService
  36059. * @category iServer Data Field
  36060. * @classdesc 字段查询统计服务类。用来完成对指定数据集指定字段的查询统计分析,即求平均值,最大值等。
  36061. * @extends {CommonServiceBase}
  36062. * @param {string} url - 服务地址。如访问 World Map 服务,只需将 url 设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  36063. * @param {Object} options - 参数。
  36064. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  36065. * @param {DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  36066. * @param {string} options.datasource - 数据集所在的数据源名称。
  36067. * @param {string} options.dataset - 数据集名称。
  36068. * @param {string} options.field - 查询统计的目标字段名称。
  36069. * @param {StatisticMode} options.statisticMode - 字段查询统计的方法类型。
  36070. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36071. * @param {Object} [options.headers] - 请求头。
  36072. * @example
  36073. * var myService = new FieldStatisticService(url, {eventListeners: {
  36074. * "processCompleted": fieldStatisticCompleted,
  36075. * "processFailed": fieldStatisticError
  36076. * },
  36077. * datasource: "World",
  36078. * dataset: "Countries",
  36079. * field: "SmID",
  36080. * statisticMode: StatisticMode.AVERAGE
  36081. * };
  36082. * @usage
  36083. */
  36084. var FieldStatisticService = /*#__PURE__*/function (_CommonServiceBase) {
  36085. FieldStatisticService_inherits(FieldStatisticService, _CommonServiceBase);
  36086. var _super = FieldStatisticService_createSuper(FieldStatisticService);
  36087. function FieldStatisticService(url, options) {
  36088. var _this;
  36089. FieldStatisticService_classCallCheck(this, FieldStatisticService);
  36090. _this = _super.call(this, url, options);
  36091. /**
  36092. * @member {string} FieldStatisticService.prototype.datasource
  36093. * @description 数据集所在的数据源名称。
  36094. */
  36095. _this.datasource = null;
  36096. /**
  36097. * @member {string} FieldStatisticService.prototype.dataset
  36098. * @description 数据集名称。
  36099. */
  36100. _this.dataset = null;
  36101. /**
  36102. * @member {string} FieldStatisticService.prototype.field
  36103. * @description 查询统计的目标字段名称。
  36104. */
  36105. _this.field = null;
  36106. /**
  36107. * @member {StatisticMode} FieldStatisticService.prototype.statisticMode
  36108. * @description 字段查询统计的方法类型。
  36109. */
  36110. _this.statisticMode = null;
  36111. if (options) {
  36112. Util_Util.extend(FieldStatisticService_assertThisInitialized(_this), options);
  36113. }
  36114. _this.CLASS_NAME = "SuperMap.FieldStatisticService";
  36115. return _this;
  36116. }
  36117. /**
  36118. * @function FieldStatisticService.prototype.destroy
  36119. * @override
  36120. */
  36121. FieldStatisticService_createClass(FieldStatisticService, [{
  36122. key: "destroy",
  36123. value: function destroy() {
  36124. FieldStatisticService_get(FieldStatisticService_getPrototypeOf(FieldStatisticService.prototype), "destroy", this).call(this);
  36125. var me = this;
  36126. me.datasource = null;
  36127. me.dataset = null;
  36128. me.field = null;
  36129. me.statisticMode = null;
  36130. }
  36131. /**
  36132. * @function FieldStatisticService.prototype.processAsync
  36133. * @description 执行服务,进行指定字段的查询统计。
  36134. */
  36135. }, {
  36136. key: "processAsync",
  36137. value: function processAsync() {
  36138. var me = this,
  36139. fieldStatisticURL = "datasources/" + me.datasource + "/datasets/" + me.dataset + "/fields/" + me.field + "/" + me.statisticMode;
  36140. me.url = Util_Util.urlPathAppend(me.url, fieldStatisticURL);
  36141. me.request({
  36142. method: "GET",
  36143. data: null,
  36144. scope: me,
  36145. success: me.serviceProcessCompleted,
  36146. failure: me.serviceProcessFailed
  36147. });
  36148. }
  36149. }]);
  36150. return FieldStatisticService;
  36151. }(CommonServiceBase);
  36152. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesParameters.js
  36153. function FindClosestFacilitiesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36154. 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); } }
  36155. 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; }
  36156. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36157. * This program are made available under the terms of the Apache License, Version 2.0
  36158. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36159. /**
  36160. * @class FindClosestFacilitiesParameters
  36161. * @deprecatedclass SuperMap.FindClosestFacilitiesParameters
  36162. * @category iServer NetworkAnalyst ClosestFacility
  36163. * @classdesc 最近设施分析参数类。
  36164. * @param {Object} options - 参数。
  36165. * @param {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} options.event - 事件点,一般为需要获得服务设施服务的事件位置。
  36166. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.facilities - 设施点集合,一般为提供服务的服务设施位置。
  36167. * @param {number} [options.expectFacilityCount=1] - 要查找的设施点数量。
  36168. * @param {boolean} [options.fromEvent=false] - 是否从事件点到设施点进行查找。
  36169. * @param {boolean} [options.isAnalyzeById=false] - 事件点和设施点是否通过节点 ID 号来指定。
  36170. * @param {number} [options.maxWeight=0] - 权值的最大限值。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  36171. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  36172. * @usage
  36173. */
  36174. var FindClosestFacilitiesParameters = /*#__PURE__*/function () {
  36175. function FindClosestFacilitiesParameters(options) {
  36176. FindClosestFacilitiesParameters_classCallCheck(this, FindClosestFacilitiesParameters);
  36177. /**
  36178. * @member {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} FindClosestFacilitiesParameters.prototype.event
  36179. * @description 事件点,一般为需要获得服务设施服务的事件位置。
  36180. * 可以通过两种方式赋予事件点:当该类中字段 isAnalyzeById = true 时,应输入事件点 ID 号;当 isAnalyzeById = false 时,应输入事件点坐标。
  36181. */
  36182. this.event = null;
  36183. /**
  36184. * @member {number} [FindClosestFacilitiesParameters.prototype.expectFacilityCount=1]
  36185. * @description 要查找的设施点数量。
  36186. */
  36187. this.expectFacilityCount = 1;
  36188. /**
  36189. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} [FindClosestFacilitiesParameters.prototype.facilities=false]
  36190. * @description 设施点集合,一般为提供服务的服务设施位置。
  36191. * 可以通过两种方式赋予设施点:当该类中字段 isAnalyzeById = true 时,应输入设施点 ID 号;当 isAnalyzeById = false 时,应输入设施点坐标。
  36192. */
  36193. this.facilities = null;
  36194. /**
  36195. * @member {boolean} [FindClosestFacilitiesParameters.prototype.fromEvent=false]
  36196. * @description 是否从事件点到设施点进行查找。最近设施分析主要是通过设施点和事件点之间最优的路线来分析在一定范围内哪个或哪些设施与事件点有最优路线的关系。
  36197. * 这个行走线路是通过网络图层进行网络分析算法计算出来的两点间的最优路线。由于存在从 A 点到 B 点与从 B 点到 A 点的耗费不一样的情况,因此起止点不同可能会得到不同的最优路线。因此在进行最近设施分析之前,需要设置获取的最优路线的方向,即是以事件点作为起点到最近设施点的方向分析,还是以最近设施点为起点到事件点的方向分析。如果需要以事件点作为起点到设施点方向进行查找,设置该字段值为 true;设置为 false,表示从设施点到事件点进行查找。
  36198. */
  36199. this.fromEvent = false;
  36200. /**
  36201. * @member {boolean} [FindClosestFacilitiesParameters.prototype.isAnalyzeById=false]
  36202. * @description 事件点和设施点是否通过节点 ID 号来指定,设置为 false,表示通过坐标点指定事件点和设施点。
  36203. */
  36204. this.isAnalyzeById = false;
  36205. /**
  36206. * @member {number} [FindClosestFacilitiesParameters.prototype.maxWeight=0]
  36207. * @description 权值的最大限值。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  36208. * 例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,超过 10 分钟能到达的都不予考虑。
  36209. * 那么需要将网络分析参数中 parameter.weightFieldName 设置为表示时间的字段,然后设置查找范围的半径值为10。
  36210. */
  36211. this.maxWeight = 0;
  36212. /**
  36213. * @member {TransportationAnalystParameter} [FindClosestFacilitiesParameters.prototype.parameter]
  36214. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  36215. * 它为 TransportationAnalystParameter 类型,虽然为可选参数,但是如果不设置其中的 resultSetting 字段,
  36216. * 则返回结果空间信息等都为空。
  36217. */
  36218. this.parameter = new TransportationAnalystParameter();
  36219. Util_Util.extend(this, options);
  36220. this.CLASS_NAME = "SuperMap.FindClosestFacilitiesParameters";
  36221. }
  36222. /**
  36223. * @function FindClosestFacilitiesParameters.prototype.destroy
  36224. * @description 释放资源,将引用资源的属性置空。
  36225. */
  36226. FindClosestFacilitiesParameters_createClass(FindClosestFacilitiesParameters, [{
  36227. key: "destroy",
  36228. value: function destroy() {
  36229. var me = this;
  36230. me.event = null;
  36231. me.expectFacilityCount = null;
  36232. me.facilities = null;
  36233. me.fromEvent = null;
  36234. me.isAnalyzeById = null;
  36235. me.maxWeight = null;
  36236. if (me.parameter) {
  36237. me.parameter.destroy();
  36238. me.parameter = null;
  36239. }
  36240. }
  36241. }]);
  36242. return FindClosestFacilitiesParameters;
  36243. }();
  36244. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesService.js
  36245. 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); }
  36246. function FindClosestFacilitiesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36247. 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); } }
  36248. 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; }
  36249. 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); }
  36250. function FindClosestFacilitiesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindClosestFacilitiesService_getPrototypeOf(object); if (object === null) break; } return object; }
  36251. 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); }
  36252. 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); }
  36253. 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); }; }
  36254. 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); }
  36255. function FindClosestFacilitiesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36256. 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; } }
  36257. function FindClosestFacilitiesService_getPrototypeOf(o) { FindClosestFacilitiesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindClosestFacilitiesService_getPrototypeOf(o); }
  36258. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36259. * This program are made available under the terms of the Apache License, Version 2.0
  36260. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36261. /**
  36262. * @class FindClosestFacilitiesService
  36263. * @deprecatedclass SuperMap.FindClosestFacilitiesService
  36264. * @category iServer NetworkAnalyst ClosestFacility
  36265. * @classdesc 最近设施分析服务类。
  36266. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  36267. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  36268. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  36269. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  36270. * @extends {NetworkAnalystServiceBase}
  36271. * @example
  36272. * var myfindClosestFacilitiesService = new FindClosestFacilitiesService(url, {
  36273. * eventListeners: {
  36274. * "processCompleted": findClosestFacilitiesCompleted,
  36275. * "processFailed": findClosestFacilitiesError
  36276. * }
  36277. * });
  36278. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  36279. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  36280. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  36281. * @param {Object} options - 参数。
  36282. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36283. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36284. * @param {Object} [options.headers] - 请求头。
  36285. * @usage
  36286. */
  36287. var FindClosestFacilitiesService = /*#__PURE__*/function (_NetworkAnalystServic) {
  36288. FindClosestFacilitiesService_inherits(FindClosestFacilitiesService, _NetworkAnalystServic);
  36289. var _super = FindClosestFacilitiesService_createSuper(FindClosestFacilitiesService);
  36290. function FindClosestFacilitiesService(url, options) {
  36291. var _this;
  36292. FindClosestFacilitiesService_classCallCheck(this, FindClosestFacilitiesService);
  36293. _this = _super.call(this, url, options);
  36294. _this.CLASS_NAME = "SuperMap.FindClosestFacilitiesService";
  36295. return _this;
  36296. }
  36297. /**
  36298. * @function FindClosestFacilitiesService.prototype.destroy
  36299. * @override
  36300. */
  36301. FindClosestFacilitiesService_createClass(FindClosestFacilitiesService, [{
  36302. key: "destroy",
  36303. value: function destroy() {
  36304. FindClosestFacilitiesService_get(FindClosestFacilitiesService_getPrototypeOf(FindClosestFacilitiesService.prototype), "destroy", this).call(this);
  36305. }
  36306. /**
  36307. * @function FindClosestFacilitiesService.prototype.processAsync
  36308. * @description 负责将客户端的查询参数传递到服务端。
  36309. * @param {FindClosestFacilitiesParameters} params - 最近设施分析服务参数类
  36310. */
  36311. }, {
  36312. key: "processAsync",
  36313. value: function processAsync(params) {
  36314. if (!(params instanceof FindClosestFacilitiesParameters)) {
  36315. return;
  36316. }
  36317. var me = this,
  36318. jsonObject;
  36319. me.url = Util_Util.urlPathAppend(me.url, 'closestfacility');
  36320. jsonObject = {
  36321. expectFacilityCount: params.expectFacilityCount,
  36322. fromEvent: params.fromEvent,
  36323. maxWeight: params.maxWeight,
  36324. parameter: Util_Util.toJSON(params.parameter),
  36325. event: Util_Util.toJSON(params.event),
  36326. facilities: me.getJson(params.isAnalyzeById, params.facilities)
  36327. };
  36328. me.request({
  36329. method: "GET",
  36330. params: jsonObject,
  36331. scope: me,
  36332. success: me.serviceProcessCompleted,
  36333. failure: me.serviceProcessFailed
  36334. });
  36335. }
  36336. /**
  36337. * @function FindClosestFacilitiesService.prototype.getJson
  36338. * @description 将对象转化为JSON字符串。
  36339. * @param {boolean} isAnalyzeById - 是否通过ID来分析
  36340. * @param {Array.<Object>} params - 分析参数数组
  36341. * @returns {Object} 转化后的JSON字符串。
  36342. */
  36343. }, {
  36344. key: "getJson",
  36345. value: function getJson(isAnalyzeById, params) {
  36346. var jsonString = "[",
  36347. len = params ? params.length : 0;
  36348. if (isAnalyzeById === false) {
  36349. for (var i = 0; i < len; i++) {
  36350. if (i > 0) {
  36351. jsonString += ",";
  36352. }
  36353. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  36354. }
  36355. } else if (isAnalyzeById === true) {
  36356. for (var _i2 = 0; _i2 < len; _i2++) {
  36357. if (_i2 > 0) {
  36358. jsonString += ",";
  36359. }
  36360. jsonString += params[_i2];
  36361. }
  36362. }
  36363. jsonString += ']';
  36364. return jsonString;
  36365. }
  36366. /**
  36367. * @function FindClosestFacilitiesService.prototype.toGeoJSONResult
  36368. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  36369. * @param {Object} result - 服务器返回的结果对象。
  36370. */
  36371. }, {
  36372. key: "toGeoJSONResult",
  36373. value: function toGeoJSONResult(result) {
  36374. if (!result || !result.facilityPathList) {
  36375. return result;
  36376. }
  36377. var geoJSONFormat = new GeoJSON();
  36378. result.facilityPathList.map(function (path) {
  36379. if (path.route) {
  36380. path.route = geoJSONFormat.toGeoJSON(path.route);
  36381. }
  36382. if (path.pathGuideItems) {
  36383. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  36384. }
  36385. if (path.edgeFeatures) {
  36386. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  36387. }
  36388. if (path.nodeFeatures) {
  36389. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  36390. }
  36391. return path;
  36392. });
  36393. return result;
  36394. }
  36395. }]);
  36396. return FindClosestFacilitiesService;
  36397. }(NetworkAnalystServiceBase);
  36398. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationParameters.js
  36399. function FindLocationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36400. 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); } }
  36401. 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; }
  36402. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36403. * This program are made available under the terms of the Apache License, Version 2.0
  36404. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36405. /**
  36406. * @class FindLocationParameters
  36407. * @deprecatedclass SuperMap.FindLocationParameters
  36408. * @category iServer NetworkAnalyst Location
  36409. * @classdesc 选址分区分析参数类。
  36410. * @param {Object} options - 参数。
  36411. * @param {string} options.turnWeightField - 转向权值字段的名称。
  36412. * @param {string} options.weightName - 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  36413. * @param {Array.<SupplyCenter>} options.supplyCenters - 资源供给中心集合。
  36414. * @param {number} [options.expectedSupplyCenterCount=1] - 期望用于最终设施选址的资源供给中心数量。
  36415. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分配资源。
  36416. * @usage
  36417. */
  36418. var FindLocationParameters = /*#__PURE__*/function () {
  36419. function FindLocationParameters(options) {
  36420. FindLocationParameters_classCallCheck(this, FindLocationParameters);
  36421. /**
  36422. * @member {number} [FindLocationParameters.prototype.expectedSupplyCenterCount=1]
  36423. * @description 期望用于最终设施选址的资源供给中心数量。
  36424. * 当输入值为 0 时,最终设施选址的资源供给中心数量默认为覆盖分析区域内的所需最少的供给中心数。
  36425. */
  36426. this.expectedSupplyCenterCount = null;
  36427. /**
  36428. * @member {boolean} [FindLocationParameters.prototype.isFromCenter=false]
  36429. * @description 是否从中心点开始分配资源。
  36430. * 由于网路数据中的弧段具有正反阻力,即弧段的正向阻力值与其反向阻力值可能不同,
  36431. * 因此,在进行分析时,从资源供给中心开始分配资源到需求点与从需求点向资源供给中心分配这两种分配形式下,所得的分析结果会不同。
  36432. */
  36433. this.isFromCenter = false;
  36434. /**
  36435. * @member {Array.<SupplyCenter>} FindLocationParameters.prototype.supplyCenters
  36436. * @description 资源供给中心集合。
  36437. * 资源供给中心是提供资源和服务的设施,对应于网络结点,
  36438. * 资源供给中心的相关信息包括资源量、最大阻力值、资源供给中心类型,资源供给中心在网络中所处结点的 ID 等,以便在进行选址分区分析时使用。
  36439. */
  36440. this.supplyCenters = null;
  36441. /**
  36442. * @member {string} FindLocationParameters.prototype.turnWeightField
  36443. * @description 转向权值字段的名称。
  36444. */
  36445. this.turnWeightField = null;
  36446. /**
  36447. * @member {string} FindLocationParameters.prototype.weightName
  36448. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  36449. */
  36450. this.weightName = null;
  36451. Util_Util.extend(this, options);
  36452. this.CLASS_NAME = "SuperMap.FindLocationParameters";
  36453. }
  36454. /**
  36455. * @function FindLocationParameters.prototype.destroy
  36456. * @description 释放资源,将引用资源的属性置空。
  36457. */
  36458. FindLocationParameters_createClass(FindLocationParameters, [{
  36459. key: "destroy",
  36460. value: function destroy() {
  36461. var me = this;
  36462. me.expectedSupplyCenterCount = null;
  36463. me.isFromCenter = null;
  36464. me.turnWeightField = null;
  36465. me.weightName = null;
  36466. if (me.supplyCenters) {
  36467. for (var i = 0, supplyCenters = me.supplyCenters, len = supplyCenters.length; i < len; i++) {
  36468. supplyCenters[i].destroy();
  36469. }
  36470. me.supplyCenters = null;
  36471. }
  36472. }
  36473. }]);
  36474. return FindLocationParameters;
  36475. }();
  36476. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationService.js
  36477. 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); }
  36478. function FindLocationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36479. 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); } }
  36480. 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; }
  36481. 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); }
  36482. function FindLocationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindLocationService_getPrototypeOf(object); if (object === null) break; } return object; }
  36483. 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); }
  36484. 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); }
  36485. 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); }; }
  36486. 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); }
  36487. function FindLocationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36488. 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; } }
  36489. function FindLocationService_getPrototypeOf(o) { FindLocationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindLocationService_getPrototypeOf(o); }
  36490. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36491. * This program are made available under the terms of the Apache License, Version 2.0
  36492. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36493. /**
  36494. * @class FindLocationService
  36495. * @deprecatedclass SuperMap.FindLocationService
  36496. * @category iServer NetworkAnalyst Location
  36497. * @classdesc 选址分区分析服务类。
  36498. * 选址分区分析是为了确定一个或多个待建设施的最佳或最优位置,使得设施可以用一种最经济有效的方式为需求方提供服务或者商品。
  36499. * 选址分区不仅仅是一个选址过程,还要将需求点的需求分配到相应的新建设施的服务区中,因此称之为选址与分区。
  36500. * 选址分区分析结果通过该类支持的事件的监听函数参数获取
  36501. * @extends {NetworkAnalystServiceBase}
  36502. * @example
  36503. * (start code)
  36504. * var findLocationService = new FindLocationService(url, {
  36505. * eventListeners: {
  36506. * "processCompleted": findLocationCompleted,
  36507. * "processFailed": findLocationError
  36508. * }
  36509. * });
  36510. * (end)
  36511. * @param {string} url - 服务地址。
  36512. * 如 http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  36513. * @param {Object} options - 参数。
  36514. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36515. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36516. * @param {Object} [options.headers] - 请求头。
  36517. * @usage
  36518. */
  36519. var FindLocationService = /*#__PURE__*/function (_NetworkAnalystServic) {
  36520. FindLocationService_inherits(FindLocationService, _NetworkAnalystServic);
  36521. var _super = FindLocationService_createSuper(FindLocationService);
  36522. function FindLocationService(url, options) {
  36523. var _this;
  36524. FindLocationService_classCallCheck(this, FindLocationService);
  36525. _this = _super.call(this, url, options);
  36526. _this.CLASS_NAME = "SuperMap.FindLocationService";
  36527. return _this;
  36528. }
  36529. /**
  36530. * @function FindLocationService.prototype.destroy
  36531. * @override
  36532. */
  36533. FindLocationService_createClass(FindLocationService, [{
  36534. key: "destroy",
  36535. value: function destroy() {
  36536. FindLocationService_get(FindLocationService_getPrototypeOf(FindLocationService.prototype), "destroy", this).call(this);
  36537. }
  36538. /**
  36539. * @function FindLocationService.prototype.processAsync
  36540. * @description 负责将客户端的查询参数传递到服务端。
  36541. * @param {FindLocationParameters} params - 选址分区分析服务参数类
  36542. */
  36543. }, {
  36544. key: "processAsync",
  36545. value: function processAsync(params) {
  36546. if (!(params instanceof FindLocationParameters)) {
  36547. return;
  36548. }
  36549. var me = this,
  36550. jsonObject;
  36551. me.url = Util_Util.urlPathAppend(me.url, 'location');
  36552. jsonObject = {
  36553. isFromCenter: params.isFromCenter,
  36554. expectedSupplyCenterCount: params.expectedSupplyCenterCount,
  36555. weightName: params.weightName,
  36556. turnWeightField: params.turnWeightField,
  36557. returnEdgeFeature: true,
  36558. returnEdgeGeometry: true,
  36559. returnNodeFeature: true,
  36560. mapParameter: Util_Util.toJSON(params.mapParameter),
  36561. supplyCenters: me.getCentersJson(params.supplyCenters)
  36562. };
  36563. me.request({
  36564. method: "GET",
  36565. params: jsonObject,
  36566. scope: me,
  36567. success: me.serviceProcessCompleted,
  36568. failure: me.serviceProcessFailed
  36569. });
  36570. }
  36571. /**
  36572. * @function FindLocationService.prototype.getCentersJson
  36573. * @description 将数组对象转化为JSON字符串。
  36574. * @param {Array} params - 需要转换的参数
  36575. * @returns {string} 转化后的JSON字符串。
  36576. */
  36577. }, {
  36578. key: "getCentersJson",
  36579. value: function getCentersJson(params) {
  36580. var json = "[",
  36581. len = params ? params.length : 0;
  36582. for (var i = 0; i < len; i++) {
  36583. if (i > 0) {
  36584. json += ",";
  36585. }
  36586. json += Util_Util.toJSON(params[i]);
  36587. }
  36588. json += "]";
  36589. return json;
  36590. }
  36591. /**
  36592. * @function FindLocationService.prototype.toGeoJSONResult
  36593. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  36594. * @param {Object} result - 服务器返回的结果对象。
  36595. */
  36596. }, {
  36597. key: "toGeoJSONResult",
  36598. value: function toGeoJSONResult(result) {
  36599. if (!result) {
  36600. return null;
  36601. }
  36602. var geoJSONFormat = new GeoJSON();
  36603. if (result.demandResults) {
  36604. result.demandResults = geoJSONFormat.toGeoJSON(result.demandResults);
  36605. }
  36606. if (result.supplyResults) {
  36607. result.supplyResults = geoJSONFormat.toGeoJSON(result.supplyResults);
  36608. }
  36609. return result;
  36610. }
  36611. }]);
  36612. return FindLocationService;
  36613. }(NetworkAnalystServiceBase);
  36614. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsParameters.js
  36615. function FindMTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36616. 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); } }
  36617. 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; }
  36618. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36619. * This program are made available under the terms of the Apache License, Version 2.0
  36620. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36621. /**
  36622. * @class FindMTSPPathsParameters
  36623. * @deprecatedclass SuperMap.FindMTSPPathsParameters
  36624. * @category iServer NetworkAnalyst MTSPPath
  36625. * @classdesc 多旅行商分析参数类。
  36626. * @param {Object} options - 参数。
  36627. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.centers - 配送中心集合。
  36628. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 配送目标集合。
  36629. * @param {boolean} [options.hasLeastTotalCost=false] - 配送模式是否为总花费最小方案。
  36630. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  36631. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  36632. * @usage
  36633. */
  36634. var FindMTSPPathsParameters = /*#__PURE__*/function () {
  36635. function FindMTSPPathsParameters(options) {
  36636. FindMTSPPathsParameters_classCallCheck(this, FindMTSPPathsParameters);
  36637. /**
  36638. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindMTSPPathsParameters.prototype.centers
  36639. * @description 配送中心集合。
  36640. * 当 FindMTSPPathsParameters.isAnalyzeById = false 时,centers 应为点的坐标数组;
  36641. * 当 FindMTSPPathsParameters.isAnalyzeById = true 时,centers 应为点的 ID 数组。
  36642. */
  36643. this.centers = null;
  36644. /**
  36645. * @member {boolean} [FindMTSPPathsParameters.prototype.hasLeastTotalCost=false]
  36646. * @description 配送模式是否为总花费最小方案。
  36647. * 若为 true,则按照总花费最小的模式进行配送,此时可能会出现某几个配送中心点配送的花费较多而其他配送中心点的花费很少的情况。
  36648. * 若为 false,则为局部最优,此方案会控制每个配送中心点的花费,使各个中心点花费相对平均,此时总花费不一定最小。
  36649. */
  36650. this.hasLeastTotalCost = false;
  36651. /**
  36652. * @member {boolean} [FindMTSPPathsParameters.prototype.isAnalyzeById=false]
  36653. * @description 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  36654. */
  36655. this.isAnalyzeById = false;
  36656. /**
  36657. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindMTSPPathsParameters.prototype.nodes
  36658. * @description 配送目标集合。
  36659. * 当 FindMTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  36660. * 当 FindMTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  36661. */
  36662. this.nodes = null;
  36663. /**
  36664. * @member {TransportationAnalystParameter} [FindMTSPPathsParameters.prototype.parameter]
  36665. * @description 交通网络分析通用参数。
  36666. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  36667. * TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting 字段,则返回结果空间信息等都为空。
  36668. */
  36669. this.parameter = new TransportationAnalystParameter();
  36670. Util_Util.extend(this, options);
  36671. this.CLASS_NAME = "SuperMap.FindMTSPPathsParameters";
  36672. }
  36673. /**
  36674. * @function FindMTSPPathsParameters.prototype.destroy
  36675. * @description 释放资源,将引用资源的属性置空。
  36676. */
  36677. FindMTSPPathsParameters_createClass(FindMTSPPathsParameters, [{
  36678. key: "destroy",
  36679. value: function destroy() {
  36680. var me = this;
  36681. me.centers = null;
  36682. me.hasLeastTotalCost = null;
  36683. me.isAnalyzeById = null;
  36684. me.nodes = null;
  36685. me.maxWeight = null;
  36686. if (me.parameter) {
  36687. me.parameter.destroy();
  36688. me.parameter = null;
  36689. }
  36690. }
  36691. }]);
  36692. return FindMTSPPathsParameters;
  36693. }();
  36694. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsService.js
  36695. 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); }
  36696. function FindMTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36697. 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); } }
  36698. 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; }
  36699. 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); }
  36700. function FindMTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindMTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  36701. 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); }
  36702. 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); }
  36703. 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); }; }
  36704. 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); }
  36705. function FindMTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36706. 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; } }
  36707. function FindMTSPPathsService_getPrototypeOf(o) { FindMTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindMTSPPathsService_getPrototypeOf(o); }
  36708. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36709. * This program are made available under the terms of the Apache License, Version 2.0
  36710. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36711. /**
  36712. * @class FindMTSPPathsService
  36713. * @deprecatedclass SuperMap.FindMTSPPathsService
  36714. * @category iServer NetworkAnalyst MTSPPath
  36715. * @classdesc 多旅行商分析服务类
  36716. * 多旅行商分析也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。
  36717. * 查找经济有效的配送路径,并给出相应的行走路线。
  36718. * 物流配送功能就是解决如何合理分配配送次序和送货路线,使配送总花费达到最小或每个配送中心的花费达到最小。
  36719. * 该类负责将客户端指定的多旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  36720. * 多旅行商分析结果通过该类支持的事件的监听函数参数获取。
  36721. * @extends {NetworkAnalystServiceBase}
  36722. * @example
  36723. * var myFindMTSPPathsService = new FindMTSPPathsService(url, {
  36724. * eventListeners: {
  36725. * "processCompleted": findMTSPPathsCompleted,
  36726. * "processFailed": findMTSPPathsError
  36727. * }
  36728. * });
  36729. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  36730. * http://{服务器地址}:{服务端口号}/iserver/services/网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  36731. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  36732. * @param {Object} options - 互服务时所需可选参数。如:
  36733. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36734. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36735. * @param {Object} [options.headers] - 请求头。
  36736. * @usage
  36737. */
  36738. var FindMTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  36739. FindMTSPPathsService_inherits(FindMTSPPathsService, _NetworkAnalystServic);
  36740. var _super = FindMTSPPathsService_createSuper(FindMTSPPathsService);
  36741. function FindMTSPPathsService(url, options) {
  36742. var _this;
  36743. FindMTSPPathsService_classCallCheck(this, FindMTSPPathsService);
  36744. _this = _super.call(this, url, options);
  36745. _this.CLASS_NAME = "SuperMap.FindMTSPPathsService";
  36746. return _this;
  36747. }
  36748. /**
  36749. * @function FindMTSPPathsService.prototype.destroy
  36750. * @override
  36751. */
  36752. FindMTSPPathsService_createClass(FindMTSPPathsService, [{
  36753. key: "destroy",
  36754. value: function destroy() {
  36755. FindMTSPPathsService_get(FindMTSPPathsService_getPrototypeOf(FindMTSPPathsService.prototype), "destroy", this).call(this);
  36756. }
  36757. /**
  36758. * @function FindMTSPPathsService..prototype.processAsync
  36759. * @description 负责将客户端的查询参数传递到服务端。
  36760. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类
  36761. */
  36762. }, {
  36763. key: "processAsync",
  36764. value: function processAsync(params) {
  36765. if (!(params instanceof FindMTSPPathsParameters)) {
  36766. return;
  36767. }
  36768. var me = this,
  36769. jsonObject,
  36770. //end = me.url.substr(me.url.length - 1, 1),
  36771. centers = me.getJson(params.isAnalyzeById, params.centers),
  36772. nodes = me.getJson(params.isAnalyzeById, params.nodes);
  36773. me.url = Util_Util.urlPathAppend(me.url, 'mtsppath');
  36774. jsonObject = {
  36775. centers: centers,
  36776. nodes: nodes,
  36777. parameter: Util_Util.toJSON(params.parameter),
  36778. hasLeastTotalCost: params.hasLeastTotalCost
  36779. };
  36780. me.request({
  36781. method: "GET",
  36782. params: jsonObject,
  36783. scope: me,
  36784. success: me.serviceProcessCompleted,
  36785. failure: me.serviceProcessFailed
  36786. });
  36787. }
  36788. /**
  36789. * @function FindMTSPPathsService.prototype.getJson
  36790. * @description 将对象转化为JSON字符串。
  36791. * @param {boolean} isAnalyzeById - 是否通过id分析
  36792. * @param {Array} params - 需要转换的数字
  36793. * @returns {Object} 转化后的JSON字符串。
  36794. */
  36795. }, {
  36796. key: "getJson",
  36797. value: function getJson(isAnalyzeById, params) {
  36798. var jsonString = "[",
  36799. len = params ? params.length : 0;
  36800. if (isAnalyzeById === false) {
  36801. for (var i = 0; i < len; i++) {
  36802. if (i > 0) {
  36803. jsonString += ",";
  36804. }
  36805. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  36806. }
  36807. } else if (isAnalyzeById === true) {
  36808. for (var _i2 = 0; _i2 < len; _i2++) {
  36809. if (_i2 > 0) {
  36810. jsonString += ",";
  36811. }
  36812. jsonString += params[_i2];
  36813. }
  36814. }
  36815. jsonString += ']';
  36816. return jsonString;
  36817. }
  36818. /**
  36819. * @function FindMTSPPathsService.prototype.toGeoJSONResult
  36820. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  36821. * @param {Object} result - 服务器返回的结果对象。
  36822. */
  36823. }, {
  36824. key: "toGeoJSONResult",
  36825. value: function toGeoJSONResult(result) {
  36826. if (!result || !result.pathList) {
  36827. return null;
  36828. }
  36829. var geoJSONFormat = new GeoJSON();
  36830. result.pathList.map(function (path) {
  36831. if (path.route) {
  36832. path.route = geoJSONFormat.toGeoJSON(path.route);
  36833. }
  36834. if (path.pathGuideItems) {
  36835. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  36836. }
  36837. if (path.edgeFeatures) {
  36838. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  36839. }
  36840. if (path.nodeFeatures) {
  36841. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  36842. }
  36843. return path;
  36844. });
  36845. return result;
  36846. }
  36847. }]);
  36848. return FindMTSPPathsService;
  36849. }(NetworkAnalystServiceBase);
  36850. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathParameters.js
  36851. function FindPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36852. 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); } }
  36853. 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; }
  36854. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36855. * This program are made available under the terms of the Apache License, Version 2.0
  36856. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36857. /**
  36858. * @class FindPathParameters
  36859. * @deprecatedclass SuperMap.FindPathParameters
  36860. * @category iServer NetworkAnalyst Path
  36861. * @classdesc 最佳路径分析参数类。最佳路径是在网络数据集中指定一些结点,按照顺序访问结点从而求解起止点之间阻抗最小的路径。
  36862. * 例如如果要顺序访问 1、2、3、4 四个结点,则需要分别找到1、2结点间的最佳路径 R1—2,2、3 间的最佳路径 R2—3 和 3、4 结点间的最佳路径 R3—4,
  36863. * 顺序访问 1、2、3、4 四个结点的最佳路径就是 R = R1—2 + R2—3 + R3—4。
  36864. * 阻抗就是指从一点到另一点的耗费,在实际应用中我们可以将距离、时间、花费等作为阻抗条件。
  36865. * 阻抗最小也就可以理解为从一点到另一点距离最短、时间最少、花费最低等。当两点间距离最短时为最短路径,它是最佳路径问题的一个特例。
  36866. * 阻抗值通过 {@link TransportationAnalystParameter#weightFieldName}设置。
  36867. * 计算最佳路径除了受阻抗影响外,还受转向字段的影响。转向值通过 {@link TransportationAnalystParameter#turnWeightField} 设置。
  36868. *
  36869. * @param {Object} options - 参数。
  36870. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 最佳路径分析经过的结点或设施点数组。该字段至少包含两个点。
  36871. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  36872. * @param {boolean} [options.hasLeastEdgeCount=false] - 是否按照弧段数最少的进行最佳路径分析。
  36873. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  36874. * @usage
  36875. */
  36876. var FindPathParameters = /*#__PURE__*/function () {
  36877. function FindPathParameters(options) {
  36878. FindPathParameters_classCallCheck(this, FindPathParameters);
  36879. /**
  36880. * @member {boolean} [FindPathParameters.prototype.isAnalyzeById=false]
  36881. * @description 是否通过节点 ID 指定路径分析的结点。
  36882. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  36883. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 FindPathParameters.nodes = [ID1,ID2,...];
  36884. * 反之表示通过结点坐标指定途经点,即 FindPathParameters.nodes = [{x1,y1},{x2,y2},...] 。
  36885. */
  36886. this.isAnalyzeById = false;
  36887. /**
  36888. * @member {boolean} [FindPathParameters.prototype.hasLeastEdgeCount=false]
  36889. * @description 是否按照弧段数最少的进行最佳路径分析。
  36890. * true 表示按照弧段数最少进行分析,返回弧段数最少的路径中一个阻抗最小的最佳路径;
  36891. * false 表示直接返回阻抗最小的路径,而不考虑弧段的多少。
  36892. */
  36893. this.hasLeastEdgeCount = null;
  36894. /**
  36895. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindPathParameters.prototype.nodes
  36896. * @description 最佳路径分析经过的结点或设施点数组,必设字段。该字段至少包含两个点。
  36897. * 当 FindPathParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  36898. * 当 FindPathParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  36899. */
  36900. this.nodes = null;
  36901. /**
  36902. * @member {TransportationAnalystParameter} FindPathParameters.prototype.parameter
  36903. * @description 交通网络分析通用参数。
  36904. */
  36905. this.parameter = new TransportationAnalystParameter();
  36906. Util_Util.extend(this, options);
  36907. this.CLASS_NAME = "SuperMap.FindPathParameters";
  36908. }
  36909. /**
  36910. * @function FindPathParameters.prototype.destroy
  36911. * @description 释放资源,将引用资源的属性置空。
  36912. */
  36913. FindPathParameters_createClass(FindPathParameters, [{
  36914. key: "destroy",
  36915. value: function destroy() {
  36916. var me = this;
  36917. me.isAnalyzeById = null;
  36918. me.hasLeastEdgeCount = null;
  36919. me.nodes = null;
  36920. if (me.parameter) {
  36921. me.parameter.destroy();
  36922. me.parameter = null;
  36923. }
  36924. }
  36925. }]);
  36926. return FindPathParameters;
  36927. }();
  36928. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathService.js
  36929. 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); }
  36930. function FindPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36931. 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); } }
  36932. 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; }
  36933. 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); }
  36934. function FindPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  36935. 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); }
  36936. 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); }
  36937. 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); }; }
  36938. 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); }
  36939. function FindPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36940. 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; } }
  36941. function FindPathService_getPrototypeOf(o) { FindPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindPathService_getPrototypeOf(o); }
  36942. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  36943. * This program are made available under the terms of the Apache License, Version 2.0
  36944. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36945. /**
  36946. * @class FindPathService
  36947. * @deprecatedclass SuperMap.FindPathService
  36948. * @category iServer NetworkAnalyst Path
  36949. * @classdesc 最佳路径分析服务类。
  36950. * 最佳路径是在网络数据集中指定一些节点,按照节点的选择顺序,
  36951. * 顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  36952. * 该类负责将客户端指定的最佳路径分析参数传递给服务端,并接收服务端返回的结果数据。
  36953. * 最佳路径分析结果通过该类支持的事件的监听函数参数获取
  36954. * @extends {NetworkAnalystServiceBase}
  36955. * @example
  36956. * var myFindPathService = new FindPathService(url, {
  36957. * eventListeners: {
  36958. * "processCompleted": findPathCompleted,
  36959. * "processFailed": findPathError
  36960. * }
  36961. * });
  36962. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  36963. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  36964. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  36965. * @param {Object} options - 参数。
  36966. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  36967. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36968. * @param {Object} [options.headers] - 请求头。
  36969. * @usage
  36970. */
  36971. var FindPathService = /*#__PURE__*/function (_NetworkAnalystServic) {
  36972. FindPathService_inherits(FindPathService, _NetworkAnalystServic);
  36973. var _super = FindPathService_createSuper(FindPathService);
  36974. function FindPathService(url, options) {
  36975. var _this;
  36976. FindPathService_classCallCheck(this, FindPathService);
  36977. _this = _super.call(this, url, options);
  36978. _this.CLASS_NAME = "SuperMap.FindPathService";
  36979. return _this;
  36980. }
  36981. /**
  36982. * @function FindPathService.prototype.destroy
  36983. * @override
  36984. */
  36985. FindPathService_createClass(FindPathService, [{
  36986. key: "destroy",
  36987. value: function destroy() {
  36988. FindPathService_get(FindPathService_getPrototypeOf(FindPathService.prototype), "destroy", this).call(this);
  36989. }
  36990. /**
  36991. * @function FindPathService.prototype.processAsync
  36992. * @description 负责将客户端的查询参数传递到服务端。
  36993. * @param {FindPathParameters} params - 最佳路径分析服务参数类
  36994. */
  36995. }, {
  36996. key: "processAsync",
  36997. value: function processAsync(params) {
  36998. if (!(params instanceof FindPathParameters)) {
  36999. return;
  37000. }
  37001. var me = this,
  37002. jsonObject;
  37003. me.url = Util_Util.urlPathAppend(me.url, 'path');
  37004. jsonObject = {
  37005. hasLeastEdgeCount: params.hasLeastEdgeCount,
  37006. parameter: Util_Util.toJSON(params.parameter),
  37007. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  37008. };
  37009. me.request({
  37010. method: "GET",
  37011. params: jsonObject,
  37012. scope: me,
  37013. success: me.serviceProcessCompleted,
  37014. failure: me.serviceProcessFailed
  37015. });
  37016. }
  37017. /**
  37018. * @function FindPathService.prototype.getJson
  37019. * @description 将对象转化为JSON字符串。
  37020. * @param {boolean} isAnalyzeById - 是否通过id分析
  37021. * @param {Array} params - 需要转换的数字
  37022. * @returns {Object} 转化后的JSON字符串。
  37023. */
  37024. }, {
  37025. key: "getJson",
  37026. value: function getJson(isAnalyzeById, params) {
  37027. var jsonString = "[",
  37028. len = params ? params.length : 0;
  37029. if (isAnalyzeById === false) {
  37030. for (var i = 0; i < len; i++) {
  37031. if (i > 0) {
  37032. jsonString += ",";
  37033. }
  37034. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  37035. }
  37036. } else if (isAnalyzeById === true) {
  37037. for (var _i2 = 0; _i2 < len; _i2++) {
  37038. if (_i2 > 0) {
  37039. jsonString += ",";
  37040. }
  37041. jsonString += params[_i2];
  37042. }
  37043. }
  37044. jsonString += ']';
  37045. return jsonString;
  37046. }
  37047. /**
  37048. * @function FindMTSPPathsService.prototype.toGeoJSONResult
  37049. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  37050. * @param {Object} result - 服务器返回的结果对象。
  37051. */
  37052. }, {
  37053. key: "toGeoJSONResult",
  37054. value: function toGeoJSONResult(result) {
  37055. if (!result || !result.pathList || result.pathList.length < 1) {
  37056. return null;
  37057. }
  37058. var geoJSONFormat = new GeoJSON();
  37059. result.pathList.forEach(function (path) {
  37060. if (path.route) {
  37061. path.route = geoJSONFormat.toGeoJSON(path.route);
  37062. }
  37063. if (path.pathGuideItems) {
  37064. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  37065. }
  37066. if (path.edgeFeatures) {
  37067. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  37068. }
  37069. if (path.nodeFeatures) {
  37070. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  37071. }
  37072. });
  37073. return result;
  37074. }
  37075. }]);
  37076. return FindPathService;
  37077. }(NetworkAnalystServiceBase);
  37078. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasParameters.js
  37079. function FindServiceAreasParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37080. 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); } }
  37081. 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; }
  37082. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37083. * This program are made available under the terms of the Apache License, Version 2.0
  37084. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37085. /**
  37086. * @class FindServiceAreasParameters
  37087. * @deprecatedclass SuperMap.FindServiceAreasParameters
  37088. * @category iServer NetworkAnalyst ServiceArea
  37089. * @classdesc 服务区分析参数类。
  37090. * 服务区分析是以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  37091. * 例如:计算某快餐店能够在30分钟内送达快餐的区域。
  37092. * @param {Object} options - 参数。
  37093. * @param {Array.<number>} options.weights - 每个服务站点提供服务的阻力半径,超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  37094. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.centers - 服务站点数组。
  37095. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  37096. * @param {boolean} [options.isCenterMutuallyExclusive=false] - 是否中心点互斥。
  37097. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分析。
  37098. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  37099. * @usage
  37100. */
  37101. var FindServiceAreasParameters = /*#__PURE__*/function () {
  37102. function FindServiceAreasParameters(options) {
  37103. FindServiceAreasParameters_classCallCheck(this, FindServiceAreasParameters);
  37104. /**
  37105. * @member {boolean} [FindServiceAreasParameters.prototype.isAnalyzeById=false]
  37106. * @description 是否通过节点 ID 指定路径分析的结点。
  37107. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  37108. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 FindServiceAreasParameters.centers = [ID1,ID2,...];
  37109. * 反之表示通过结点坐标指定途经点,即 FindServiceAreasParameters.centers = [{x1,y1},{x2,y2},...]。
  37110. */
  37111. this.isAnalyzeById = false;
  37112. /**
  37113. * @member {boolean} [FindServiceAreasParameters.prototype.isCenterMutuallyExclusive=false]
  37114. * @description 是否中心点互斥,即按照中心点的距离进行判断是否要进行互斥处理。
  37115. * 若分析出的服务区有重叠的部分,则通过设置该参数进行互斥处理。
  37116. */
  37117. this.isCenterMutuallyExclusive = false;
  37118. /**
  37119. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindServiceAreasParameters.prototype.centers
  37120. * @description 服务站点数组。
  37121. * 当该类的 iSAnalyzeById = true 时,通过结点 ID 号指定服务站点;当 iSAnalyzeById = false 时,通过点坐标指定服务站点。
  37122. */
  37123. this.centers = null;
  37124. /**
  37125. * @member {boolean} [FindServiceAreasParameters.prototype.isFromCenter=false]
  37126. * @description 是否从中心点开始分析。
  37127. * 从中心点开始分析和不从中心点开始分析,体现了服务中心和需要该服务的需求地的关系模式。
  37128. * 从中心点开始分析,是一个服务中心向服务需求地提供服务;
  37129. * 而不从中心点开始分析,是一个服务需求地主动到服务中心获得服务。
  37130. */
  37131. this.isFromCenter = false;
  37132. /**
  37133. * APIProperty: weights
  37134. * @member {Array.<number>} FindServiceAreasParameters.prototype.weights
  37135. * @description 每个服务站点提供服务的阻力半径,即超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  37136. * 该字段为一个数组,数组长度跟服务中心个数一致,按照索引顺序与站点一一对应,每个元素表示了在对每个服务中心进行服务区分析时,所用的服务半径。
  37137. */
  37138. this.weights = null;
  37139. /**
  37140. * @member {TransportationAnalystParameter} FindServiceAreasParameters.prototype.parameter
  37141. * @description 交通网络分析通用参数。
  37142. */
  37143. this.parameter = new TransportationAnalystParameter();
  37144. Util_Util.extend(this, options);
  37145. this.CLASS_NAME = "SuperMap.FindServiceAreasParameters";
  37146. }
  37147. /**
  37148. * @function FindServiceAreasParameters.prototype.destroy
  37149. * @description 释放资源,将引用资源的属性置空。
  37150. */
  37151. FindServiceAreasParameters_createClass(FindServiceAreasParameters, [{
  37152. key: "destroy",
  37153. value: function destroy() {
  37154. var me = this;
  37155. me.isAnalyzeById = null;
  37156. me.isCenterMutuallyExclusive = null;
  37157. me.centers = null;
  37158. me.isFromCenter = null;
  37159. me.weights = null;
  37160. if (me.parameter) {
  37161. me.parameter.destroy();
  37162. me.parameter = null;
  37163. }
  37164. }
  37165. }]);
  37166. return FindServiceAreasParameters;
  37167. }();
  37168. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasService.js
  37169. 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); }
  37170. function FindServiceAreasService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37171. 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); } }
  37172. 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; }
  37173. 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); }
  37174. function FindServiceAreasService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindServiceAreasService_getPrototypeOf(object); if (object === null) break; } return object; }
  37175. 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); }
  37176. 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); }
  37177. 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); }; }
  37178. 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); }
  37179. function FindServiceAreasService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37180. 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; } }
  37181. function FindServiceAreasService_getPrototypeOf(o) { FindServiceAreasService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindServiceAreasService_getPrototypeOf(o); }
  37182. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37183. * This program are made available under the terms of the Apache License, Version 2.0
  37184. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37185. /**
  37186. * @class FindServiceAreasService
  37187. * @deprecatedclass SuperMap.FindServiceAreasService
  37188. * @category iServer NetworkAnalyst ServiceArea
  37189. * @classdesc 服务区分析服务类。
  37190. * 服务区分析是以指定服务站点为中心,
  37191. * 在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  37192. * 该类负责将客户端指定的服务区分析参数传递给服务端,并接收服务端返回的结果数据。
  37193. * 服务区分析结果通过该类支持的事件的监听函数参数获取
  37194. * @extends {NetworkAnalystServiceBase}
  37195. * @example
  37196. * var myFindServiceAreasService = new FindServiceAreasService(url, {
  37197. * eventListeners: {
  37198. * "processCompleted": findServiceAreasCompleted,
  37199. * "processFailed": findServiceAreasError
  37200. * }
  37201. * });
  37202. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  37203. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  37204. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  37205. * @param {Object} options - 互服务时所需可选参数。如:
  37206. * @param {Object} options.eventListeners - 需要被注册的监听器对象
  37207. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37208. * @param {Object} [options.headers] - 请求头。
  37209. * @usage
  37210. */
  37211. var FindServiceAreasService = /*#__PURE__*/function (_NetworkAnalystServic) {
  37212. FindServiceAreasService_inherits(FindServiceAreasService, _NetworkAnalystServic);
  37213. var _super = FindServiceAreasService_createSuper(FindServiceAreasService);
  37214. function FindServiceAreasService(url, options) {
  37215. var _this;
  37216. FindServiceAreasService_classCallCheck(this, FindServiceAreasService);
  37217. _this = _super.call(this, url, options);
  37218. _this.CLASS_NAME = "SuperMap.FindServiceAreasService";
  37219. return _this;
  37220. }
  37221. /**
  37222. * @function FindServiceAreasService.prototype.destroy
  37223. * @override
  37224. */
  37225. FindServiceAreasService_createClass(FindServiceAreasService, [{
  37226. key: "destroy",
  37227. value: function destroy() {
  37228. FindServiceAreasService_get(FindServiceAreasService_getPrototypeOf(FindServiceAreasService.prototype), "destroy", this).call(this);
  37229. }
  37230. /**
  37231. * @function FindServiceAreasService.prototype.processAsync
  37232. * @description 负责将客户端的查询参数传递到服务端。
  37233. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类
  37234. */
  37235. }, {
  37236. key: "processAsync",
  37237. value: function processAsync(params) {
  37238. if (!(params instanceof FindServiceAreasParameters)) {
  37239. return;
  37240. }
  37241. var me = this,
  37242. jsonObject;
  37243. me.url = Util_Util.urlPathAppend(me.url, 'servicearea');
  37244. jsonObject = {
  37245. isFromCenter: params.isFromCenter,
  37246. isCenterMutuallyExclusive: params.isCenterMutuallyExclusive,
  37247. parameter: Util_Util.toJSON(params.parameter),
  37248. centers: me.getJson(params.isAnalyzeById, params.centers),
  37249. weights: me.getJson(true, params.weights)
  37250. };
  37251. me.request({
  37252. method: "GET",
  37253. params: jsonObject,
  37254. scope: me,
  37255. success: me.serviceProcessCompleted,
  37256. failure: me.serviceProcessFailed
  37257. });
  37258. }
  37259. /**
  37260. * @function FindServiceAreasService.prototype.getJson
  37261. * @description 将对象转化为JSON字符串。
  37262. * @param {boolean} isAnalyzeById - 是否通过id分析
  37263. * @param {Array} params - 需要转换的数字
  37264. * @returns {Object} 转化后的JSON字符串。
  37265. */
  37266. }, {
  37267. key: "getJson",
  37268. value: function getJson(isAnalyzeById, params) {
  37269. var jsonString = "[",
  37270. len = params ? params.length : 0;
  37271. if (isAnalyzeById === false) {
  37272. for (var i = 0; i < len; i++) {
  37273. if (i > 0) {
  37274. jsonString += ",";
  37275. }
  37276. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  37277. }
  37278. } else if (isAnalyzeById === true) {
  37279. for (var _i2 = 0; _i2 < len; _i2++) {
  37280. if (_i2 > 0) {
  37281. jsonString += ",";
  37282. }
  37283. jsonString += params[_i2];
  37284. }
  37285. }
  37286. jsonString += ']';
  37287. return jsonString;
  37288. }
  37289. /**
  37290. * @function FindServiceAreasService.prototype.toGeoJSONResult
  37291. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  37292. * @param {Object} result - 服务器返回的结果对象。
  37293. */
  37294. }, {
  37295. key: "toGeoJSONResult",
  37296. value: function toGeoJSONResult(result) {
  37297. if (!result || !result.serviceAreaList) {
  37298. return result;
  37299. }
  37300. var geoJSONFormat = new GeoJSON();
  37301. result.serviceAreaList.map(function (serviceArea) {
  37302. if (serviceArea.serviceRegion) {
  37303. serviceArea.serviceRegion = geoJSONFormat.toGeoJSON(serviceArea.serviceRegion);
  37304. }
  37305. if (serviceArea.edgeFeatures) {
  37306. serviceArea.edgeFeatures = geoJSONFormat.toGeoJSON(serviceArea.edgeFeatures);
  37307. }
  37308. if (serviceArea.nodeFeatures) {
  37309. serviceArea.nodeFeatures = geoJSONFormat.toGeoJSON(serviceArea.nodeFeatures);
  37310. }
  37311. if (serviceArea.routes) {
  37312. serviceArea.routes = geoJSONFormat.toGeoJSON(serviceArea.routes);
  37313. }
  37314. return serviceArea;
  37315. });
  37316. return result;
  37317. }
  37318. }]);
  37319. return FindServiceAreasService;
  37320. }(NetworkAnalystServiceBase);
  37321. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsParameters.js
  37322. function FindTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37323. 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); } }
  37324. 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; }
  37325. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37326. * This program are made available under the terms of the Apache License, Version 2.0
  37327. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37328. /**
  37329. * @class FindTSPPathsParameters
  37330. * @deprecatedclass SuperMap.FindTSPPathsParameters
  37331. * @category iServer NetworkAnalyst TSPPath
  37332. * @classdesc 旅行商分析参数类。
  37333. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  37334. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  37335. * 旅行商分析和最佳路径分析都是在网络中寻找遍历所有站点的最经济的路径,区别是在遍历网络所有站点的过程中对结点访问顺序不同。
  37336. * 最佳路径分析必须按照指定顺序对站点进行访问,而旅行商分析是无序的路径分析。
  37337. * @param {Object} options - 参数。
  37338. * @param {boolean} [options.endNodeAssigned=false] - 是否指定终止点,将指定的途经点的最后一个点作为终止点。true 表示指定终止点,则旅行商必须最后一个访问终止点。
  37339. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点。
  37340. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} options.nodes - 配送目标集合。
  37341. * @param {TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  37342. * @usage
  37343. */
  37344. var FindTSPPathsParameters = /*#__PURE__*/function () {
  37345. function FindTSPPathsParameters(options) {
  37346. FindTSPPathsParameters_classCallCheck(this, FindTSPPathsParameters);
  37347. /**
  37348. * @member {boolean} [FindTSPPathsParameters.prototype.endNodeAssigned=false]
  37349. * @description 是否指定终止点,将指定的途经点的最后一个点作为终止点。
  37350. * true 表示指定终止点,则旅行商必须最后一个访问终止点。
  37351. */
  37352. this.endNodeAssigned = false;
  37353. /**
  37354. * @member {boolean} [FindTSPPathsParameters.prototype.isAnalyzeById=false]
  37355. * @description 是否通过节点 ID 号来指定途经点。
  37356. */
  37357. this.isAnalyzeById = false;
  37358. /**
  37359. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>>} FindTSPPathsParameters.prototype.nodes
  37360. * @description 旅行商分析途经点数组。
  37361. * 当 FindTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  37362. * 当 FindTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  37363. */
  37364. this.nodes = null;
  37365. /**
  37366. * @member {TransportationAnalystParameter} [FindTSPPathsParameters.prototype.parameter]
  37367. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  37368. * TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting
  37369. * 字段,则返回结果空间信息等都为空。
  37370. */
  37371. this.parameter = new TransportationAnalystParameter();
  37372. Util_Util.extend(this, options);
  37373. this.CLASS_NAME = "SuperMap.FindTSPPathsParameters";
  37374. }
  37375. /**
  37376. * @function FindTSPPathsParameters.prototype.destroy
  37377. * @description 释放资源,将引用资源的属性置空。
  37378. */
  37379. FindTSPPathsParameters_createClass(FindTSPPathsParameters, [{
  37380. key: "destroy",
  37381. value: function destroy() {
  37382. var me = this;
  37383. me.endNodeAssigned = null;
  37384. me.isAnalyzeById = null;
  37385. me.nodes = null;
  37386. if (me.parameter) {
  37387. me.parameter.destroy();
  37388. me.parameter = null;
  37389. }
  37390. }
  37391. }]);
  37392. return FindTSPPathsParameters;
  37393. }();
  37394. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsService.js
  37395. 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); }
  37396. function FindTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37397. 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); } }
  37398. 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; }
  37399. 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); }
  37400. function FindTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  37401. 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); }
  37402. 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); }
  37403. 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); }; }
  37404. 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); }
  37405. function FindTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37406. 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; } }
  37407. function FindTSPPathsService_getPrototypeOf(o) { FindTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindTSPPathsService_getPrototypeOf(o); }
  37408. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37409. * This program are made available under the terms of the Apache License, Version 2.0
  37410. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37411. /**
  37412. * @class FindTSPPathsService
  37413. * @deprecatedclass SuperMap.FindTSPPathsService
  37414. * @category iServer NetworkAnalyst TSPPath
  37415. * @classdesc 旅行商分析服务类
  37416. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  37417. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  37418. * 该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  37419. * 旅行商分析结果通过该类支持的事件的监听函数参数获取
  37420. * @extends {NetworkAnalystServiceBase}
  37421. * @example
  37422. * (start code)
  37423. * var myFindTSPPathsService = new FindTSPPathsService(url, {
  37424. * eventListeners: {
  37425. * "processCompleted": findTSPPathsCompleted,
  37426. * "processFailed": findTSPPathsError
  37427. * }
  37428. * });
  37429. * (end)
  37430. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  37431. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  37432. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  37433. * @param {Object} options - 参数。
  37434. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37435. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37436. * @param {Object} [options.headers] - 请求头。
  37437. * @usage
  37438. */
  37439. var FindTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  37440. FindTSPPathsService_inherits(FindTSPPathsService, _NetworkAnalystServic);
  37441. var _super = FindTSPPathsService_createSuper(FindTSPPathsService);
  37442. function FindTSPPathsService(url, options) {
  37443. var _this;
  37444. FindTSPPathsService_classCallCheck(this, FindTSPPathsService);
  37445. _this = _super.call(this, url, options);
  37446. _this.CLASS_NAME = "SuperMap.FindTSPPathsService";
  37447. return _this;
  37448. }
  37449. /**
  37450. * @function FindTSPPathsService.prototype.destroy
  37451. * @override
  37452. */
  37453. FindTSPPathsService_createClass(FindTSPPathsService, [{
  37454. key: "destroy",
  37455. value: function destroy() {
  37456. FindTSPPathsService_get(FindTSPPathsService_getPrototypeOf(FindTSPPathsService.prototype), "destroy", this).call(this);
  37457. }
  37458. /**
  37459. * @function FindTSPPathsService.prototype.processAsync
  37460. * @description 负责将客户端的查询参数传递到服务端。
  37461. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  37462. */
  37463. }, {
  37464. key: "processAsync",
  37465. value: function processAsync(params) {
  37466. if (!(params instanceof FindTSPPathsParameters)) {
  37467. return;
  37468. }
  37469. var me = this,
  37470. jsonObject;
  37471. me.url = Util_Util.urlPathAppend(me.url, 'tsppath');
  37472. jsonObject = {
  37473. parameter: Util_Util.toJSON(params.parameter),
  37474. endNodeAssigned: params.endNodeAssigned,
  37475. nodes: me.getNodesJson(params)
  37476. };
  37477. me.request({
  37478. method: "GET",
  37479. params: jsonObject,
  37480. scope: me,
  37481. success: me.serviceProcessCompleted,
  37482. failure: me.serviceProcessFailed
  37483. });
  37484. }
  37485. /**
  37486. * @function FindTSPPathsService.prototype.getNodesJson
  37487. * @description 将节点对象转化为JSON字符串。
  37488. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  37489. * @returns {string} 转化后的JSON字符串。
  37490. */
  37491. }, {
  37492. key: "getNodesJson",
  37493. value: function getNodesJson(params) {
  37494. var jsonParameters = "",
  37495. nodesString,
  37496. i,
  37497. len,
  37498. nodes;
  37499. if (params.isAnalyzeById === false) {
  37500. for (nodesString = "[", i = 0, nodes = params.nodes, len = nodes.length; i < len; i++) {
  37501. if (i > 0) {
  37502. nodesString += ",";
  37503. }
  37504. nodesString += '{"x":' + nodes[i].x + ',"y":' + nodes[i].y + '}';
  37505. }
  37506. nodesString += ']';
  37507. jsonParameters += nodesString;
  37508. } else if (params.isAnalyzeById === true) {
  37509. var nodeIDsString = "[",
  37510. _nodes = params.nodes,
  37511. _len = _nodes.length;
  37512. for (var _i2 = 0; _i2 < _len; _i2++) {
  37513. if (_i2 > 0) {
  37514. nodeIDsString += ",";
  37515. }
  37516. nodeIDsString += _nodes[_i2];
  37517. }
  37518. nodeIDsString += ']';
  37519. jsonParameters += nodeIDsString;
  37520. }
  37521. return jsonParameters;
  37522. }
  37523. /**
  37524. * @function FindTSPPathsService.prototype.toGeoJSONResult
  37525. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  37526. * @param {Object} result - 服务器返回的结果对象。
  37527. */
  37528. }, {
  37529. key: "toGeoJSONResult",
  37530. value: function toGeoJSONResult(result) {
  37531. if (!result || !result.tspPathList) {
  37532. return null;
  37533. }
  37534. var geoJSONFormat = new GeoJSON();
  37535. result.tspPathList.forEach(function (path) {
  37536. if (path.route) {
  37537. path.route = geoJSONFormat.toGeoJSON(path.route);
  37538. }
  37539. if (path.pathGuideItems) {
  37540. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  37541. }
  37542. if (path.edgeFeatures) {
  37543. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  37544. }
  37545. if (path.nodeFeatures) {
  37546. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  37547. }
  37548. });
  37549. return result;
  37550. }
  37551. }]);
  37552. return FindTSPPathsService;
  37553. }(NetworkAnalystServiceBase);
  37554. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataParameters.js
  37555. function GenerateSpatialDataParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37556. 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); } }
  37557. 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; }
  37558. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37559. * This program are made available under the terms of the Apache License, Version 2.0
  37560. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37561. /**
  37562. * @class GenerateSpatialDataParameters
  37563. * @deprecatedclass SuperMap.GenerateSpatialDataParameters
  37564. * @category iServer SpatialAnalyst GenerateSpatialData
  37565. * @classdesc 动态分段操作参数类。通过该类可以为动态分段提供参数信息。
  37566. * @param {Object} options - 参数。
  37567. * @param {string} options.routeTable - 路由数据集。
  37568. * @param {string} options.routeIDField - 路由数据集的标识字段。
  37569. * @param {string} options.eventTable - 用于生成空间数据的事件表名。
  37570. * @param {DataReturnOption} options.dataReturnOption - 设置数据返回选项。
  37571. * @param {string} [options.attributeFilter] - 属性过滤条件。
  37572. * @param {string} options.eventRouteIDField - 用于生成空间数据的事件表的路由标识字段。
  37573. * @param {string} [options.measureField] - 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  37574. * @param {string} [options.measureStartField] - 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  37575. * @param {string} [options.measureEndField] - 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  37576. * @param {string} [options.measureOffsetField] - 刻度偏移量字段。
  37577. * @param {string} [options.errorInfoField] - 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  37578. * @param {Array.<string>} [options.retainedFields] - 欲保留到结果空间数据中的字段集合(系统字段除外)。
  37579. * @usage
  37580. */
  37581. var GenerateSpatialDataParameters = /*#__PURE__*/function () {
  37582. function GenerateSpatialDataParameters(options) {
  37583. GenerateSpatialDataParameters_classCallCheck(this, GenerateSpatialDataParameters);
  37584. /**
  37585. * @member {string} GenerateSpatialDataParameters.prototype.routeTable
  37586. * @description 路由数据集。
  37587. */
  37588. this.routeTable = null;
  37589. /**
  37590. * @member {string} GenerateSpatialDataParameters.prototype.routeIDField
  37591. * @description 路由数据集的标识字段。
  37592. */
  37593. this.routeIDField = null;
  37594. /**
  37595. * @member {string} [GenerateSpatialDataParameters.prototype.attributeFilter]
  37596. * @description 属性过滤条件。
  37597. * 当 {@link GenerateSpatialDataParameters.prototype.dataReturnOption.dataReturnMode} 为 {@link DataReturnMode.DATASET_AND_RECORDSET} 或 {@link DataReturnMode.RECORDSET_ONLY} 时有效。
  37598. */
  37599. this.attributeFilter = null;
  37600. /**
  37601. * @member {string} GenerateSpatialDataParameters.prototype.eventTable
  37602. * @description 用于生成空间数据的事件表名。
  37603. */
  37604. this.eventTable = null;
  37605. /**
  37606. * @member {string} GenerateSpatialDataParameters.prototype.eventRouteIDField
  37607. * @description 用于生成空间数据的事件表的路由标识字段。
  37608. */
  37609. this.eventRouteIDField = null;
  37610. /**
  37611. * @member {string} [GenerateSpatialDataParameters.prototype.measureField]
  37612. * @description 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  37613. */
  37614. this.measureField = null;
  37615. /**
  37616. * @member {string} [GenerateSpatialDataParameters.prototype.measureStartField]
  37617. * @description 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  37618. */
  37619. this.measureStartField = null;
  37620. /**
  37621. * @member {string} [GenerateSpatialDataParameters.prototype.measureEndField]
  37622. * @description 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  37623. */
  37624. this.measureEndField = null;
  37625. /**
  37626. * @member {string} [GenerateSpatialDataParameters.prototype.measureOffsetField]
  37627. * @description 刻度偏移量字段。
  37628. */
  37629. this.measureOffsetField = null;
  37630. /**
  37631. * @member {string} [GenerateSpatialDataParameters.prototype.errorInfoField]
  37632. * @description 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  37633. */
  37634. this.errorInfoField = null;
  37635. /**
  37636. * @member {Array.<string>} [GenerateSpatialDataParameters.prototype.retainedFields]
  37637. * @description 欲保留到结果空间数据中的字段集合(系统字段除外)。
  37638. * 生成空间数据时,无论是否指定保留字段,路由 ID 字段、刻度偏移量字段、刻度值字段(点事件为刻度字段,线事件是起始和终止刻度字段)都会保留到结果空间数据中;
  37639. * 如果没有指定 retainedFields 参数或者 retainedFields 参数数组长度为 0,则返回所有用户字段。
  37640. */
  37641. this.retainedFields = null;
  37642. /**
  37643. * @member {DataReturnOption} GenerateSpatialDataParameters.prototype.dataReturnOption
  37644. * @description 设置数据返回的选项。
  37645. */
  37646. this.dataReturnOption = null;
  37647. if (options) {
  37648. Util_Util.extend(this, options);
  37649. }
  37650. this.CLASS_NAME = "SuperMap.GenerateSpatialDataParameters";
  37651. }
  37652. /**
  37653. * @function GenerateSpatialDataParameters.prototype.destroy
  37654. * @description 释放资源,将引用资源的属性置空。
  37655. */
  37656. GenerateSpatialDataParameters_createClass(GenerateSpatialDataParameters, [{
  37657. key: "destroy",
  37658. value: function destroy() {
  37659. var me = this;
  37660. if (me.routeTable) {
  37661. me.routeTable = null;
  37662. }
  37663. me.routeIDField = null;
  37664. me.attributeFilter = null;
  37665. me.eventTable = null;
  37666. me.eventRouteIDField = null;
  37667. me.measureField = null;
  37668. me.measureStartField = null;
  37669. me.measureEndField = null;
  37670. me.measureOffsetField = null;
  37671. me.errorInfoField = null;
  37672. if (me.dataReturnOption) {
  37673. me.dataReturnOption.destroy();
  37674. me.dataReturnOption = null;
  37675. }
  37676. }
  37677. }]);
  37678. return GenerateSpatialDataParameters;
  37679. }();
  37680. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataService.js
  37681. 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); }
  37682. function GenerateSpatialDataService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37683. 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); } }
  37684. 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; }
  37685. 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); }
  37686. function GenerateSpatialDataService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GenerateSpatialDataService_getPrototypeOf(object); if (object === null) break; } return object; }
  37687. 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); }
  37688. 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); }
  37689. 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); }; }
  37690. 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); }
  37691. function GenerateSpatialDataService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37692. 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; } }
  37693. function GenerateSpatialDataService_getPrototypeOf(o) { GenerateSpatialDataService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GenerateSpatialDataService_getPrototypeOf(o); }
  37694. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37695. * This program are made available under the terms of the Apache License, Version 2.0
  37696. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37697. /**
  37698. * @class GenerateSpatialDataService
  37699. * @deprecatedclass SuperMap.GenerateSpatialDataService
  37700. * @category iServer SpatialAnalyst GenerateSpatialData
  37701. * @classdesc 动态分段分析服务类。该类负责将客户设置的动态分段分析服务参数传递给服务端,并接收服务端返回的动态分段分析结果数据。
  37702. * 获取的结果数据包括 originResult 、result 两种,其中,originResult 为服务端返回的用 JSON 对象表示的动态分段分析结果数据,result 为服务端返回的动态分段分析结果数据。
  37703. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  37704. * @param {Object} options - 参数。</br>
  37705. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37706. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37707. * @param {Object} [options.headers] - 请求头。
  37708. * @extends {SpatialAnalystBase}
  37709. * @example 实例化该类如下例所示:
  37710. * (start code)
  37711. * function GenerateSpatialData(){
  37712. *
  37713. * //配置数据返回选项(option)
  37714. * var option = new DataReturnOption({
  37715. * expectCount: 1000,
  37716. * dataset: "generateSpatialData",
  37717. * deleteExistResultDataset: true,
  37718. * dataReturnMode: DataReturnMode.DATASET_ONLY
  37719. * }),
  37720. * //配置动态分段参数(Parameters)
  37721. * parameters = new GenerateSpatialDataParameters({
  37722. * routeTable: "RouteDT_road@Changchun",
  37723. * routeIDField: "RouteID",
  37724. * eventTable: "LinearEventTabDT@Changchun",
  37725. * eventRouteIDField: "RouteID",
  37726. * measureField: "",
  37727. * measureStartField: "LineMeasureFrom",
  37728. * measureEndField: "LineMeasureTo",
  37729. * measureOffsetField: "",
  37730. * errorInfoField: "",
  37731. * retainedFields:[],
  37732. * dataReturnOption: option
  37733. * }),
  37734. * //配置动态分段iService
  37735. * iService = new GenerateSpatialDataService(Changchun_spatialanalyst, {
  37736. * eventListeners: {
  37737. * processCompleted: generateCompleted,
  37738. * processFailed: generateFailded
  37739. * }
  37740. * });
  37741. * //执行
  37742. * iService.processAsync(parameters);
  37743. * function Completed(generateSpatialDataEventArgs){//todo};
  37744. * function Error(generateSpatialDataEventArgs){//todo};
  37745. * (end)
  37746. * @usage
  37747. */
  37748. var GenerateSpatialDataService = /*#__PURE__*/function (_SpatialAnalystBase) {
  37749. GenerateSpatialDataService_inherits(GenerateSpatialDataService, _SpatialAnalystBase);
  37750. var _super = GenerateSpatialDataService_createSuper(GenerateSpatialDataService);
  37751. function GenerateSpatialDataService(url, options) {
  37752. var _this;
  37753. GenerateSpatialDataService_classCallCheck(this, GenerateSpatialDataService);
  37754. _this = _super.call(this, url, options);
  37755. _this.CLASS_NAME = "SuperMap.GenerateSpatialDataService";
  37756. return _this;
  37757. }
  37758. /**
  37759. * @function GenerateSpatialDataService.prototype.destroy
  37760. * @override
  37761. */
  37762. GenerateSpatialDataService_createClass(GenerateSpatialDataService, [{
  37763. key: "destroy",
  37764. value: function destroy() {
  37765. GenerateSpatialDataService_get(GenerateSpatialDataService_getPrototypeOf(GenerateSpatialDataService.prototype), "destroy", this).call(this);
  37766. }
  37767. /**
  37768. * @function GenerateSpatialDataService.prototype.processAsync
  37769. * @description 负责将客户端的动态分段服务参数传递到服务端。
  37770. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  37771. */
  37772. }, {
  37773. key: "processAsync",
  37774. value: function processAsync(params) {
  37775. if (!(params instanceof GenerateSpatialDataParameters)) {
  37776. return;
  37777. }
  37778. var me = this,
  37779. jsonParameters;
  37780. jsonParameters = me.getJsonParameters(params);
  37781. me.request({
  37782. method: "POST",
  37783. data: jsonParameters,
  37784. scope: me,
  37785. success: me.serviceProcessCompleted,
  37786. failure: me.serviceProcessFailed
  37787. });
  37788. }
  37789. /**
  37790. * @function GenerateSpatialDataService.prototype.getJsonParameters
  37791. * @description 将参数转化为 JSON 字符串。
  37792. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  37793. * @returns {string}转化后的JSON字符串。
  37794. */
  37795. }, {
  37796. key: "getJsonParameters",
  37797. value: function getJsonParameters(params) {
  37798. var jsonParameters = "",
  37799. jsonStr = "datasets/" + params.routeTable + "/linearreferencing/generatespatialdata",
  37800. me = this;
  37801. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  37802. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  37803. jsonParameters = Util_Util.toJSON(params);
  37804. return jsonParameters;
  37805. }
  37806. }]);
  37807. return GenerateSpatialDataService;
  37808. }(SpatialAnalystBase);
  37809. ;// CONCATENATED MODULE: ./src/common/iServer/GeoHashGridAggParameter.js
  37810. 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); }
  37811. function GeoHashGridAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37812. 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); } }
  37813. 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; }
  37814. 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); }
  37815. function GeoHashGridAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoHashGridAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  37816. 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); }
  37817. 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); }
  37818. 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); }; }
  37819. 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); }
  37820. function GeoHashGridAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37821. 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; } }
  37822. function GeoHashGridAggParameter_getPrototypeOf(o) { GeoHashGridAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoHashGridAggParameter_getPrototypeOf(o); }
  37823. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37824. * This program are made available under the terms of the Apache License, Version 2.0
  37825. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37826. /**
  37827. * @class GeoHashGridAggParameter
  37828. * @deprecatedclass SuperMap.GeoHashGridAggParameter
  37829. * @classdesc 格网聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  37830. * @category iServer Data FeatureResults
  37831. * @param {Object} options - 可选参数。
  37832. * @param {number} [options.precision=5] - 精度。
  37833. * @extends {BucketAggParameter}
  37834. * @usage
  37835. */
  37836. var GeoHashGridAggParameter = /*#__PURE__*/function (_BucketAggParameter) {
  37837. GeoHashGridAggParameter_inherits(GeoHashGridAggParameter, _BucketAggParameter);
  37838. var _super = GeoHashGridAggParameter_createSuper(GeoHashGridAggParameter);
  37839. function GeoHashGridAggParameter(options) {
  37840. var _this;
  37841. GeoHashGridAggParameter_classCallCheck(this, GeoHashGridAggParameter);
  37842. _this = _super.call(this);
  37843. /**
  37844. * @member {number} [GeoHashGridAggParameter.prototype.precision=5]
  37845. * @description 网格中数字的精度。
  37846. */
  37847. _this.precision = 5;
  37848. Util_Util.extend(GeoHashGridAggParameter_assertThisInitialized(_this), options);
  37849. /**
  37850. * @member {BucketAggType} [GeoHashGridAggParameter.prototype.aggType=BucketAggType.GEOHASH_GRID]
  37851. * @description 格网聚合类型。
  37852. */
  37853. _this.aggType = BucketAggType.GEOHASH_GRID;
  37854. _this.CLASS_NAME = 'SuperMap.GeoHashGridAggParameter';
  37855. return _this;
  37856. }
  37857. GeoHashGridAggParameter_createClass(GeoHashGridAggParameter, [{
  37858. key: "destroy",
  37859. value: function destroy() {
  37860. GeoHashGridAggParameter_get(GeoHashGridAggParameter_getPrototypeOf(GeoHashGridAggParameter.prototype), "destroy", this).call(this);
  37861. this.aggType = null;
  37862. this.precision = null;
  37863. }
  37864. /**
  37865. * @function GeoHashGridAggParameter.toJsonParameters
  37866. * @description 将对象转为 JSON 格式。
  37867. * @param param 转换对象。
  37868. * @returns {Object}
  37869. */
  37870. }], [{
  37871. key: "toJsonParameters",
  37872. value: function toJsonParameters(param) {
  37873. var parameters = {
  37874. aggName: param.aggName,
  37875. aggFieldName: param.aggFieldName,
  37876. aggType: param.aggType,
  37877. precision: param.precision
  37878. };
  37879. return Util_Util.toJson(parameters);
  37880. }
  37881. }]);
  37882. return GeoHashGridAggParameter;
  37883. }(BucketAggParameter);
  37884. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryOverlayAnalystParameters.js
  37885. 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); }
  37886. function GeometryOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37887. 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); } }
  37888. 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; }
  37889. 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); }
  37890. function GeometryOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  37891. 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); }
  37892. 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); }
  37893. 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); }; }
  37894. 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); }
  37895. function GeometryOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37896. 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; } }
  37897. function GeometryOverlayAnalystParameters_getPrototypeOf(o) { GeometryOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryOverlayAnalystParameters_getPrototypeOf(o); }
  37898. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  37899. * This program are made available under the terms of the Apache License, Version 2.0
  37900. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37901. /**
  37902. * @class GeometryOverlayAnalystParameters
  37903. * @deprecatedclass SuperMap.GeometryOverlayAnalystParameters
  37904. * @category iServer SpatialAnalyst OverlayAnalyst
  37905. * @classdesc
  37906. * 几何对象叠加分析参数类。对指定的某两个几何对象做叠加分析。通过该类可以指定要做叠加分析的几何对象、叠加操作类型。
  37907. * @param {Object} options - 参数。
  37908. * @param {GeoJSONObject} options.operateGeometry - 叠加分析的操作几何对象。<br>
  37909. * 点类型可以是:{@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>
  37910. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link GeoJSONObject}。<br>
  37911. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link GeoJSONObject}。<br>
  37912. * @param {GeoJSONObject} options.sourceGeometry - 叠加分析的源几何对象。
  37913. * @param {Array.<GeoJSONFeature>} [options.operateGeometries] - 批量叠加分析的操作几何对象数组。
  37914. * @param {Array.<GeoJSONFeature>} [options.sourceGeometries] -批量叠加分析的源几何对象数组。
  37915. * @param {OverlayOperationType} [options.operation] - 叠加操作枚举值。
  37916. * @extends {OverlayAnalystParameters}
  37917. * @usage
  37918. */
  37919. var GeometryOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  37920. GeometryOverlayAnalystParameters_inherits(GeometryOverlayAnalystParameters, _OverlayAnalystParame);
  37921. var _super = GeometryOverlayAnalystParameters_createSuper(GeometryOverlayAnalystParameters);
  37922. function GeometryOverlayAnalystParameters(options) {
  37923. var _this;
  37924. GeometryOverlayAnalystParameters_classCallCheck(this, GeometryOverlayAnalystParameters);
  37925. _this = _super.call(this, options);
  37926. if (options && options.operateGeometry) {
  37927. _this.operateGeometry = options.operateGeometry;
  37928. }
  37929. if (options && options.sourceGeometry) {
  37930. _this.sourceGeometry = options.sourceGeometry;
  37931. }
  37932. if (options && options.operateGeometries) {
  37933. _this.operateGeometries = options.operateGeometries;
  37934. }
  37935. if (options && options.sourceGeometries) {
  37936. _this.sourceGeometries = options.sourceGeometries;
  37937. }
  37938. if (options) {
  37939. Util_Util.extend(GeometryOverlayAnalystParameters_assertThisInitialized(_this), options);
  37940. }
  37941. _this.CLASS_NAME = "SuperMap.GeometryOverlayAnalystParameters";
  37942. return _this;
  37943. }
  37944. /**
  37945. * @function GeometryOverlayAnalystParameters.prototype.destroy
  37946. * @override
  37947. */
  37948. GeometryOverlayAnalystParameters_createClass(GeometryOverlayAnalystParameters, [{
  37949. key: "destroy",
  37950. value: function destroy() {
  37951. GeometryOverlayAnalystParameters_get(GeometryOverlayAnalystParameters_getPrototypeOf(GeometryOverlayAnalystParameters.prototype), "destroy", this).call(this);
  37952. var me = this;
  37953. if (me.sourceGeometry) {
  37954. me.sourceGeometry.destroy();
  37955. me.sourceGeometry = null;
  37956. }
  37957. if (me.sourceGeometries) {
  37958. me.sourceGeometries.destroy();
  37959. me.sourceGeometries = null;
  37960. }
  37961. if (me.sourceGeometry) {
  37962. me.sourceGeometry.destroy();
  37963. me.sourceGeometry = null;
  37964. }
  37965. if (me.operateGeometries) {
  37966. me.operateGeometries.destroy();
  37967. me.operateGeometries = null;
  37968. }
  37969. }
  37970. /**
  37971. * @function GeometryOverlayAnalystParameters.toObject
  37972. * @param {GeometryOverlayAnalystParameters} geometryOverlayAnalystParameters - 几何对象叠加分析参数类。
  37973. * @param {GeometryOverlayAnalystParameters} tempObj - 几何对象叠加分析参数对象。
  37974. * @description 将几何对象叠加分析参数对象转换为 JSON 对象。
  37975. * @returns {Object} JSON 对象。
  37976. */
  37977. }], [{
  37978. key: "toObject",
  37979. value: function toObject(geometryOverlayAnalystParameters, tempObj) {
  37980. for (var name in geometryOverlayAnalystParameters) {
  37981. if (name === "sourceGeometry") {
  37982. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometry);
  37983. } else if (name === "sourceGeometries") {
  37984. var sourceGeometries = [];
  37985. for (var i = 0; i < geometryOverlayAnalystParameters.sourceGeometries.length; i++) {
  37986. sourceGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometries[i]));
  37987. }
  37988. tempObj.sourceGeometries = sourceGeometries;
  37989. } else if (name === "operateGeometry") {
  37990. tempObj.operateGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometry);
  37991. } else if (name === "operateGeometries") {
  37992. var operateGeometries = [];
  37993. for (var j = 0; j < geometryOverlayAnalystParameters.operateGeometries.length; j++) {
  37994. operateGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometries[j]));
  37995. }
  37996. tempObj.operateGeometries = operateGeometries;
  37997. } else {
  37998. tempObj[name] = geometryOverlayAnalystParameters[name];
  37999. }
  38000. }
  38001. }
  38002. }]);
  38003. return GeometryOverlayAnalystParameters;
  38004. }(OverlayAnalystParameters);
  38005. ;// CONCATENATED MODULE: ./src/common/iServer/GeometrySurfaceAnalystParameters.js
  38006. 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); }
  38007. function GeometrySurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38008. 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); } }
  38009. 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; }
  38010. 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); }
  38011. function GeometrySurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometrySurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  38012. 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); }
  38013. 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); }
  38014. 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); }; }
  38015. 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); }
  38016. function GeometrySurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38017. 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; } }
  38018. function GeometrySurfaceAnalystParameters_getPrototypeOf(o) { GeometrySurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometrySurfaceAnalystParameters_getPrototypeOf(o); }
  38019. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38020. * This program are made available under the terms of the Apache License, Version 2.0
  38021. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38022. /**
  38023. * @class GeometrySurfaceAnalystParameters
  38024. * @deprecatedclass SuperMap.GeometrySurfaceAnalystParameters
  38025. * @category iServer SpatialAnalyst SurfaceAnalyst
  38026. * @classdesc 几何对象表面分析参数类。该类对几何对象表面分析所用到的参数进行设置。
  38027. * @param {Object} options - 参数。
  38028. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.points - 表面分析的坐标点数组。
  38029. * @param {Array.<number>} options.zValues - 表面分析的坐标点的 Z 值数组。
  38030. * @param {number} [options.resolution] - 获取或设置指定中间结果(栅格数据集)的分辨率。
  38031. * @param {DataReturnOption} [options.resultSetting] - 结果返回设置类。
  38032. * @param {SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  38033. * @param {SurfaceAnalystMethod} [options.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  38034. * @extends {SurfaceAnalystParameters}
  38035. * @usage
  38036. */
  38037. var GeometrySurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  38038. GeometrySurfaceAnalystParameters_inherits(GeometrySurfaceAnalystParameters, _SurfaceAnalystParame);
  38039. var _super = GeometrySurfaceAnalystParameters_createSuper(GeometrySurfaceAnalystParameters);
  38040. function GeometrySurfaceAnalystParameters(options) {
  38041. var _this;
  38042. GeometrySurfaceAnalystParameters_classCallCheck(this, GeometrySurfaceAnalystParameters);
  38043. _this = _super.call(this, options);
  38044. /**
  38045. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} GeometrySurfaceAnalystParameters.prototype.points
  38046. * @description 获取或设置用于表面分析的坐标点数组。
  38047. */
  38048. _this.points = null;
  38049. /**
  38050. * @member {Array.<number>} GeometrySurfaceAnalystParameters.prototype.zValues
  38051. * @description 获取或设置用于提取操作的值。提取等值线时,将使用该数组中的值,
  38052. * 对几何对象中的坐标点数组进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  38053. */
  38054. _this.zValues = null;
  38055. if (options) {
  38056. Util_Util.extend(GeometrySurfaceAnalystParameters_assertThisInitialized(_this), options);
  38057. }
  38058. _this.CLASS_NAME = "SuperMap.GeometrySurfaceAnalystParameters";
  38059. return _this;
  38060. }
  38061. /**
  38062. * @function GeometrySurfaceAnalystParameters.prototype.destroy
  38063. * @override
  38064. */
  38065. GeometrySurfaceAnalystParameters_createClass(GeometrySurfaceAnalystParameters, [{
  38066. key: "destroy",
  38067. value: function destroy() {
  38068. GeometrySurfaceAnalystParameters_get(GeometrySurfaceAnalystParameters_getPrototypeOf(GeometrySurfaceAnalystParameters.prototype), "destroy", this).call(this);
  38069. var me = this;
  38070. if (me.points) {
  38071. for (var i = 0, points = me.points, len = points.length; i < len; i++) {
  38072. points[i].destroy();
  38073. }
  38074. me.points = null;
  38075. }
  38076. me.zValues = null;
  38077. }
  38078. }]);
  38079. return GeometrySurfaceAnalystParameters;
  38080. }(SurfaceAnalystParameters);
  38081. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryThiessenAnalystParameters.js
  38082. 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); }
  38083. function GeometryThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38084. 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); } }
  38085. 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; }
  38086. 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); }
  38087. function GeometryThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  38088. 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); }
  38089. 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); }
  38090. 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); }; }
  38091. 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); }
  38092. function GeometryThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38093. 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; } }
  38094. function GeometryThiessenAnalystParameters_getPrototypeOf(o) { GeometryThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryThiessenAnalystParameters_getPrototypeOf(o); }
  38095. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38096. * This program are made available under the terms of the Apache License, Version 2.0
  38097. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38098. /**
  38099. * @class GeometryThiessenAnalystParameters
  38100. * @deprecatedclass SuperMap.GeometryThiessenAnalystParameters
  38101. * @constructs GeometryThiessenAnalystParameters
  38102. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  38103. * @classdesc 几何对象泰森多边形分析参数类。对指定的某个几何对象做泰森多边形分析。通过该类可以指定要做泰森多边形分析的几何对象、返回数据集名称等。
  38104. * @param {Object} options - 参数。
  38105. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} options.points - 使用点数组进行分析时使用的几何对象。
  38106. * @extends {ThiessenAnalystParameters}
  38107. * @usage
  38108. */
  38109. var GeometryThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  38110. GeometryThiessenAnalystParameters_inherits(GeometryThiessenAnalystParameters, _ThiessenAnalystParam);
  38111. var _super = GeometryThiessenAnalystParameters_createSuper(GeometryThiessenAnalystParameters);
  38112. function GeometryThiessenAnalystParameters(options) {
  38113. var _this;
  38114. GeometryThiessenAnalystParameters_classCallCheck(this, GeometryThiessenAnalystParameters);
  38115. _this = _super.call(this, options);
  38116. /**
  38117. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} GeometryThiessenAnalystParameters.prototype.points
  38118. * @description 使用点数组进行分析时使用的几何对象。
  38119. */
  38120. _this.points = null;
  38121. if (options) {
  38122. Util_Util.extend(GeometryThiessenAnalystParameters_assertThisInitialized(_this), options);
  38123. }
  38124. _this.CLASS_NAME = "SuperMap.GeometryThiessenAnalystParameters";
  38125. return _this;
  38126. }
  38127. /**
  38128. * @function GeometryThiessenAnalystParameters.prototype.destroy
  38129. * @override
  38130. */
  38131. GeometryThiessenAnalystParameters_createClass(GeometryThiessenAnalystParameters, [{
  38132. key: "destroy",
  38133. value: function destroy() {
  38134. GeometryThiessenAnalystParameters_get(GeometryThiessenAnalystParameters_getPrototypeOf(GeometryThiessenAnalystParameters.prototype), "destroy", this).call(this);
  38135. var me = this;
  38136. if (me.points) {
  38137. for (var i = me.points.length - 1; i >= 0; i--) {
  38138. me.points[i].destroy();
  38139. }
  38140. me.points = null;
  38141. }
  38142. }
  38143. /**
  38144. * @function GeometryThiessenAnalystParameters.toObject
  38145. * @param {GeometryThiessenAnalystParameters} geometryThiessenAnalystParameters - 几何对象泰森多边形分析参数类。
  38146. * @param {GeometryThiessenAnalystParameters} tempObj - 几何对象泰森多边形分析参数对象。
  38147. * @description 将几何对象泰森多边形分析参数对象转换为 JSON 对象。
  38148. * @returns {Object} JSON 对象。
  38149. */
  38150. }], [{
  38151. key: "toObject",
  38152. value: function toObject(geometryThiessenAnalystParameters, tempObj) {
  38153. for (var name in geometryThiessenAnalystParameters) {
  38154. if (name === "clipRegion") {
  38155. tempObj.clipRegion = ServerGeometry.fromGeometry(geometryThiessenAnalystParameters.clipRegion);
  38156. } else {
  38157. tempObj[name] = geometryThiessenAnalystParameters[name];
  38158. }
  38159. }
  38160. }
  38161. }]);
  38162. return GeometryThiessenAnalystParameters;
  38163. }(ThiessenAnalystParameters);
  38164. ;// CONCATENATED MODULE: ./src/common/iServer/GeoprocessingService.js
  38165. 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); }
  38166. function GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38167. 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); } }
  38168. 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; }
  38169. 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); }
  38170. 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); }
  38171. 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); }; }
  38172. 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); }
  38173. function GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38174. 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; } }
  38175. function GeoprocessingService_getPrototypeOf(o) { GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoprocessingService_getPrototypeOf(o); }
  38176. /**
  38177. * @class GeoprocessingService
  38178. * @deprecatedclass SuperMap.GeoprocessingService
  38179. * @category iServer ProcessingAutomationService
  38180. * @classdesc 处理自动化服务接口的基类。
  38181. * @version 10.1.0
  38182. * @extends {CommonServiceBase}
  38183. * @param {string} url - 服务地址。
  38184. * @param {Object} options - 参数。
  38185. * @param {Events} options.events - 处理所有事件的对象。
  38186. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  38187. * @usage
  38188. */
  38189. var GeoprocessingService = /*#__PURE__*/function (_CommonServiceBase) {
  38190. GeoprocessingService_inherits(GeoprocessingService, _CommonServiceBase);
  38191. var _super = GeoprocessingService_createSuper(GeoprocessingService);
  38192. function GeoprocessingService(url, options) {
  38193. var _this;
  38194. GeoprocessingService_classCallCheck(this, GeoprocessingService);
  38195. options = options || {};
  38196. options.EVENT_TYPES = ['processCompleted', 'processFailed', 'processRunning'];
  38197. _this = _super.call(this, url, options);
  38198. _this.CLASS_NAME = 'SuperMap.GeoprocessingService';
  38199. _this.headers = {};
  38200. _this.crossOrigin = true;
  38201. _this.eventCount = 0;
  38202. return _this;
  38203. }
  38204. /**
  38205. * @function GeoprocessingService.prototype.getTools
  38206. * @description 获取处理自动化工具列表。
  38207. * @param {string} identifier - 处理自动化工具ID。
  38208. */
  38209. GeoprocessingService_createClass(GeoprocessingService, [{
  38210. key: "getTools",
  38211. value: function getTools(callback) {
  38212. this._processAsync({
  38213. url: "".concat(this.url, "/list"),
  38214. callback: callback
  38215. });
  38216. }
  38217. /**
  38218. * @function GeoprocessingService.prototype.getTool
  38219. * @description 获取处理自动化工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  38220. * @param {string} identifier - 处理自动化工具ID。
  38221. */
  38222. }, {
  38223. key: "getTool",
  38224. value: function getTool(identifier, callback) {
  38225. this._processAsync({
  38226. url: "".concat(this.url, "/").concat(identifier),
  38227. callback: callback
  38228. });
  38229. }
  38230. /**
  38231. * @function GeoprocessingService.prototype.execute
  38232. * @description 同步执行处理自动化工具。
  38233. * @param {string} identifier - 处理自动化工具ID。
  38234. * @param {Object} parameter - 处理自动化工具的输入参数。
  38235. * @param {Object} environment - 处理自动化工具的环境参数。
  38236. */
  38237. }, {
  38238. key: "execute",
  38239. value: function execute(identifier, parameter, environment, callback) {
  38240. parameter = parameter ? parameter : null;
  38241. environment = environment ? environment : null;
  38242. var executeParamter = {
  38243. parameter: parameter,
  38244. environment: environment
  38245. };
  38246. this._processAsync({
  38247. url: "".concat(this.url, "/").concat(identifier, "/execute"),
  38248. executeParamter: executeParamter,
  38249. callback: callback
  38250. });
  38251. }
  38252. /**
  38253. * @function GeoprocessingService.prototype.submitJob
  38254. * @description 异步执行处理自动化工具。
  38255. * @param {string} identifier - 处理自动化工具ID。
  38256. * @param {Object} parameter - 处理自动化工具的输入参数。
  38257. * @param {Object} environments - 处理自动化工具的环境参数。
  38258. */
  38259. }, {
  38260. key: "submitJob",
  38261. value: function submitJob(identifier, parameter, environments, callback) {
  38262. parameter = parameter ? parameter : null;
  38263. environments = environments ? environments : null;
  38264. var asyncParamter = JSON.stringify({
  38265. parameter: parameter,
  38266. environments: environments
  38267. });
  38268. this._processAsync({
  38269. url: "".concat(this.url, "/").concat(identifier, "/jobs"),
  38270. method: 'POST',
  38271. callback: callback,
  38272. params: asyncParamter
  38273. });
  38274. }
  38275. /**
  38276. * @function GeoprocessingService.prototype.waitForJobCompletion
  38277. * @description 获取处理自动化异步执行状态信息。
  38278. * @param {string} jobId - 处理自动化任务ID。
  38279. * @param {string} identifier - 处理自动化工具ID。
  38280. * @param {Object} options - 状态信息参数。
  38281. * @param {number} options.interval - 定时器时间间隔。
  38282. * @param {function} options.statusCallback - 任务状态的回调函数。
  38283. */
  38284. }, {
  38285. key: "waitForJobCompletion",
  38286. value: function waitForJobCompletion(jobId, identifier, options, callback) {
  38287. var me = this;
  38288. var timer = setInterval(function () {
  38289. var serviceProcessCompleted = function serviceProcessCompleted(serverResult, options) {
  38290. var state = serverResult.state.runState;
  38291. if (options.statusCallback) {
  38292. options.statusCallback(state);
  38293. }
  38294. switch (state) {
  38295. case 'FINISHED':
  38296. clearInterval(timer);
  38297. me.events.triggerEvent('processCompleted', {
  38298. result: serverResult,
  38299. options: options
  38300. });
  38301. break;
  38302. case 'FAILED':
  38303. clearInterval(timer);
  38304. me.events.triggerEvent('processFailed', {
  38305. result: serverResult,
  38306. options: options
  38307. });
  38308. break;
  38309. case 'CANCELED':
  38310. clearInterval(timer);
  38311. me.events.triggerEvent('processFailed', {
  38312. result: serverResult,
  38313. options: options
  38314. });
  38315. break;
  38316. }
  38317. };
  38318. me._processAsync({
  38319. url: "".concat(me.url, "/").concat(identifier, "/jobs/").concat(jobId),
  38320. serviceProcessCompleted: serviceProcessCompleted,
  38321. callback: callback
  38322. });
  38323. }, options.interval);
  38324. }
  38325. /**
  38326. * @function GeoprocessingService.prototype.getJobInfo
  38327. * @description 获取处理自动化任务的执行信息。
  38328. * @param {string} identifier - 处理自动化工具ID。
  38329. * @param {string} jobId - 处理自动化任务ID。
  38330. */
  38331. }, {
  38332. key: "getJobInfo",
  38333. value: function getJobInfo(identifier, jobId, callback) {
  38334. this._processAsync({
  38335. url: "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId),
  38336. callback: callback
  38337. });
  38338. }
  38339. /**
  38340. * @function GeoprocessingService.prototype.cancelJob
  38341. * @description 取消处理自动化任务的异步执行。
  38342. * @param {string} identifier - 处理自动化工具ID。
  38343. * @param {string} jobId - 处理自动化任务ID。
  38344. */
  38345. }, {
  38346. key: "cancelJob",
  38347. value: function cancelJob(identifier, jobId, callback) {
  38348. this._processAsync({
  38349. url: "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/cancel"),
  38350. callback: callback
  38351. });
  38352. }
  38353. /**
  38354. * @function GeoprocessingService.prototype.getJobs
  38355. * @description 获取处理自动化服务任务列表。
  38356. * @param {string} identifier - 处理自动化工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  38357. */
  38358. }, {
  38359. key: "getJobs",
  38360. value: function getJobs(identifier, callback) {
  38361. var url = "".concat(this.url, "/jobs");
  38362. if (identifier) {
  38363. url = "".concat(this.url, "/").concat(identifier, "/jobs");
  38364. }
  38365. this._processAsync({
  38366. url: url,
  38367. callback: callback
  38368. });
  38369. }
  38370. /**
  38371. * @function GeoprocessingService.prototype.getResults
  38372. * @description 处理自动化工具执行的结果等,支持结果过滤。
  38373. * @param {string} identifier - 处理自动化工具ID。
  38374. * @param {string} jobId - 处理自动化任务ID。
  38375. * @param {string} filter - 输出异步结果的ID。(可选,传入filter参数时对该处理自动化工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  38376. */
  38377. }, {
  38378. key: "getResults",
  38379. value: function getResults(identifier, jobId, filter, callback) {
  38380. var url = "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/results");
  38381. if (filter) {
  38382. url = "".concat(url, "/").concat(filter);
  38383. }
  38384. this._processAsync({
  38385. url: url,
  38386. callback: callback
  38387. });
  38388. }
  38389. }, {
  38390. key: "_processAsync",
  38391. value: function _processAsync(_ref) {
  38392. var url = _ref.url,
  38393. method = _ref.method,
  38394. callback = _ref.callback,
  38395. paramter = _ref.paramter,
  38396. serviceProcessCompleted = _ref.serviceProcessCompleted,
  38397. serviceProcessFailed = _ref.serviceProcessFailed;
  38398. var eventId = ++this.eventCount;
  38399. var eventListeners = {
  38400. scope: this,
  38401. processCompleted: function processCompleted(result) {
  38402. if (eventId === result.result.eventId && callback) {
  38403. delete result.result.eventId;
  38404. callback(result);
  38405. this.events && this.events.un(eventListeners);
  38406. return false;
  38407. }
  38408. },
  38409. processFailed: function processFailed(result) {
  38410. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  38411. callback(result);
  38412. this.events && this.events.un(eventListeners);
  38413. return false;
  38414. }
  38415. }
  38416. };
  38417. this.events.on(eventListeners);
  38418. this.request({
  38419. url: url,
  38420. method: method || 'GET',
  38421. params: paramter,
  38422. headers: {
  38423. 'Content-type': 'application/json'
  38424. },
  38425. scope: this,
  38426. success: function success(result, options) {
  38427. result.eventId = eventId;
  38428. var callback = serviceProcessCompleted || this.serviceProcessCompleted.bind(this);
  38429. callback(result, options);
  38430. },
  38431. failure: function failure(result, options) {
  38432. if (result.error) {
  38433. result.error.eventId = eventId;
  38434. }
  38435. result.eventId = eventId;
  38436. var callback = serviceProcessFailed || this.serviceProcessFailed.bind(this);
  38437. callback(result, options);
  38438. }
  38439. });
  38440. }
  38441. }]);
  38442. return GeoprocessingService;
  38443. }(CommonServiceBase);
  38444. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystParameters.js
  38445. function GeoRelationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38446. 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); } }
  38447. 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; }
  38448. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38449. * This program are made available under the terms of the Apache License, Version 2.0
  38450. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38451. /**
  38452. * @class GeoRelationAnalystParameters
  38453. * @deprecatedclass SuperMap.GeoRelationAnalystParameters
  38454. * @category iServer SpatialAnalyst GeoRelationAnalyst
  38455. * @classdesc 空间关系分析服务参数类。使用该类可以为空间关系分析服务提供所需的参数信息。
  38456. * @param {Object} options - 参数。
  38457. * @param {FilterParameter} options.sourceFilter - 空间关系分析中的源数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  38458. * @param {FilterParameter} options.referenceFilter - 空间关系分析中的参考数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  38459. * @param {SpatialRelationType} options.spatialRelationType - 指定的空间关系类型。
  38460. * @param {boolean} [options.isBorderInside] - 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  38461. * @param {boolean} [options.returnFeature] - 是否返回 Feature 信息。
  38462. * @param {boolean} [options.returnGeoRelatedOnly=true] - 仅返回满足指定空间关系的空间对象。
  38463. * @param {number} [options.startRecord=0] - 分析结果起始记录位置。
  38464. * @param {number} [options.expectCount=500] - 空间关系分析期望返回结果记录数,如果实际不足500条结果则返回所有分析结果。
  38465. * @usage
  38466. */
  38467. var GeoRelationAnalystParameters = /*#__PURE__*/function () {
  38468. function GeoRelationAnalystParameters(options) {
  38469. GeoRelationAnalystParameters_classCallCheck(this, GeoRelationAnalystParameters);
  38470. /**
  38471. * @member {string} GeoRelationAnalystParameters.prototype.dataset
  38472. * @description 源数据集名称。
  38473. */
  38474. this.dataset = null;
  38475. /**
  38476. * @member {FilterParameter} GeoRelationAnalystParameters.prototype.sourceFilter
  38477. * @description 空间关系分析中的源数据集查询参数。仅 ids、attributeFilter 和 fields 字段有效。
  38478. */
  38479. this.sourceFilter = null;
  38480. /**
  38481. * @member {FilterParameter} GeoRelationAnalystParameters.prototype.referenceFilter
  38482. * @description 空间关系分析中的参考数据集查询参数。仅 name,ids,attributeFilter 和 fields 字段有效。
  38483. */
  38484. this.referenceFilter = null;
  38485. /**
  38486. * @member {SpatialRelationType} GeoRelationAnalystParameters.prototype.spatialRelationType
  38487. * @description 指定的空间关系类型。
  38488. */
  38489. this.spatialRelationType = null;
  38490. /**
  38491. * @member {boolean} [GeoRelationAnalystParameters.prototype.isBorderInside]
  38492. * @description 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  38493. */
  38494. this.isBorderInside = null;
  38495. /**
  38496. * @member {boolean} [GeoRelationAnalystParameters.prototype.returnFeature]
  38497. * @description 是否返回 Feature 信息。
  38498. */
  38499. this.returnFeature = null;
  38500. /**
  38501. * @member {boolean} [GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=true]
  38502. * @description 是否仅返回满足指定空间关系的空间对象。
  38503. */
  38504. this.returnGeoRelatedOnly = null;
  38505. /**
  38506. * @member {number} [GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=0]
  38507. * @description 分析结果起始记录位置。
  38508. */
  38509. this.startRecord = 0;
  38510. /**
  38511. * @member {number} [GeoRelationAnalystParameters.prototype.expectCount=500]
  38512. * @description 空间关系分析期望返回结果记录数,如果实际不足 500 条结果则返回所有分析结果。
  38513. */
  38514. this.expectCount = 500;
  38515. if (options) {
  38516. Util_Util.extend(this, options);
  38517. }
  38518. this.CLASS_NAME = "SuperMap.GeoRelationAnalystParameters";
  38519. }
  38520. /**
  38521. * @function GeoRelationAnalystParameters.prototype.destroy
  38522. * @description 释放资源,将引用资源的属性置空。
  38523. */
  38524. GeoRelationAnalystParameters_createClass(GeoRelationAnalystParameters, [{
  38525. key: "destroy",
  38526. value: function destroy() {
  38527. var me = this;
  38528. if (me.sourceFilter) {
  38529. me.sourceFilter.destroy();
  38530. }
  38531. me.sourceFilter = null;
  38532. if (me.referenceFilter) {
  38533. me.referenceFilter.destroy();
  38534. }
  38535. me.referenceFilter = null;
  38536. me.dataset = null;
  38537. me.spatialRelationType = null;
  38538. me.isBorderInside = null;
  38539. me.returnFeature = null;
  38540. me.returnGeoRelatedOnly = null;
  38541. me.startRecord = null;
  38542. me.expectCount = null;
  38543. }
  38544. }]);
  38545. return GeoRelationAnalystParameters;
  38546. }();
  38547. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystService.js
  38548. 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); }
  38549. function GeoRelationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38550. 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); } }
  38551. 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; }
  38552. 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); }
  38553. function GeoRelationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoRelationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  38554. 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); }
  38555. 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); }
  38556. 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); }; }
  38557. 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); }
  38558. function GeoRelationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38559. 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; } }
  38560. function GeoRelationAnalystService_getPrototypeOf(o) { GeoRelationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoRelationAnalystService_getPrototypeOf(o); }
  38561. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38562. * This program are made available under the terms of the Apache License, Version 2.0
  38563. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38564. /**
  38565. * @class GeoRelationAnalystService
  38566. * @deprecatedclass SuperMap.GeoRelationAnalystService
  38567. * @category iServer SpatialAnalyst GeoRelationAnalyst
  38568. * @classdesc 空间关系分析服务类。该类负责将客户设置的空间关系分析服务参数传递给服务端,并接收服务端返回的空间关系分析结果数据。
  38569. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  38570. * @param {Object} options - 参数。
  38571. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  38572. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38573. * @param {Object} [options.headers] - 请求头。
  38574. * @extends {SpatialAnalystBase}
  38575. * @example 实例化该类如下例所示:
  38576. * (start code)
  38577. * function datasetGeoRelationAnalystProcess() {
  38578. * var referenceFilter = new FilterParameter({
  38579. * name:"Frame_R@Changchun",
  38580. * attributeFilter:"SmID>0"});
  38581. * var sourceFilter = new FilterParameter({
  38582. * attributeFilter:"SmID>0"});
  38583. * //初始化服务类
  38584. * var datasetGeoRelationService = new GeoRelationAnalystService(
  38585. * "http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/"),
  38586. * //构建参数类
  38587. * datasetGeoRelationParameters = new GeoRelationAnalystParameters({
  38588. * dataset: "Park@Changchun",
  38589. * startRecord: 0,
  38590. * expectCount: 20,
  38591. * sourceFilter: sourceFilter,
  38592. * referenceFilter: referenceFilter,
  38593. * spatialRelationType: SpatialRelationType.INTERSECT,
  38594. * isBorderInside: true,
  38595. * returnFeature: true,
  38596. * returnGeoRelatedOnly: true
  38597. * });
  38598. * datasetGeoRelationService.events.on({
  38599. * "processCompleted": datasetGeoRelationAnalystCompleted,
  38600. * "processFailed": datasetGeoRelationAnalystFailed});
  38601. * //执行
  38602. * datasetGeoRelationService.processAsync(datasetGeoRelationParameters);
  38603. * }
  38604. * function Completed(datasetGeoRelationAnalystCompleted){//todo};
  38605. * function Error(datasetGeoRelationAnalystFailed){//todo};
  38606. * (end)
  38607. * @usage
  38608. */
  38609. var GeoRelationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  38610. GeoRelationAnalystService_inherits(GeoRelationAnalystService, _SpatialAnalystBase);
  38611. var _super = GeoRelationAnalystService_createSuper(GeoRelationAnalystService);
  38612. function GeoRelationAnalystService(url, options) {
  38613. var _this;
  38614. GeoRelationAnalystService_classCallCheck(this, GeoRelationAnalystService);
  38615. _this = _super.call(this, url, options);
  38616. _this.CLASS_NAME = "SuperMap.GeoRelationAnalystService";
  38617. return _this;
  38618. }
  38619. /**
  38620. * @function GeoRelationAnalystService.prototype.destroy
  38621. * @override
  38622. */
  38623. GeoRelationAnalystService_createClass(GeoRelationAnalystService, [{
  38624. key: "destroy",
  38625. value: function destroy() {
  38626. GeoRelationAnalystService_get(GeoRelationAnalystService_getPrototypeOf(GeoRelationAnalystService.prototype), "destroy", this).call(this);
  38627. }
  38628. /**
  38629. * @function GeoRelationAnalystService.prototype.processAsync
  38630. * @description 负责将客户端的空间关系分析参数传递到服务端
  38631. * @param {GeoRelationAnalystParameters} parameter - 空间关系分析所需的参数信息。
  38632. */
  38633. }, {
  38634. key: "processAsync",
  38635. value: function processAsync(parameter) {
  38636. if (!(parameter instanceof GeoRelationAnalystParameters)) {
  38637. return;
  38638. }
  38639. var me = this;
  38640. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/georelation');
  38641. var jsonParameters = Util_Util.toJSON(parameter);
  38642. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  38643. me.request({
  38644. method: "POST",
  38645. data: jsonParameters,
  38646. scope: me,
  38647. success: me.serviceProcessCompleted,
  38648. failure: me.serviceProcessFailed
  38649. });
  38650. }
  38651. }]);
  38652. return GeoRelationAnalystService;
  38653. }(SpatialAnalystBase);
  38654. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetService.js
  38655. 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); }
  38656. function DatasetService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38657. 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); } }
  38658. 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; }
  38659. 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); }
  38660. function DatasetService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetService_getPrototypeOf(object); if (object === null) break; } return object; }
  38661. 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); }
  38662. 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); }
  38663. 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); }; }
  38664. 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); }
  38665. function DatasetService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38666. 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; } }
  38667. function DatasetService_getPrototypeOf(o) { DatasetService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetService_getPrototypeOf(o); }
  38668. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38669. * This program are made available under the terms of the Apache License, Version 2.0
  38670. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38671. /**
  38672. * @class DatasetService
  38673. * @deprecatedclass SuperMap.DatasetService
  38674. * @category iServer Data Dataset
  38675. * @classdesc 数据集查询服务。
  38676. * @param {string} url - 服务的访问地址。如访问World Data服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  38677. * @param {Object} options - 参数。
  38678. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  38679. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  38680. * @param {string}options.datasource - 数据源名称。
  38681. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  38682. * @param {Object} [options.headers] - 请求头。
  38683. * @usage
  38684. */
  38685. var DatasetService = /*#__PURE__*/function (_CommonServiceBase) {
  38686. DatasetService_inherits(DatasetService, _CommonServiceBase);
  38687. var _super = DatasetService_createSuper(DatasetService);
  38688. function DatasetService(url, options) {
  38689. var _this;
  38690. DatasetService_classCallCheck(this, DatasetService);
  38691. _this = _super.call(this, url, options);
  38692. if (!options) {
  38693. return DatasetService_possibleConstructorReturn(_this);
  38694. }
  38695. /**
  38696. * @member {string} DatasetService.prototype.datasource
  38697. * @description 要查询的数据集所在的数据源名称。
  38698. */
  38699. _this.datasource = null;
  38700. /**
  38701. * @member {string} DatasetService.prototype.dataset
  38702. * @description 要查询的数据集名称。
  38703. */
  38704. _this.dataset = null;
  38705. _this.eventCount = 0;
  38706. if (options) {
  38707. Util_Util.extend(DatasetService_assertThisInitialized(_this), options);
  38708. }
  38709. _this.CLASS_NAME = "SuperMap.DatasetService";
  38710. return _this;
  38711. }
  38712. /**
  38713. * @function DatasetService.prototype.destroy
  38714. * @override
  38715. */
  38716. DatasetService_createClass(DatasetService, [{
  38717. key: "destroy",
  38718. value: function destroy() {
  38719. DatasetService_get(DatasetService_getPrototypeOf(DatasetService.prototype), "destroy", this).call(this);
  38720. var me = this;
  38721. me.datasource = null;
  38722. me.dataset = null;
  38723. }
  38724. /**
  38725. * @function DatasetService.prototype.getDatasetsService
  38726. * @description 执行服务,查询数据集服务。
  38727. */
  38728. }, {
  38729. key: "getDatasetsService",
  38730. value: function getDatasetsService(params, callback) {
  38731. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params, "/datasets"));
  38732. this.processAsync(url, 'GET', callback);
  38733. }
  38734. /**
  38735. * @function DatasetService.prototype.getDatasetService
  38736. * @description 执行服务,查询数据集信息服务。
  38737. */
  38738. }, {
  38739. key: "getDatasetService",
  38740. value: function getDatasetService(datasourceName, datasetName, callback) {
  38741. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName, "/datasets/name/").concat(datasetName));
  38742. this.processAsync(url, 'GET', callback);
  38743. }
  38744. /**
  38745. * @function DatasetService.prototype.setDatasetService
  38746. * @description 执行服务,更改数据集信息服务。
  38747. */
  38748. }, {
  38749. key: "setDatasetService",
  38750. value: function setDatasetService(params, callback) {
  38751. if (!params) {
  38752. return;
  38753. }
  38754. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(params.datasourceName, "/datasets/name/").concat(params.datasetName));
  38755. delete params.datasourceName;
  38756. this.processAsync(url, 'PUT', callback, params);
  38757. }
  38758. /**
  38759. * @function DatasetService.prototype.deleteDatasetService
  38760. * @description 执行服务,删除数据集信息服务。
  38761. */
  38762. }, {
  38763. key: "deleteDatasetService",
  38764. value: function deleteDatasetService(datasourceName, datasetName, callback) {
  38765. var url = Util_Util.urlPathAppend(this.url, "datasources/name/".concat(datasourceName, "/datasets/name/").concat(datasetName));
  38766. this.processAsync(url, 'DELETE', callback);
  38767. }
  38768. }, {
  38769. key: "processAsync",
  38770. value: function processAsync(url, method, callback, params) {
  38771. var eventId = ++this.eventCount;
  38772. var eventListeners = {
  38773. scope: this,
  38774. processCompleted: function processCompleted(result) {
  38775. if (eventId === result.result.eventId && callback) {
  38776. delete result.result.eventId;
  38777. callback(result);
  38778. this.events && this.events.un(eventListeners);
  38779. return false;
  38780. }
  38781. },
  38782. processFailed: function processFailed(result) {
  38783. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  38784. callback(result);
  38785. this.events && this.events.un(eventListeners);
  38786. return false;
  38787. }
  38788. }
  38789. };
  38790. this.events.on(eventListeners);
  38791. var me = this;
  38792. var requestConfig = {
  38793. url: url,
  38794. method: method,
  38795. scope: me,
  38796. success: function success(result, options) {
  38797. result.eventId = eventId;
  38798. me.serviceProcessCompleted(result, options);
  38799. },
  38800. failure: function failure(result, options) {
  38801. if (result.error) {
  38802. result.error.eventId = eventId;
  38803. }
  38804. result.eventId = eventId;
  38805. me.serviceProcessFailed(result, options);
  38806. }
  38807. };
  38808. params && (requestConfig.data = Util_Util.toJSON(params));
  38809. me.request(requestConfig);
  38810. }
  38811. }]);
  38812. return DatasetService;
  38813. }(CommonServiceBase);
  38814. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesParametersBase.js
  38815. function GetFeaturesParametersBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38816. 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); } }
  38817. 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; }
  38818. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38819. * This program are made available under the terms of the Apache License, Version 2.0
  38820. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38821. /**
  38822. * @class GetFeaturesParametersBase
  38823. * @deprecatedclass SuperMap.GetFeaturesParametersBase
  38824. * @category iServer Data FeatureResults
  38825. * @classdesc 要素查询参数基类。
  38826. * @param {Object} options - 参数。
  38827. * @param {Array.<string>} options.datasetNames - 数据集名称列表。
  38828. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  38829. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  38830. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  38831. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  38832. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  38833. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  38834. * @usage
  38835. */
  38836. var GetFeaturesParametersBase = /*#__PURE__*/function () {
  38837. function GetFeaturesParametersBase(options) {
  38838. GetFeaturesParametersBase_classCallCheck(this, GetFeaturesParametersBase);
  38839. /**
  38840. * @member {Array.<string>} GetFeaturesParametersBase.prototype.datasetName
  38841. * @description 数据集集合中的数据集名称列表。
  38842. */
  38843. this.datasetNames = null;
  38844. /**
  38845. * @member {string} GetFeaturesParametersBase.prototype.targetEpsgCode
  38846. * @description 动态投影的目标坐标系对应的 EPSG Code,使用时需设置 returnContent 参数为 true。
  38847. */
  38848. this.targetEpsgCode = null;
  38849. /**
  38850. * @member {Object} GetFeaturesParametersBase.prototype.targetPrj
  38851. * @description 动态投影的目标坐标系。使用时需设置 returnContent 参数为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  38852. */
  38853. this.targetPrj = null;
  38854. /**
  38855. * @member {boolean} [GetFeaturesParametersBase.prototype.returnContent=true]
  38856. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  38857. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  38858. * 如果为 false,则返回的是查询结果资源的 URI。
  38859. */
  38860. this.returnContent = true;
  38861. /**
  38862. * @member {number} [GetFeaturesParametersBase.prototype.fromIndex=0]
  38863. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  38864. */
  38865. this.fromIndex = 0;
  38866. /**
  38867. * @member {number} [GetFeaturesParametersBase.prototype.toIndex=19]
  38868. * @description 查询结果的最大索引号。如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  38869. */
  38870. this.toIndex = 19;
  38871. /**
  38872. * @member {boolean} [GetFeaturesParametersBase.prototype.returnCountOnly=false]
  38873. * @description 只返回查询结果的总数。
  38874. */
  38875. this.returnCountOnly = false;
  38876. /**
  38877. * @member {number} [GetFeaturesParametersBase.prototype.maxFeatures=1000]
  38878. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  38879. */
  38880. this.maxFeatures = null;
  38881. /**
  38882. * @member {number} [GetFeaturesParametersBase.prototype.hasGeometry=true]
  38883. * @description 返回结果是否包含Geometry。
  38884. */
  38885. this.hasGeometry = true;
  38886. /**
  38887. * @member {MetricsAggParameter|GeoHashGridAggParameter} GetFeaturesParametersBase.prototype.aggregations
  38888. * @description 聚合查询参数,该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  38889. */
  38890. this.aggregations = null;
  38891. Util_Util.extend(this, options);
  38892. this.CLASS_NAME = 'SuperMap.GetFeaturesParametersBase';
  38893. }
  38894. /**
  38895. *
  38896. * @function GetFeaturesParametersBase.prototype.destroy
  38897. * @description 释放资源,将引用资源的属性置空。
  38898. */
  38899. GetFeaturesParametersBase_createClass(GetFeaturesParametersBase, [{
  38900. key: "destroy",
  38901. value: function destroy() {
  38902. var me = this;
  38903. me.datasetNames = null;
  38904. me.returnContent = null;
  38905. me.fromIndex = null;
  38906. me.toIndex = null;
  38907. me.hasGeometry = null;
  38908. me.maxFeatures = null;
  38909. me.targetEpsgCode = null;
  38910. me.targetPrj = null;
  38911. if (me.aggregation) {
  38912. me.aggregation = null;
  38913. }
  38914. }
  38915. }]);
  38916. return GetFeaturesParametersBase;
  38917. }();
  38918. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsParameters.js
  38919. 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); }
  38920. function GetFeaturesByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38921. 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); } }
  38922. 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; }
  38923. 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); }
  38924. function GetFeaturesByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  38925. 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); }
  38926. 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); }
  38927. 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); }; }
  38928. 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); }
  38929. function GetFeaturesByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  38930. 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; } }
  38931. function GetFeaturesByBoundsParameters_getPrototypeOf(o) { GetFeaturesByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsParameters_getPrototypeOf(o); }
  38932. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  38933. * This program are made available under the terms of the Apache License, Version 2.0
  38934. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38935. /**
  38936. * @class GetFeaturesByBoundsParameters
  38937. * @deprecatedclass SuperMap.GetFeaturesByBoundsParameters
  38938. * @category iServer Data FeatureResults
  38939. * @classdesc 数据集范围查询参数类,该类用于设置数据集范围查询的相关参数。
  38940. * @param {Object} options - 参数。
  38941. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 查询的范围对象。
  38942. * @param {Array.<string>} options.datasetNames - 数据集名称列表。
  38943. * @param {string} [options.attributeFilter] - 范围查询属性过滤条件。
  38944. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  38945. * @param {SpatialQueryMode} [options.spatialQueryMode=SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  38946. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  38947. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  38948. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  38949. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  38950. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  38951. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  38952. * @extends {GetFeaturesParametersBase}
  38953. * @usage
  38954. */
  38955. var GetFeaturesByBoundsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  38956. GetFeaturesByBoundsParameters_inherits(GetFeaturesByBoundsParameters, _GetFeaturesParameter);
  38957. var _super = GetFeaturesByBoundsParameters_createSuper(GetFeaturesByBoundsParameters);
  38958. function GetFeaturesByBoundsParameters(options) {
  38959. var _this;
  38960. GetFeaturesByBoundsParameters_classCallCheck(this, GetFeaturesByBoundsParameters);
  38961. _this = _super.call(this, options);
  38962. /**
  38963. * @member {string} GetFeaturesByBoundsParameters.prototype.getFeatureMode
  38964. * @description 数据集查询模式。范围查询有 "BOUNDS","BOUNDS_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 BOUNDS_ATTRIBUTEFILTER 访问服务。
  38965. */
  38966. _this.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS;
  38967. /**
  38968. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} GetFeaturesByBoundsParameters.prototype.bounds
  38969. * @description 用于查询的范围对象。
  38970. *
  38971. */
  38972. _this.bounds = null;
  38973. /**
  38974. * @member {Array.<string>} GetFeaturesByBoundsParameters.prototype.fields
  38975. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  38976. */
  38977. _this.fields = null;
  38978. /**
  38979. * @member {string} GetFeaturesByBoundsParameters.prototype.attributeFilter
  38980. * @description 范围查询属性过滤条件。
  38981. */
  38982. _this.attributeFilter = null;
  38983. /**
  38984. * @member {SpatialQueryMode} [GetFeaturesByBoundsParameters.prototype.spatialQueryMode=SpatialQueryMode.CONTAIN]
  38985. * @description 空间查询模式常量。
  38986. */
  38987. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  38988. Util_Util.extend(GetFeaturesByBoundsParameters_assertThisInitialized(_this), options);
  38989. _this.CLASS_NAME = 'SuperMap.GetFeaturesByBoundsParameters';
  38990. return _this;
  38991. }
  38992. /**
  38993. * @function GetFeaturesByBoundsParameters.prototype.destroy
  38994. * @override
  38995. */
  38996. GetFeaturesByBoundsParameters_createClass(GetFeaturesByBoundsParameters, [{
  38997. key: "destroy",
  38998. value: function destroy() {
  38999. GetFeaturesByBoundsParameters_get(GetFeaturesByBoundsParameters_getPrototypeOf(GetFeaturesByBoundsParameters.prototype), "destroy", this).call(this);
  39000. var me = this;
  39001. if (me.bounds) {
  39002. me.bounds.destroy();
  39003. me.bounds = null;
  39004. }
  39005. if (me.fields) {
  39006. while (me.fields.length > 0) {
  39007. me.fields.pop();
  39008. }
  39009. me.fields = null;
  39010. }
  39011. me.attributeFilter = null;
  39012. me.spatialQueryMode = null;
  39013. me.getFeatureMode = null;
  39014. }
  39015. /**
  39016. * @function GetFeaturesByBoundsParameters.toJsonParameters
  39017. * @description 将 {@link GetFeaturesByBoundsParameters} 对象参数转换为 JSON 字符串。
  39018. * @param {GetFeaturesByBoundsParameters} params - 范围查询参数。
  39019. * @returns {string} 转化后的 JSON 字符串。
  39020. *
  39021. */
  39022. }], [{
  39023. key: "toJsonParameters",
  39024. value: function toJsonParameters(params) {
  39025. var filterParameter, bounds, parasByBounds;
  39026. bounds = {
  39027. leftBottom: {
  39028. x: params.bounds.left,
  39029. y: params.bounds.bottom
  39030. },
  39031. rightTop: {
  39032. x: params.bounds.right,
  39033. y: params.bounds.top
  39034. }
  39035. };
  39036. parasByBounds = {
  39037. datasetNames: params.datasetNames,
  39038. getFeatureMode: GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS,
  39039. bounds: bounds,
  39040. spatialQueryMode: params.spatialQueryMode
  39041. };
  39042. if (params.fields) {
  39043. filterParameter = new FilterParameter();
  39044. filterParameter.name = params.datasetNames;
  39045. filterParameter.fields = params.fields;
  39046. parasByBounds.queryParameter = filterParameter;
  39047. }
  39048. if (params.attributeFilter) {
  39049. parasByBounds.attributeFilter = params.attributeFilter;
  39050. parasByBounds.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS_ATTRIBUTEFILTER;
  39051. }
  39052. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  39053. parasByBounds.maxFeatures = params.maxFeatures;
  39054. }
  39055. if (typeof params.hasGeometry === 'boolean') {
  39056. parasByBounds.hasGeometry = params.hasGeometry;
  39057. }
  39058. if (params.targetEpsgCode) {
  39059. parasByBounds.targetEpsgCode = params.targetEpsgCode;
  39060. }
  39061. if (!params.targetEpsgCode && params.targetPrj) {
  39062. parasByBounds.targetPrj = params.targetPrj;
  39063. }
  39064. if (params.aggregations) {
  39065. parasByBounds.aggregations = params.aggregations;
  39066. }
  39067. return Util_Util.toJSON(parasByBounds);
  39068. }
  39069. }]);
  39070. return GetFeaturesByBoundsParameters;
  39071. }(GetFeaturesParametersBase);
  39072. GetFeaturesByBoundsParameters.getFeatureMode = {
  39073. BOUNDS: 'BOUNDS',
  39074. BOUNDS_ATTRIBUTEFILTER: 'BOUNDS_ATTRIBUTEFILTER'
  39075. };
  39076. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesServiceBase.js
  39077. 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); }
  39078. function GetFeaturesServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39079. 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); } }
  39080. 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; }
  39081. 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); }
  39082. function GetFeaturesServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  39083. 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); }
  39084. 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); }
  39085. 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); }; }
  39086. 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); }
  39087. function GetFeaturesServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39088. 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; } }
  39089. function GetFeaturesServiceBase_getPrototypeOf(o) { GetFeaturesServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesServiceBase_getPrototypeOf(o); }
  39090. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39091. * This program are made available under the terms of the Apache License, Version 2.0
  39092. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39093. /**
  39094. * @class GetFeaturesServiceBase
  39095. * @deprecatedclass SuperMap.GetFeaturesServiceBase
  39096. * @category iServer Data FeatureResults
  39097. * @classdesc 数据服务中数据集查询服务基类。获取结果数据类型为 Object。包含 result 属性,result 的数据格式根据 format 参数决定为 GeoJSON 或者 iServerJSON。
  39098. * @extends CommonServiceBase
  39099. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  39100. * URL应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/
  39101. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  39102. * @param {Object} options - 参数。
  39103. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  39104. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39105. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39106. * @param {Object} [options.headers] - 请求头。
  39107. * @example
  39108. * var myService = new GetFeaturesServiceBase(url, {
  39109. * eventListeners: {
  39110. * "processCompleted": getFeatureCompleted,
  39111. * "processFailed": getFeatureError
  39112. * }
  39113. * });
  39114. * @usage
  39115. */
  39116. var GetFeaturesServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  39117. GetFeaturesServiceBase_inherits(GetFeaturesServiceBase, _CommonServiceBase);
  39118. var _super = GetFeaturesServiceBase_createSuper(GetFeaturesServiceBase);
  39119. function GetFeaturesServiceBase(url, options) {
  39120. var _this;
  39121. GetFeaturesServiceBase_classCallCheck(this, GetFeaturesServiceBase);
  39122. _this = _super.call(this, url, options);
  39123. options = options || {};
  39124. /**
  39125. * @member {boolean} [GetFeaturesServiceBase.prototype.returnContent=true]
  39126. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  39127. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  39128. * 如果为 false,则返回的是查询结果资源的 URI。
  39129. */
  39130. _this.returnContent = true;
  39131. /**
  39132. * @member {number} [GetFeaturesServiceBase.prototype.fromIndex=0]
  39133. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  39134. */
  39135. _this.fromIndex = 0;
  39136. /**
  39137. * @member {number} [GetFeaturesServiceBase.prototype.toIndex=19]
  39138. * @description 查询结果的最大索引号。
  39139. * 如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  39140. */
  39141. _this.toIndex = 19;
  39142. /**
  39143. * @member {number} [GetFeaturesServiceBase.prototype.hasGeometry=true]
  39144. * @description 返回结果是否包含Geometry。
  39145. */
  39146. _this.hasGeometry = true;
  39147. /**
  39148. * @member {number} [GetFeaturesServiceBase.prototype.maxFeatures=1000]
  39149. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  39150. */
  39151. _this.maxFeatures = null;
  39152. /**
  39153. * @member {string} [GetFeaturesServiceBase.prototype.format=DataFormat.GEOJSON]
  39154. * @description 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。
  39155. * 参数格式为 "ISERVER","GEOJSON","FGB"。
  39156. */
  39157. _this.format = DataFormat.GEOJSON;
  39158. Util_Util.extend(GetFeaturesServiceBase_assertThisInitialized(_this), options);
  39159. _this.url = Util_Util.urlPathAppend(_this.url, 'featureResults');
  39160. _this.CLASS_NAME = "SuperMap.GetFeaturesServiceBase";
  39161. return _this;
  39162. }
  39163. /**
  39164. * @function GetFeaturesServiceBase.prototype.destroy
  39165. * @description 释放资源,将引用资源的属性置空。
  39166. */
  39167. GetFeaturesServiceBase_createClass(GetFeaturesServiceBase, [{
  39168. key: "destroy",
  39169. value: function destroy() {
  39170. GetFeaturesServiceBase_get(GetFeaturesServiceBase_getPrototypeOf(GetFeaturesServiceBase.prototype), "destroy", this).call(this);
  39171. var me = this;
  39172. me.returnContent = null;
  39173. me.fromIndex = null;
  39174. me.toIndex = null;
  39175. me.maxFeatures = null;
  39176. me.format = null;
  39177. me.hasGeometry = null;
  39178. }
  39179. /**
  39180. * @function GetFeaturesServiceBase.prototype.processAsync
  39181. * @description 将客户端的查询参数传递到服务端。
  39182. * @param {Object} params - 查询参数。
  39183. */
  39184. }, {
  39185. key: "processAsync",
  39186. value: function processAsync(params) {
  39187. if (!params) {
  39188. return;
  39189. }
  39190. var me = this,
  39191. jsonParameters = null,
  39192. firstPara = true;
  39193. me.returnContent = params.returnContent;
  39194. me.fromIndex = params.fromIndex;
  39195. me.toIndex = params.toIndex;
  39196. me.maxFeatures = params.maxFeatures;
  39197. me.hasGeometry = params.hasGeometry;
  39198. if (me.returnContent) {
  39199. firstPara = false;
  39200. }
  39201. var isValidNumber = me.fromIndex != null && me.toIndex != null && !isNaN(me.fromIndex) && !isNaN(me.toIndex);
  39202. if (isValidNumber && me.fromIndex >= 0 && me.toIndex >= 0 && !firstPara) {
  39203. me.url = Util_Util.urlAppend(me.url, "fromIndex=".concat(me.fromIndex, "&toIndex=").concat(me.toIndex));
  39204. }
  39205. if (params.returnCountOnly) {
  39206. me.url = Util_Util.urlAppend(me.url, "&returnCountOnly=" + params.returnContent);
  39207. }
  39208. jsonParameters = me.getJsonParameters(params);
  39209. me.request({
  39210. method: "POST",
  39211. data: jsonParameters,
  39212. scope: me,
  39213. success: me.serviceProcessCompleted,
  39214. failure: me.serviceProcessFailed
  39215. });
  39216. }
  39217. /**
  39218. * @function GetFeaturesServiceBase.prototype.getFeatureComplete
  39219. * @description 查询完成,执行此方法。
  39220. * @param {Object} result - 服务器返回的结果对象。
  39221. */
  39222. }, {
  39223. key: "serviceProcessCompleted",
  39224. value: function serviceProcessCompleted(result, options) {
  39225. var me = this;
  39226. result = Util_Util.transformResult(result);
  39227. if (me.format === DataFormat.GEOJSON && result.features) {
  39228. var geoJSONFormat = new GeoJSON();
  39229. result.features = geoJSONFormat.toGeoJSON(result.features);
  39230. }
  39231. me.events.triggerEvent("processCompleted", {
  39232. result: result,
  39233. options: options
  39234. });
  39235. }
  39236. }, {
  39237. key: "dataFormat",
  39238. value: function dataFormat() {
  39239. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  39240. }
  39241. }]);
  39242. return GetFeaturesServiceBase;
  39243. }(CommonServiceBase);
  39244. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsService.js
  39245. 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); }
  39246. function GetFeaturesByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39247. 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); } }
  39248. 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; }
  39249. 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); }
  39250. function GetFeaturesByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  39251. 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); }
  39252. 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); }
  39253. 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); }; }
  39254. 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); }
  39255. function GetFeaturesByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39256. 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; } }
  39257. function GetFeaturesByBoundsService_getPrototypeOf(o) { GetFeaturesByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsService_getPrototypeOf(o); }
  39258. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39259. * This program are made available under the terms of the Apache License, Version 2.0
  39260. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39261. /**
  39262. * @class GetFeaturesByBoundsService
  39263. * @deprecatedclass SuperMap.GetFeaturesByBoundsService
  39264. * @category iServer Data FeatureResults
  39265. * @classdesc 数据集范围查询服务类,查询与指定范围对象符合一定空间关系的矢量要素。
  39266. * @description 数据集范围查询服务类构造函数。
  39267. * @extends {GetFeaturesServiceBase}
  39268. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  39269. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  39270. * @param {Object} options - 参数。
  39271. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  39272. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39273. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39274. * @param {Object} [options.headers] - 请求头。
  39275. * @example
  39276. * var myGetFeaturesByBoundsService = new SuperMa.GetFeaturesByBoundsService(url, {
  39277. * eventListeners: {
  39278. * "processCompleted": getFeatureCompleted,
  39279. * "processFailed": getFeatureError
  39280. * }
  39281. * });
  39282. * function getFeatureCompleted(object){//todo};
  39283. * function getFeatureError(object){//todo}
  39284. * @usage
  39285. */
  39286. var GetFeaturesByBoundsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  39287. GetFeaturesByBoundsService_inherits(GetFeaturesByBoundsService, _GetFeaturesServiceBa);
  39288. var _super = GetFeaturesByBoundsService_createSuper(GetFeaturesByBoundsService);
  39289. function GetFeaturesByBoundsService(url, options) {
  39290. var _this;
  39291. GetFeaturesByBoundsService_classCallCheck(this, GetFeaturesByBoundsService);
  39292. _this = _super.call(this, url, options);
  39293. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsService";
  39294. return _this;
  39295. }
  39296. /**
  39297. * @function GetFeaturesByBoundsService.prototype.destroy
  39298. * @override
  39299. */
  39300. GetFeaturesByBoundsService_createClass(GetFeaturesByBoundsService, [{
  39301. key: "destroy",
  39302. value: function destroy() {
  39303. GetFeaturesByBoundsService_get(GetFeaturesByBoundsService_getPrototypeOf(GetFeaturesByBoundsService.prototype), "destroy", this).call(this);
  39304. }
  39305. /**
  39306. * @function GetFeaturesByBoundsService.prototype.getJsonParameters
  39307. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry,Bounds等)。
  39308. * @param params {GetFeaturesByBoundsParameters}
  39309. * @returns {string} 转化后的 JSON 字符串。
  39310. *
  39311. */
  39312. }, {
  39313. key: "getJsonParameters",
  39314. value: function getJsonParameters(params) {
  39315. return GetFeaturesByBoundsParameters.toJsonParameters(params);
  39316. }
  39317. }]);
  39318. return GetFeaturesByBoundsService;
  39319. }(GetFeaturesServiceBase);
  39320. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferParameters.js
  39321. 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); }
  39322. function GetFeaturesByBufferParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39323. 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); } }
  39324. 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; }
  39325. 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); }
  39326. function GetFeaturesByBufferParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39327. 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); }
  39328. 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); }
  39329. 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); }; }
  39330. 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); }
  39331. function GetFeaturesByBufferParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39332. 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; } }
  39333. function GetFeaturesByBufferParameters_getPrototypeOf(o) { GetFeaturesByBufferParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferParameters_getPrototypeOf(o); }
  39334. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39335. * This program are made available under the terms of the Apache License, Version 2.0
  39336. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39337. /**
  39338. * @class GetFeaturesByBufferParameters
  39339. * @deprecatedclass SuperMap.GetFeaturesByBufferParameters
  39340. * @category iServer Data FeatureResults
  39341. * @classdesc 数据集缓冲区查询参数类。
  39342. * @param {Object} options - 参数。
  39343. * @param {number} options.bufferDistance - buffer 距离,单位与所查询图层对应的数据集单位相同。
  39344. * @param {GeoJSONObject} options.geometry - 空间查询条件。
  39345. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  39346. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  39347. * @param {string} [options.attributeFilter] - 属性查询条件。
  39348. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  39349. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  39350. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  39351. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  39352. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  39353. * @extends {GetFeaturesParametersBase}
  39354. * @usage
  39355. */
  39356. var GetFeaturesByBufferParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  39357. GetFeaturesByBufferParameters_inherits(GetFeaturesByBufferParameters, _GetFeaturesParameter);
  39358. var _super = GetFeaturesByBufferParameters_createSuper(GetFeaturesByBufferParameters);
  39359. function GetFeaturesByBufferParameters(options) {
  39360. var _this;
  39361. GetFeaturesByBufferParameters_classCallCheck(this, GetFeaturesByBufferParameters);
  39362. _this = _super.call(this, options);
  39363. /**
  39364. * @member {number} GetFeaturesByBufferParameters.prototype.bufferDistance
  39365. * @description buffer 距离,单位与所查询图层对应的数据集单位相同。
  39366. */
  39367. _this.bufferDistance = null;
  39368. /**
  39369. * @member {string} GetFeaturesByBufferParameters.prototype.attributeFilter
  39370. * @description 属性查询条件。
  39371. */
  39372. _this.attributeFilter = null;
  39373. /**
  39374. * @member {GeoJSONObject} GetFeaturesByBufferParameters.prototype.geometry
  39375. * @description 空间查询条件。<br>
  39376. * 点类型可以是:{@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>
  39377. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。</br>
  39378. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  39379. */
  39380. _this.geometry = null;
  39381. /**
  39382. * @member {Array.<string>} GetFeaturesByBufferParameters.prototype.fields
  39383. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  39384. */
  39385. _this.fields = null;
  39386. Util_Util.extend(GetFeaturesByBufferParameters_assertThisInitialized(_this), options);
  39387. _this.CLASS_NAME = 'SuperMap.GetFeaturesByBufferParameters';
  39388. return _this;
  39389. }
  39390. /**
  39391. * @function GetFeaturesByBufferParameters.prototype.destroy
  39392. * @override
  39393. */
  39394. GetFeaturesByBufferParameters_createClass(GetFeaturesByBufferParameters, [{
  39395. key: "destroy",
  39396. value: function destroy() {
  39397. GetFeaturesByBufferParameters_get(GetFeaturesByBufferParameters_getPrototypeOf(GetFeaturesByBufferParameters.prototype), "destroy", this).call(this);
  39398. var me = this;
  39399. me.bufferDistance = null;
  39400. me.attributeFilter = null;
  39401. if (me.fields) {
  39402. while (me.fields.length > 0) {
  39403. me.fields.pop();
  39404. }
  39405. me.fields = null;
  39406. }
  39407. if (me.geometry) {
  39408. me.geometry.destroy();
  39409. me.geometry = null;
  39410. }
  39411. }
  39412. /**
  39413. * @function GetFeaturesByBufferParameters.toJsonParameters
  39414. * @description 将 GetFeaturesByBufferParameters 对象转换为 JSON 字符串。
  39415. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数对象。
  39416. * @returns {string} 转化后的 JSON 字符串。
  39417. */
  39418. }], [{
  39419. key: "toJsonParameters",
  39420. value: function toJsonParameters(params) {
  39421. var filterParameter, paramsByBuffer, geometry;
  39422. geometry = ServerGeometry.fromGeometry(params.geometry);
  39423. paramsByBuffer = {
  39424. datasetNames: params.datasetNames,
  39425. getFeatureMode: 'BUFFER',
  39426. bufferDistance: params.bufferDistance,
  39427. geometry: geometry
  39428. };
  39429. if (params.fields) {
  39430. filterParameter = new FilterParameter();
  39431. filterParameter.name = params.datasetNames;
  39432. filterParameter.fields = params.fields;
  39433. paramsByBuffer.queryParameter = filterParameter;
  39434. }
  39435. if (params.attributeFilter) {
  39436. paramsByBuffer.attributeFilter = params.attributeFilter;
  39437. paramsByBuffer.getFeatureMode = 'BUFFER_ATTRIBUTEFILTER';
  39438. }
  39439. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  39440. paramsByBuffer.maxFeatures = params.maxFeatures;
  39441. }
  39442. if (typeof params.hasGeometry === 'boolean') {
  39443. paramsByBuffer.hasGeometry = params.hasGeometry;
  39444. }
  39445. if (params.targetEpsgCode) {
  39446. paramsByBuffer.targetEpsgCode = params.targetEpsgCode;
  39447. }
  39448. if (!params.targetEpsgCode && params.targetPrj) {
  39449. paramsByBuffer.targetPrj = params.targetPrj;
  39450. }
  39451. return Util_Util.toJSON(paramsByBuffer);
  39452. }
  39453. }]);
  39454. return GetFeaturesByBufferParameters;
  39455. }(GetFeaturesParametersBase);
  39456. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferService.js
  39457. 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); }
  39458. function GetFeaturesByBufferService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39459. 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); } }
  39460. 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; }
  39461. 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); }
  39462. function GetFeaturesByBufferService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferService_getPrototypeOf(object); if (object === null) break; } return object; }
  39463. 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); }
  39464. 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); }
  39465. 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); }; }
  39466. 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); }
  39467. function GetFeaturesByBufferService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39468. 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; } }
  39469. function GetFeaturesByBufferService_getPrototypeOf(o) { GetFeaturesByBufferService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferService_getPrototypeOf(o); }
  39470. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39471. * This program are made available under the terms of the Apache License, Version 2.0
  39472. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39473. /**
  39474. * @class GetFeaturesByBufferService
  39475. * @deprecatedclass SuperMap.GetFeaturesByBufferService
  39476. * @category iServer Data FeatureResults
  39477. * @classdesc 数据服务中数据集缓冲区查询服务类。
  39478. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  39479. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  39480. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  39481. * @param {Object} options - 参数。
  39482. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  39483. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39484. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39485. * @param {Object} [options.headers] - 请求头。
  39486. * @extends {GetFeaturesServiceBase}
  39487. * @example
  39488. * var myGetFeaturesByBufferService = new GetFeaturesByBufferService(url, {
  39489. * eventListeners: {
  39490. * "processCompleted": GetFeaturesCompleted,
  39491. * "processFailed": GetFeaturesError
  39492. * }
  39493. * });
  39494. * function GetFeaturesCompleted(object){//todo};
  39495. * function GetFeaturesError(object){//todo};
  39496. * @usage
  39497. */
  39498. var GetFeaturesByBufferService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  39499. GetFeaturesByBufferService_inherits(GetFeaturesByBufferService, _GetFeaturesServiceBa);
  39500. var _super = GetFeaturesByBufferService_createSuper(GetFeaturesByBufferService);
  39501. function GetFeaturesByBufferService(url, options) {
  39502. var _this;
  39503. GetFeaturesByBufferService_classCallCheck(this, GetFeaturesByBufferService);
  39504. _this = _super.call(this, url, options);
  39505. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferService";
  39506. return _this;
  39507. }
  39508. /**
  39509. * @function GetFeaturesByBufferService.prototype.destroy
  39510. * @override
  39511. */
  39512. GetFeaturesByBufferService_createClass(GetFeaturesByBufferService, [{
  39513. key: "destroy",
  39514. value: function destroy() {
  39515. GetFeaturesByBufferService_get(GetFeaturesByBufferService_getPrototypeOf(GetFeaturesByBufferService.prototype), "destroy", this).call(this);
  39516. }
  39517. /**
  39518. * @function GetFeaturesByBufferService.prototype.getJsonParameters
  39519. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(IDs, SQL, Buffer, Geometry等)。
  39520. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  39521. * @returns {Object} 转化后的 JSON 字符串。
  39522. */
  39523. }, {
  39524. key: "getJsonParameters",
  39525. value: function getJsonParameters(params) {
  39526. if (!(params instanceof GetFeaturesByBufferParameters)) {
  39527. return;
  39528. }
  39529. return GetFeaturesByBufferParameters.toJsonParameters(params);
  39530. }
  39531. }]);
  39532. return GetFeaturesByBufferService;
  39533. }(GetFeaturesServiceBase);
  39534. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryParameters.js
  39535. 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); }
  39536. function GetFeaturesByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39537. 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); } }
  39538. 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; }
  39539. 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); }
  39540. function GetFeaturesByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39541. 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); }
  39542. 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); }
  39543. 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); }; }
  39544. 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); }
  39545. function GetFeaturesByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39546. 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; } }
  39547. function GetFeaturesByGeometryParameters_getPrototypeOf(o) { GetFeaturesByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryParameters_getPrototypeOf(o); }
  39548. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39549. * This program are made available under the terms of the Apache License, Version 2.0
  39550. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39551. /**
  39552. * @class GetFeaturesByGeometryParameters
  39553. * @deprecatedclass SuperMap.GetFeaturesByGeometryParameters
  39554. * @category iServer Data FeatureResults
  39555. * @classdesc 数据集几何查询参数类。该类用于设置数据集几何查询的相关参数。
  39556. * @param {Object} options - 参数。
  39557. * @param {GeoJSONObject} options.geometry - 查询的几何对象。
  39558. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  39559. * @param {string} [options.attributeFilter] - 几何查询属性过滤条件。
  39560. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  39561. * @param {SpatialQueryMode} [options.spatialQueryMode=SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  39562. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  39563. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  39564. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  39565. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  39566. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  39567. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  39568. * @extends {GetFeaturesParametersBase}
  39569. * @usage
  39570. */
  39571. var GetFeaturesByGeometryParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  39572. GetFeaturesByGeometryParameters_inherits(GetFeaturesByGeometryParameters, _GetFeaturesParameter);
  39573. var _super = GetFeaturesByGeometryParameters_createSuper(GetFeaturesByGeometryParameters);
  39574. function GetFeaturesByGeometryParameters(options) {
  39575. var _this;
  39576. GetFeaturesByGeometryParameters_classCallCheck(this, GetFeaturesByGeometryParameters);
  39577. _this = _super.call(this, options);
  39578. /**
  39579. * @member {string} GetFeaturesByGeometryParameters.prototype.getFeatureMode
  39580. * @description 数据集查询模式。几何查询有 "SPATIAL","SPATIAL_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 SPATIAL_ATTRIBUTEFILTER 访问服务。
  39581. */
  39582. _this.getFeatureMode = 'SPATIAL';
  39583. /**
  39584. * @member {GeoJSONObject} GetFeaturesByGeometryParameters.prototype.geometry
  39585. * @description 用于查询的几何对象。 </br>
  39586. * 点类型可以是:{@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>
  39587. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。</br>
  39588. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  39589. */
  39590. _this.geometry = null;
  39591. /**
  39592. * @member {Array.<string>} GetFeaturesByGeometryParameters.prototype.fields
  39593. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  39594. */
  39595. _this.fields = null;
  39596. /**
  39597. * @member {string} GetFeaturesByGeometryParameters.prototype.attributeFilter
  39598. * @description 几何查询属性过滤条件。
  39599. */
  39600. _this.attributeFilter = null;
  39601. /**
  39602. * @member {SpatialQueryMode} [GetFeaturesByGeometryParameters.prototype.spatialQueryMode=SpatialQueryMode.CONTAIN]
  39603. * @description 空间查询模式常量。
  39604. */
  39605. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  39606. Util_Util.extend(GetFeaturesByGeometryParameters_assertThisInitialized(_this), options);
  39607. _this.CLASS_NAME = 'SuperMap.GetFeaturesByGeometryParameters';
  39608. return _this;
  39609. }
  39610. /**
  39611. * @function GetFeaturesByGeometryParameters.prototype.destroy
  39612. * @description 释放资源,将引用资源的属性置空。
  39613. */
  39614. GetFeaturesByGeometryParameters_createClass(GetFeaturesByGeometryParameters, [{
  39615. key: "destroy",
  39616. value: function destroy() {
  39617. GetFeaturesByGeometryParameters_get(GetFeaturesByGeometryParameters_getPrototypeOf(GetFeaturesByGeometryParameters.prototype), "destroy", this).call(this);
  39618. var me = this;
  39619. if (me.geometry) {
  39620. me.geometry.destroy();
  39621. me.geometry = null;
  39622. }
  39623. if (me.fields) {
  39624. while (me.fields.length > 0) {
  39625. me.fields.pop();
  39626. }
  39627. me.fields = null;
  39628. }
  39629. me.attributeFilter = null;
  39630. me.spatialQueryMode = null;
  39631. me.getFeatureMode = null;
  39632. }
  39633. /**
  39634. * @function GetFeaturesByGeometryParameters.toJsonParameters
  39635. * @description 将 GetFeaturesByGeometryParameters 对象参数转换为 JSON 字符串。
  39636. * @param {GetFeaturesByGeometryParameters} params - 查询参数对象。
  39637. * @returns {string} 转化后的 JSON 字符串。
  39638. */
  39639. }], [{
  39640. key: "toJsonParameters",
  39641. value: function toJsonParameters(params) {
  39642. var filterParameter, geometry, parasByGeometry;
  39643. geometry = ServerGeometry.fromGeometry(params.geometry);
  39644. parasByGeometry = {
  39645. datasetNames: params.datasetNames,
  39646. getFeatureMode: 'SPATIAL',
  39647. geometry: geometry,
  39648. spatialQueryMode: params.spatialQueryMode
  39649. };
  39650. if (params.fields) {
  39651. filterParameter = new FilterParameter();
  39652. filterParameter.name = params.datasetNames;
  39653. filterParameter.fields = params.fields;
  39654. parasByGeometry.queryParameter = filterParameter;
  39655. }
  39656. if (params.attributeFilter) {
  39657. parasByGeometry.attributeFilter = params.attributeFilter;
  39658. parasByGeometry.getFeatureMode = 'SPATIAL_ATTRIBUTEFILTER';
  39659. }
  39660. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  39661. parasByGeometry.maxFeatures = params.maxFeatures;
  39662. }
  39663. if (typeof params.hasGeometry === 'boolean') {
  39664. parasByGeometry.hasGeometry = params.hasGeometry;
  39665. }
  39666. if (params.targetEpsgCode) {
  39667. parasByGeometry.targetEpsgCode = params.targetEpsgCode;
  39668. }
  39669. if (!params.targetEpsgCode && params.targetPrj) {
  39670. parasByGeometry.targetPrj = params.targetPrj;
  39671. }
  39672. if (params.aggregations) {
  39673. parasByGeometry.aggregations = params.aggregations;
  39674. }
  39675. return Util_Util.toJSON(parasByGeometry);
  39676. }
  39677. }]);
  39678. return GetFeaturesByGeometryParameters;
  39679. }(GetFeaturesParametersBase);
  39680. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryService.js
  39681. 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); }
  39682. function GetFeaturesByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39683. 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); } }
  39684. 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; }
  39685. 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); }
  39686. function GetFeaturesByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  39687. 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); }
  39688. 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); }
  39689. 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); }; }
  39690. 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); }
  39691. function GetFeaturesByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39692. 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; } }
  39693. function GetFeaturesByGeometryService_getPrototypeOf(o) { GetFeaturesByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryService_getPrototypeOf(o); }
  39694. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39695. * This program are made available under the terms of the Apache License, Version 2.0
  39696. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39697. /**
  39698. * @class GetFeaturesByGeometryService
  39699. * @deprecatedclass SuperMap.GetFeaturesByGeometryService
  39700. * @category iServer Data FeatureResults
  39701. * @classdesc 数据集几何查询服务类,查询与指定几何对象符合一定空间关系的矢量要素。
  39702. * @param {string} url - 服务地址。请求数据服务中数据集查询服务。
  39703. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data;
  39704. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data"
  39705. * @param {Object} options - 参数。
  39706. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  39707. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39708. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39709. * @param {Object} [options.headers] - 请求头。
  39710. * @extends {GetFeaturesServiceBase}
  39711. * @example
  39712. * var myService = new GetFeaturesByGeometryService(url, {
  39713. * eventListeners: {
  39714. * "processCompleted": getFeatureCompleted,
  39715. * "processFailed": getFeatureError
  39716. * }
  39717. * });
  39718. * function getFeatureCompleted(object){//todo};
  39719. * function getFeatureError(object){//todo}
  39720. * @usage
  39721. */
  39722. var GetFeaturesByGeometryService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  39723. GetFeaturesByGeometryService_inherits(GetFeaturesByGeometryService, _GetFeaturesServiceBa);
  39724. var _super = GetFeaturesByGeometryService_createSuper(GetFeaturesByGeometryService);
  39725. function GetFeaturesByGeometryService(url, options) {
  39726. var _this;
  39727. GetFeaturesByGeometryService_classCallCheck(this, GetFeaturesByGeometryService);
  39728. _this = _super.call(this, url, options);
  39729. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryService";
  39730. return _this;
  39731. }
  39732. /**
  39733. * @function GetFeaturesByGeometryService.prototype.destroy
  39734. * @override
  39735. */
  39736. GetFeaturesByGeometryService_createClass(GetFeaturesByGeometryService, [{
  39737. key: "destroy",
  39738. value: function destroy() {
  39739. GetFeaturesByGeometryService_get(GetFeaturesByGeometryService_getPrototypeOf(GetFeaturesByGeometryService.prototype), "destroy", this).call(this);
  39740. }
  39741. /**
  39742. * @function GetFeaturesByGeometryService.prototype.getJsonParameters
  39743. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  39744. * @description 将查询参数转化为 JSON 字符串。
  39745. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  39746. * @returns {Object} 转化后的 JSON 字符串。
  39747. */
  39748. }, {
  39749. key: "getJsonParameters",
  39750. value: function getJsonParameters(params) {
  39751. return GetFeaturesByGeometryParameters.toJsonParameters(params);
  39752. }
  39753. }]);
  39754. return GetFeaturesByGeometryService;
  39755. }(GetFeaturesServiceBase);
  39756. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsParameters.js
  39757. 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); }
  39758. function GetFeaturesByIDsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39759. 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); } }
  39760. 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; }
  39761. 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); }
  39762. function GetFeaturesByIDsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39763. 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); }
  39764. 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); }
  39765. 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); }; }
  39766. 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); }
  39767. function GetFeaturesByIDsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39768. 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; } }
  39769. function GetFeaturesByIDsParameters_getPrototypeOf(o) { GetFeaturesByIDsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsParameters_getPrototypeOf(o); }
  39770. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39771. * This program are made available under the terms of the Apache License, Version 2.0
  39772. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39773. /**
  39774. * @class GetFeaturesByIDsParameters
  39775. * @deprecatedclass SuperMap.GetFeaturesByIDsParameters
  39776. * @category iServer Data FeatureResults
  39777. * @classdesc ID 查询参数类。
  39778. * @param {Object} options - 参数。
  39779. * @param {Array.<number>} options.IDs - 指定查询的元素 ID 信息。
  39780. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  39781. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  39782. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  39783. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  39784. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  39785. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  39786. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  39787. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  39788. * @extends {GetFeaturesParametersBase}
  39789. * @usage
  39790. */
  39791. var GetFeaturesByIDsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  39792. GetFeaturesByIDsParameters_inherits(GetFeaturesByIDsParameters, _GetFeaturesParameter);
  39793. var _super = GetFeaturesByIDsParameters_createSuper(GetFeaturesByIDsParameters);
  39794. function GetFeaturesByIDsParameters(options) {
  39795. var _this;
  39796. GetFeaturesByIDsParameters_classCallCheck(this, GetFeaturesByIDsParameters);
  39797. _this = _super.call(this, options);
  39798. /**
  39799. * @member {string} GetFeaturesByIDsParameters.prototype.getFeatureMode
  39800. * @description 数据集查询模式。
  39801. */
  39802. _this.getFeatureMode = 'ID';
  39803. /**
  39804. * @member {Array.<number>} GetFeaturesByIDsParameters.prototype.IDs
  39805. * @description 所要查询指定的元素 ID 信息。
  39806. */
  39807. _this.IDs = null;
  39808. /**
  39809. * @member {Array.<string>} GetFeaturesByIDsParameters.prototype.fields
  39810. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  39811. */
  39812. _this.fields = null;
  39813. Util_Util.extend(GetFeaturesByIDsParameters_assertThisInitialized(_this), options);
  39814. _this.CLASS_NAME = 'SuperMap.GetFeaturesByIDsParameters';
  39815. return _this;
  39816. }
  39817. /**
  39818. * @function GetFeaturesByIDsParameters.prototype.destroy
  39819. * @override
  39820. */
  39821. GetFeaturesByIDsParameters_createClass(GetFeaturesByIDsParameters, [{
  39822. key: "destroy",
  39823. value: function destroy() {
  39824. GetFeaturesByIDsParameters_get(GetFeaturesByIDsParameters_getPrototypeOf(GetFeaturesByIDsParameters.prototype), "destroy", this).call(this);
  39825. var me = this;
  39826. me.IDs = null;
  39827. me.getFeatureMode = null;
  39828. if (me.fields) {
  39829. while (me.fields.length > 0) {
  39830. me.fields.pop();
  39831. }
  39832. me.fields = null;
  39833. }
  39834. }
  39835. /**
  39836. * @function GetFeaturesByIDsParameters.toJsonParameters
  39837. * @description 将 GetFeaturesByIDsParameters 对象转换为 JSON 字符串。
  39838. * @param {GetFeaturesByIDsParameters} params - ID 查询参数对象。
  39839. * @returns {string} 转化后的 JSON 字符串。
  39840. */
  39841. }], [{
  39842. key: "toJsonParameters",
  39843. value: function toJsonParameters(params) {
  39844. var parasByIDs, filterParameter;
  39845. parasByIDs = {
  39846. datasetNames: params.datasetNames,
  39847. getFeatureMode: 'ID',
  39848. ids: params.IDs
  39849. };
  39850. if (params.fields) {
  39851. filterParameter = new FilterParameter();
  39852. filterParameter.name = params.datasetNames;
  39853. filterParameter.fields = params.fields;
  39854. parasByIDs.queryParameter = filterParameter;
  39855. }
  39856. if (params.targetEpsgCode) {
  39857. parasByIDs.targetEpsgCode = params.targetEpsgCode;
  39858. }
  39859. if (typeof params.hasGeometry === 'boolean') {
  39860. parasByIDs.hasGeometry = params.hasGeometry;
  39861. }
  39862. if (!params.targetEpsgCode && params.targetPrj) {
  39863. parasByIDs.targetPrj = params.targetPrj;
  39864. }
  39865. if (params.aggregations) {
  39866. parasByIDs.aggregations = params.aggregations;
  39867. }
  39868. return Util_Util.toJSON(parasByIDs);
  39869. }
  39870. }]);
  39871. return GetFeaturesByIDsParameters;
  39872. }(GetFeaturesParametersBase);
  39873. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsService.js
  39874. 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); }
  39875. function GetFeaturesByIDsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39876. 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); } }
  39877. 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; }
  39878. 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); }
  39879. function GetFeaturesByIDsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsService_getPrototypeOf(object); if (object === null) break; } return object; }
  39880. 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); }
  39881. 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); }
  39882. 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); }; }
  39883. 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); }
  39884. function GetFeaturesByIDsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39885. 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; } }
  39886. function GetFeaturesByIDsService_getPrototypeOf(o) { GetFeaturesByIDsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsService_getPrototypeOf(o); }
  39887. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39888. * This program are made available under the terms of the Apache License, Version 2.0
  39889. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39890. /**
  39891. * @class GetFeaturesByIDsService
  39892. * @deprecatedclass SuperMap.GetFeaturesByIDsService
  39893. * @category iServer Data FeatureResults
  39894. * @classdesc 数据集ID查询服务类。在数据集集合中查找指定 ID 号对应的空间地物要素。
  39895. * @param {string} url - 服务地址。请求数据服务中数据集查询服务。
  39896. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  39897. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  39898. * @param {Object} options - 参数。
  39899. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  39900. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  39901. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  39902. * @param {Object} [options.headers] - 请求头。
  39903. * @extends {GetFeaturesServiceBase}
  39904. * @example
  39905. * var myGetFeaturesByIDsService = new GetFeaturesByIDsService(url, {
  39906. * eventListeners: {
  39907. * "processCompleted": getFeatureCompleted,
  39908. * "processFailed": getFeatureError
  39909. * }
  39910. * });
  39911. * function getFeatureCompleted(object){//todo};
  39912. * function getFeatureError(object){//todo}
  39913. * @usage
  39914. */
  39915. var GetFeaturesByIDsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  39916. GetFeaturesByIDsService_inherits(GetFeaturesByIDsService, _GetFeaturesServiceBa);
  39917. var _super = GetFeaturesByIDsService_createSuper(GetFeaturesByIDsService);
  39918. function GetFeaturesByIDsService(url, options) {
  39919. var _this;
  39920. GetFeaturesByIDsService_classCallCheck(this, GetFeaturesByIDsService);
  39921. _this = _super.call(this, url, options);
  39922. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsService";
  39923. return _this;
  39924. }
  39925. /**
  39926. * @function GetFeaturesByIDsService.prototype.destroy
  39927. * @override
  39928. */
  39929. GetFeaturesByIDsService_createClass(GetFeaturesByIDsService, [{
  39930. key: "destroy",
  39931. value: function destroy() {
  39932. GetFeaturesByIDsService_get(GetFeaturesByIDsService_getPrototypeOf(GetFeaturesByIDsService.prototype), "destroy", this).call(this);
  39933. }
  39934. /**
  39935. * @function GetFeaturesByIDsService.prototype.getJsonParameters
  39936. * @description 将查询参数转化为 JSON 字符串。
  39937. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  39938. * @param {GetFeaturesByIDsParameters} params - ID查询参数类。
  39939. * @returns {string} 转化后的 JSON 字符串。
  39940. */
  39941. }, {
  39942. key: "getJsonParameters",
  39943. value: function getJsonParameters(params) {
  39944. return GetFeaturesByIDsParameters.toJsonParameters(params);
  39945. }
  39946. }]);
  39947. return GetFeaturesByIDsService;
  39948. }(GetFeaturesServiceBase);
  39949. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLParameters.js
  39950. 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); }
  39951. function GetFeaturesBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39952. 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); } }
  39953. 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; }
  39954. 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); }
  39955. function GetFeaturesBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  39956. 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); }
  39957. 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); }
  39958. 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); }; }
  39959. 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); }
  39960. function GetFeaturesBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  39961. 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; } }
  39962. function GetFeaturesBySQLParameters_getPrototypeOf(o) { GetFeaturesBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLParameters_getPrototypeOf(o); }
  39963. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  39964. * This program are made available under the terms of the Apache License, Version 2.0
  39965. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39966. /**
  39967. * @class GetFeaturesBySQLParameters
  39968. * @deprecatedclass SuperMap.GetFeaturesBySQLParameters
  39969. * @category iServer Data FeatureResults
  39970. * @classdesc 数据集 SQL 查询参数类。
  39971. * @param {Object} options - 参数。
  39972. * @param {FilterParameter} options.queryParameter - 查询过滤条件参数。
  39973. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  39974. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  39975. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  39976. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  39977. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  39978. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  39979. * @param {MetricsAggParameter|GeoHashGridAggParameter} [options.aggregations] - 聚合查询参数。该参数仅支持数据来源 Elasticsearch 服务的Supermap iServer的rest数据服务。
  39980. * @extends {GetFeaturesParametersBase}
  39981. * @usage
  39982. */
  39983. var GetFeaturesBySQLParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  39984. GetFeaturesBySQLParameters_inherits(GetFeaturesBySQLParameters, _GetFeaturesParameter);
  39985. var _super = GetFeaturesBySQLParameters_createSuper(GetFeaturesBySQLParameters);
  39986. function GetFeaturesBySQLParameters(options) {
  39987. var _this;
  39988. GetFeaturesBySQLParameters_classCallCheck(this, GetFeaturesBySQLParameters);
  39989. _this = _super.call(this, options);
  39990. /**
  39991. * @member {string} GetFeaturesBySQLParameters.prototype.getFeatureMode
  39992. * @description 数据集查询模式。
  39993. */
  39994. _this.getFeatureMode = 'SQL';
  39995. /**
  39996. * @member {FilterParameter} GetFeaturesBySQLParameters.prototype.queryParameter
  39997. * @description 查询过滤条件参数类。
  39998. */
  39999. _this.queryParameter = null;
  40000. Util_Util.extend(GetFeaturesBySQLParameters_assertThisInitialized(_this), options);
  40001. _this.CLASS_NAME = 'SuperMap.GetFeaturesBySQLParameters';
  40002. return _this;
  40003. }
  40004. /**
  40005. * @function GetFeaturesBySQLParameters.prototype.destroy
  40006. * @override
  40007. */
  40008. GetFeaturesBySQLParameters_createClass(GetFeaturesBySQLParameters, [{
  40009. key: "destroy",
  40010. value: function destroy() {
  40011. GetFeaturesBySQLParameters_get(GetFeaturesBySQLParameters_getPrototypeOf(GetFeaturesBySQLParameters.prototype), "destroy", this).call(this);
  40012. var me = this;
  40013. me.getFeatureMode = null;
  40014. if (me.queryParameter) {
  40015. me.queryParameter.destroy();
  40016. me.queryParameter = null;
  40017. }
  40018. }
  40019. /**
  40020. * @function GetFeaturesBySQLParameters.prototype.toJsonParameters
  40021. * @description 将 GetFeaturesBySQLParameters 对象转换为 JSON 字符串。
  40022. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数对象。
  40023. * @returns {string} 转化后的 JSON 字符串。
  40024. */
  40025. }], [{
  40026. key: "toJsonParameters",
  40027. value: function toJsonParameters(params) {
  40028. var paramsBySql = {
  40029. datasetNames: params.datasetNames,
  40030. getFeatureMode: 'SQL',
  40031. queryParameter: params.queryParameter
  40032. };
  40033. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  40034. paramsBySql.maxFeatures = params.maxFeatures;
  40035. }
  40036. if (typeof params.hasGeometry === 'boolean') {
  40037. paramsBySql.hasGeometry = params.hasGeometry;
  40038. }
  40039. if (params.aggregations) {
  40040. paramsBySql.aggregations = params.aggregations;
  40041. }
  40042. if (params.targetEpsgCode) {
  40043. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  40044. }
  40045. if (!params.targetEpsgCode && params.targetPrj) {
  40046. paramsBySql.targetPrj = params.targetPrj;
  40047. }
  40048. if (params.aggregations) {
  40049. paramsBySql.aggregations = params.aggregations;
  40050. }
  40051. return Util_Util.toJSON(paramsBySql);
  40052. }
  40053. }]);
  40054. return GetFeaturesBySQLParameters;
  40055. }(GetFeaturesParametersBase);
  40056. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLService.js
  40057. 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); }
  40058. function GetFeaturesBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40059. 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); } }
  40060. 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; }
  40061. 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); }
  40062. function GetFeaturesBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  40063. 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); }
  40064. 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); }
  40065. 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); }; }
  40066. 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); }
  40067. function GetFeaturesBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40068. 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; } }
  40069. function GetFeaturesBySQLService_getPrototypeOf(o) { GetFeaturesBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLService_getPrototypeOf(o); }
  40070. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40071. * This program are made available under the terms of the Apache License, Version 2.0
  40072. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40073. /**
  40074. * @class GetFeaturesBySQLService
  40075. * @deprecatedclass SuperMap.GetFeaturesBySQLService
  40076. * @constructs GetFeaturesBySQLService
  40077. * @category iServer Data FeatureResults
  40078. * @classdesc 数据服务中数据集 SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  40079. * @param {string} url - 服务地址。请求数据服务中数据集查询服务,
  40080. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  40081. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  40082. * @param {Object} options - 参数。
  40083. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  40084. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  40085. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40086. * @param {Object} [options.headers] - 请求头。
  40087. * @extends {GetFeaturesServiceBase}
  40088. * @example
  40089. * var myGetFeaturesBySQLService = new GetFeaturesBySQLService(url, {
  40090. * eventListeners: {
  40091. * "processCompleted": GetFeaturesCompleted,
  40092. * "processFailed": GetFeaturesError
  40093. * }
  40094. * });
  40095. * function getFeaturesCompleted(object){//todo};
  40096. * function getFeaturesError(object){//todo};
  40097. * @usage
  40098. */
  40099. var GetFeaturesBySQLService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  40100. GetFeaturesBySQLService_inherits(GetFeaturesBySQLService, _GetFeaturesServiceBa);
  40101. var _super = GetFeaturesBySQLService_createSuper(GetFeaturesBySQLService);
  40102. function GetFeaturesBySQLService(url, options) {
  40103. var _this;
  40104. GetFeaturesBySQLService_classCallCheck(this, GetFeaturesBySQLService);
  40105. _this = _super.call(this, url, options);
  40106. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLService";
  40107. return _this;
  40108. }
  40109. /**
  40110. * @function GetFeaturesBySQLService.prototype.destroy
  40111. * @override
  40112. */
  40113. GetFeaturesBySQLService_createClass(GetFeaturesBySQLService, [{
  40114. key: "destroy",
  40115. value: function destroy() {
  40116. GetFeaturesBySQLService_get(GetFeaturesBySQLService_getPrototypeOf(GetFeaturesBySQLService.prototype), "destroy", this).call(this);
  40117. }
  40118. /*
  40119. * @function GetFeaturesBySQLService.prototype.getJsonParameters
  40120. * @description 将查询参数转化为 JSON 字符串。
  40121. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  40122. * @param {GetFeaturesBySQLParameters} params - 数据集SQL查询参数类。
  40123. * @returns {string} 转化后的 JSON 字符串。
  40124. */
  40125. }, {
  40126. key: "getJsonParameters",
  40127. value: function getJsonParameters(params) {
  40128. return GetFeaturesBySQLParameters.toJsonParameters(params);
  40129. }
  40130. }]);
  40131. return GetFeaturesBySQLService;
  40132. }(GetFeaturesServiceBase);
  40133. ;// CONCATENATED MODULE: ./src/common/iServer/GetFieldsService.js
  40134. 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); }
  40135. function GetFieldsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40136. 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); } }
  40137. 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; }
  40138. 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); }
  40139. function GetFieldsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFieldsService_getPrototypeOf(object); if (object === null) break; } return object; }
  40140. 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); }
  40141. 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); }
  40142. 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); }; }
  40143. 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); }
  40144. function GetFieldsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40145. 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; } }
  40146. function GetFieldsService_getPrototypeOf(o) { GetFieldsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFieldsService_getPrototypeOf(o); }
  40147. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40148. * This program are made available under the terms of the Apache License, Version 2.0
  40149. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40150. /**
  40151. * @class GetFieldsService
  40152. * @deprecatedclass SuperMap.GetFieldsService
  40153. * @category iServer Data Field
  40154. * @classdesc 字段查询服务,支持查询指定数据集的中所有属性字段(field)的集合。
  40155. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  40156. * @param {Object} options - 参数。
  40157. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  40158. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  40159. * @param {string}options.datasource - 数据源名称。
  40160. * @param {string}options.dataset - 数据集名称。
  40161. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40162. * @param {Object} [options.headers] - 请求头。
  40163. * @extends {CommonServiceBase}
  40164. * @example
  40165. * var myService = new GetFieldsService(url, {eventListeners: {
  40166. * "processCompleted": getFieldsCompleted,
  40167. * "processFailed": getFieldsError
  40168. * },
  40169. * datasource: "World",
  40170. * dataset: "Countries"
  40171. * };
  40172. * @usage
  40173. */
  40174. var GetFieldsService = /*#__PURE__*/function (_CommonServiceBase) {
  40175. GetFieldsService_inherits(GetFieldsService, _CommonServiceBase);
  40176. var _super = GetFieldsService_createSuper(GetFieldsService);
  40177. function GetFieldsService(url, options) {
  40178. var _this;
  40179. GetFieldsService_classCallCheck(this, GetFieldsService);
  40180. _this = _super.call(this, url, options);
  40181. /**
  40182. * @member {string} GetFieldsService.prototype.datasource
  40183. * @description 要查询的数据集所在的数据源名称。
  40184. */
  40185. _this.datasource = null;
  40186. /**
  40187. * @member {string} GetFieldsService.prototype.dataset
  40188. * @description 要查询的数据集名称。
  40189. */
  40190. _this.dataset = null;
  40191. if (options) {
  40192. Util_Util.extend(GetFieldsService_assertThisInitialized(_this), options);
  40193. }
  40194. _this.CLASS_NAME = "SuperMap.GetFieldsService";
  40195. return _this;
  40196. }
  40197. /**
  40198. * @function GetFieldsService.prototype.destroy
  40199. * @override
  40200. */
  40201. GetFieldsService_createClass(GetFieldsService, [{
  40202. key: "destroy",
  40203. value: function destroy() {
  40204. GetFieldsService_get(GetFieldsService_getPrototypeOf(GetFieldsService.prototype), "destroy", this).call(this);
  40205. var me = this;
  40206. me.datasource = null;
  40207. me.dataset = null;
  40208. }
  40209. /**
  40210. * @function GetFieldsService.prototype.processAsync
  40211. * @description 执行服务,查询指定数据集的字段信息。
  40212. */
  40213. }, {
  40214. key: "processAsync",
  40215. value: function processAsync() {
  40216. var me = this;
  40217. me.url = Util_Util.urlPathAppend(me.url, "datasources/".concat(me.datasource, "/datasets/").concat(me.dataset, "/fields"));
  40218. me.request({
  40219. method: "GET",
  40220. data: null,
  40221. scope: me,
  40222. success: me.serviceProcessCompleted,
  40223. failure: me.serviceProcessFailed
  40224. });
  40225. }
  40226. }]);
  40227. return GetFieldsService;
  40228. }(CommonServiceBase);
  40229. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosParameters.js
  40230. function GetGridCellInfosParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40231. 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); } }
  40232. 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; }
  40233. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40234. * This program are made available under the terms of the Apache License, Version 2.0
  40235. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40236. /**
  40237. * @class GetGridCellInfosParameters
  40238. * @deprecatedclass SuperMap.GetGridCellInfosParameters
  40239. * @category iServer Data Grid
  40240. * @classdesc 数据服务栅格查询参数类。
  40241. * @param {Object} options - 参数。
  40242. * @param {string} options.datasetName - 数据集名称。
  40243. * @param {string} options.dataSourceName - 数据源名称。
  40244. * @param {number} options.X - 地理位置 X 轴。
  40245. * @param {number} options.Y - 地理位置 Y 轴。
  40246. * @usage
  40247. */
  40248. var GetGridCellInfosParameters = /*#__PURE__*/function () {
  40249. function GetGridCellInfosParameters(options) {
  40250. GetGridCellInfosParameters_classCallCheck(this, GetGridCellInfosParameters);
  40251. /**
  40252. * @member {string} GetGridCellInfosParameters.prototype.datasetName
  40253. * @description 数据集名称。
  40254. */
  40255. this.datasetName = null;
  40256. /**
  40257. * @member {string} GetGridCellInfosParameters.prototype.dataSourceName
  40258. * @description 数据源名称。
  40259. */
  40260. this.dataSourceName = null;
  40261. /**
  40262. * @member {number} GetGridCellInfosParameters.prototype.X
  40263. * @description 要查询的地理位置 X 轴。
  40264. */
  40265. this.X = null;
  40266. /**
  40267. * @member {number} GetGridCellInfosParameters.prototype.Y
  40268. * @description 要查询的地理位置 Y 轴。
  40269. */
  40270. this.Y = null;
  40271. Util_Util.extend(this, options);
  40272. this.CLASS_NAME = "SuperMap.GetGridCellInfosParameters";
  40273. }
  40274. /**
  40275. * @function GetGridCellInfosParameters.prototype.destroy
  40276. * @description 释放资源,将引用的资源属性置空。
  40277. */
  40278. GetGridCellInfosParameters_createClass(GetGridCellInfosParameters, [{
  40279. key: "destroy",
  40280. value: function destroy() {
  40281. var me = this;
  40282. me.datasetName = null;
  40283. me.dataSourceName = null;
  40284. me.X = null;
  40285. me.Y = null;
  40286. }
  40287. }]);
  40288. return GetGridCellInfosParameters;
  40289. }();
  40290. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosService.js
  40291. 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); }
  40292. function GetGridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40293. 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); } }
  40294. 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; }
  40295. 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); }
  40296. function GetGridCellInfosService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetGridCellInfosService_getPrototypeOf(object); if (object === null) break; } return object; }
  40297. 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); }
  40298. 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); }
  40299. 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); }; }
  40300. 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); }
  40301. function GetGridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  40302. 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; } }
  40303. function GetGridCellInfosService_getPrototypeOf(o) { GetGridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetGridCellInfosService_getPrototypeOf(o); }
  40304. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40305. * This program are made available under the terms of the Apache License, Version 2.0
  40306. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40307. /**
  40308. * @class GetGridCellInfosService
  40309. * @deprecatedclass SuperMap.GetGridCellInfosService
  40310. * @category iServer Data Grid
  40311. * @classdesc 数据栅格查询服务,支持查询指定地理位置的栅格信息。
  40312. * @param {string} url - 服务地址。例如: http://localhost:8090/iserver/services/data-jingjin/rest/data
  40313. * @param {Object} options - 参数。
  40314. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  40315. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  40316. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  40317. * @param {Object} [options.headers] - 请求头。
  40318. * @extends {CommonServiceBase}
  40319. * @example
  40320. * var myService = new GetGridCellInfosService(url, {eventListeners: {
  40321. * "processCompleted": queryCompleted,
  40322. * "processFailed": queryError
  40323. * }
  40324. * });
  40325. * @usage
  40326. */
  40327. var GetGridCellInfosService = /*#__PURE__*/function (_CommonServiceBase) {
  40328. GetGridCellInfosService_inherits(GetGridCellInfosService, _CommonServiceBase);
  40329. var _super = GetGridCellInfosService_createSuper(GetGridCellInfosService);
  40330. function GetGridCellInfosService(url, options) {
  40331. var _this;
  40332. GetGridCellInfosService_classCallCheck(this, GetGridCellInfosService);
  40333. _this = _super.call(this, url, options);
  40334. /**
  40335. * @member {string} GetGridCellInfosService.prototype.datasetName
  40336. * @description 数据集名称。
  40337. */
  40338. _this.datasetName = null;
  40339. /**
  40340. * @member {string} GetGridCellInfosService.prototype.dataSourceName
  40341. * @description 数据源名称。
  40342. */
  40343. _this.dataSourceName = null;
  40344. /**
  40345. * @member {string} GetGridCellInfosService.prototype.datasetType
  40346. * @description 数据集类型。
  40347. */
  40348. _this.datasetType = null;
  40349. /**
  40350. * @member {number} GetGridCellInfosService.prototype.X
  40351. * @description 要查询的地理位置X轴
  40352. */
  40353. _this.X = null;
  40354. /**
  40355. * @member {number} GetGridCellInfosService.prototype.Y
  40356. * @description 要查询的地理位置Y轴
  40357. */
  40358. _this.Y = null;
  40359. if (options) {
  40360. Util_Util.extend(GetGridCellInfosService_assertThisInitialized(_this), options);
  40361. }
  40362. _this.eventCount = 0;
  40363. _this.CLASS_NAME = "SuperMap.GetGridCellInfosService";
  40364. return _this;
  40365. }
  40366. /**
  40367. * @function GetGridCellInfosService.prototype.destroy
  40368. * @override
  40369. */
  40370. GetGridCellInfosService_createClass(GetGridCellInfosService, [{
  40371. key: "destroy",
  40372. value: function destroy() {
  40373. GetGridCellInfosService_get(GetGridCellInfosService_getPrototypeOf(GetGridCellInfosService.prototype), "destroy", this).call(this);
  40374. var me = this;
  40375. me.X = null;
  40376. me.Y = null;
  40377. me.datasetName = null;
  40378. me.dataSourceName = null;
  40379. me.datasetType = null;
  40380. }
  40381. /**
  40382. * @function GetGridCellInfosService.prototype.processAsync
  40383. * @description 执行服务,查询数据集信息。
  40384. * @param {GetGridCellInfosParameters} params - 查询参数。
  40385. */
  40386. }, {
  40387. key: "processAsync",
  40388. value: function processAsync(params, callback) {
  40389. if (!(params instanceof GetGridCellInfosParameters)) {
  40390. return;
  40391. }
  40392. Util_Util.extend(this, params);
  40393. var me = this;
  40394. me.url = Util_Util.urlPathAppend(me.url, "datasources/".concat(me.dataSourceName, "/datasets/").concat(me.datasetName));
  40395. me.queryRequest(me.getDatasetInfoCompleted.bind(me), me.getDatasetInfoFailed.bind(me), callback);
  40396. }
  40397. /**
  40398. * @function GetGridCellInfosService.prototype.queryRequest
  40399. * @description 执行服务,查询。
  40400. * @callback {function} successFun - 成功后执行的函数。
  40401. * @callback {function} failedFunc - 失败后执行的函数。
  40402. */
  40403. }, {
  40404. key: "queryRequest",
  40405. value: function queryRequest(successFun, failedFunc, callback) {
  40406. var eventId = ++this.eventCount;
  40407. var eventListeners = {
  40408. scope: this,
  40409. processCompleted: function processCompleted(result) {
  40410. if (eventId === result.result.eventId && callback) {
  40411. delete result.result.eventId;
  40412. callback(result);
  40413. this.events && this.events.un(eventListeners);
  40414. return false;
  40415. }
  40416. },
  40417. processFailed: function processFailed(result) {
  40418. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  40419. callback(result);
  40420. this.events && this.events.un(eventListeners);
  40421. return false;
  40422. }
  40423. }
  40424. };
  40425. this.events.on(eventListeners);
  40426. var me = this;
  40427. me.request({
  40428. method: "GET",
  40429. data: null,
  40430. scope: me,
  40431. success: function success(result, options) {
  40432. result.eventId = eventId;
  40433. successFun(result, options, callback);
  40434. },
  40435. failure: function failure(result, options) {
  40436. if (result.error) {
  40437. result.error.eventId = eventId;
  40438. }
  40439. result.eventId = eventId;
  40440. failedFunc(result, options);
  40441. }
  40442. });
  40443. }
  40444. /**
  40445. * @function GetGridCellInfosService.prototype.getDatasetInfoCompleted
  40446. * @description 数据集查询完成,执行此方法。
  40447. * @param {Object} result - 服务器返回的结果对象。
  40448. */
  40449. }, {
  40450. key: "getDatasetInfoCompleted",
  40451. value: function getDatasetInfoCompleted(result, options, callback) {
  40452. var me = this;
  40453. result = Util_Util.transformResult(result);
  40454. me.datasetType = result.datasetInfo.type;
  40455. me.queryGridInfos(callback);
  40456. }
  40457. /**
  40458. * @function GetGridCellInfosService.prototype.queryGridInfos
  40459. * @description 执行服务,查询数据集栅格信息。
  40460. */
  40461. }, {
  40462. key: "queryGridInfos",
  40463. value: function queryGridInfos(callback) {
  40464. var me = this;
  40465. me.url = Util_Util.urlPathAppend(me.url, me.datasetType == 'GRID' ? 'gridValue' : 'imageValue');
  40466. if (me.X != null && me.Y != null) {
  40467. me.url = Util_Util.urlAppend(me.url, "x=".concat(me.X, "&y=").concat(me.Y));
  40468. }
  40469. me.queryRequest(me.serviceProcessCompleted.bind(me), me.serviceProcessFailed.bind(me), callback);
  40470. }
  40471. /**
  40472. * @function GetGridCellInfosService.prototype.getDatasetInfoFailed
  40473. * @description 数据集查询失败,执行此方法。
  40474. * @param {Object} result - 服务器返回的结果对象。
  40475. */
  40476. }, {
  40477. key: "getDatasetInfoFailed",
  40478. value: function getDatasetInfoFailed(result, options) {
  40479. var me = this;
  40480. me.serviceProcessFailed(result, options);
  40481. }
  40482. }]);
  40483. return GetGridCellInfosService;
  40484. }(CommonServiceBase);
  40485. ;// CONCATENATED MODULE: ./src/common/iServer/Theme.js
  40486. function Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40487. 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); } }
  40488. 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; }
  40489. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40490. * This program are made available under the terms of the Apache License, Version 2.0
  40491. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40492. /**
  40493. * @class CommonTheme
  40494. * @aliasclass Theme
  40495. * @deprecatedclass SuperMap.Theme
  40496. * @category iServer Map Theme
  40497. * @classdesc 专题图基类。
  40498. * @param {string} type - 专题图类型。
  40499. * @param {Object} options - 可选参数。
  40500. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  40501. * @usage
  40502. */
  40503. var Theme = /*#__PURE__*/function () {
  40504. function Theme(type, options) {
  40505. Theme_classCallCheck(this, Theme);
  40506. if (!type) {
  40507. return this;
  40508. }
  40509. /**
  40510. * @member {ThemeMemoryData} CommonTheme.prototype.memoryData
  40511. * @description 专题图内存数据。<br>
  40512. * 用内存数据制作专题图的方式与表达式制作专题图的方式互斥,前者优先级较高。
  40513. * 第一个参数代表专题值,即数据集中用来做专题图的字段或表达式的值;第二个参数代表外部值。在制作专题图时,会用外部值代替专题值来制作相应的专题图。
  40514. */
  40515. this.memoryData = null;
  40516. /**
  40517. * @member {string} CommonTheme.prototype.type
  40518. * @description 专题图类型。
  40519. */
  40520. this.type = type;
  40521. if (options) {
  40522. Util_Util.extend(this, options);
  40523. }
  40524. this.CLASS_NAME = "SuperMap.Theme";
  40525. }
  40526. /**
  40527. * @function CommonTheme.prototype.destroy
  40528. * @description 释放资源,将引用资源的属性置空。
  40529. */
  40530. Theme_createClass(Theme, [{
  40531. key: "destroy",
  40532. value: function destroy() {
  40533. var me = this;
  40534. if (me.memoryData) {
  40535. me.memoryData.destroy();
  40536. me.memoryData = null;
  40537. }
  40538. me.type = null;
  40539. }
  40540. /**
  40541. * @function CommonTheme.prototype.toServerJSONObject
  40542. * @description 转换成对应的 JSON 格式对象。
  40543. * @returns {Object} 对应的 JSON 格式对象。
  40544. */
  40545. }, {
  40546. key: "toServerJSONObject",
  40547. value: function toServerJSONObject() {
  40548. //return 子类实现
  40549. return;
  40550. }
  40551. }]);
  40552. return Theme;
  40553. }();
  40554. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTextStyle.js
  40555. function ServerTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40556. 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); } }
  40557. 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; }
  40558. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40559. * This program are made available under the terms of the Apache License, Version 2.0
  40560. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40561. /**
  40562. * @class ServerTextStyle
  40563. * @deprecatedclass SuperMap.ServerTextStyle
  40564. * @category iServer Map Theme
  40565. * @classdesc 服务端文本风格类。该类用于定义文本风格的相关属性。
  40566. * @param {Object} options - 可选参数。
  40567. * @param {TextAlignment} [options.align=TextAlignment.BASELINECENTER] - 文本的对齐方式。
  40568. * @param {ServerColor} [options.backColor] - 文本的背景色。默认 backColor = new ServerColor(255, 255, 255)。
  40569. * @param {ServerColor} [options.foreColor] - 文本的前景色。默认 foreColor = new ServerColor(0, 0, 0)。
  40570. * @param {boolean} [options.backOpaque=false] - 文本背景是否不透明。
  40571. * @param {boolean} [options.sizeFixed=true] - 文本大小是否固定。
  40572. * @param {number} [options.fontHeight=6] - 文本字体的高度。
  40573. * @param {number} [options.fontWidth=0] - 文本字体的宽度。
  40574. * @param {number} [options.fontWeight=400] - 文本字体的磅数。
  40575. * @param {string} [options.fontName='Times New Roman'] - 文本字体的名称。
  40576. * @param {boolean} [options.bold=false] - 文本是否为粗体字。
  40577. * @param {boolean} [options.italic=false] - 文本是否采用斜体。
  40578. * @param {number} [options.italicAngle=0] - 字体倾斜角度。
  40579. * @param {boolean} [options.shadow=false] - 文本是否有阴影。
  40580. * @param {boolean} [options.strikeout=false] - 文本字体是否加删除线。
  40581. * @param {boolean} [options.outline=false] - 是否以轮廓的方式来显示文本的背景。
  40582. * @param {number} [options.opaqueRate=0] - 注记文字的不透明度。
  40583. * @param {boolean} [options.underline=false] - 文本字体是否加下划线。
  40584. * @param {number} [options.rotation=0.0] - 文本旋转的角度。
  40585. * @usage
  40586. */
  40587. var ServerTextStyle = /*#__PURE__*/function () {
  40588. function ServerTextStyle(options) {
  40589. ServerTextStyle_classCallCheck(this, ServerTextStyle);
  40590. /**
  40591. * @member {TextAlignment} [ServerTextStyle.prototype.align= TextAlignment.BASELINECENTER]
  40592. * @description 文本的对齐方式。
  40593. */
  40594. this.align = TextAlignment.BASELINECENTER;
  40595. /**
  40596. * @member {ServerColor} [ServerTextStyle.prototype.backColor=(255, 255, 255)]
  40597. * @description 文本的背景色。
  40598. */
  40599. this.backColor = new ServerColor(255, 255, 255);
  40600. /**
  40601. * @member {ServerColor} [ServerTextStyle.prototype.foreColor=(0, 0, 0)]
  40602. * @description 文本的前景色。
  40603. */
  40604. this.foreColor = new ServerColor(0, 0, 0);
  40605. /**
  40606. * @member {boolean} [ServerTextStyle.prototype.backOpaque=false]
  40607. * @description 文本背景是否不透明。true 表示文本背景不透明。
  40608. */
  40609. this.backOpaque = false;
  40610. /**
  40611. * @member {boolean} [ServerTextStyle.prototype.sizeFixed=true]
  40612. * @description 文本大小是否固定。设置为 true,表示图片为固定像素大小,具体大小请参考 fontHeight。当设为 false 时,图片会随着地图缩放而缩放。
  40613. */
  40614. this.sizeFixed = true;
  40615. /**
  40616. * @member {number} [ServerTextStyle.prototype.fontHeight=6]
  40617. * @description 文本字体的高度,单位与 sizeFixed 有关,当 sizeFixed 为 False 时,即非固定文本大小时使用地图坐标单位,
  40618. * 如地理坐标系下的地图中单位为度;当 sizeFixed 为 True 时,单位为毫米(mm)。
  40619. */
  40620. this.fontHeight = 6;
  40621. /**
  40622. * @member {number} [ServerTextStyle.prototype.fontWidth=0]
  40623. * @description 文本字体的宽度。字体的宽度以英文字符为标准,由于一个中文字符相当于两个英文字符。
  40624. */
  40625. this.fontWidth = 0;
  40626. /**
  40627. * @member {number} [ServerTextStyle.prototype.fontWeight=400]
  40628. * @description 文本字体的磅数。表示粗体的具体数值。取值范围为从0-900之间的整百数。
  40629. */
  40630. this.fontWeight = 400;
  40631. /**
  40632. * @member {string} [ServerTextStyle.prototype.fontName="Times New Roman"]
  40633. * @description 文本字体的名称。
  40634. */
  40635. this.fontName = "Times New Roman";
  40636. /**
  40637. * @member {boolean} [ServerTextStyle.prototype.bold=false]
  40638. * @description 文本是否为粗体字。true 表示为粗体。false 表示文本不是粗体字。
  40639. */
  40640. this.bold = false;
  40641. /**
  40642. * @member {boolean} [ServerTextStyle.prototype.italic=false]
  40643. * @description 文本是否采用斜体。true 表示采用斜体。
  40644. */
  40645. this.italic = false;
  40646. /**
  40647. * @member {number} [ServerTextStyle.prototype.italicAngle=0]
  40648. * @description 字体倾斜角度。正负度之间,以度为单位,精确到0.1度。当倾斜角度为0度,为系统默认的字体倾斜样式。
  40649. * 正负度是指以纵轴为起始零度线,其纵轴左侧为正,右侧为负。允许的最大角度为60,最小-60。大于60按照60处理,小于-60按照-60处理。目前只对标签专题图有效。
  40650. */
  40651. this.italicAngle = 0;
  40652. /**
  40653. * @member {boolean} [ServerTextStyle.prototype.shadow=false]
  40654. * @description 文本是否有阴影。true 表示给文本增加阴影。false 表示文本没有阴影。
  40655. */
  40656. this.shadow = false;
  40657. /**
  40658. * @member {boolean} [ServerTextStyle.prototype.strikeout=false]
  40659. * @description 文本字体是否加删除线。true 表示加删除线。false 表示文本字体不加删除线。
  40660. */
  40661. this.strikeout = false;
  40662. /**
  40663. * @member {boolean} [ServerTextStyle.prototype.outline=false]
  40664. * @description 是否以轮廓的方式来显示文本的背景。true 表示以轮廓的方式来显示文本的背景。false 表示不以轮廓的方式来显示文本的背景。
  40665. */
  40666. this.outline = false;
  40667. /**
  40668. * @member {number} [ServerTextStyle.prototype.opaqueRate=0]
  40669. * @description 注记文字的不透明度。不透明度的范围为0-100。0表示透明。
  40670. */
  40671. this.opaqueRate = 0;
  40672. /**
  40673. * @member {boolean} [ServerTextStyle.prototype.underline=false]
  40674. * @description 文本字体是否加下划线。true 表示加下划线。
  40675. */
  40676. this.underline = false;
  40677. /**
  40678. * @member {number} [ServerTextStyle.prototype.rotation=0.0]
  40679. * @description 文本旋转的角度。逆时针方向为正方向,单位为度,精确到0.1度。
  40680. */
  40681. this.rotation = 0.0;
  40682. if (options) {
  40683. Util_Util.extend(this, options);
  40684. }
  40685. this.CLASS_NAME = "SuperMap.ServerTextStyle";
  40686. }
  40687. /**
  40688. * @function ServerTextStyle.prototype.destroy
  40689. * @description 释放资源,将引用资源的属性置空。
  40690. */
  40691. ServerTextStyle_createClass(ServerTextStyle, [{
  40692. key: "destroy",
  40693. value: function destroy() {
  40694. var me = this;
  40695. me.align = null;
  40696. if (me.backColor) {
  40697. me.backColor.destroy();
  40698. me.backColor = null;
  40699. }
  40700. if (me.foreColor) {
  40701. me.foreColor.destroy();
  40702. me.foreColor = null;
  40703. }
  40704. me.backOpaque = null;
  40705. me.sizeFixed = null;
  40706. me.fontHeight = null;
  40707. me.fontWidth = null;
  40708. me.fontWeight = null;
  40709. me.fontName = null;
  40710. me.bold = null;
  40711. me.italic = null;
  40712. me.italicAngle = null;
  40713. me.shadow = null;
  40714. me.strikeout = null;
  40715. me.outline = null;
  40716. me.opaqueRate = null;
  40717. me.underline = null;
  40718. me.rotation = null;
  40719. }
  40720. /**
  40721. * @function ServerTextStyle.fromObj
  40722. * @description 从传入对象获服务端文本风格类。
  40723. * @param {Object} obj - 传入对象
  40724. * @returns {ServerTextStyle} 返回服务端文本风格对象
  40725. */
  40726. }], [{
  40727. key: "fromObj",
  40728. value: function fromObj(obj) {
  40729. var res = new ServerTextStyle(obj);
  40730. Util_Util.copy(res, obj);
  40731. res.backColor = ServerColor.fromJson(obj.backColor);
  40732. res.foreColor = ServerColor.fromJson(obj.foreColor);
  40733. return res;
  40734. }
  40735. }]);
  40736. return ServerTextStyle;
  40737. }();
  40738. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelItem.js
  40739. function ThemeLabelItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40740. 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); } }
  40741. 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; }
  40742. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40743. * This program are made available under the terms of the Apache License, Version 2.0
  40744. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40745. /**
  40746. * @class ThemeLabelItem
  40747. * @deprecatedclass SuperMap.ThemeLabelItem
  40748. * @category iServer Map Theme
  40749. * @classdesc 分段标签专题图的子项。标签专题图用专题值对点、线、面等对象做标注。
  40750. * 值得注意的是,分段标签专题图允许用户通过 rangeExpression 字段指定用于分段的数值型字段,
  40751. * 同一范围段内的标签具有相同的显示风格,其中每一个范围段就是一个专题图子项,
  40752. * 每一个子项都具有其名称、风格、起始值和终止值。注意:每个分段所表示的范围为 [Start, End)。例如:标签专题图的分段点有两个子项,
  40753. * 他们所代表的分段区间分别为[0,5),[5,10)。那么需要分别设置 ThemeLabelItem[0].start=0,
  40754. * ThemeLabelItem[0].end=5,SuperMap.ThemeLabelItem[1].start=5,SuperMap.ThemeLabelItem[1].end=10。
  40755. * @param {Object} options - 可选参数。
  40756. * @param {string} [options.caption] - 子项的名称。
  40757. * @param {number} [options.end=0] - 子项的终止值。
  40758. * @param {number} [options.start=0] - 子项的分段起始值。
  40759. * @param {boolean} [options.visible=true] - 子项是否可见。
  40760. * @param {ServerTextStyle} [options.style] - 子项文本的显示风格。
  40761. * @usage
  40762. */
  40763. var ThemeLabelItem = /*#__PURE__*/function () {
  40764. function ThemeLabelItem(options) {
  40765. ThemeLabelItem_classCallCheck(this, ThemeLabelItem);
  40766. /**
  40767. * @member {string} [ThemeLabelItem.prototype.caption]
  40768. * @description 标签专题子项的标题。
  40769. */
  40770. this.caption = null;
  40771. /**
  40772. * @member {number} [ThemeLabelItem.prototype.end=0]
  40773. * @description 标签专题图子项的终止值。如果该子项是分段中最后一个子项,那么该终止值就是分段的最大值;
  40774. * 如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常。
  40775. */
  40776. this.end = 0;
  40777. /**
  40778. * @member {number} [ThemeLabelItem.prototype.start=0]
  40779. * @description 标签专题图子项的分段起始值。如果该子项是分段中第一项,那么该起始值就是分段的最小值;
  40780. * 如果该子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  40781. */
  40782. this.start = 0;
  40783. /**
  40784. * @member {boolean} [ThemeLabelItem.prototype.visible=true]
  40785. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  40786. */
  40787. this.visible = true;
  40788. /**
  40789. * @member {ServerTextStyle} ThemeLabelItem.prototype.style
  40790. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  40791. * uniformMixedStyle(标签文本的复合风格),ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  40792. */
  40793. this.style = new ServerTextStyle();
  40794. if (options) {
  40795. Util_Util.extend(this, options);
  40796. }
  40797. this.CLASS_NAME = "SuperMap.ThemeLabelItem";
  40798. }
  40799. /**
  40800. * @function ThemeLabelItem.prototype.destroy
  40801. * @description 释放资源,将引用资源的属性置空。
  40802. */
  40803. ThemeLabelItem_createClass(ThemeLabelItem, [{
  40804. key: "destroy",
  40805. value: function destroy() {
  40806. var me = this;
  40807. me.caption = null;
  40808. me.end = null;
  40809. me.start = null;
  40810. if (me.style) {
  40811. me.style.destroy();
  40812. me.style = null;
  40813. }
  40814. me.visible = null;
  40815. }
  40816. /**
  40817. * @function ThemeLabelItem.fromObj
  40818. * @description 从传入对象获取分段标签专题图的子项类。
  40819. * @param {Object} obj - 传入对象。
  40820. * @returns {ThemeLabelItem} ThemeLabelItem 对象。
  40821. */
  40822. }], [{
  40823. key: "fromObj",
  40824. value: function fromObj(obj) {
  40825. if (!obj) {
  40826. return;
  40827. }
  40828. var t = new ThemeLabelItem();
  40829. Util_Util.copy(t, obj);
  40830. return t;
  40831. }
  40832. }]);
  40833. return ThemeLabelItem;
  40834. }();
  40835. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUniqueItem.js
  40836. function ThemeUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40837. 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); } }
  40838. 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; }
  40839. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40840. * This program are made available under the terms of the Apache License, Version 2.0
  40841. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40842. /**
  40843. * @class ThemeUniqueItem
  40844. * @deprecatedclass SuperMap.ThemeUniqueItem
  40845. * @category iServer Map Theme
  40846. * @classdesc 单值专题图子项类。单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有 5 种不同值,则该行政区划图有 5 个专题图子项。
  40847. * @param {Object} options - 参数。
  40848. * @param {string} options.unique - 子项的单值字段。
  40849. * @param {string} [options.caption] - 子项的标题。
  40850. * @param {ServerStyle} [options.style] - 子项的风格。
  40851. * @param {boolean} [options.visible=true] - 子项是否可见。
  40852. * @usage
  40853. */
  40854. var ThemeUniqueItem = /*#__PURE__*/function () {
  40855. function ThemeUniqueItem(options) {
  40856. ThemeUniqueItem_classCallCheck(this, ThemeUniqueItem);
  40857. /**
  40858. * @member {string} [ThemeUniqueItem.prototype.caption]
  40859. * @description 单值专题图子项的标题。
  40860. */
  40861. this.caption = null;
  40862. /**
  40863. * @member {ServerStyle} [ThemeUniqueItem.prototype.style]
  40864. * @description 单值专题图子项的显示风格。
  40865. */
  40866. this.style = new ServerStyle();
  40867. /**
  40868. * @member {string} ThemeUniqueItem.prototype.unique
  40869. * @description 单值专题图子项的值,可以为数字、字符串等。
  40870. */
  40871. this.unique = null;
  40872. /**
  40873. * @member {boolean} [ThemeUniqueItem.prototype.visible=true]
  40874. * @description 单值专题图子项的可见性。
  40875. */
  40876. this.visible = true;
  40877. if (options) {
  40878. Util_Util.extend(this, options);
  40879. }
  40880. this.CLASS_NAME = "SuperMap.ThemeUniqueItem";
  40881. }
  40882. /**
  40883. * @function ThemeUniqueItem.prototype.destroy
  40884. * @description 释放资源,将引用资源的属性置空。
  40885. */
  40886. ThemeUniqueItem_createClass(ThemeUniqueItem, [{
  40887. key: "destroy",
  40888. value: function destroy() {
  40889. var me = this;
  40890. me.caption = null;
  40891. me.unique = null;
  40892. if (me.style) {
  40893. me.style.destroy();
  40894. me.style = null;
  40895. }
  40896. me.visible = null;
  40897. }
  40898. /**
  40899. * @function ThemeUniqueItem.prototype.toServerJSONObject
  40900. * @description 转换成对应的 JSON 格式对象。
  40901. * @returns {Object} 对应的 JSON 格式对象。
  40902. */
  40903. }, {
  40904. key: "toServerJSONObject",
  40905. value: function toServerJSONObject() {
  40906. var obj = {};
  40907. obj = Util_Util.copyAttributes(obj, this);
  40908. if (obj.style) {
  40909. if (obj.style.toServerJSONObject) {
  40910. obj.style = obj.style.toServerJSONObject();
  40911. }
  40912. }
  40913. return obj;
  40914. }
  40915. /**
  40916. * @function ThemeUniqueItem.fromObj
  40917. * @description 从传入对象获取单值专题图子项类。
  40918. * @param {Object} obj - 传入对象。
  40919. * @returns {ThemeUniqueItem} ThemeUniqueItem 对象。
  40920. */
  40921. }], [{
  40922. key: "fromObj",
  40923. value: function fromObj(obj) {
  40924. var res = new ThemeUniqueItem();
  40925. Util_Util.copy(res, obj);
  40926. res.style = ServerStyle.fromJson(obj.style);
  40927. return res;
  40928. }
  40929. }]);
  40930. return ThemeUniqueItem;
  40931. }();
  40932. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeOffset.js
  40933. function ThemeOffset_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40934. 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); } }
  40935. 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; }
  40936. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  40937. * This program are made available under the terms of the Apache License, Version 2.0
  40938. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40939. /**
  40940. * @class ThemeOffset
  40941. * @deprecatedclass SuperMap.ThemeOffset
  40942. * @category iServer Map Theme
  40943. * @classdesc 专题图中文本或符号相对于要素内点的偏移量设置类。
  40944. * 通过该类可以设置专题图中标记文本或符号的偏移量以及偏移量是否随地图缩放而改变。
  40945. * @param {Object} options - 可选参数。
  40946. * @param {boolean} [options.offsetFixed=false] - 当前专题图是否固定标记文本或符号的偏移量。
  40947. * @param {string} [options.offsetX='0.0'] - 专题图中文本或符号相对于要素内点的水平偏移量。
  40948. * @param {string} [options.offsetY='0.0'] - 专题图中文本或符号相对于要素内点的垂直偏移量。
  40949. * @usage
  40950. */
  40951. var ThemeOffset = /*#__PURE__*/function () {
  40952. function ThemeOffset(options) {
  40953. ThemeOffset_classCallCheck(this, ThemeOffset);
  40954. /**
  40955. * @member {boolean} [ThemeOffset.prototype.offsetFixed=false]
  40956. * @description 当前专题图是否固定标记文本或符号的偏移量。所谓固定偏移量,指文本或符号的偏移量不随地图的缩放而变化。
  40957. */
  40958. this.offsetFixed = false;
  40959. /**
  40960. * @member {string} [ThemeOffset.prototype.offsetX=0.0]
  40961. * @description 专题图中文本或符号相对于要素内点的水平偏移量。偏移量的单位为地图单位。
  40962. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么水平偏移量为2。
  40963. */
  40964. this.offsetX = "0.0";
  40965. /**
  40966. * @member {string} [ThemeOffset.prototype.offsetY=0.0]
  40967. * @description 专题图中文本或符号相对于要素内点的垂直偏移量。偏移量的单位为地图单位。
  40968. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么垂直偏移量为2。
  40969. */
  40970. this.offsetY = "0.0";
  40971. if (options) {
  40972. Util_Util.extend(this, options);
  40973. }
  40974. this.CLASS_NAME = "SuperMap.ThemeOffset";
  40975. }
  40976. /**
  40977. * @function ThemeOffset.prototype.destroy
  40978. * @description 释放资源,将引用资源的属性置空。
  40979. */
  40980. ThemeOffset_createClass(ThemeOffset, [{
  40981. key: "destroy",
  40982. value: function destroy() {
  40983. var me = this;
  40984. me.offsetFixed = null;
  40985. me.offsetX = null;
  40986. me.offsetY = null;
  40987. }
  40988. /**
  40989. * @function ThemeOffset.fromObj
  40990. * @description 从传入对象获取专题图中文本或符号相对于要素内点的偏移量设置类。
  40991. * @param {Object} obj - 传入对象。
  40992. * @returns {ThemeOffset} ThemeOffset 对象。
  40993. */
  40994. }], [{
  40995. key: "fromObj",
  40996. value: function fromObj(obj) {
  40997. if (!obj) {
  40998. return;
  40999. }
  41000. var res = new ThemeOffset();
  41001. Util_Util.copy(res, obj);
  41002. return res;
  41003. }
  41004. }]);
  41005. return ThemeOffset;
  41006. }();
  41007. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMixedTextStyle.js
  41008. function LabelMixedTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41009. 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); } }
  41010. 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; }
  41011. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41012. * This program are made available under the terms of the Apache License, Version 2.0
  41013. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41014. /**
  41015. * @class LabelMixedTextStyle
  41016. * @deprecatedclass SuperMap.LabelMixedTextStyle
  41017. * @category iServer Map Theme
  41018. * @classdesc 标签文本复合风格类。
  41019. * 该类主要用于对标签专题图中标签的文本内容进行风格设置。通过该类用户可以使标签的文字显示不同的风格,比如文本 “喜马拉雅山”,通过本类可以将前三个字用红色显示,后两个字用蓝色显示。对同一文本设置不同的风格实质上是对文本的字符进行分段,同一分段内的字符具有相同的显示风格。对字符分段有两种方式,一种是利用分隔符对文本进行分段;另一种是根据分段索引值进行分段:</br>
  41020. * 1.利用分隔符对文本进行分段: 比如文本 “5&109” 被分隔符 “&” 分为 “5” 和 “109” 两部分,
  41021. * 在显示时,“5” 和分隔符 “&” 使用同一个风格,字符串 “109” 使用相同的风格。<br>
  41022. * 2.利用分段索引值进行分段: 文本中字符的索引值是以0开始的整数,比如文本 “珠穆朗玛峰”,
  41023. * 第一个字符(“珠”)的索引值为 0,第二个字符(“穆”)的索引值为 1,以此类推;当设置分段索引值为 1,3,4,9 时,
  41024. * 字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),可以看出索引号为 0 的字符(即“珠” )在第一个分段内,
  41025. * 索引号为 1,2 的字符(即“穆”、“朗”)位于第二个分段内,索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  41026. * @param {Object} options - 可选参数。
  41027. * @param {ServerTextStyle} [options.defaultStyle] - 默认的文本复合风格。
  41028. * @param {string} [options.separator] - 文本的分隔符。
  41029. * @param {boolean} [options.separatorEnabled=false] - 文本的分隔符是否有效。
  41030. * @param {Array.<number>} [options.splitIndexes] - 分段索引值,分段索引值用来对文本中的字符进行分段。
  41031. * @param {Array.<ServerTextStyle>} [options.styles] - 文本样式集合。
  41032. * @usage
  41033. */
  41034. var LabelMixedTextStyle = /*#__PURE__*/function () {
  41035. function LabelMixedTextStyle(options) {
  41036. LabelMixedTextStyle_classCallCheck(this, LabelMixedTextStyle);
  41037. /**
  41038. * @member {ServerTextStyle} LabelMixedTextStyle.prototype.defaultStyle
  41039. * @description 默认的文本复合风格,即 ServerTextStyle 各字段的默认值。
  41040. */
  41041. this.defaultStyle = null;
  41042. /**
  41043. * @member {string} LabelMixedTextStyle.prototype.separator
  41044. * @description 文本的分隔符,分隔符的风格与前一个字符的风格一样。文本的分隔符是一个将文本分割开的符号,
  41045. * 比如文本 “5_109” 被 “ _ ” 分隔为 “5” 和 “109” 两部分,假设有风格数组:style1、style2。
  41046. * 在显示时,“5” 和分隔符 “ _ ” 使用 Style1 风格渲染,字符串 “109” 使用 Style2 的风格。
  41047. */
  41048. this.separator = null;
  41049. /**
  41050. * @member {boolean} [LabelMixedTextStyle.prototype.separatorEnabled=false]
  41051. * @description 文本的分隔符是否有效。分隔符有效时利用分隔符对文本进行分段;无效时根据文本中字符的位置进行分段。
  41052. * 分段后,同一分段内的字符具有相同的显示风格。
  41053. */
  41054. this.separatorEnabled = false;
  41055. /**
  41056. * @member {Array.<number>} LabelMixedTextStyle.prototype.splitIndexes
  41057. * @description 分段索引值,分段索引值用来对文本中的字符进行分段。
  41058. * 文本中字符的索引值是以 0 开始的整数,比如文本“珠穆朗玛峰”,第一个字符(“珠”)的索引值为0,第二个字符(“穆”)的索引值为 1,
  41059. * 以此类推;当设置分段索引值数组为 [1,3,4,9] 时,字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),
  41060. * 可以看出索引号为 0 的字符(即 “珠”)在第一个分段内,索引号为 1,2 的字符(即 “穆”、“朗”)位于第二个分段内,
  41061. * 索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  41062. */
  41063. this.splitIndexes = null;
  41064. /**
  41065. * @member {Array.<ServerTextStyle>} LabelMixedTextStyle.prototype.styles
  41066. * @description 文本样式集合。文本样式集合中的样式根据索引与不同分段一一对应,
  41067. * 如果有分段没有风格对应则使用 defaultStyle。
  41068. */
  41069. this.styles = new ServerTextStyle();
  41070. if (options) {
  41071. Util_Util.extend(this, options);
  41072. }
  41073. this.CLASS_NAME = "SuperMap.LabelMixedTextStyle";
  41074. }
  41075. /**
  41076. * @function LabelMixedTextStyle.prototype.destroy
  41077. * @description 释放资源,将引用资源的属性置空。
  41078. */
  41079. LabelMixedTextStyle_createClass(LabelMixedTextStyle, [{
  41080. key: "destroy",
  41081. value: function destroy() {
  41082. var me = this;
  41083. if (me.defaultStyle) {
  41084. me.defaultStyle.destroy();
  41085. me.defaultStyle = null;
  41086. }
  41087. me.separator = null;
  41088. me.separatorEnabled = null;
  41089. if (me.splitIndexes) {
  41090. me.splitIndexes = null;
  41091. }
  41092. if (me.styles) {
  41093. for (var i = 0, styles = me.styles, len = styles.length; i < len; i++) {
  41094. styles[i].destroy();
  41095. }
  41096. me.styles = null;
  41097. }
  41098. }
  41099. /**
  41100. * @function LabelMixedTextStyle.fromObj
  41101. * @description 从传入对象获取标签文本复合风格类。
  41102. * @param {Object} obj - 传入对象。
  41103. * @returns {LabelMixedTextStyle} 返回新的 LabelMixedTextStyle 对象。
  41104. */
  41105. }], [{
  41106. key: "fromObj",
  41107. value: function fromObj(obj) {
  41108. if (!obj) {
  41109. return;
  41110. }
  41111. var res = new LabelMixedTextStyle();
  41112. var stys = obj.styles;
  41113. Util_Util.copy(res, obj);
  41114. res.defaultStyle = new ServerTextStyle(obj.defaultStyle);
  41115. if (stys) {
  41116. res.styles = [];
  41117. for (var i = 0, len = stys.length; i < len; i++) {
  41118. res.styles.push(new ServerTextStyle(stys[i]));
  41119. }
  41120. }
  41121. return res;
  41122. }
  41123. }]);
  41124. return LabelMixedTextStyle;
  41125. }();
  41126. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelText.js
  41127. function ThemeLabelText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41128. 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); } }
  41129. 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; }
  41130. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41131. * This program are made available under the terms of the Apache License, Version 2.0
  41132. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41133. /**
  41134. * @class ThemeLabelText
  41135. * @deprecatedclass SuperMap.ThemeLabelText
  41136. * @category iServer Map Theme
  41137. * @classdesc 标签中文本风格类。
  41138. * 通过该类可以设置标签中的文本字体大小和显示风格。
  41139. * @param {Object} options - 参数。
  41140. * @param {number} [options.maxTextHeight=0] - 标签中文本的最大高度。
  41141. * @param {number} [options.maxTextWidth=0] - 标签中文本的最大宽度。
  41142. * @param {number} [options.minTextHeight=0] - 标签中文本的最小高度。
  41143. * @param {number} [options.minTextWidth=0] - 标签中文本的最小宽度。
  41144. * @param {ServerTextStyle} [options.uniformStyle] - 统一文本风格。
  41145. * @param {LabelMixedTextStyle} [options.uniformMixedStyle] - 标签专题图统一的文本复合风格。
  41146. * @usage
  41147. */
  41148. var ThemeLabelText = /*#__PURE__*/function () {
  41149. function ThemeLabelText(options) {
  41150. ThemeLabelText_classCallCheck(this, ThemeLabelText);
  41151. /**
  41152. * @member {number} [ThemeLabelText.prototype.maxTextHeight=0]
  41153. * @description 标签中文本的最大高度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  41154. * 当放大后的文本高度超过最大高度之后就不再放大。高度单位为毫米。
  41155. */
  41156. this.maxTextHeight = 0;
  41157. /**
  41158. * @member {number} [ThemeLabelText.prototype.maxTextWidth=0]
  41159. * @description 标签中文本的最大宽度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  41160. * 当放大后的文本宽度超过最大高度之后就不再放大。宽度单位为毫米。
  41161. */
  41162. this.maxTextWidth = 0;
  41163. /**
  41164. * @member {number} [ThemeLabelText.prototype.minTextHeight=0]
  41165. * @description 标签中文本的最小高度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  41166. * 当缩小后的文本高度小于最小高度之后就不再缩小。高度单位为毫米。
  41167. */
  41168. this.minTextHeight = 0;
  41169. /**
  41170. * @member {number} [ThemeLabelText.prototype.minTextWidth=0]
  41171. * @description 标签中文本的最小宽度。当标签文本不固定大小时,即 ServerTextStyle.sizeFixed = false 有效,
  41172. * 当缩小后的文本宽度小于最小宽度之后就不再缩小。宽度单位为毫米。
  41173. */
  41174. this.minTextWidth = 0;
  41175. /**
  41176. * @member {ServerTextStyle} [ThemeLabelText.prototype.uniformStyle]
  41177. * @description 统一文本风格。当标签专题图子项的个数大于等于1时,
  41178. * uniformStyle 不起作用,各标签的风格使用子项中设置的风格。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  41179. * ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  41180. */
  41181. this.uniformStyle = new ServerTextStyle();
  41182. /**
  41183. *@member {LabelMixedTextStyle} [ThemeLabelText.prototype.uniformMixedStyle]
  41184. *@description 标签专题图统一的文本复合风格。通过该类可以使同一个标签中的文字使用多种风格显示。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  41185. * ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  41186. */
  41187. this.uniformMixedStyle = null;
  41188. if (options) {
  41189. Util_Util.extend(this, options);
  41190. }
  41191. this.CLASS_NAME = "SuperMap.ThemeLabelText";
  41192. }
  41193. /**
  41194. * @function ThemeLabelText.prototype.destroy
  41195. * @description 释放资源,将引用资源的属性置空。
  41196. */
  41197. ThemeLabelText_createClass(ThemeLabelText, [{
  41198. key: "destroy",
  41199. value: function destroy() {
  41200. var me = this;
  41201. me.maxTextHeight = null;
  41202. me.maxTextWidth = null;
  41203. me.minTextHeight = null;
  41204. me.minTextWidth = null;
  41205. if (me.uniformStyle) {
  41206. me.uniformStyle.destroy();
  41207. me.uniformStyle = null;
  41208. }
  41209. if (me.uniformMixedStyle) {
  41210. me.uniformMixedStyle.destroy();
  41211. me.uniformMixedStyle = null;
  41212. }
  41213. }
  41214. /**
  41215. * @function ThemeLabelText.fromObj
  41216. * @description 从传入对象获取标签中文本风格类。
  41217. * @param {Object} obj - 传入对象。
  41218. * @returns {ThemeLabelText} ThemeLabelText 对象。
  41219. */
  41220. }], [{
  41221. key: "fromObj",
  41222. value: function fromObj(obj) {
  41223. if (!obj) {
  41224. return;
  41225. }
  41226. var res = new ThemeLabelText();
  41227. Util_Util.copy(res, obj);
  41228. res.uniformStyle = ServerTextStyle.fromObj(obj.uniformStyle);
  41229. res.uniformMixedStyle = LabelMixedTextStyle.fromObj(obj.uniformMixedStyle);
  41230. return res;
  41231. }
  41232. }]);
  41233. return ThemeLabelText;
  41234. }();
  41235. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelAlongLine.js
  41236. function ThemeLabelAlongLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41237. 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); } }
  41238. 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; }
  41239. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41240. * This program are made available under the terms of the Apache License, Version 2.0
  41241. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41242. /**
  41243. * @class ThemeLabelAlongLine
  41244. * @deprecatedclass SuperMap.ThemeLabelAlongLine
  41245. * @category iServer Map Theme
  41246. * @classdesc 标签沿线标注样式类。
  41247. * @param {Object} options - 可选参数。
  41248. * @param {boolean} [options.isAlongLine=true] - 是否沿线显示文本。
  41249. * @param {AlongLineDirection} [options.alongLineDirection=AlongLineDirection.LB_TO_RT] - 标签沿线标注方向。
  41250. * @param {boolean} [options.angleFixed=false] - 当沿线显示文本时,是否将文本角度固定。
  41251. * @param {boolean} [options.repeatedLabelAvoided=false] - 沿线循环标注时是否避免标签重复标注。
  41252. * @param {boolean} [options.repeatIntervalFixed=false] - 循环标注间隔是否固定。
  41253. * @param {number} [options.labelRepeatInterval=0] - 沿线且循环标注时循环标注的间隔。
  41254. * @usage
  41255. */
  41256. var ThemeLabelAlongLine = /*#__PURE__*/function () {
  41257. function ThemeLabelAlongLine(options) {
  41258. ThemeLabelAlongLine_classCallCheck(this, ThemeLabelAlongLine);
  41259. /**
  41260. * @member {boolean} [ThemeLabelAlongLine.prototype.isAlongLine=true]
  41261. * @description 是否沿线显示文本。true 表示沿线显示文本,false 表示正常显示文本。
  41262. */
  41263. this.isAlongLine = true;
  41264. /**
  41265. * @member {AlongLineDirection} [ThemeLabelAlongLine.prototype.alongLineDirection=AlongLineDirection.LB_TO_RT]
  41266. * @description 标签沿线标注方向。
  41267. */
  41268. this.alongLineDirection = AlongLineDirection.LB_TO_RT;
  41269. /**
  41270. * @member {boolean} [ThemeLabelAlongLine.prototype.angleFixed=false]
  41271. * @description 当沿线显示文本时,是否将文本角度固定。true 表示按固定文本角度显示文本,false 表示按照沿线角度显示文本。
  41272. * 如果固定角度,则所有标签均按所设置的文本风格中字体的旋转角度来显示,不考虑沿线标注的方向;
  41273. * 如果不固定角度,在显示标签时会同时考虑字体的旋转角度和沿线标注的方向。
  41274. */
  41275. this.angleFixed = false;
  41276. /**
  41277. * @member {boolean} ThemeLabelAlongLine.prototype.repeatedLabelAvoided
  41278. * @description 沿线循环标注时是否避免标签重复标注。
  41279. */
  41280. this.repeatedLabelAvoided = false;
  41281. /**
  41282. * @member {boolean} [ThemeLabelAlongLine.prototype.repeatIntervalFixed=false]
  41283. * @description 循环标注间隔是否固定。true 表示使用固定循环标注间隔,即使用逻辑坐标来显示循环标注间隔;
  41284. * false 表示循环标注间隔随地图的缩放而变化,即使用地理坐标来显示循环标注间隔。
  41285. */
  41286. this.repeatIntervalFixed = false;
  41287. /**
  41288. * @member {number} [ThemeLabelAlongLine.prototype.labelRepeatInterval=0]
  41289. * @description 沿线且循环标注时循环标注的间隔。长度的单位与地图的地理单位一致。只有设定 RepeatedLabelAvoided 为 true
  41290. * 的时候,labelRepeatInterval 属性才有效。
  41291. */
  41292. this.labelRepeatInterval = 0;
  41293. if (options) {
  41294. Util_Util.extend(this, options);
  41295. }
  41296. this.CLASS_NAME = "SuperMap.ThemeLabelAlongLine";
  41297. }
  41298. /**
  41299. * @function ThemeLabelAlongLine.prototype.destroy
  41300. * @description 释放资源,将引用资源的属性置空。
  41301. */
  41302. ThemeLabelAlongLine_createClass(ThemeLabelAlongLine, [{
  41303. key: "destroy",
  41304. value: function destroy() {
  41305. var me = this;
  41306. me.isAlongLine = null;
  41307. me.alongLineDirection = null;
  41308. me.angleFixed = null;
  41309. me.repeatedLabelAvoided = null;
  41310. me.repeatIntervalFixed = null;
  41311. me.labelRepeatInterval = null;
  41312. }
  41313. /**
  41314. * @function ThemeLabelAlongLine.fromObj
  41315. * @description 从传入对象获取标签沿线标注样式类。
  41316. * @param {Object} obj - 传入对象。
  41317. * @returns {ThemeLabelAlongLine} ThemeLabelAlongLine 对象。
  41318. */
  41319. }], [{
  41320. key: "fromObj",
  41321. value: function fromObj(obj) {
  41322. if (!obj) {
  41323. return;
  41324. }
  41325. var t = new ThemeLabelAlongLine();
  41326. Util_Util.copy(t, obj);
  41327. return t;
  41328. }
  41329. }]);
  41330. return ThemeLabelAlongLine;
  41331. }();
  41332. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelBackground.js
  41333. function ThemeLabelBackground_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41334. 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); } }
  41335. 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; }
  41336. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41337. * This program are made available under the terms of the Apache License, Version 2.0
  41338. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41339. /**
  41340. * @class ThemeLabelBackground
  41341. * @deprecatedclass SuperMap.ThemeLabelBackground
  41342. * @category iServer Map Theme
  41343. * @classdesc 标签背景风格类。通过该类可以设置标签的背景形状和风格。
  41344. * @param {Object} options - 可选参数。
  41345. * @param {LabelBackShape} [options.labelBackShape=LabelBackShape.NONE] - 标签专题图中标签背景的形状枚举类。
  41346. * @param {ServerStyle} [options.backStyle] - 标签专题图中标签背景风格。
  41347. * @usage
  41348. */
  41349. var ThemeLabelBackground = /*#__PURE__*/function () {
  41350. function ThemeLabelBackground(options) {
  41351. ThemeLabelBackground_classCallCheck(this, ThemeLabelBackground);
  41352. /**
  41353. * @member {LabelBackShape} [ThemeLabelBackground.prototype.labelBackShape=LabelBackShape.NONE]
  41354. * @description 标签专题图中标签背景风格。当背景形状
  41355. * labelBackShape 属性设为 NONE(即无背景形状)时,backStyle 属性无效。
  41356. */
  41357. this.labelBackShape = LabelBackShape.NONE;
  41358. /**
  41359. * @member {ServerStyle} [ThemeLabelBackground.prototype.backStyle]
  41360. * @description 标签专题图中标签背景的形状枚举类。背景类型可以是矩形、圆角矩形、菱形、椭圆形、三角形和符号等,即不使用任何的形状作为标签的背景。
  41361. */
  41362. this.backStyle = new ServerStyle();
  41363. if (options) {
  41364. Util_Util.extend(this, options);
  41365. }
  41366. this.CLASS_NAME = "SuperMap.ThemeLabelBackground";
  41367. }
  41368. /**
  41369. * @function ThemeLabelBackground.prototype.destroy
  41370. * @description 释放资源,将引用资源的属性置空。
  41371. */
  41372. ThemeLabelBackground_createClass(ThemeLabelBackground, [{
  41373. key: "destroy",
  41374. value: function destroy() {
  41375. var me = this;
  41376. me.labelBackShape = null;
  41377. if (me.backStyle) {
  41378. me.backStyle.destroy();
  41379. me.backStyle = null;
  41380. }
  41381. }
  41382. /**
  41383. * @function ThemeLabelBackground.fromObj
  41384. * @description 从传入对象获取标签背景风格类。
  41385. * @param {Object} obj - 传入对象。
  41386. * @returns {ThemeLabelBackground} ThemeLabelBackground 对象。
  41387. */
  41388. }], [{
  41389. key: "fromObj",
  41390. value: function fromObj(obj) {
  41391. if (!obj) {
  41392. return;
  41393. }
  41394. var t = new ThemeLabelBackground();
  41395. t.labelBackShape = obj.labelBackShape;
  41396. t.backStyle = ServerStyle.fromJson(obj.backStyle);
  41397. return t;
  41398. }
  41399. }]);
  41400. return ThemeLabelBackground;
  41401. }();
  41402. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabel.js
  41403. 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); }
  41404. function ThemeLabel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41405. 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); } }
  41406. 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; }
  41407. 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); }
  41408. function ThemeLabel_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeLabel_getPrototypeOf(object); if (object === null) break; } return object; }
  41409. 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); }
  41410. 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); }
  41411. 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); }; }
  41412. 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); }
  41413. function ThemeLabel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41414. 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; } }
  41415. function ThemeLabel_getPrototypeOf(o) { ThemeLabel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeLabel_getPrototypeOf(o); }
  41416. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41417. * This program are made available under the terms of the Apache License, Version 2.0
  41418. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41419. /**
  41420. * @class ThemeLabel
  41421. * @deprecatedclass SuperMap.ThemeLabel
  41422. * @category iServer Map Theme
  41423. * @classdesc 标签专题图类。
  41424. * @extends CommonTheme
  41425. * @param {Object} options - 参数。
  41426. * @param {Array.<ThemeLabelItem>} options.items - 子项数组。
  41427. * @param {string} options.labelExpression - 标注字段表达式。
  41428. * @param {Array.<LabelImageCell|LabelSymbolCell|LabelThemeCell>} options.matrixCells - 矩阵标签元素数组。
  41429. * @param {ThemeLabelAlongLine} [options.alongLine] - 标签沿线标注方向样式类。
  41430. * @param {ThemeLabelBackground} [options.background] - 标签的背景风格类。
  41431. * @param {LabelOverLengthMode} [options.labelOverLengthMode=LabelOverLengthMode.NONE] - 超长标签的处理模式枚举类。
  41432. * @param {number} [options.maxLabelLength=256] - 标签在每一行显示的最大长度。
  41433. * @param {number} [options.numericPrecision=0] - 通过该字段设置其显示的精度。
  41434. * @param {ThemeOffset} [options.offset] - 指定标签专题图中标记文本相对于要素内点的偏移量对象。
  41435. * @param {boolean} [options.overlapAvoided=true] - 是否允许以文本避让方式显示文本。
  41436. * @param {string} [options.rangeExpression] - 制作分段标签专题的分段字段或字段表达式。
  41437. * @param {boolean} [options.smallGeometryLabeled=false] - 是否显示长度大于被标注对象本身长度的标签。
  41438. * @param {ThemeLabelText} options.text - 标签中文本风格。
  41439. * @param {number} [options.textSpace=0] - 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  41440. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  41441. * @usage
  41442. */
  41443. var ThemeLabel = /*#__PURE__*/function (_Theme) {
  41444. ThemeLabel_inherits(ThemeLabel, _Theme);
  41445. var _super = ThemeLabel_createSuper(ThemeLabel);
  41446. function ThemeLabel(options) {
  41447. var _this;
  41448. ThemeLabel_classCallCheck(this, ThemeLabel);
  41449. _this = _super.call(this, "LABEL", options);
  41450. /**
  41451. * @member {ThemeLabelAlongLine} [ThemeLabel.prototype.alongLine]
  41452. * @description 标签沿线标注方向样式类。
  41453. * 在该类中可以设置标签是否沿线标注以及沿线标注的多种方式。沿线标注属性只适用于线数据集专题图。
  41454. */
  41455. _this.alongLine = new ThemeLabelAlongLine();
  41456. /**
  41457. * @member {ThemeLabelBackground} [ThemeLabel.prototype.background]
  41458. * @description 标签专题图中标签的背景风格类。通过该字段可以设置标签的背景形状和风格。
  41459. */
  41460. _this.background = new ThemeLabelBackground();
  41461. /**
  41462. * @member {Array.<ThemeLabelItem>} [ThemeLabel.prototype.items]
  41463. * @description 分段标签专题图的子项数组。分段标签专题图使用 rangeExpression
  41464. * 指定数字型的字段作为分段数据,items 中的每个子对象的 [start,end) 分段值必须来源于属性 rangeExpression 的字段值。每个子项拥有自己的风格。
  41465. */
  41466. _this.items = null;
  41467. /**
  41468. * @member {Array.<ThemeLabelUniqueItem>} ThemeLabel.prototype.uniqueItems
  41469. * @description 单值标签专题图子项数组。单值标签专题图使用 uniqueExpression单值标签专题图子项集合。
  41470. */
  41471. _this.uniqueItems = null;
  41472. /**
  41473. * @member {string} ThemeLabel.prototype.labelExpression
  41474. * @description 标注字段表达式。系统将 labelExpression 对应的字段或字段表达式的值以标签的形式显示在图层中。
  41475. */
  41476. _this.labelExpression = null;
  41477. /**
  41478. * @member {LabelOverLengthMode} [ThemeLabel.prototype.labelOverLengthMode=LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  41479. * @description 对于标签的长度超过设置的标签最大长度 maxLabelLength 时称为超长标签。
  41480. */
  41481. _this.labelOverLengthMode = LabelOverLengthMode.NONE;
  41482. /**
  41483. * @member {Array.<LabelImageCell|LabelSymbolCell|LabelThemeCell>} ThemeLabel.prototype.matrixCells
  41484. * @description 矩阵标签元素数组,用于制作矩阵标签专题图。
  41485. * 数组中可以放置符号类型的矩阵标签元素和图片类型的矩阵标签元素。
  41486. */
  41487. _this.matrixCells = null;
  41488. /**
  41489. * @member {number} [ThemeLabel.prototype.maxLabelLength=256]
  41490. * @description 标签在每一行显示的最大长度,一个中文为两个字符。
  41491. * 如果超过最大长度,可以采用两种方式来处理,一种是换行的模式进行显示,另一种是以省略号方式显示。单位为字符。
  41492. */
  41493. _this.maxLabelLength = 256;
  41494. /**
  41495. * @member {number} [ThemeLabel.prototype.numericPrecision=0]
  41496. * @description 如果显示的标签内容为数字,通过该字段设置其显示的精度。例如标签对应的数字是8071.64529347,
  41497. * 如果该属性为0时,显示8071;为1时,显示8071.6;为3时,则是8071.645。
  41498. */
  41499. _this.numericPrecision = 0;
  41500. /**
  41501. * @member {ThemeOffset} [ThemeLabel.prototype.offset]
  41502. * @description 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  41503. */
  41504. _this.offset = new ThemeOffset();
  41505. /**
  41506. * @member {boolean} [ThemeLabel.prototype.overlapAvoided=true]
  41507. * @description 是否允许以文本避让方式显示文本。true 表示自动避免文本叠盖。只针对该标签专题图层中的文本数据。
  41508. * 在标签重叠度很大的情况下,即使使用自动避让功能,可能也无法完全避免标签重叠现象。
  41509. */
  41510. _this.overlapAvoided = true;
  41511. /**
  41512. * @member {string} ThemeLabel.prototype.rangeExpression
  41513. * @description 制作分段标签专题的分段字段或字段表达式。该表达式对应的字段(或者字段表达式)的值应该为数值型。
  41514. * 该字段与 items 分段子项联合使用,每个子项的起始值 [start,end)来源于 rangeExpression 字段值。
  41515. * 最后 labelExpression 指定的标签字段(标签专题图要显示的具体内容)会根据分段子项的风格进行分段显示。
  41516. */
  41517. _this.rangeExpression = null;
  41518. /**
  41519. * @member {string} ThemeLabel.prototype.uniqueExpression
  41520. * @description 用于制作单值专题图的字段或字段表达式。
  41521. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。必须与labelExpression一起使用。
  41522. */
  41523. _this.uniqueExpression = null;
  41524. /**
  41525. * @member {boolean} [ThemeLabel.prototype.smallGeometryLabeled=false]
  41526. * @description 是否显示长度大于被标注对象本身长度的标签。在标签的长度大于线或者面对象本身的长度时,
  41527. * 如果该值为 true,则标签文字会叠加在一起显示,为了清楚完整的显示该标签,
  41528. * 可以采用换行模式来显示标签,但必须保证每行的长度小于对象本身的长度。
  41529. */
  41530. _this.smallGeometryLabeled = false;
  41531. /**
  41532. * @member {ThemeLabelText} ThemeLabel.prototype.text
  41533. * @description 标签中文本风格。
  41534. */
  41535. _this.text = new ThemeLabelText();
  41536. /**
  41537. * @member {number} [ThemeLabel.prototype.textSpace=0]
  41538. * @description 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  41539. */
  41540. _this.textSpace = 0;
  41541. if (options) {
  41542. Util_Util.extend(ThemeLabel_assertThisInitialized(_this), options);
  41543. }
  41544. _this.CLASS_NAME = "SuperMap.ThemeLabel";
  41545. return _this;
  41546. }
  41547. /**
  41548. * @function ThemeLabel.prototype.destroy
  41549. * @override
  41550. */
  41551. ThemeLabel_createClass(ThemeLabel, [{
  41552. key: "destroy",
  41553. value: function destroy() {
  41554. ThemeLabel_get(ThemeLabel_getPrototypeOf(ThemeLabel.prototype), "destroy", this).call(this);
  41555. var me = this;
  41556. me.alongLine = null;
  41557. if (me.background) {
  41558. me.background.destroy();
  41559. me.background = null;
  41560. }
  41561. if (me.items) {
  41562. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  41563. items[i].destroy();
  41564. }
  41565. me.items = null;
  41566. }
  41567. if (me.uniqueItems) {
  41568. for (var j = 0, uniqueItems = me.uniqueItems, uniqueLen = uniqueItems.length; j < uniqueLen; j++) {
  41569. uniqueItems[j].destory();
  41570. }
  41571. me.uniqueItems = null;
  41572. }
  41573. me.labelExpression = null;
  41574. me.labelOverLengthMode = null;
  41575. me.matrixCells = null;
  41576. me.maxLabelLength = null;
  41577. me.numericPrecision = null;
  41578. me.overlapAvoided = null;
  41579. me.rangeExpression = null;
  41580. me.uniqueExpression = null;
  41581. if (me.offset) {
  41582. me.offset.destroy();
  41583. me.offset = null;
  41584. }
  41585. me.overlapAvoided = null;
  41586. me.smallGeometryLabeled = null;
  41587. if (me.text) {
  41588. me.text.destroy();
  41589. me.text = null;
  41590. }
  41591. me.textSpace = null;
  41592. }
  41593. /**
  41594. * @function ThemeLabel.prototype.toJSON
  41595. * @description 将themeLabel对象转化为 JSON 字符串。
  41596. * @returns {string} 返回转换后的 JSON 字符串。
  41597. */
  41598. }, {
  41599. key: "toJSON",
  41600. value: function toJSON() {
  41601. return Util_Util.toJSON(this.toServerJSONObject());
  41602. }
  41603. /**
  41604. * @function ThemeLabel.prototype.toServerJSONObject
  41605. * @description 转换成对应的 JSON 格式对象。
  41606. * @returns {Object} 对应的 JSON 格式对象。
  41607. */
  41608. }, {
  41609. key: "toServerJSONObject",
  41610. value: function toServerJSONObject() {
  41611. var obj = {};
  41612. obj.type = this.type;
  41613. obj.memoryData = this.memoryData;
  41614. if (this.alongLine) {
  41615. obj.alongLine = this.alongLine.isAlongLine;
  41616. obj.alongLineDirection = this.alongLine.alongLineDirection;
  41617. obj.angleFixed = this.alongLine.angleFixed;
  41618. obj.isLabelRepeated = this.alongLine.isLabelRepeated;
  41619. obj.labelRepeatInterval = this.alongLine.labelRepeatInterval;
  41620. obj.repeatedLabelAvoided = this.alongLine.repeatedLabelAvoided;
  41621. obj.repeatIntervalFixed = this.alongLine.repeatIntervalFixed;
  41622. }
  41623. if (this.offset) {
  41624. obj.offsetFixed = this.offset.offsetFixed;
  41625. obj.offsetX = this.offset.offsetX;
  41626. obj.offsetY = this.offset.offsetY;
  41627. }
  41628. if (this.text) {
  41629. obj.maxTextHeight = this.text.maxTextHeight;
  41630. obj.maxTextWidth = this.text.maxTextWidth;
  41631. obj.minTextHeight = this.text.minTextHeight;
  41632. obj.minTextWidth = this.text.minTextWidth;
  41633. obj.uniformStyle = this.text.uniformStyle;
  41634. obj.uniformMixedStyle = this.text.uniformMixedStyle;
  41635. }
  41636. if (this.background) {
  41637. obj.labelBackShape = this.background.labelBackShape;
  41638. obj.backStyle = this.background.backStyle;
  41639. }
  41640. obj.labelOverLengthMode = this.labelOverLengthMode;
  41641. obj.maxLabelLength = this.maxLabelLength;
  41642. obj.smallGeometryLabeled = this.smallGeometryLabeled;
  41643. obj.rangeExpression = this.rangeExpression;
  41644. obj.uniqueExpression = this.uniqueExpression;
  41645. obj.numericPrecision = this.numericPrecision;
  41646. obj.items = this.items;
  41647. obj.uniqueItems = this.uniqueItems;
  41648. obj.labelExpression = this.labelExpression;
  41649. obj.overlapAvoided = this.overlapAvoided;
  41650. obj.matrixCells = this.matrixCells;
  41651. obj.textSpace = this.textSpace;
  41652. return obj;
  41653. }
  41654. /**
  41655. * @function ThemeLabel.fromObj
  41656. * @description 从传入对象获取标签专题图类。
  41657. * @param {Object} obj - 传入对象。
  41658. * @returns {ThemeLabel} ThemeLabel 对象。
  41659. */
  41660. }], [{
  41661. key: "fromObj",
  41662. value: function fromObj(obj) {
  41663. if (!obj) {
  41664. return;
  41665. }
  41666. var lab = new ThemeLabel();
  41667. var itemsL = obj.items,
  41668. itemsU = obj.uniqueItems,
  41669. cells = obj.matrixCells;
  41670. obj.matrixCells = null;
  41671. Util_Util.copy(lab, obj);
  41672. lab.alongLine = ThemeLabelAlongLine.fromObj(obj);
  41673. lab.background = ThemeLabelBackground.fromObj(obj);
  41674. if (itemsL) {
  41675. lab.items = [];
  41676. for (var i = 0, len = itemsL.length; i < len; i++) {
  41677. lab.items.push(ThemeLabelItem.fromObj(itemsL[i]));
  41678. }
  41679. }
  41680. if (itemsU) {
  41681. lab.uniqueItems = [];
  41682. for (var j = 0, uniqueLen = itemsU.length; j < uniqueLen; j++) {
  41683. lab.uniqueItems.push(ThemeUniqueItem.fromObj(itemsU[j]));
  41684. }
  41685. }
  41686. if (cells) {
  41687. lab.matrixCells = [];
  41688. for (var _i2 = 0, _len2 = cells.length; _i2 < _len2; _i2++) {
  41689. //TODO
  41690. //lab.matrixCells.push(LabelMatrixCell.fromObj(cells[i]));
  41691. }
  41692. }
  41693. lab.offset = ThemeOffset.fromObj(obj);
  41694. lab.text = ThemeLabelText.fromObj(obj);
  41695. return lab;
  41696. }
  41697. }]);
  41698. return ThemeLabel;
  41699. }(Theme);
  41700. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUnique.js
  41701. 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); }
  41702. function ThemeUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41703. 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); } }
  41704. 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; }
  41705. 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); }
  41706. function ThemeUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  41707. 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); }
  41708. 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); }
  41709. 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); }; }
  41710. 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); }
  41711. function ThemeUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  41712. 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; } }
  41713. function ThemeUnique_getPrototypeOf(o) { ThemeUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeUnique_getPrototypeOf(o); }
  41714. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41715. * This program are made available under the terms of the Apache License, Version 2.0
  41716. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41717. /**
  41718. * @class ThemeUnique
  41719. * @deprecatedclass SuperMap.ThemeUnique
  41720. * @category iServer Map Theme
  41721. * @classdesc 单值专题图。单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。单值专题图多用于具有分类属性的地图上,
  41722. * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。尤其是有交叉或重叠现象时,此类不推荐使用,例如:民族分布区等。
  41723. * @extends {CommonTheme}
  41724. * @param {Object} options - 参数。
  41725. * @param {Array.<ThemeUniqueItem>} options.items - 子项类数组。
  41726. * @param {string} options.uniqueExpression - 指定单值专题图的字段或字段表达式。
  41727. * @param {ServerStyle} [options.defaultStyle] - 未参与单值专题图制作的对象的显示风格。
  41728. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  41729. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  41730. * @usage
  41731. */
  41732. var ThemeUnique = /*#__PURE__*/function (_Theme) {
  41733. ThemeUnique_inherits(ThemeUnique, _Theme);
  41734. var _super = ThemeUnique_createSuper(ThemeUnique);
  41735. function ThemeUnique(options) {
  41736. var _this;
  41737. ThemeUnique_classCallCheck(this, ThemeUnique);
  41738. _this = _super.call(this, "UNIQUE", options);
  41739. /**
  41740. * @member {ServerStyle} ThemeUnique.prototype.defaultStyle
  41741. * @description 未参与单值专题图制作的对象的显示风格。
  41742. * 通过单值专题图子项数组 (items)可以指定某些要素参与单值专题图制作,对于那些没有被包含的要素,即不参加单值专题表达的要素,使用该风格显示。
  41743. */
  41744. _this.defaultStyle = new ServerStyle();
  41745. /**
  41746. * @member {Array.<ThemeUniqueItem>} ThemeUnique.prototype.items
  41747. * @description 单值专题图子项类数组。
  41748. * 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,
  41749. * Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有5种不同值,则该行政区划图有 5 个专题图子项。
  41750. */
  41751. _this.items = null;
  41752. /**
  41753. * @member {string} ThemeUnique.prototype.uniqueExpression
  41754. * @description 用于制作单值专题图的字段或字段表达式。
  41755. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。
  41756. */
  41757. _this.uniqueExpression = null;
  41758. /**
  41759. * @member {ColorGradientType} [ThemeUnique.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  41760. * @description 渐变颜色枚举类。
  41761. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  41762. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。
  41763. * 但如果为某几个子项的风格进行单独设置后(设置了 ThemeUniqueItem 或 ThemeRangeItem 类中Style属性),
  41764. * 该配色方案对于这几个子项将不起作用。
  41765. */
  41766. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  41767. if (options) {
  41768. Util_Util.extend(ThemeUnique_assertThisInitialized(_this), options);
  41769. }
  41770. _this.CLASS_NAME = "SuperMap.ThemeUnique";
  41771. return _this;
  41772. }
  41773. /**
  41774. * @function ThemeUnique.prototype.destroy
  41775. * @override
  41776. */
  41777. ThemeUnique_createClass(ThemeUnique, [{
  41778. key: "destroy",
  41779. value: function destroy() {
  41780. ThemeUnique_get(ThemeUnique_getPrototypeOf(ThemeUnique.prototype), "destroy", this).call(this);
  41781. var me = this;
  41782. me.uniqueExpression = null;
  41783. me.colorGradientType = null;
  41784. if (me.items) {
  41785. if (me.items.length > 0) {
  41786. for (var item in me.items) {
  41787. me.items[item].destroy();
  41788. me.items[item] = null;
  41789. }
  41790. }
  41791. me.items = null;
  41792. }
  41793. if (me.defaultStyle) {
  41794. me.defaultStyle.destroy();
  41795. me.defaultStyle = null;
  41796. }
  41797. }
  41798. /**
  41799. * @function ThemeUnique.prototype.toServerJSONObject
  41800. * @description 转换成对应的 JSON 格式对象。
  41801. * @returns {Object} 对应的 JSON 格式对象。
  41802. */
  41803. }, {
  41804. key: "toServerJSONObject",
  41805. value: function toServerJSONObject() {
  41806. var obj = {};
  41807. obj = Util_Util.copyAttributes(obj, this);
  41808. if (obj.defaultStyle) {
  41809. if (obj.defaultStyle.toServerJSONObject) {
  41810. obj.defaultStyle = obj.defaultStyle.toServerJSONObject();
  41811. }
  41812. }
  41813. if (obj.items) {
  41814. var items = [],
  41815. len = obj.items.length;
  41816. for (var i = 0; i < len; i++) {
  41817. items.push(obj.items[i].toServerJSONObject());
  41818. }
  41819. obj.items = items;
  41820. }
  41821. return obj;
  41822. }
  41823. /**
  41824. * @function ThemeUnique.fromObj
  41825. * @description 从传入对象获取单值专题图类。
  41826. * @param {Object} obj - 传入对象。
  41827. * @returns {ThemeUnique} ThemeUnique 对象。
  41828. */
  41829. }], [{
  41830. key: "fromObj",
  41831. value: function fromObj(obj) {
  41832. var res = new ThemeUnique();
  41833. var uItems = obj.items;
  41834. var len = uItems ? uItems.length : 0;
  41835. Util_Util.extend(res, obj);
  41836. res.items = [];
  41837. res.defaultStyle = ServerStyle.fromJson(obj.defaultStyle);
  41838. for (var i = 0; i < len; i++) {
  41839. res.items.push(ThemeUniqueItem.fromObj(uItems[i]));
  41840. }
  41841. return res;
  41842. }
  41843. }]);
  41844. return ThemeUnique;
  41845. }(Theme);
  41846. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphAxes.js
  41847. function ThemeGraphAxes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41848. 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); } }
  41849. 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; }
  41850. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41851. * This program are made available under the terms of the Apache License, Version 2.0
  41852. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41853. /**
  41854. * @class ThemeGraphAxes
  41855. * @deprecatedclass SuperMap.ThemeGraphAxes
  41856. * @category iServer Map Theme
  41857. * @classdesc 统计专题图坐标轴样式类。
  41858. * @param {Object} options - 参数。
  41859. * @param {ServerColor} [options.axesColor=(0, 0, 0)] - 坐标轴颜色。
  41860. * @param {boolean} [options.axesDisplayed=false] - 是否显示坐标轴。
  41861. * @param {boolean} [options.axesGridDisplayed=false] - 是否在统计图坐标轴上显示网格。
  41862. * @param {boolean} [options.axesTextDisplayed=false] - 是否显示坐标轴的文本标注。
  41863. * @param {ServerTextStyle} [options.axesTextStyle] - 统计符号的最大最小尺寸。
  41864. * @usage
  41865. */
  41866. var ThemeGraphAxes = /*#__PURE__*/function () {
  41867. function ThemeGraphAxes(options) {
  41868. ThemeGraphAxes_classCallCheck(this, ThemeGraphAxes);
  41869. /**
  41870. * @member {ServerColor} [ThemeGraphAxes.prototype.axesColor=(0, 0, 0)]
  41871. * @description 坐标轴颜色。当 axesDisplayed = true 时有效。
  41872. */
  41873. this.axesColor = new ServerColor(0, 0, 0);
  41874. /**
  41875. * @member {boolean} [ThemeGraphAxes.prototype.axesDisplayed=false]
  41876. * @description 是否显示坐标轴。<br>
  41877. * 由于饼状图和环状图无坐标轴,故该属性以及所有与坐标轴设置相关的属性都不适用于它们。并且只有当该值为 true 时,其它设置坐标轴的属性才起作用。
  41878. */
  41879. this.axesDisplayed = false;
  41880. /**
  41881. * @member {boolean} [ThemeGraphAxes.prototype.axesGridDisplayed=false]
  41882. * @description 是否在统计图坐标轴上显示网格。
  41883. */
  41884. this.axesGridDisplayed = false;
  41885. /**
  41886. * @member {boolean} [ThemeGraphAxes.prototype.axesTextDisplayed=false]
  41887. * @description 是否显示坐标轴的文本标注。
  41888. */
  41889. this.axesTextDisplayed = false;
  41890. /**
  41891. * @member {ServerTextStyle} ThemeGraphAxes.prototype.axesTextStyle
  41892. * @description 坐标轴文本风格。当 axesTextDisplayed = true 时有效。
  41893. */
  41894. this.axesTextStyle = new ServerTextStyle();
  41895. if (options) {
  41896. Util_Util.extend(this, options);
  41897. }
  41898. this.CLASS_NAME = "SuperMap.ThemeGraphAxes";
  41899. }
  41900. /**
  41901. * @function ThemeGraphAxes.prototype.destroy
  41902. * @description 释放资源,将引用资源的属性置空。
  41903. */
  41904. ThemeGraphAxes_createClass(ThemeGraphAxes, [{
  41905. key: "destroy",
  41906. value: function destroy() {
  41907. var me = this;
  41908. if (me.axesColor) {
  41909. me.axesColor.destroy();
  41910. me.axesColor = null;
  41911. }
  41912. me.axesDisplayed = null;
  41913. me.axesGridDisplayed = null;
  41914. me.axesTextDisplayed = null;
  41915. if (me.axesTextStyle) {
  41916. me.axesTextStyle.destroy();
  41917. me.axesTextStyle = null;
  41918. }
  41919. }
  41920. /**
  41921. * @function ThemeGraphAxes.fromObj
  41922. * @description 从传入对象获取统计专题图坐标轴样式类。
  41923. * @param {Object} obj - 传入对象。
  41924. * @returns {ThemeGraphAxes} ThemeGraphAxes 对象。
  41925. */
  41926. }], [{
  41927. key: "fromObj",
  41928. value: function fromObj(obj) {
  41929. if (!obj) {
  41930. return;
  41931. }
  41932. var res = new ThemeGraphAxes();
  41933. Util_Util.copy(res, obj);
  41934. res.axesColor = ServerColor.fromJson(obj.axesColor);
  41935. res.axesTextStyle = ServerTextStyle.fromObj(obj.axesTextStyle);
  41936. return res;
  41937. }
  41938. }]);
  41939. return ThemeGraphAxes;
  41940. }();
  41941. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphSize.js
  41942. function ThemeGraphSize_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  41943. 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); } }
  41944. 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; }
  41945. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  41946. * This program are made available under the terms of the Apache License, Version 2.0
  41947. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  41948. /**
  41949. * @class ThemeGraphSize
  41950. * @deprecatedclass SuperMap.ThemeGraphSize
  41951. * @category iServer Map Theme
  41952. * @classdesc 统计专题图符号尺寸类。
  41953. * @param {Object} options - 参数。
  41954. * @param {number} [options.maxGraphSize=0] - 统计图中显示的最大图表尺寸基准值。
  41955. * @param {number} [options.minGraphSize=0] - 统计图中显示的最小图表尺寸基准值。
  41956. * @usage
  41957. */
  41958. var ThemeGraphSize = /*#__PURE__*/function () {
  41959. function ThemeGraphSize(options) {
  41960. ThemeGraphSize_classCallCheck(this, ThemeGraphSize);
  41961. /**
  41962. * @member {number} [ThemeGraphSize.prototype.maxGraphSize=0]
  41963. * @description 获取或设置统计图中显示的最大图表尺寸基准值,单位为像素。
  41964. */
  41965. this.maxGraphSize = 0;
  41966. /**
  41967. * @member {number} [ThemeGraphSize.prototype.minGraphSize=0]
  41968. * @description 获取或设置统计图中显示的最小图表尺寸基准值,单位为像素。
  41969. */
  41970. this.minGraphSize = 0;
  41971. if (options) {
  41972. Util_Util.extend(this, options);
  41973. }
  41974. this.CLASS_NAME = "SuperMap.ThemeGraphSize";
  41975. }
  41976. /**
  41977. * @function ThemeGraphSize.prototype.destroy
  41978. * @description 释放资源,将引用资源的属性置空。
  41979. */
  41980. ThemeGraphSize_createClass(ThemeGraphSize, [{
  41981. key: "destroy",
  41982. value: function destroy() {
  41983. var me = this;
  41984. me.maxGraphSize = null;
  41985. me.minGraphSize = null;
  41986. }
  41987. /**
  41988. * @function ThemeGraphSize.fromObj
  41989. * @description 从传入对象获统计专题图符号尺寸类。
  41990. * @param {Object} obj - 传入对象。
  41991. * @returns {ThemeGraphSize} ThemeGraphSize 对象。
  41992. */
  41993. }], [{
  41994. key: "fromObj",
  41995. value: function fromObj(obj) {
  41996. var res = new ThemeGraphSize();
  41997. Util_Util.copy(res, obj);
  41998. return res;
  41999. }
  42000. }]);
  42001. return ThemeGraphSize;
  42002. }();
  42003. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphText.js
  42004. function ThemeGraphText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42005. 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); } }
  42006. 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; }
  42007. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42008. * This program are made available under the terms of the Apache License, Version 2.0
  42009. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42010. /**
  42011. * @class ThemeGraphText
  42012. * @deprecatedclass SuperMap.ThemeGraphText
  42013. * @category iServer Map Theme
  42014. * @classdesc 统计图文字标注风格类。
  42015. * @param {Object} options - 可选参数。
  42016. * @param {boolean} [options.graphTextDisplayed=false] - 是否显示统计图上的文字标注。
  42017. * @param {ThemeGraphTextFormat} [options.graphTextFormat=ThemeGraphTextFormat.CAPTION] - 统计专题图文本显示格式。
  42018. * @param {ServerTextStyle} [options.graphTextStyle] - 统计图上的文字标注风格。
  42019. * @usage
  42020. */
  42021. var ThemeGraphText = /*#__PURE__*/function () {
  42022. function ThemeGraphText(options) {
  42023. ThemeGraphText_classCallCheck(this, ThemeGraphText);
  42024. /**
  42025. * @member {boolean} [ThemeGraphText.prototype.graphTextDisplayed=false]
  42026. * @description 是否显示统计图上的文字标注。
  42027. */
  42028. this.graphTextDisplayed = false;
  42029. /**
  42030. * @member {ThemeGraphTextFormat} [ThemeGraphText.prototype.graphTextFormat=ThemeGraphTextFormat.CAPTION]
  42031. * @description 统计专题图文本显示格式。
  42032. * 文本显示格式包括百分数、真实数值、标题、标题+百分数、标题+真实数值。
  42033. */
  42034. this.graphTextFormat = ThemeGraphTextFormat.CAPTION;
  42035. /**
  42036. * @member {ServerTextStyle} ThemeGraphText.prototype.graphTextStyle
  42037. * @description 统计图上的文字标注风格。
  42038. */
  42039. this.graphTextStyle = new ServerTextStyle();
  42040. if (options) {
  42041. Util_Util.extend(this, options);
  42042. }
  42043. this.CLASS_NAME = "SuperMap.ThemeGraphText";
  42044. }
  42045. /**
  42046. * @function ThemeGraphText.prototype.destroy
  42047. * @description 释放资源,将引用资源的属性置空。
  42048. */
  42049. ThemeGraphText_createClass(ThemeGraphText, [{
  42050. key: "destroy",
  42051. value: function destroy() {
  42052. var me = this;
  42053. me.graphTextDisplayed = null;
  42054. me.graphTextFormat = null;
  42055. if (me.graphTextStyle) {
  42056. me.graphTextStyle.destroy();
  42057. me.graphTextStyle = null;
  42058. }
  42059. }
  42060. /**
  42061. * @function ThemeGraphText.fromObj
  42062. * @description 从传入对象获取统计图文字标注风格类。
  42063. * @param {Object} obj - 传入对象。
  42064. * @returns {ThemeGraphText} ThemeGraphText 对象。
  42065. */
  42066. }], [{
  42067. key: "fromObj",
  42068. value: function fromObj(obj) {
  42069. var res = new ThemeGraphText();
  42070. Util_Util.copy(res, obj);
  42071. res.graphTextStyle = ServerTextStyle.fromObj(obj.graphTextStyle);
  42072. return res;
  42073. }
  42074. }]);
  42075. return ThemeGraphText;
  42076. }();
  42077. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphItem.js
  42078. function ThemeGraphItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42079. 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); } }
  42080. 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; }
  42081. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42082. * This program are made available under the terms of the Apache License, Version 2.0
  42083. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42084. /**
  42085. * @class ThemeGraphItem
  42086. * @deprecatedclass SuperMap.ThemeGraphItem
  42087. * @category iServer Map Theme
  42088. * @classdesc 统计专题图子项类。
  42089. * @param {Object} options - 参数。
  42090. * @param {string} [options.caption] - 专题图子项的名称。
  42091. * @param {string} options.graphExpression - 统计专题图的专题变量。
  42092. * @param {Array.<number>} [options.memoryDoubleValues] - 内存数组方式制作专题图时的值数组。
  42093. * @param {ServerStyle} [options.uniformStyle] - 统计专题图子项的显示风格。
  42094. * @usage
  42095. */
  42096. var ThemeGraphItem = /*#__PURE__*/function () {
  42097. function ThemeGraphItem(options) {
  42098. ThemeGraphItem_classCallCheck(this, ThemeGraphItem);
  42099. /**
  42100. * @member {string} [ThemeGraphItem.prototype.caption]
  42101. * @description 专题图子项的名称。
  42102. */
  42103. this.caption = null;
  42104. /**
  42105. * @member {string} ThemeGraphItem.prototype.graphExpression
  42106. * @description 统计专题图的专题变量。专题变量可以是一个字段或字段表达式。字段必须为数值型;表达式只能为数值型的字段间的运算。
  42107. */
  42108. this.graphExpression = null;
  42109. /**
  42110. * @member {Array.<number>} [ThemeGraphItem.prototype.memoryDoubleValues]
  42111. * @description 内存数组方式制作专题图时的值数组。<br>
  42112. * 内存数组方式制作专题图时,只对 SmID 值在键数组({@link ThemeGraph#memoryKeys})中的记录制作专题图。
  42113. * 值数组的数值个数必须与键数组中数值的个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  42114. * 比如:利用面积字段和周长字段(即有两个统计专题图子项 )作为专题变量制作统计专题图。
  42115. */
  42116. this.memoryDoubleValues = null;
  42117. /**
  42118. * @member {ServerStyle} [ThemeGraphItem.prototype.uniformStyle]
  42119. * @description 统计专题图子项的显示风格。
  42120. * 每一个统计专题图子项都对应一种显示风格。
  42121. */
  42122. this.uniformStyle = new ServerStyle();
  42123. if (options) {
  42124. Util_Util.extend(this, options);
  42125. }
  42126. this.CLASS_NAME = "SuperMap.ThemeGraphItem";
  42127. }
  42128. /**
  42129. * @function ThemeGraphItem.prototype.destroy
  42130. * @description 释放资源,将引用资源的属性置空。
  42131. */
  42132. ThemeGraphItem_createClass(ThemeGraphItem, [{
  42133. key: "destroy",
  42134. value: function destroy() {
  42135. var me = this;
  42136. me.caption = null;
  42137. me.graphExpression = null;
  42138. me.memoryDoubleValues = null;
  42139. me.uniformStyle = null;
  42140. }
  42141. /**
  42142. * @function ThemeGraphItem.fromObj
  42143. * @description 从传入对象获取统计专题图子项类。
  42144. * @param {Object} obj - 传入对象。
  42145. * @returns {ThemeGraphItem} ThemeGraphItem 对象。
  42146. */
  42147. }], [{
  42148. key: "fromObj",
  42149. value: function fromObj(obj) {
  42150. if (!obj) {
  42151. return;
  42152. }
  42153. var res = new ThemeGraphItem();
  42154. Util_Util.copy(res, obj);
  42155. res.uniformStyle = ServerStyle.fromJson(obj.uniformStyle);
  42156. return res;
  42157. }
  42158. }]);
  42159. return ThemeGraphItem;
  42160. }();
  42161. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraph.js
  42162. 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); }
  42163. function ThemeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42164. 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); } }
  42165. 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; }
  42166. 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); }
  42167. function ThemeGraph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraph_getPrototypeOf(object); if (object === null) break; } return object; }
  42168. 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); }
  42169. 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); }
  42170. 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); }; }
  42171. 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); }
  42172. function ThemeGraph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42173. 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; } }
  42174. function ThemeGraph_getPrototypeOf(o) { ThemeGraph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraph_getPrototypeOf(o); }
  42175. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42176. * This program are made available under the terms of the Apache License, Version 2.0
  42177. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42178. /**
  42179. * @class ThemeGraph
  42180. * @deprecatedclass SuperMap.ThemeGraph
  42181. * @category iServer Map Theme
  42182. * @classdesc 统计专题图类。
  42183. * @extends {CommonTheme}
  42184. * @param {Object} options - 参数。
  42185. * @param {Array.<ThemeGraphItem>} options.items - 统计专题图子项集合。
  42186. * @param {number} [options.barWidth=0] - 柱状专题图中每一个柱的宽度。
  42187. * @param {GraduatedMode} [options.graduatedMode=GraduatedMode.CONSTANT] - 统计图中地理要素的值与图表尺寸间的映射关系。
  42188. * @param {ThemeGraphAxes} [options.graphAxes] - 统计图中坐标轴样式相关信息。
  42189. * @param {ThemeGraphSize} [options.graphSize=0] - 统计符号的最大最小尺寸。
  42190. * @param {boolean} [options.graphSizeFixed=false] - 缩放地图时统计图符号是否固定大小。
  42191. * @param {ThemeGraphText} [options.graphText] - 统计图上的文字是否可见以及文字标注风格。
  42192. * @param {GraphAxesTextDisplayMode} [options.graphAxesTextDisplayMode=GraphAxesTextDisplayMode.NONE] - 统计专题图坐标轴文本显示模式。
  42193. * @param {ThemeGraphType} [options.graphType=ThemeGraphType.AREA] - 统计专题图类型。
  42194. * @param {Array.<number>} [options.memoryKeys] - 以内存数组方式制作专题图时的键数组。
  42195. * @param {boolean} [options.negativeDisplayed=false] - 专题图中是否显示属性为负值的数据。
  42196. * @param {ThemeOffset} [options.offset] - 统计图相对于要素内点的偏移量。
  42197. * @param {boolean} [options.overlapAvoided=true] - 统计图是否采用避让方式显示。
  42198. * @param {number} [options.roseAngle=0] - 统计图中玫瑰图或三维玫瑰图用于等分的角度。
  42199. * @param {number} [options.startAngle=0] - 饼状统计图扇形的起始角度。
  42200. * @usage
  42201. */
  42202. var ThemeGraph = /*#__PURE__*/function (_Theme) {
  42203. ThemeGraph_inherits(ThemeGraph, _Theme);
  42204. var _super = ThemeGraph_createSuper(ThemeGraph);
  42205. function ThemeGraph(options) {
  42206. var _this;
  42207. ThemeGraph_classCallCheck(this, ThemeGraph);
  42208. _this = _super.call(this, "GRAPH", options);
  42209. /**
  42210. * @member {number} [ThemeGraph.prototype.barWidth=0]
  42211. * @description 柱状专题图中每一个柱的宽度。使用地图坐标单位。
  42212. * 只有选择的统计图类型为柱状图(柱状图、三维柱状图、堆叠柱状图、三维堆叠柱状图)时,此项才可设置。
  42213. */
  42214. _this.barWidth = 0;
  42215. /**
  42216. * @member {GraduatedMode} [ThemeGraph.prototype.graduatedMode=GraduatedMode.CONSTANT]
  42217. * @description 统计图中地理要素的值与图表尺寸间的映射关系(常数、对数、平方根),即分级方式。
  42218. * 分级主要是为了减少制作统计专题图中数据大小之间的差异,使得统计图的视觉效果比较好,同时不同类别之间的比较也还是有意义的。
  42219. * 提供三种分级模式:常数、对数和平方根,对于有值为负数的字段,不可以采用对数和平方根的分级方式。不同的等级方式用于确定符号大小的数值是不相同的。
  42220. */
  42221. _this.graduatedMode = GraduatedMode.CONSTANT;
  42222. /**
  42223. * @member {ThemeGraphAxes} ThemeGraph.prototype.graphAxes
  42224. * @description 用于设置统计图中坐标轴样式相关信息,如坐标轴颜色、是否显示、坐标文本样式等。
  42225. */
  42226. _this.graphAxes = new ThemeGraphAxes();
  42227. /**
  42228. * @member {ThemeGraphSize} [ThemeGraph.prototype.graphSize=0]
  42229. * @description 用于设置统计符号的最大最小尺寸。
  42230. */
  42231. _this.graphSize = new ThemeGraphSize();
  42232. /**
  42233. * @member {boolean} [ThemeGraph.prototype.graphSizeFixed=false]
  42234. * @description 缩放地图时统计图符号是否固定大小。即统计图符号将随地图缩放。
  42235. */
  42236. _this.graphSizeFixed = false;
  42237. /**
  42238. * @member {ThemeGraphText} ThemeGraph.prototype.graphText
  42239. * @description 统计图上的文字是否可见以及文字标注风格。
  42240. */
  42241. _this.graphText = new ThemeGraphText();
  42242. /**
  42243. * @member {ThemeGraphType} [ThemeGraph.prototype.graphType=ThemeGraphType.AREA]
  42244. * @description 统计专题图类型。SuperMap 提供了多种类型的统计图,
  42245. * 分别为面积图、阶梯图、折线图、点状图、柱状图、三维柱状图、饼图、三维饼图、玫瑰图、三维玫瑰图、堆叠柱状图、三维堆叠柱状图、环状图。默认为面积图。
  42246. */
  42247. _this.graphType = ThemeGraphType.AREA;
  42248. /**
  42249. * @member {GraphAxesTextDisplayMode} [ThemeGraph.prototype.graphAxesTextDisplayMode=GraphAxesTextDisplayMode.NONE]
  42250. * @description 统计专题图坐标轴文本显示模式。
  42251. */
  42252. _this.graphAxesTextDisplayMode = GraphAxesTextDisplayMode.NONE;
  42253. /**
  42254. * @member {Array.<ThemeGraphItem>} ThemeGraph.prototype.items
  42255. * @description 统计专题图子项集合。
  42256. * 统计专题图可以基于多个变量,反映多种属性,即可以将多个专题变量的值绘制在一个统计图上。每一个专题变量对应的统计图即为一个专题图子项。
  42257. * 对于每个专题图子项可以为其设置标题、风格,甚至可以将该子项再制作成范围分段专题图。
  42258. */
  42259. _this.items = null;
  42260. /**
  42261. * @member {Array.<number>} ThemeGraph.prototype.memoryKeys
  42262. * @description 以内存数组方式制作专题图时的键数组。
  42263. * 键数组内的数值代表 SmID 值,它与 {@link ThemeGraphItem} 类中的值数组({@link ThemeGraphItem#memoryDoubleValues})要关联起来应用。
  42264. * 键数组中数值的个数必须要与值数组的数值个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  42265. * 目前所有的专题图都支持以内存数组的方式制作专题图,但统计专题图与其他专题图指定内存数组的方式不同,
  42266. * 统计专题图使用 memoryKeys 指定内存数组,而其他专题图则使用 memoryData 来指定内存数组。
  42267. * @example
  42268. * memoryKeys 的使用方法如下:
  42269. * function addThemeGraph() {
  42270. * removeTheme();
  42271. * //创建统计专题图对象,ThemeGraph 必设 items。
  42272. * //专题图参数 ThemeParameters 必设 theme(即以设置好的分段专题图对象)、dataSourceName 和 datasetName
  42273. * var style1 = new ServerStyle({
  42274. * fillForeColor: new ServerColor(92,73,234),
  42275. * lineWidth: 0.1
  42276. * }),
  42277. * style2 = new ServerStyle({
  42278. * fillForeColor: new ServerColor(211,111,240),
  42279. * lineWidth: 0.1
  42280. * }),
  42281. * item1 = new ThemeGraphItem({
  42282. * memoryDoubleValues:[1.18,0.95,0.37,1.31,0.8,1.5],
  42283. * caption: "1992-1995人口增长率",
  42284. * graphExpression: "Pop_Rate95",
  42285. * uniformStyle: style1
  42286. * }),
  42287. * item2 = new ThemeGraphItem({
  42288. * //以内存数组方式制作专题图时的值数组
  42289. * memoryDoubleValues:[2.71,0,0.74,3.1,2.2,3.5],
  42290. * caption: "1995-1999人口增长率", //专题图子项的名称
  42291. * graphExpression: "Pop_Rate99", //统计专题图的专题变量
  42292. * uniformStyle: style2 //统计专题图子项的显示风格
  42293. * }),
  42294. * themeGraph = new ThemeGraph({
  42295. * //以内存数组方式制作专题图时的键数组,键数组内的数值代表 SmID 值
  42296. * memoryKeys:[1,2,4,8,10,12],
  42297. * items: new Array(item1,item2),
  42298. * barWidth: 0.03,
  42299. * //统计图中地理要素的值与图表尺寸间的映射关系为平方根
  42300. * graduatedMode: GraduatedMode.SQUAREROOT,
  42301. * //graphAxes用于设置统计图中坐标轴样式相关信息
  42302. * graphAxes: new ThemeGraphAxes({
  42303. * axesDisplayed: true
  42304. * }),
  42305. * graphSize: new ThemeGraphSize({
  42306. * maxGraphSize: 1,
  42307. * minGraphSize: 0.35
  42308. * }),
  42309. * //统计图上的文字是否可见以及文字标注风格
  42310. * graphText: new ThemeGraphText({
  42311. * graphTextDisplayed: true,
  42312. * graphTextFormat: ThemeGraphTextFormat.VALUE,
  42313. * graphTextStyle: new ServerTextStyle({
  42314. * sizeFixed: true,
  42315. * fontHeight: 9,
  42316. * fontWidth: 5
  42317. * })
  42318. * }),
  42319. * //统计专题图类型为三维柱状图
  42320. * graphType: ThemeGraphType.BAR3D
  42321. * }),
  42322. * //专题图参数对象
  42323. * themeParameters = new ThemeParameters({
  42324. * themes: [themeGraph],
  42325. * dataSourceNames: ["Jingjin"],
  42326. * datasetNames: ["BaseMap_R"]
  42327. * }),
  42328. * //与服务端交互
  42329. * themeService=new ThemeService(url, {
  42330. * eventListeners: {
  42331. * "processCompleted": ThemeCompleted,
  42332. * "processFailed": themeFailed
  42333. * }
  42334. * });
  42335. * themeService.processAsync(themeParameters);
  42336. * }
  42337. */
  42338. _this.memoryKeys = null;
  42339. /**
  42340. * @member {boolean} [ThemeGraph.prototype.negativeDisplayed=false]
  42341. * @description 专题图中是否显示属性为负值的数据。true 表示显示;false 不显示。
  42342. */
  42343. _this.negativeDisplayed = false;
  42344. /**
  42345. * @member {ThemeOffset} ThemeGraph.prototype.offset
  42346. * @description 用于设置统计图相对于要素内点的偏移量。
  42347. */
  42348. _this.offset = new ThemeOffset();
  42349. /**
  42350. * @member {boolean} ThemeGraph.prototype.overlapAvoided
  42351. * @description 统计图是否采用避让方式显示。<br>
  42352. * 1.对数据集制作统计专题图:当统计图采用避让方式显示时,如果 overlapAvoided 为 true,则在统计图重叠度很大的情况下,
  42353. * 会出现无法完全避免统计图重叠的现象;如果 overlapAvoided 为 false,会过滤掉一些统计图,从而保证所有的统计图均不重叠。<br>
  42354. * 2.对数据集同时制作统计专题图和标签专题图:当统计图不显示子项文本时,标签专题图的标签即使和统计图重叠,两者也都可正常显示;
  42355. * 当统计图显示子项文本时,如果统计图中的子项文本和标签专题图中的标签不重叠,则两者均正常显示;如果重叠,则会过滤掉统计图的子项文本,只显示标签。
  42356. */
  42357. _this.overlapAvoided = true;
  42358. /**
  42359. * @member {number} [ThemeGraph.prototype.roseAngle=0]
  42360. * @description 统计图中玫瑰图或三维玫瑰图用于等分的角度,默认为 0 度,精确到 0.1 度。在角度为0或者大于 360 度的情况下均使用 360 度来等分制作统计图的字段数。
  42361. */
  42362. _this.roseAngle = 0;
  42363. /**
  42364. * @member {number} [ThemeGraph.prototype.startAngle=0]
  42365. * @description 饼状统计图扇形的起始角度。精确到 0.1 度,以水平方向为正向。只有选择的统计图类型为饼状图(饼图、三维饼图、玫瑰图、三维玫瑰图)时,此项才可设置。
  42366. */
  42367. _this.startAngle = 0;
  42368. if (options) {
  42369. Util_Util.extend(ThemeGraph_assertThisInitialized(_this), options);
  42370. }
  42371. _this.CLASS_NAME = "SuperMap.ThemeGraph";
  42372. return _this;
  42373. }
  42374. /**
  42375. * @function ThemeGraph.prototype.destroy
  42376. * @override
  42377. */
  42378. ThemeGraph_createClass(ThemeGraph, [{
  42379. key: "destroy",
  42380. value: function destroy() {
  42381. ThemeGraph_get(ThemeGraph_getPrototypeOf(ThemeGraph.prototype), "destroy", this).call(this);
  42382. var me = this;
  42383. me.barWidth = null;
  42384. me.graduatedMode = null;
  42385. if (me.graphAxes) {
  42386. me.graphAxes.destroy();
  42387. me.graphAxes = null;
  42388. }
  42389. if (me.graphSize) {
  42390. me.graphSize.destroy();
  42391. me.graphSize = null;
  42392. }
  42393. me.graphSizeFixed = null;
  42394. if (me.graphText) {
  42395. me.graphText.destroy();
  42396. me.graphText = null;
  42397. }
  42398. me.graphType = null;
  42399. if (me.items) {
  42400. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  42401. items[i].destroy();
  42402. }
  42403. me.items = null;
  42404. }
  42405. me.memoryKeys = null;
  42406. me.negativeDisplayed = null;
  42407. if (me.offset) {
  42408. me.offset.destroy();
  42409. me.offset = null;
  42410. }
  42411. me.overlapAvoided = null;
  42412. me.roseAngle = null;
  42413. me.startAngle = null;
  42414. me.graphAxesTextDisplayMode = null;
  42415. }
  42416. /**
  42417. * @function ThemeGraph.prototype.toJSON
  42418. * @description 将 ThemeGraph 对象转化为 JSON 字符串。
  42419. * @returns {string} 返回转换后的 JSON 字符串。
  42420. */
  42421. }, {
  42422. key: "toJSON",
  42423. value: function toJSON() {
  42424. return Util_Util.toJSON(this.toServerJSONObject());
  42425. }
  42426. /**
  42427. * @function ThemeGraph.prototype.toServerJSONObject
  42428. * @description 转换成对应的 JSON 格式对象。
  42429. * @returns {Object} 对应的 JSON 格式对象。
  42430. */
  42431. }, {
  42432. key: "toServerJSONObject",
  42433. value: function toServerJSONObject() {
  42434. var obj = {};
  42435. obj.type = this.type;
  42436. if (this.graphText) {
  42437. obj.graphTextDisplayed = this.graphText.graphTextDisplayed;
  42438. obj.graphTextFormat = this.graphText.graphTextFormat;
  42439. obj.graphTextStyle = this.graphText.graphTextStyle;
  42440. }
  42441. if (this.graphAxes) {
  42442. obj.axesColor = this.graphAxes.axesColor;
  42443. obj.axesDisplayed = this.graphAxes.axesDisplayed;
  42444. obj.axesGridDisplayed = this.graphAxes.axesGridDisplayed;
  42445. obj.axesTextDisplayed = this.graphAxes.axesTextDisplayed;
  42446. obj.axesTextStyle = this.graphAxes.axesTextStyle;
  42447. }
  42448. if (this.graphSize) {
  42449. obj.maxGraphSize = this.graphSize.maxGraphSize;
  42450. obj.minGraphSize = this.graphSize.minGraphSize;
  42451. }
  42452. if (this.offset) {
  42453. obj.offsetFixed = this.offset.offsetFixed;
  42454. obj.offsetX = this.offset.offsetX;
  42455. obj.offsetY = this.offset.offsetY;
  42456. }
  42457. obj.barWidth = this.barWidth;
  42458. obj.graduatedMode = this.graduatedMode;
  42459. obj.graphSizeFixed = this.graphSizeFixed;
  42460. obj.graphType = this.graphType;
  42461. obj.graphAxesTextDisplayMode = this.graphAxesTextDisplayMode;
  42462. obj.items = this.items;
  42463. obj.memoryKeys = this.memoryKeys;
  42464. obj.negativeDisplayed = this.negativeDisplayed;
  42465. obj.overlapAvoided = this.overlapAvoided;
  42466. obj.roseAngle = this.roseAngle;
  42467. obj.startAngle = this.startAngle;
  42468. return obj;
  42469. }
  42470. /**
  42471. * @function ThemeGraph.fromObj
  42472. * @description 从传入对象获取统计专题图类。
  42473. * @param {Object} obj - 传入对象。
  42474. * @returns {ThemeGraph} ThemeGraph 对象。
  42475. */
  42476. }], [{
  42477. key: "fromObj",
  42478. value: function fromObj(obj) {
  42479. var res = new ThemeGraph();
  42480. var itemsG = obj.items;
  42481. var len = itemsG ? itemsG.length : 0;
  42482. Util_Util.copy(res, obj);
  42483. res.items = [];
  42484. res.graphAxes = ThemeGraphAxes.fromObj(obj);
  42485. res.graphSize = ThemeGraphSize.fromObj(obj);
  42486. res.graphText = ThemeGraphText.fromObj(obj);
  42487. res.offset = ThemeOffset.fromObj(obj);
  42488. for (var i = 0; i < len; i++) {
  42489. res.items.push(ThemeGraphItem.fromObj(itemsG[i]));
  42490. }
  42491. return res;
  42492. }
  42493. }]);
  42494. return ThemeGraph;
  42495. }(Theme);
  42496. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeDotDensity.js
  42497. 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); }
  42498. function ThemeDotDensity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42499. 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); } }
  42500. 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; }
  42501. 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); }
  42502. 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); }
  42503. 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); }; }
  42504. 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); }
  42505. function ThemeDotDensity_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42506. 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; } }
  42507. function ThemeDotDensity_getPrototypeOf(o) { ThemeDotDensity_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeDotDensity_getPrototypeOf(o); }
  42508. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42509. * This program are made available under the terms of the Apache License, Version 2.0
  42510. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42511. /**
  42512. * @class ThemeDotDensity
  42513. * @deprecatedclass SuperMap.ThemeDotDensity
  42514. * @category iServer Map Theme
  42515. * @classdesc 点密度专题图。点密度专题图用一定大小、形状相同的点表示现象分布范围、数量特征和分布密度。点的多少和所代表的意义由地图的内容确定。
  42516. * 点密度专题图利用图层的某一数值属性信息(专题值)映射为不同等级,每一级别使用不同数量或表现为密度的点符号来表示。
  42517. * 该专题值在各个分区内的分布情况,体现不同区域的相对数量差异。多用于具有数量特征的地图上,
  42518. * 比如表示不同地区的粮食产量、GDP、人口等的分级,主要针对区域或面状的要素,因而,点密度专题图适用于面数据集。
  42519. * 注意:点密度专题图中点的分布是随机的,并不代表实际的分布位置。即使在相关设置完全相同的情况下,
  42520. * 每次制作出的专题图,点的数量相同,但点的位置都有差异。
  42521. * @extends {CommonTheme}
  42522. * @param {Object} options - 参数。
  42523. * @param {string} options.dotExpression - 创建点密度专题图的字段或字段表达式。
  42524. * @param {ServerStyle} [options.style] - 点密度专题图中点的风格。
  42525. * @param {number} [options.value] - 专题图中每一个点所代表的数值。
  42526. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  42527. * @usage
  42528. */
  42529. var ThemeDotDensity = /*#__PURE__*/function (_Theme) {
  42530. ThemeDotDensity_inherits(ThemeDotDensity, _Theme);
  42531. var _super = ThemeDotDensity_createSuper(ThemeDotDensity);
  42532. function ThemeDotDensity(options) {
  42533. var _this;
  42534. ThemeDotDensity_classCallCheck(this, ThemeDotDensity);
  42535. _this = _super.call(this, "DOTDENSITY", options);
  42536. /**
  42537. * @member {string} ThemeDotDensity.prototype.dotExpression
  42538. * @description 创建点密度专题图的字段或字段表达式。点的数目或密集程度的来源。
  42539. */
  42540. _this.dotExpression = null;
  42541. /**
  42542. * @member {ServerStyle} ThemeDotDensity.prototype.style
  42543. * @description 点密度专题图中点的风格。
  42544. */
  42545. _this.style = new ServerStyle();
  42546. /**
  42547. * @member {number} ThemeDotDensity.prototype.value
  42548. * @description 专题图中每一个点所代表的数值。<br>
  42549. * 点值的确定与地图比例尺以及点的大小有关。地图比例尺越大,相应的图面范围也越大,
  42550. * 点相应就可以越多,此时点值就可以设置相对小一些。点形状越大,
  42551. * 点值相应就应该设置的小一些。点值过大或过小都是不合适的。
  42552. */
  42553. _this.value = null;
  42554. if (options) {
  42555. Util_Util.extend(ThemeDotDensity_assertThisInitialized(_this), options);
  42556. }
  42557. _this.CLASS_NAME = "SuperMap.ThemeDotDensity";
  42558. return _this;
  42559. }
  42560. /**
  42561. * @function ThemeDotDensity.prototype.destroy
  42562. * @description 释放资源,将引用资源的属性置空。
  42563. */
  42564. ThemeDotDensity_createClass(ThemeDotDensity, [{
  42565. key: "destroy",
  42566. value: function destroy() {
  42567. var me = this;
  42568. me.dotExpression = null;
  42569. me.value = null;
  42570. if (me.style) {
  42571. me.style.destroy();
  42572. me.style = null;
  42573. }
  42574. }
  42575. /**
  42576. * @function ThemeDotDensity.prototype.toServerJSONObject
  42577. * @description 转换成对应的 JSON 格式对象。
  42578. * @returns {Object} 对应的 JSON 格式对象。
  42579. */
  42580. }, {
  42581. key: "toServerJSONObject",
  42582. value: function toServerJSONObject() {
  42583. var obj = {};
  42584. obj = Util_Util.copyAttributes(obj, this);
  42585. if (obj.style) {
  42586. if (obj.style.toServerJSONObject) {
  42587. obj.style = obj.style.toServerJSONObject();
  42588. }
  42589. }
  42590. return obj;
  42591. }
  42592. /**
  42593. * @function ThemeDotDensity.fromObj
  42594. * @description 从传入对象获取点密度专题图中点的风格。
  42595. * @param {Object} obj - 传入对象。
  42596. * @returns {ThemeDotDensity} ThemeDotDensity 对象。
  42597. */
  42598. }], [{
  42599. key: "fromObj",
  42600. value: function fromObj(obj) {
  42601. if (!obj) {
  42602. return;
  42603. }
  42604. var res = new ThemeDotDensity();
  42605. Util_Util.copy(res, obj);
  42606. res.style = ServerStyle.fromJson(obj.style);
  42607. return res;
  42608. }
  42609. }]);
  42610. return ThemeDotDensity;
  42611. }(Theme);
  42612. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbolStyle.js
  42613. function ThemeGraduatedSymbolStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42614. 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); } }
  42615. 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; }
  42616. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42617. * This program are made available under the terms of the Apache License, Version 2.0
  42618. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42619. /**
  42620. * @class ThemeGraduatedSymbolStyle
  42621. * @deprecatedclass SuperMap.ThemeGraduatedSymbolStyle
  42622. * @category iServer Map Theme
  42623. * @classdesc 等级符号专题图正负零值显示风格类。
  42624. * @param {Object} options - 参数。
  42625. * @param {boolean} [options.negativeDisplayed=false] - 是否显示负值。
  42626. * @param {ServerStyle} [options.negativeStyle] - 负值的等级符号风格。
  42627. * @param {ServerStyle} [options.positiveStyle] - 正值的等级符号风格。
  42628. * @param {boolean} [options.zeroDisplayed=false] - 是否显示 0 值。
  42629. * @param {ServerStyle} [options.zeroStyle] - 0 值的等级符号风格。
  42630. * @usage
  42631. */
  42632. var ThemeGraduatedSymbolStyle = /*#__PURE__*/function () {
  42633. function ThemeGraduatedSymbolStyle(options) {
  42634. ThemeGraduatedSymbolStyle_classCallCheck(this, ThemeGraduatedSymbolStyle);
  42635. /**
  42636. * @member {boolean} [ThemeGraduatedSymbolStyle.prototype.negativeDisplayed=false]
  42637. * @description 是否显示负值。
  42638. */
  42639. this.negativeDisplayed = false;
  42640. /**
  42641. * @member {ServerStyle} [ThemeGraduatedSymbolStyle.prototype.negativeStyle]
  42642. * @description 负值的等级符号风格。
  42643. */
  42644. this.negativeStyle = new ServerStyle();
  42645. /**
  42646. * @member {ServerStyle} [ThemeGraduatedSymbolStyle.prototype.positiveStyle]
  42647. * @description 正值的等级符号风格。
  42648. */
  42649. this.positiveStyle = new ServerStyle();
  42650. /**
  42651. * @member {boolean} [ThemeGraduatedSymbolStyle.prototype.zeroDisplayed=false]
  42652. * @description 是否显示 0 值。
  42653. */
  42654. this.zeroDisplayed = false;
  42655. /**
  42656. * @member {ServerStyle} ThemeGraduatedSymbolStyle.prototype.zeroStyle
  42657. * @description 0 值的等级符号风格。
  42658. */
  42659. this.zeroStyle = new ServerStyle();
  42660. if (options) {
  42661. Util_Util.extend(this, options);
  42662. }
  42663. this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbolStyle";
  42664. }
  42665. /**
  42666. * @function ThemeGraduatedSymbolStyle.prototype.destroy
  42667. * @description 释放资源,将引用资源的属性置空。
  42668. */
  42669. ThemeGraduatedSymbolStyle_createClass(ThemeGraduatedSymbolStyle, [{
  42670. key: "destroy",
  42671. value: function destroy() {
  42672. var me = this;
  42673. me.negativeDisplayed = null;
  42674. me.negativeStyle = null;
  42675. me.positiveStyle = null;
  42676. me.zeroDisplayed = null;
  42677. me.zeroStyle = null;
  42678. }
  42679. /**
  42680. * @function ThemeGraduatedSymbolStyle.fromObj
  42681. * @description 从传入对象获取等级符号专题图正负零值显示风格类。
  42682. * @param {Object} obj - 传入对象。
  42683. * @returns {ThemeGraduatedSymbolStyle} ThemeGraduatedSymbolStyle 对象。
  42684. */
  42685. }], [{
  42686. key: "fromObj",
  42687. value: function fromObj(obj) {
  42688. if (!obj) {
  42689. return;
  42690. }
  42691. var res = new ThemeGraduatedSymbolStyle();
  42692. Util_Util.copy(res, obj);
  42693. res.negativeStyle = ServerStyle.fromJson(obj.negativeStyle);
  42694. res.positiveStyle = ServerStyle.fromJson(obj.positiveStyle);
  42695. res.zeroStyle = ServerStyle.fromJson(obj.zeroStyle);
  42696. return res;
  42697. }
  42698. }]);
  42699. return ThemeGraduatedSymbolStyle;
  42700. }();
  42701. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbol.js
  42702. 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); }
  42703. function ThemeGraduatedSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42704. 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); } }
  42705. 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; }
  42706. 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); }
  42707. function ThemeGraduatedSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraduatedSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  42708. 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); }
  42709. 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); }
  42710. 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); }; }
  42711. 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); }
  42712. function ThemeGraduatedSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42713. 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; } }
  42714. function ThemeGraduatedSymbol_getPrototypeOf(o) { ThemeGraduatedSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraduatedSymbol_getPrototypeOf(o); }
  42715. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42716. * This program are made available under the terms of the Apache License, Version 2.0
  42717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42718. /**
  42719. * @class ThemeGraduatedSymbol
  42720. * @deprecatedclass SuperMap.ThemeGraduatedSymbol
  42721. * @category iServer Map Theme
  42722. * @classdesc 等级符号专题图。
  42723. * @extends {CommonTheme}
  42724. * @param {Object} options - 参数。
  42725. * @param {ThemeGraduatedSymbolStyle} options.style - 等级符号专题图正负零值显示风格类。
  42726. * @param {string} options.expression - 等级符号专题图的字段或字段表达式。
  42727. * @param {number} [options.baseValue=0] - 等级符号专题图的基准值,单位同专题变量的单位。
  42728. * @param {GraduatedMode} [options.graduatedMode=GraduatedMode.CONSTANT] - 等级符号专题图分级模式。
  42729. * @param {ThemeOffset} [options.offset] - 指定等级符号专题图中标记文本相对于要素内点的偏移量对象。
  42730. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  42731. * @usage
  42732. */
  42733. var ThemeGraduatedSymbol = /*#__PURE__*/function (_Theme) {
  42734. ThemeGraduatedSymbol_inherits(ThemeGraduatedSymbol, _Theme);
  42735. var _super = ThemeGraduatedSymbol_createSuper(ThemeGraduatedSymbol);
  42736. function ThemeGraduatedSymbol(options) {
  42737. var _this;
  42738. ThemeGraduatedSymbol_classCallCheck(this, ThemeGraduatedSymbol);
  42739. _this = _super.call(this, "GRADUATEDSYMBOL", options);
  42740. /**
  42741. * @member {number} [ThemeGraduatedSymbol.prototype.baseValue=0]
  42742. * @description 等级符号专题图的基准值,单位同专题变量的单位。<br>
  42743. * 依据此值系统会自动根据分级方式计算其余值对应的符号大小,每个符号的显示大小等于
  42744. * ThemeValueSection.positiveStyle(或 zeroStyle,negativeStyle).markerSize * value / basevalue,
  42745. * 其中 value 是 expression 所指定字段对应的值经过分级计算之后的值。默认值为0,建议通过多次尝试设置该值才能达到较好的显示效果。
  42746. */
  42747. _this.baseValue = 0;
  42748. /**
  42749. * @member {string} ThemeGraduatedSymbol.prototype.expression
  42750. * @description 用于创建等级符号专题图的字段或字段表达式,字段或字段表达式应为数值型。
  42751. */
  42752. _this.expression = null;
  42753. /**
  42754. * @member {GraduatedMode} [ThemeGraduatedSymbol.prototype.graduatedMode=GraduatedMode.CONSTANT]
  42755. * @description 等级符号专题图分级模式。<br>
  42756. * 分级主要是为了减少制作等级符号专题图中数据大小之间的差异。如果数据之间差距较大,则可以采用对数或者平方根的分级方式来进行,
  42757. * 这样就减少了数据之间的绝对大小的差异,使得等级符号图的视觉效果比较好,同时不同类别之间的比较也是有意义的。
  42758. * 有三种分级模式:常数、对数和平方根,对于有值为负数的字段,在用对数或平方根方式分级时,默认对负数取正。
  42759. * 不同的分级模式用于确定符号大小的数值是不相同的:常数按照字段的原始数据进行;对数则是对每条记录对应的专题变量取自然对数;
  42760. * 平方根则是对其取平方根,然后用最终得到的结果来确定其等级符号的大小。
  42761. */
  42762. _this.graduatedMode = GraduatedMode.CONSTAN;
  42763. /**
  42764. * @member {ThemeOffset} [ThemeGraduatedSymbol.prototype.offset]
  42765. * @description 用于设置等级符号图相对于要素内点的偏移量。
  42766. */
  42767. _this.offset = new ThemeOffset();
  42768. /**
  42769. * @member {ThemeGraduatedSymbolStyle} ThemeGraduatedSymbol.prototype.style
  42770. * @description 用于设置等级符号图正负和零值显示风格。
  42771. */
  42772. _this.style = new ThemeGraduatedSymbolStyle();
  42773. if (options) {
  42774. Util_Util.extend(ThemeGraduatedSymbol_assertThisInitialized(_this), options);
  42775. }
  42776. _this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbol";
  42777. return _this;
  42778. }
  42779. /**
  42780. * @function ThemeGraduatedSymbol.prototype.destroy
  42781. * @description 释放资源,将引用资源的属性置空。
  42782. */
  42783. ThemeGraduatedSymbol_createClass(ThemeGraduatedSymbol, [{
  42784. key: "destroy",
  42785. value: function destroy() {
  42786. ThemeGraduatedSymbol_get(ThemeGraduatedSymbol_getPrototypeOf(ThemeGraduatedSymbol.prototype), "destroy", this).call(this);
  42787. var me = this;
  42788. me.expression = null;
  42789. me.graduatedMode = GraduatedMode.CONSTANT;
  42790. if (me.offset) {
  42791. me.offset.destroy();
  42792. me.offset = null;
  42793. }
  42794. if (me.style) {
  42795. me.style.destroy();
  42796. me.style = null;
  42797. }
  42798. }
  42799. /**
  42800. * @function ThemeGraduatedSymbol.prototype.toJSON
  42801. * @description 将 themeLabel 对象转化为 JSON 字符串。
  42802. * @returns {string} 返回转换后的 JSON 字符串。
  42803. */
  42804. }, {
  42805. key: "toJSON",
  42806. value: function toJSON() {
  42807. return Util_Util.toJSON(this.toServerJSONObject());
  42808. }
  42809. /**
  42810. * @function ThemeGraduatedSymbol.prototype.toServerJSONObject
  42811. * @description 转换成对应的 JSON 格式对象。
  42812. * @returns {Object} 对应的 JSON 格式对象。
  42813. */
  42814. }, {
  42815. key: "toServerJSONObject",
  42816. value: function toServerJSONObject() {
  42817. var obj = {};
  42818. obj.type = this.type;
  42819. obj.memoryData = this.memoryData;
  42820. obj.baseValue = this.baseValue;
  42821. obj.expression = this.expression;
  42822. obj.graduatedMode = this.graduatedMode;
  42823. if (this.offset) {
  42824. obj.offsetFixed = this.offset.offsetFixed;
  42825. obj.offsetX = this.offset.offsetX;
  42826. obj.offsetY = this.offset.offsetY;
  42827. }
  42828. if (this.style) {
  42829. obj.negativeStyle = this.style.negativeStyle;
  42830. obj.negativeDisplayed = this.style.negativeDisplayed;
  42831. obj.positiveStyle = this.style.positiveStyle;
  42832. obj.zeroDisplayed = this.style.zeroDisplayed;
  42833. obj.zeroStyle = this.style.zeroStyle;
  42834. }
  42835. return obj;
  42836. }
  42837. /**
  42838. * @function ThemeGraduatedSymbol.fromObj
  42839. * @description 从传入对象获取等级符号专题图。
  42840. * @param {Object} obj - 传入对象。
  42841. * @returns {ThemeGraduatedSymbol} 等级符号专题图对象。
  42842. */
  42843. }], [{
  42844. key: "fromObj",
  42845. value: function fromObj(obj) {
  42846. if (!obj) {
  42847. return;
  42848. }
  42849. var res = new ThemeGraduatedSymbol();
  42850. Util_Util.copy(res, obj);
  42851. res.offset = ThemeOffset.fromObj(obj);
  42852. res.style = ThemeGraduatedSymbolStyle.fromObj(obj);
  42853. return res;
  42854. }
  42855. }]);
  42856. return ThemeGraduatedSymbol;
  42857. }(Theme);
  42858. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRangeItem.js
  42859. function ThemeRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42860. 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); } }
  42861. 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; }
  42862. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42863. * This program are made available under the terms of the Apache License, Version 2.0
  42864. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42865. /**
  42866. * @class ThemeRangeItem
  42867. * @deprecatedclass SuperMap.ThemeRangeItem
  42868. * @category iServer Map Theme
  42869. * @classdesc 范围分段专题图子项类。在分段专题图中,字段值按照某种分段模式被分成多个范围段,
  42870. * 每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  42871. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为[start, end)。
  42872. * @param {Object} options - 参数。
  42873. * @param {string} [options.caption] - 子项的标题。
  42874. * @param {number} [options.end=0] - 子项的终止值。
  42875. * @param {number} [options.start=0] - 子项的起始值。
  42876. * @param {ServerStyle} options.style - 子项的风格。
  42877. * @param {boolean} [options.visible=true] - 子项是否可见。
  42878. * @usage
  42879. */
  42880. var ThemeRangeItem = /*#__PURE__*/function () {
  42881. function ThemeRangeItem(options) {
  42882. ThemeRangeItem_classCallCheck(this, ThemeRangeItem);
  42883. /**
  42884. * @member {string} [ThemeRangeItem.prototype.caption]
  42885. * @description 分段专题图子项的标题。
  42886. */
  42887. this.caption = null;
  42888. /**
  42889. * @member {number} [ThemeRangeItem.prototype.end=0]
  42890. * @description 分段专题图子项的终止值,即该段专题值范围的最大值。<br>
  42891. * 如果该子项是分段中最后一个子项,则该终止值应大于分段字段(ThemeRange 类的 rangeExpression 属性)的最大值,若该终止值小于分段字段最大值,
  42892. * 则剩余部分由内部随机定义其颜色;如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常;
  42893. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  42894. */
  42895. this.end = 0;
  42896. /**
  42897. * @member {number} [ThemeRangeItem.prototype.start=0]
  42898. * @description 分段专题图子项的起始值,即该段专题值范围的最小值。<br>
  42899. * 如果该子项是分段中第一个子项,那么该起始值就是分段的最小值;如果子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  42900. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  42901. */
  42902. this.start = 0;
  42903. /**
  42904. * @member {ServerStyle} ThemeRangeItem.prototype.style
  42905. * @description 分段专题图子项的风格。
  42906. * 每一个分段专题图子项都对应一种显示风格。
  42907. */
  42908. this.style = new ServerStyle();
  42909. /**
  42910. * @member {boolean} [ThemeRangeItem.prototype.visible=true]
  42911. * @description 分段专题图子项是否可见。
  42912. */
  42913. this.visible = true;
  42914. if (options) {
  42915. Util_Util.extend(this, options);
  42916. }
  42917. this.CLASS_NAME = "SuperMap.ThemeRangeItem";
  42918. }
  42919. /**
  42920. * @function ThemeRangeItem.prototype.destroy
  42921. * @description 释放资源,将引用资源的属性置空。
  42922. */
  42923. ThemeRangeItem_createClass(ThemeRangeItem, [{
  42924. key: "destroy",
  42925. value: function destroy() {
  42926. var me = this;
  42927. me.caption = null;
  42928. me.end = null;
  42929. me.start = null;
  42930. if (me.style) {
  42931. me.style.destroy();
  42932. me.style = null;
  42933. }
  42934. me.visible = null;
  42935. }
  42936. /**
  42937. * @function ThemeRangeItem.prototypetoServerJSONObject
  42938. * @description 转换成对应的 JSON 格式对象。
  42939. * @returns {Object} 对应的 JSON 格式对象。
  42940. */
  42941. }, {
  42942. key: "toServerJSONObject",
  42943. value: function toServerJSONObject() {
  42944. var obj = {};
  42945. obj = Util_Util.copyAttributes(obj, this);
  42946. if (obj.style) {
  42947. if (obj.style.toServerJSONObject) {
  42948. obj.style = obj.style.toServerJSONObject();
  42949. }
  42950. }
  42951. return obj;
  42952. }
  42953. /**
  42954. * @function ThemeRangeItem.fromObj
  42955. * @description 从传入对象获取范围分段专题图子项类。
  42956. * @param {Object} obj - 传入对象。
  42957. * @returns {ThemeRangeItem} ThemeRangeItem 对象。
  42958. */
  42959. }], [{
  42960. key: "fromObj",
  42961. value: function fromObj(obj) {
  42962. if (!obj) {
  42963. return;
  42964. }
  42965. var res = new ThemeRangeItem();
  42966. Util_Util.copy(res, obj);
  42967. res.style = ServerStyle.fromJson(obj.style);
  42968. return res;
  42969. }
  42970. }]);
  42971. return ThemeRangeItem;
  42972. }();
  42973. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRange.js
  42974. 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); }
  42975. function ThemeRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  42976. 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); } }
  42977. 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; }
  42978. 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); }
  42979. function ThemeRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeRange_getPrototypeOf(object); if (object === null) break; } return object; }
  42980. 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); }
  42981. 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); }
  42982. 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); }; }
  42983. 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); }
  42984. function ThemeRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  42985. 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; } }
  42986. function ThemeRange_getPrototypeOf(o) { ThemeRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeRange_getPrototypeOf(o); }
  42987. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  42988. * This program are made available under the terms of the Apache License, Version 2.0
  42989. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  42990. /**
  42991. * @class ThemeRange
  42992. * @deprecatedclass SuperMap.ThemeRange
  42993. * @category iServer Map Theme
  42994. * @classdesc 范围分段专题图。
  42995. * 范围分段专题图是按照指定的分段方法(如:等距离分段法)对字段的属性值进行分段,使用不同的颜色或符号(线型、填充)表示不同范围段落的属性值在整体上的分布情况,体现区域的差异。
  42996. * 在分段专题图中,专题值按照某种分段方式被分成多个范围段,要素根据各自的专题值被分配到其中一个范围段中,在同一个范围段中的要素使用相同的颜色,填充,符号等风格进行显示。
  42997. * 分段专题图所基于的专题变量必须为数值型,分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
  42998. * @extends {CommonTheme}
  42999. * @param {Object} options - 参数。
  43000. * @param {Array.<ThemeRangeItem>} options.items - 子项数组。
  43001. * @param {string} options.rangeExpression - 分段字段表达式。
  43002. * @param {number} options.rangeParameter - 分段参数。
  43003. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 分段模式。
  43004. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  43005. * @param {ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  43006. * @usage
  43007. */
  43008. var ThemeRange = /*#__PURE__*/function (_Theme) {
  43009. ThemeRange_inherits(ThemeRange, _Theme);
  43010. var _super = ThemeRange_createSuper(ThemeRange);
  43011. function ThemeRange(options) {
  43012. var _this;
  43013. ThemeRange_classCallCheck(this, ThemeRange);
  43014. _this = _super.call(this, "RANGE", options);
  43015. /**
  43016. * @member {string} ThemeRange.prototype.precision
  43017. * @description 精准度。
  43018. */
  43019. _this.precision = '1.0E-12';
  43020. /**
  43021. * @member {Array.<ThemeRangeItem>} ThemeRange.prototype.items
  43022. * @description 分段专题图子项数组。<br>
  43023. * 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  43024. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为 [start, end)。
  43025. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按照您设置的值对分段结果进行调整。
  43026. */
  43027. _this.items = null;
  43028. /**
  43029. * @member {string} ThemeRange.prototype.rangeExpression
  43030. * @description 分段字段表达式。<br>
  43031. * 由于范围分段专题图基于各种分段方法根据一定的距离进行分段,因而范围分段专题图所基于的字段值的数据类型必须为数值型。对于字段表达式,只能为数值型的字段间的运算。
  43032. */
  43033. _this.rangeExpression = null;
  43034. /**
  43035. * @member {RangeMode} [ThemeRange.prototype.rangeMode=RangeMode.EQUALINTERVAL]
  43036. * @description 分段专题图的分段模式。<br>
  43037. * 在分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  43038. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  43039. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  43040. */
  43041. _this.rangeMode = RangeMode.EQUALINTERVAL;
  43042. /**
  43043. * @member {number} ThemeRange.prototype.rangeParameter
  43044. * @description 分段参数。
  43045. * 当分段模式为等距离分段法,平方根分段,对数分段法,等计数分段法其中一种模式时,该参数用于设置分段个数;当分段模式为标准差分段法时,
  43046. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  43047. */
  43048. _this.rangeParameter = 0;
  43049. /**
  43050. * @member {ColorGradientType} [ThemeRange.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  43051. * @description 渐变颜色枚举类。<br>
  43052. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  43053. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。但如果为某几个子项的风格进行单独设置后(设置了 {@link ThemeUniqueItem} 或 {@link ThemeRangeItem} 类中Style属性),
  43054. * 该配色方案对于这几个子项将不起作用。
  43055. */
  43056. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  43057. if (options) {
  43058. Util_Util.extend(ThemeRange_assertThisInitialized(_this), options);
  43059. }
  43060. _this.CLASS_NAME = "SuperMap.ThemeRange";
  43061. return _this;
  43062. }
  43063. /**
  43064. * @function ThemeRange.prototype.destroy
  43065. * @override
  43066. */
  43067. ThemeRange_createClass(ThemeRange, [{
  43068. key: "destroy",
  43069. value: function destroy() {
  43070. ThemeRange_get(ThemeRange_getPrototypeOf(ThemeRange.prototype), "destroy", this).call(this);
  43071. var me = this;
  43072. if (me.items) {
  43073. if (me.items.length > 0) {
  43074. for (var item in me.items) {
  43075. me.items[item].destroy();
  43076. me.items[item] = null;
  43077. }
  43078. }
  43079. me.items = null;
  43080. }
  43081. me.rangeExpression = null;
  43082. me.rangeMode = null;
  43083. me.rangeParameter = null;
  43084. me.colorGradientType = null;
  43085. }
  43086. /**
  43087. * @function ThemeRange.fromObj
  43088. * @description 从传入对象获取范围分段专题图类。
  43089. * @param {Object} obj - 传入对象。
  43090. * @returns {ThemeRange} ThemeRange 对象。
  43091. */
  43092. }], [{
  43093. key: "fromObj",
  43094. value: function fromObj(obj) {
  43095. if (!obj) {
  43096. return;
  43097. }
  43098. var res = new ThemeRange();
  43099. Util_Util.copy(res, obj);
  43100. var itemsR = obj.items;
  43101. var len = itemsR ? itemsR.length : 0;
  43102. res.items = [];
  43103. for (var i = 0; i < len; i++) {
  43104. res.items.push(ThemeRangeItem.fromObj(itemsR[i]));
  43105. }
  43106. return res;
  43107. }
  43108. }]);
  43109. return ThemeRange;
  43110. }(Theme);
  43111. ;// CONCATENATED MODULE: ./src/common/iServer/UGCLayer.js
  43112. function UGCLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43113. 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); } }
  43114. 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; }
  43115. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43116. * This program are made available under the terms of the Apache License, Version 2.0
  43117. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43118. /**
  43119. * @class UGCLayer
  43120. * @deprecatedclass SuperMap.UGCLayer
  43121. * @category iServer Map Layer
  43122. * @classdesc SuperMap 图层类。
  43123. * @param {Object} options - 参数。
  43124. * @param {Bounds} options.bounds - 图层范围。
  43125. * @param {string} options.name - 图层的名称。
  43126. * @param {UGCLayerType} options.type - 图层类型。
  43127. * @param {string} [options.caption] - 图层的标题。
  43128. * @param {string} [options.description] - 图层的描述信息。
  43129. * @param {boolean} [options.queryable] - 图层中的对象是否可以查询。
  43130. * @param {boolean} [options.subUGCLayers] - 是否允许图层的符号大小随图缩放。
  43131. * @param {boolean} [options.visible=false] - 地图对象在同一范围内时,是否重叠显示。
  43132. * @usage
  43133. */
  43134. var UGCLayer = /*#__PURE__*/function () {
  43135. function UGCLayer(options) {
  43136. UGCLayer_classCallCheck(this, UGCLayer);
  43137. options = options || {};
  43138. /**
  43139. * @member {Bounds} UGCLayer.prototype.bounds
  43140. * @description 图层范围。
  43141. */
  43142. this.bounds = null;
  43143. /**
  43144. * @member {string} [UGCLayer.prototype.caption]
  43145. * @description 图层的标题。默认情况下图层的标题与图层的名称一致。在图例、图层控制列表中显示的图层名称就是该图层的标题值。
  43146. */
  43147. this.caption = null;
  43148. /**
  43149. * @member {string} UGCLayer.prototype.description
  43150. * @description 图层的描述信息。
  43151. */
  43152. this.description = null;
  43153. /**
  43154. * @member {string} UGCLayer.prototype.name
  43155. * @description 图层的名称。图层的名称在图层所在的地图中唯一标识此图层。该属性区分大小写。
  43156. */
  43157. this.name = null;
  43158. /**
  43159. * @member {boolean} UGCLayer.prototype.queryable
  43160. * @description 图层中的对象是否可以查询。
  43161. */
  43162. this.queryable = null;
  43163. /**
  43164. * @member {Array} UGCLayer.prototype.subLayers
  43165. * @description 子图层集。
  43166. */
  43167. this.subLayers = null;
  43168. /**
  43169. * @member {UGCLayerType} UGCLayer.prototype.type
  43170. * @description 图层类型。
  43171. */
  43172. this.type = null;
  43173. /**
  43174. * @member {boolean} UGCLayer.prototype.visible
  43175. * @description 地图对象在同一范围内时,是否重叠显示。
  43176. */
  43177. this.visible = null;
  43178. Util_Util.extend(this, options);
  43179. this.CLASS_NAME = "SuperMap.UGCLayer";
  43180. }
  43181. /**
  43182. * @function UGCLayer.prototype.destroy
  43183. * @description 释放资源,将引用资源的属性置空。
  43184. */
  43185. UGCLayer_createClass(UGCLayer, [{
  43186. key: "destroy",
  43187. value: function destroy() {
  43188. var me = this;
  43189. Util_Util.reset(me);
  43190. }
  43191. /**
  43192. * @function UGCLayer.prototype.fromJson
  43193. * @description 将服务端 JSON 对象转换成当前客户端对象。
  43194. * @param {Object} jsonObject - 要转换的 JSON 对象。
  43195. */
  43196. }, {
  43197. key: "fromJson",
  43198. value: function fromJson(jsonObject) {
  43199. jsonObject = jsonObject ? jsonObject : {};
  43200. Util_Util.extend(this, jsonObject);
  43201. var b = this.bounds;
  43202. if (b) {
  43203. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  43204. }
  43205. }
  43206. /**
  43207. * @function UGCLayer.prototype.toServerJSONObject
  43208. * @description 转换成对应的 JSON 格式对象。
  43209. * @returns {Object} 对应的 JSON 格式对象。
  43210. */
  43211. }, {
  43212. key: "toServerJSONObject",
  43213. value: function toServerJSONObject() {
  43214. var jsonObject = {};
  43215. jsonObject = Util_Util.copyAttributes(jsonObject, this);
  43216. if (jsonObject.bounds) {
  43217. if (jsonObject.bounds.toServerJSONObject) {
  43218. jsonObject.bounds = jsonObject.bounds.toServerJSONObject();
  43219. }
  43220. }
  43221. return jsonObject;
  43222. }
  43223. }]);
  43224. return UGCLayer;
  43225. }();
  43226. ;// CONCATENATED MODULE: ./src/common/iServer/UGCMapLayer.js
  43227. 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); }
  43228. function UGCMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43229. 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); } }
  43230. 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; }
  43231. 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); }
  43232. function UGCMapLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCMapLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  43233. 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); }
  43234. 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); }
  43235. 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); }; }
  43236. 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); }
  43237. function UGCMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43238. 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; } }
  43239. function UGCMapLayer_getPrototypeOf(o) { UGCMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCMapLayer_getPrototypeOf(o); }
  43240. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43241. * This program are made available under the terms of the Apache License, Version 2.0
  43242. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43243. /**
  43244. * @class UGCMapLayer
  43245. * @deprecatedclass SuperMap.UGCMapLayer
  43246. * @category iServer Map Layer
  43247. * @classdesc SuperMap 地图图层类。
  43248. * @extends {UGCLayer}
  43249. * @param {Object} options - 可选参数。
  43250. * @param {boolean} [options.completeLineSymbolDisplayed] - 是否显示完整线型。
  43251. * @param {number} [options.maxScale] - 地图最大比例尺。
  43252. * @param {number} [options.minScale] - 地图最小比例尺。
  43253. * @param {number} [options.minVisibleGeometrySize] - 几何对象的最小可见大小,以像素为单位。
  43254. * @param {number} [options.opaqueRate] - 图层的不透明度。
  43255. * @param {boolean} [options.symbolScalable] - 是否允许图层的符号大小随图缩放。
  43256. * @param {number} [options.symbolScale] - 图层的符号缩放基准比例尺。
  43257. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
  43258. * @param {OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 地图的压盖过滤显示选项,当overlapDisplayed 为 false 时有效。
  43259. * @usage
  43260. */
  43261. var UGCMapLayer = /*#__PURE__*/function (_UGCLayer) {
  43262. UGCMapLayer_inherits(UGCMapLayer, _UGCLayer);
  43263. var _super = UGCMapLayer_createSuper(UGCMapLayer);
  43264. function UGCMapLayer(options) {
  43265. var _this;
  43266. UGCMapLayer_classCallCheck(this, UGCMapLayer);
  43267. options = options || {};
  43268. _this = _super.call(this, options);
  43269. /**
  43270. * @member {boolean} UGCMapLayer.prototype.completeLineSymbolDisplayed
  43271. * @description 是否显示完整线型。
  43272. */
  43273. _this.completeLineSymbolDisplayed = null;
  43274. /**
  43275. * @member {number} UGCMapLayer.prototype.maxScale
  43276. * @description 地图最大比例尺。
  43277. */
  43278. _this.maxScale = null;
  43279. /**
  43280. * @member {number} UGCMapLayer.prototype.minScale
  43281. * @description 地图最小比例尺。
  43282. */
  43283. _this.minScale = null;
  43284. /**
  43285. * @member {number} UGCMapLayer.prototype.minVisibleGeometrySize
  43286. * @description 几何对象的最小可见大小,以像素为单位。
  43287. */
  43288. _this.minVisibleGeometrySize = null;
  43289. /**
  43290. * @member {number} UGCMapLayer.prototype.opaqueRate
  43291. * @description 图层的不透明度。
  43292. */
  43293. _this.opaqueRate = null;
  43294. /**
  43295. * @member {boolean} UGCMapLayer.prototype.symbolScalable
  43296. * @description 是否允许图层的符号大小随图缩放。
  43297. */
  43298. _this.symbolScalable = null;
  43299. /**
  43300. * @member {number} UGCMapLayer.prototype.symbolScale
  43301. * @description 图层的符号缩放基准比例尺。
  43302. */
  43303. _this.symbolScale = null;
  43304. /**
  43305. * @member {boolean} [UGCMapLayer.prototype.overlapDisplayed=false]
  43306. * @description 地图对象在同一范围内时,是否重叠显示。
  43307. */
  43308. _this.overlapDisplayed = null;
  43309. /**
  43310. * @member {OverlapDisplayedOptions} UGCMapLayer.prototype.overlapDisplayedOptions
  43311. * @description 地图的压盖过滤显示选项,当 overlapDisplayed 为 false 时有效。
  43312. */
  43313. _this.overlapDisplayedOptions = null;
  43314. _this.CLASS_NAME = "SuperMap.UGCMapLayer";
  43315. return _this;
  43316. }
  43317. /**
  43318. * @function UGCMapLayer.prototype.destroy
  43319. * @override
  43320. */
  43321. UGCMapLayer_createClass(UGCMapLayer, [{
  43322. key: "destroy",
  43323. value: function destroy() {
  43324. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "destroy", this).call(this);
  43325. Util_Util.reset(this);
  43326. }
  43327. /**
  43328. * @function UGCMapLayer.prototype.fromJson
  43329. * @description 将服务端 JSON 对象转换成当前客户端对象。
  43330. * @param {Object} jsonObject - 要转换的 JSON 对象。
  43331. */
  43332. }, {
  43333. key: "fromJson",
  43334. value: function fromJson(jsonObject) {
  43335. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "fromJson", this).call(this, jsonObject);
  43336. }
  43337. /**
  43338. * @function UGCMapLayer.prototype.toServerJSONObject
  43339. * @description 转换成对应的 JSON 格式对象。
  43340. * @returns {Object} 对应的 JSON 格式对象。
  43341. */
  43342. }, {
  43343. key: "toServerJSONObject",
  43344. value: function toServerJSONObject() {
  43345. return UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "toServerJSONObject", this).call(this);
  43346. }
  43347. }]);
  43348. return UGCMapLayer;
  43349. }(UGCLayer);
  43350. ;// CONCATENATED MODULE: ./src/common/iServer/JoinItem.js
  43351. function JoinItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43352. 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); } }
  43353. 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; }
  43354. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43355. * This program are made available under the terms of the Apache License, Version 2.0
  43356. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43357. /**
  43358. * @class JoinItem
  43359. * @deprecatedclass SuperMap.JoinItem
  43360. * @category iServer Data FeatureResults
  43361. * @classdesc 连接信息类。
  43362. * 该类用于矢量数据集与外部表的连接。外部表可以为另一个矢量数据集(其中纯属性数据集中没有空间几何信息)所对应的 DBMS 表,也可以是用户自建的业务表。
  43363. * 需要注意的是,矢量数据集与外部表必须属于同一数据源。表之间的联系的建立有两种方式,一种是连接(join),一种是关联(link)。
  43364. * 连接,实际上是依据相同的字段将一个外部表追加到指定的表;而关联是基于一个相同的字段定义了两个表格之间的联系,但不是实际的追加。
  43365. * 用于连接两个表的字段的名称不一定相同,但类型必须一致。当两个表格之间建立了连接,通过对主表进行操作,可以对外部表进行查询,制作专题图以及分析等。
  43366. * 当两个表格之间是一对一或多对一的关系时,可以使用 join 连接。当为多对一的关系时,允许指定多个字段之间的关联。
  43367. *(注意:JoinItem 目前支持左连接和内连接,不支持全连接和右连接,UDB 引擎不支持内连接。并且用于建立连接的两个表必须在同一个数据源下。)
  43368. * @param {Object} options - 参数。
  43369. * @param {string} options.foreignTableName - 外部表的名称。
  43370. * @param {string} options.joinFilter - 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  43371. * @param {JoinType} options.joinType - 两个表之间连接类型。
  43372. * @example 下面以 SQL 查询说明 joinItem 的使用方法:
  43373. *(start code)
  43374. * function queryBySQL() {
  43375. * // 设置与外部表的连接信息
  43376. * var joinItem = new JoinItem({
  43377. * foreignTableName: "foreignTable",
  43378. * joinFilter: "foreignTable.CONTINENT = Countries.CONTINENT",
  43379. * joinType: "LEFTJOIN"
  43380. * })
  43381. * var queryParam, queryBySQLParams, queryBySQLService;
  43382. * // 设置查询参数,在查询参数中添加joinItem关联条件信息
  43383. * queryParam = new FilterParameter({
  43384. * name: "Countries@World",
  43385. * joinItems: [joinItem]
  43386. * }),
  43387. * queryBySQLParams = new QueryBySQLParameters({
  43388. * queryParams: [queryParam]
  43389. * }),
  43390. * queryBySQLService = new QueryBySQLService(url, {
  43391. * eventListeners: { "processCompleted": processCompleted, "processFailed": processFailed}
  43392. * });
  43393. * queryBySQLService.processAsync(queryBySQLParams);
  43394. * }
  43395. * function processCompleted(queryEventArgs) {//todo}
  43396. * function processFailed(e) {//todo}
  43397. * (end)
  43398. * @usage
  43399. */
  43400. var JoinItem = /*#__PURE__*/function () {
  43401. function JoinItem(options) {
  43402. JoinItem_classCallCheck(this, JoinItem);
  43403. /**
  43404. * @member {string} JoinItem.prototype.foreignTableName
  43405. * @description 外部表的名称。
  43406. * 如果外部表的名称是以 “表名@数据源名” 命名方式,则该属性只需赋值表名。
  43407. * 例如:外部表 Name@changchun,Name 为表名,changchun 为数据源名称,则该属性的赋值应为:Name。
  43408. */
  43409. this.foreignTableName = null;
  43410. /**
  43411. * @member {string} JoinItem.prototype.joinFilter
  43412. * @description 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  43413. * 例如,将房屋面数据集(Building)的 district 字段与房屋拥有者的纯属性数据集(Owner)的 region 字段相连接,
  43414. * 两个数据集对应的表名称分别为 Table_Building 和 Table_Owner,
  43415. * 则连接表达式为 Table_Building.district = Table_Owner.region。
  43416. * 当有多个字段相连接时,用 AND 将多个表达式相连。
  43417. */
  43418. this.joinFilter = null;
  43419. /**
  43420. * @member {JoinType} JoinItem.prototype.joinType
  43421. * @description 两个表之间连接类型。
  43422. * 连接类型决定了对两个表进行连接查询后返回的记录的情况。
  43423. */
  43424. this.joinType = null;
  43425. if (options) {
  43426. Util_Util.extend(this, options);
  43427. }
  43428. this.CLASS_NAME = "SuperMap.JoinItem";
  43429. }
  43430. /**
  43431. * @function JoinItem.prototype.destroy
  43432. * @description 释放资源,将引用资源的属性置空。
  43433. */
  43434. JoinItem_createClass(JoinItem, [{
  43435. key: "destroy",
  43436. value: function destroy() {
  43437. var me = this;
  43438. me.foreignTableName = null;
  43439. me.joinFilter = null;
  43440. me.joinType = null;
  43441. }
  43442. /**
  43443. * @function JoinItem.prototype.toServerJSONObject
  43444. * @description 转换成对应的 JSON 格式对象。
  43445. */
  43446. }, {
  43447. key: "toServerJSONObject",
  43448. value: function toServerJSONObject() {
  43449. var dataObj = {};
  43450. dataObj = Util_Util.copyAttributes(dataObj, this);
  43451. //joinFilter基本是个纯属性对象,这里不再做转换
  43452. return dataObj;
  43453. }
  43454. }]);
  43455. return JoinItem;
  43456. }();
  43457. ;// CONCATENATED MODULE: ./src/common/iServer/UGCSubLayer.js
  43458. 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); }
  43459. function UGCSubLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43460. 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); } }
  43461. 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; }
  43462. 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); }
  43463. function UGCSubLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCSubLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  43464. 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); }
  43465. 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); }
  43466. 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); }; }
  43467. 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); }
  43468. function UGCSubLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43469. 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; } }
  43470. function UGCSubLayer_getPrototypeOf(o) { UGCSubLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCSubLayer_getPrototypeOf(o); }
  43471. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43472. * This program are made available under the terms of the Apache License, Version 2.0
  43473. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43474. /**
  43475. * @class UGCSubLayer
  43476. * @deprecatedclass SuperMap.UGCSubLayer
  43477. * @category iServer Map Layer
  43478. * @classdesc 地图服务图层属性信息类。影像图层(Image)、专题图层(ServerTheme)、栅格图层(Grid)、矢量图层(Vector)等图层均继承该类。
  43479. * @extends {UGCMapLayer}
  43480. * @param {Object} options - 参数。
  43481. * @param {DatasetInfo} options.datasetInfo - 数据集信息。
  43482. * @param {string} [options.displayFilter] - 图层显示过滤条件。
  43483. * @param {JoinItem} [options.joinItems] - 连接信息类。
  43484. * @param {string} [options.representationField] - 存储制图表达信息的字段。
  43485. * @param {LayerType} [options.ugcLayerType] - 图层类型。
  43486. * @usage
  43487. */
  43488. var UGCSubLayer = /*#__PURE__*/function (_UGCMapLayer) {
  43489. UGCSubLayer_inherits(UGCSubLayer, _UGCMapLayer);
  43490. var _super = UGCSubLayer_createSuper(UGCSubLayer);
  43491. function UGCSubLayer(options) {
  43492. var _this;
  43493. UGCSubLayer_classCallCheck(this, UGCSubLayer);
  43494. options = options || {};
  43495. _this = _super.call(this, options);
  43496. /**
  43497. * @member {DatasetInfo} UGCSubLayer.prototype.datasetInfo
  43498. * @description 数据集信息。
  43499. */
  43500. _this.datasetInfo = null;
  43501. /**
  43502. * @member {string} UGCSubLayer.prototype.displayFilter
  43503. * @description 图层显示过滤条件。
  43504. */
  43505. _this.displayFilter = null;
  43506. /**
  43507. * @member {JoinItem} UGCSubLayer.prototype.joinItems
  43508. * @description 连接信息类。
  43509. */
  43510. _this.joinItems = null;
  43511. /**
  43512. * @member {string} UGCSubLayer.prototype.representationField
  43513. * @description 存储制图表达信息的字段。
  43514. */
  43515. _this.representationField = null;
  43516. /**
  43517. * @member {LayerType} UGCSubLayer.prototype.ugcLayerType
  43518. * @description 图层类型。
  43519. */
  43520. _this.ugcLayerType = null;
  43521. _this.CLASS_NAME = "SuperMap.UGCSubLayer";
  43522. return _this;
  43523. }
  43524. /**
  43525. * @function UGCSubLayer.prototype.fromJson
  43526. * @description 将服务端 JSON 对象转换成当前客户端对象。
  43527. * @param {Object} jsonObject - 要转换的 JSON 对象。
  43528. */
  43529. UGCSubLayer_createClass(UGCSubLayer, [{
  43530. key: "fromJson",
  43531. value: function fromJson(jsonObject) {
  43532. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "fromJson", this).call(this, jsonObject);
  43533. if (this.datasetInfo) {
  43534. this.datasetInfo = new DatasetInfo(this.datasetInfo);
  43535. }
  43536. if (this.joinItems && this.joinItems.length) {
  43537. var newJoinItems = [];
  43538. for (var i = 0; i < this.joinItems.length; i++) {
  43539. newJoinItems[i] = new JoinItem(this.joinItems[i]);
  43540. }
  43541. this.joinItems = newJoinItems;
  43542. }
  43543. }
  43544. /**
  43545. * @function UGCSubLayer.prototype.destroy
  43546. * @override
  43547. */
  43548. }, {
  43549. key: "destroy",
  43550. value: function destroy() {
  43551. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "destroy", this).call(this);
  43552. Util_Util.reset(this);
  43553. }
  43554. /**
  43555. * @function UGCSubLayer.prototype.toServerJSONObject
  43556. * @description 转换成对应的 JSON 格式对象。
  43557. * @returns {Object} 对应的 JSON 格式对象。
  43558. */
  43559. }, {
  43560. key: "toServerJSONObject",
  43561. value: function toServerJSONObject() {
  43562. var jsonObject = UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "toServerJSONObject", this).call(this);
  43563. if (jsonObject.joinItems) {
  43564. var joinItems = [];
  43565. for (var i = 0; i < jsonObject.joinItems.length; i++) {
  43566. if (jsonObject.joinItems[i].toServerJSONObject) {
  43567. joinItems[i] = jsonObject.joinItems[i].toServerJSONObject();
  43568. }
  43569. }
  43570. jsonObject.joinItems = joinItems;
  43571. }
  43572. if (jsonObject.datasetInfo) {
  43573. if (jsonObject.datasetInfo.toServerJSONObject) {
  43574. jsonObject.datasetInfo = jsonObject.datasetInfo.toServerJSONObject();
  43575. }
  43576. }
  43577. return jsonObject;
  43578. }
  43579. }]);
  43580. return UGCSubLayer;
  43581. }(UGCMapLayer);
  43582. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTheme.js
  43583. 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); }
  43584. function ServerTheme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43585. 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); } }
  43586. 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; }
  43587. 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); }
  43588. function ServerTheme_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ServerTheme_getPrototypeOf(object); if (object === null) break; } return object; }
  43589. 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); }
  43590. 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); }
  43591. 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); }; }
  43592. 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); }
  43593. function ServerTheme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43594. 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; } }
  43595. function ServerTheme_getPrototypeOf(o) { ServerTheme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServerTheme_getPrototypeOf(o); }
  43596. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43597. * This program are made available under the terms of the Apache License, Version 2.0
  43598. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43599. /**
  43600. * @class ServerTheme
  43601. * @deprecatedclass SuperMap.ServerTheme
  43602. * @category iServer Map Theme
  43603. * @classdesc SuperMap 专题图图层类。
  43604. * @extends {UGCSubLayer}
  43605. * @param {CommonTheme} theme - 专题图对象。
  43606. * @param {LonLat} themeElementPosition - 专题图元素位置。
  43607. * @usage
  43608. */
  43609. var ServerTheme = /*#__PURE__*/function (_UGCSubLayer) {
  43610. ServerTheme_inherits(ServerTheme, _UGCSubLayer);
  43611. var _super = ServerTheme_createSuper(ServerTheme);
  43612. function ServerTheme(options) {
  43613. var _this;
  43614. ServerTheme_classCallCheck(this, ServerTheme);
  43615. options = options || {};
  43616. _this = _super.call(this, options);
  43617. /**
  43618. * @member {CommonTheme} ServerTheme.prototype.theme
  43619. * @description 专题图对象。
  43620. */
  43621. _this.theme = null;
  43622. /**
  43623. * @member {LonLat} ServerTheme.prototype.themeElementPosition
  43624. * @description 专题图元素位置。
  43625. */
  43626. _this.themeElementPosition = null;
  43627. _this.CLASS_NAME = "SuperMap.ServerTheme";
  43628. return _this;
  43629. }
  43630. /**
  43631. * @function ServerTheme.prototype.destroy
  43632. * @description 释放资源,将引用资源的属性置空。
  43633. * @override
  43634. */
  43635. ServerTheme_createClass(ServerTheme, [{
  43636. key: "destroy",
  43637. value: function destroy() {
  43638. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "destroy", this).call(this);
  43639. Util_Util.reset(this);
  43640. }
  43641. /**
  43642. * @function ServerTheme.prototype.fromJson
  43643. * @description 将服务端 JSON 对象转换成当前客户端对象。
  43644. * @param {Object} jsonObject - 要转换的 JSON 对象。
  43645. */
  43646. }, {
  43647. key: "fromJson",
  43648. value: function fromJson(jsonObject) {
  43649. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "fromJson", this).call(this, jsonObject);
  43650. var themeObj = this.theme;
  43651. var themeT = themeObj && themeObj.type;
  43652. switch (themeT) {
  43653. case 'LABEL':
  43654. this.theme = ThemeLabel.fromObj(themeObj);
  43655. break;
  43656. case 'UNIQUE':
  43657. this.theme = ThemeUnique.fromObj(themeObj);
  43658. break;
  43659. case 'GRAPH':
  43660. this.theme = ThemeGraph.fromObj(themeObj);
  43661. break;
  43662. case 'DOTDENSITY':
  43663. this.theme = ThemeDotDensity.fromObj(themeObj);
  43664. break;
  43665. case 'GRADUATEDSYMBOL':
  43666. this.theme = ThemeGraduatedSymbol.fromObj(themeObj);
  43667. break;
  43668. case 'RANGE':
  43669. this.theme = ThemeRange.fromObj(themeObj);
  43670. break;
  43671. default:
  43672. break;
  43673. }
  43674. if (this.themeElementPosition) {
  43675. //待测试
  43676. this.themeElementPosition = new LonLat(this.themeElementPosition.x, this.themeElementPosition.y);
  43677. }
  43678. }
  43679. /**
  43680. * @function ServerTheme.prototype.toServerJSONObject
  43681. * @description 转换成对应的 JSON 格式对象。
  43682. */
  43683. }, {
  43684. key: "toServerJSONObject",
  43685. value: function toServerJSONObject() {
  43686. //普通属性直接赋值
  43687. var jsonObject = ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "toServerJSONObject", this).call(this);
  43688. if (jsonObject.themeElementPosition) {
  43689. if (jsonObject.themeElementPosition.toServerJSONObject) {
  43690. jsonObject.themeElementPosition = jsonObject.themeElementPosition.toServerJSONObject();
  43691. }
  43692. }
  43693. if (jsonObject.theme) {
  43694. if (jsonObject.theme.toServerJSONObject) {
  43695. jsonObject.theme = jsonObject.theme.toServerJSONObject();
  43696. }
  43697. }
  43698. return jsonObject;
  43699. }
  43700. }]);
  43701. return ServerTheme;
  43702. }(UGCSubLayer);
  43703. ;// CONCATENATED MODULE: ./src/common/iServer/Grid.js
  43704. 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); }
  43705. function Grid_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43706. 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); } }
  43707. 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; }
  43708. 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); }
  43709. function Grid_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Grid_getPrototypeOf(object); if (object === null) break; } return object; }
  43710. 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); }
  43711. 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); }
  43712. 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); }; }
  43713. 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); }
  43714. function Grid_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43715. 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; } }
  43716. function Grid_getPrototypeOf(o) { Grid_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Grid_getPrototypeOf(o); }
  43717. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43718. * This program are made available under the terms of the Apache License, Version 2.0
  43719. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43720. /**
  43721. * @class Grid
  43722. * @deprecatedclass SuperMap.Grid
  43723. * @category iServer Map Layer
  43724. * @classdesc SuperMap 栅格图层类。
  43725. * @extends {UGCSubLayer}
  43726. * @param {Object} options - 可选参数。
  43727. * @param {Array.<Object>} [options.colorDictionary] - 颜色对照表对象。
  43728. * @param {number} [options.brightness] - Grid 图层的亮度。
  43729. * @param {ColorGradientType} [options.colorGradientType] - 颜色渐变枚举。
  43730. * @param {ServerColor} [options.colors] - 颜色表对象。
  43731. * @param {number} [options.contrast] - Grid 图层的对比度。
  43732. * @param {GridType} [options.gridType] - 格网类型。
  43733. * @param {number} [options.horizontalSpacing] - 格网水平间隔大小。
  43734. * @param {boolean} [options.sizeFixed] - 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  43735. * @param {ServerStyle} [options.solidStyle] - 格网实线的样式。
  43736. * @param {ServerColor} [options.specialColor] - 栅格数据集无值数据的颜色。
  43737. * @param {number} [options.specialValue] - 图层的特殊值。
  43738. * @param {boolean} [options.specialValueTransparent] - 图层的特殊值(specialValue)所处区域是否透明。
  43739. * @param {number} [options.verticalSpacing] - 格网垂直间隔大小。
  43740. * @usage
  43741. */
  43742. var Grid = /*#__PURE__*/function (_UGCSubLayer) {
  43743. Grid_inherits(Grid, _UGCSubLayer);
  43744. var _super = Grid_createSuper(Grid);
  43745. function Grid(options) {
  43746. var _this;
  43747. Grid_classCallCheck(this, Grid);
  43748. options = options || {};
  43749. _this = _super.call(this, options);
  43750. /**
  43751. * @member {Array.<ColorDictionary>} Grid.prototype.colorDictionarys
  43752. * @description 颜色对照表对象。
  43753. */
  43754. _this.colorDictionarys = null;
  43755. /**
  43756. * @member {number} Grid.prototype.brightness
  43757. * @description Grid 图层的亮度。
  43758. */
  43759. _this.brightness = null;
  43760. /**
  43761. * @member {ColorGradientType} Grid.prototype.colorGradientType
  43762. * @description 渐变颜色枚举值。
  43763. */
  43764. _this.colorGradientType = null;
  43765. /**
  43766. * @member {ServerColor} Grid.prototype.colors
  43767. * @description 颜色表对象。
  43768. */
  43769. _this.colors = null;
  43770. /**
  43771. * @member {number} Grid.prototype.contrast
  43772. * @description Grid 图层的对比度。
  43773. */
  43774. _this.contrast = null;
  43775. /**
  43776. * @member {ServerStyle} Grid.prototype.dashStyle
  43777. * @description 栅格数据集特殊值数据的颜色。
  43778. */
  43779. _this.dashStyle = null;
  43780. /**
  43781. * @member {GridType} Grid.prototype.gridType
  43782. * @description 格网类型。
  43783. */
  43784. _this.gridType = null;
  43785. /**
  43786. * @member {number} Grid.prototype.horizontalSpacing
  43787. * @description 格网水平间隔大小。
  43788. */
  43789. _this.horizontalSpacing = null;
  43790. /**
  43791. * @member {boolean} Grid.prototype.sizeFixed
  43792. * @description 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  43793. */
  43794. _this.sizeFixed = null;
  43795. /**
  43796. * @member {ServerStyle} Grid.prototype.solidStyle
  43797. * @description 格网实线的样式。
  43798. */
  43799. _this.solidStyle = null;
  43800. /**
  43801. * @member {ServerColor} Grid.prototype.specialColor
  43802. * @description 栅格数据集无值数据的颜色。
  43803. */
  43804. _this.specialColor = null;
  43805. /**
  43806. * @member {number} Grid.prototype.specialValue
  43807. * @description 图层的特殊值。
  43808. */
  43809. _this.specialValue = null;
  43810. /**
  43811. * @member {boolean} Grid.prototype.specialValueTransparent
  43812. * @description 图层的特殊值(specialValue)所处区域是否透明。
  43813. */
  43814. _this.specialValueTransparent = null;
  43815. /**
  43816. * @member {number} Grid.prototype.verticalSpacing
  43817. * @description 格网垂直间隔大小。
  43818. */
  43819. _this.verticalSpacing = null;
  43820. _this.CLASS_NAME = "SuperMap.Grid";
  43821. return _this;
  43822. }
  43823. /**
  43824. * @function Grid.prototype.destroy
  43825. * @description 释放资源,将引用资源的属性置空。
  43826. */
  43827. Grid_createClass(Grid, [{
  43828. key: "destroy",
  43829. value: function destroy() {
  43830. Grid_get(Grid_getPrototypeOf(Grid.prototype), "destroy", this).call(this);
  43831. Util_Util.reset(this);
  43832. }
  43833. /**
  43834. * @function Grid.prototype.fromJson
  43835. * @description 将服务端 JSON 对象转换成当前客户端对象。
  43836. * @param {Object} jsonObject - 要转换的 JSON 对象。
  43837. */
  43838. }, {
  43839. key: "fromJson",
  43840. value: function fromJson(jsonObject) {
  43841. Grid_get(Grid_getPrototypeOf(Grid.prototype), "fromJson", this).call(this, jsonObject);
  43842. if (this.specialColor) {
  43843. this.specialColor = new ServerColor(this.specialColor.red, this.specialColor.green, this.specialColor.blue);
  43844. }
  43845. if (this.colors) {
  43846. var colors = [],
  43847. color;
  43848. for (var i in this.colors) {
  43849. color = this.colors[i];
  43850. colors.push(new ServerColor(color.red, color.green, color.blue));
  43851. }
  43852. this.colors = colors;
  43853. }
  43854. if (this.dashStyle) {
  43855. this.dashStyle = new ServerStyle(this.dashStyle);
  43856. }
  43857. if (this.solidStyle) {
  43858. this.solidStyle = new ServerStyle(this.solidStyle);
  43859. }
  43860. if (this.colorDictionary) {
  43861. var colorDics = [],
  43862. colorDic;
  43863. for (var key in this.colorDictionary) {
  43864. colorDic = this.colorDictionary[key];
  43865. colorDics.push(new ColorDictionary({
  43866. elevation: key,
  43867. color: colorDic
  43868. }));
  43869. }
  43870. this.colorDictionarys = colorDics;
  43871. }
  43872. delete this.colorDictionary;
  43873. }
  43874. /**
  43875. * @function Grid.prototype.toServerJSONObject
  43876. * @description 转换成对应的 JSON 对象。
  43877. * @returns JSON 对象。
  43878. */
  43879. }, {
  43880. key: "toServerJSONObject",
  43881. value: function toServerJSONObject() {
  43882. var jsonObject = Grid_get(Grid_getPrototypeOf(Grid.prototype), "toServerJSONObject", this).call(this);
  43883. if (jsonObject.dashStyle) {
  43884. if (jsonObject.dashStyle.toServerJSONObject) {
  43885. jsonObject.dashStyle = jsonObject.dashStyle.toServerJSONObject();
  43886. }
  43887. }
  43888. if (jsonObject.solidStyle) {
  43889. if (jsonObject.solidStyle.toServerJSONObject) {
  43890. jsonObject.solidStyle = jsonObject.solidStyle.toServerJSONObject();
  43891. }
  43892. }
  43893. return jsonObject;
  43894. }
  43895. }]);
  43896. return Grid;
  43897. }(UGCSubLayer);
  43898. ;// CONCATENATED MODULE: ./src/common/iServer/Image.js
  43899. 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); }
  43900. function Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  43901. 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); } }
  43902. 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; }
  43903. 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); }
  43904. function Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Image_getPrototypeOf(object); if (object === null) break; } return object; }
  43905. 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); }
  43906. 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); }
  43907. 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); }; }
  43908. 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); }
  43909. function Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  43910. 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; } }
  43911. function Image_getPrototypeOf(o) { Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Image_getPrototypeOf(o); }
  43912. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  43913. * This program are made available under the terms of the Apache License, Version 2.0
  43914. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  43915. /**
  43916. * @class UGCImage
  43917. * @deprecatedclass SuperMap.Image
  43918. * @category iServer Map Layer
  43919. * @classdesc SuperMap 影像图层类
  43920. * @extends {UGCSubLayer}
  43921. * @param {Object} options - 可选参数。
  43922. * @param {ColorSpaceType} [options.colorSpaceType] - 返回影像图层的色彩显示模式。
  43923. * @param {number} [options.brightness] - 影像图层的亮度。
  43924. * @param {Array.<number>} [options.displayBandIndexes] - 返回当前影像图层显示的波段索引。
  43925. * @param {number} [options.contrast] - 影像图层的对比度。
  43926. * @param {boolean} [options.transparent] - 是否背景透明。
  43927. * @param {ServerColor} [options.transparentColor] - 返回背景透明色。
  43928. * @param {number} [options.transparentColorTolerance] - 背景透明色容限。
  43929. * @usage
  43930. * @private
  43931. */
  43932. var UGCImage = /*#__PURE__*/function (_UGCSubLayer) {
  43933. Image_inherits(UGCImage, _UGCSubLayer);
  43934. var _super = Image_createSuper(UGCImage);
  43935. function UGCImage(options) {
  43936. var _this;
  43937. Image_classCallCheck(this, UGCImage);
  43938. options = options || {};
  43939. _this = _super.call(this, options);
  43940. /**
  43941. * @member {number} UGCImage.prototype.brightness
  43942. * @description 影像图层的亮度。
  43943. */
  43944. _this.brightness = null;
  43945. /**
  43946. * @member {ColorSpaceType} UGCImage.prototype.colorSpaceType
  43947. * @description 返回影像图层的色彩显示模式。
  43948. */
  43949. _this.colorSpaceType = null;
  43950. /**
  43951. * @member {number} UGCImage.prototype.contrast
  43952. * @description 影像图层的对比度。
  43953. */
  43954. _this.contrast = null;
  43955. /**
  43956. * @member {Array.<number>} UGCImage.prototype.displayBandIndexes
  43957. * @description 返回当前影像图层显示的波段索引。
  43958. */
  43959. _this.displayBandIndexes = null;
  43960. /**
  43961. * @member {boolean} UGCImage.prototype.transparent
  43962. * @description 是否背景透明。
  43963. */
  43964. _this.transparent = null;
  43965. /**
  43966. * @member {ServerColor} UGCImage.prototype.transparentColor
  43967. * @description 返回背景透明色。
  43968. */
  43969. _this.transparentColor = null;
  43970. /**
  43971. * @member {number} UGCImage.prototype.transparentColorTolerance
  43972. * @description 背景透明色容限。
  43973. */
  43974. _this.transparentColorTolerance = null;
  43975. _this.CLASS_NAME = "SuperMap.Image";
  43976. return _this;
  43977. }
  43978. /**
  43979. * @function UGCImage.prototype.destroy
  43980. * @override
  43981. */
  43982. Image_createClass(UGCImage, [{
  43983. key: "destroy",
  43984. value: function destroy() {
  43985. Image_get(Image_getPrototypeOf(UGCImage.prototype), "destroy", this).call(this);
  43986. Util_Util.reset(this);
  43987. }
  43988. /**
  43989. * @function UGCImage.prototype.fromJson
  43990. * @description 将服务端 JSON 对象转换成当前客户端对象。
  43991. * @param {Object} jsonObject - 要转换的 JSON 对象。
  43992. */
  43993. }, {
  43994. key: "fromJson",
  43995. value: function fromJson(jsonObject) {
  43996. Image_get(Image_getPrototypeOf(UGCImage.prototype), "fromJson", this).call(this, jsonObject);
  43997. if (this.transparentColor) {
  43998. this.transparentColor = new ServerColor(this.transparentColor.red, this.transparentColor.green, this.transparentColor.blue);
  43999. }
  44000. }
  44001. /**
  44002. * @function UGCImage.prototype.toServerJSONObject
  44003. * @description 转换成对应的 JSON 格式对象。
  44004. */
  44005. }, {
  44006. key: "toServerJSONObject",
  44007. value: function toServerJSONObject() {
  44008. return Image_get(Image_getPrototypeOf(UGCImage.prototype), "toServerJSONObject", this).call(this);
  44009. }
  44010. }]);
  44011. return UGCImage;
  44012. }(UGCSubLayer);
  44013. ;// CONCATENATED MODULE: ./src/common/iServer/Vector.js
  44014. 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); }
  44015. function iServer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44016. 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); } }
  44017. 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; }
  44018. 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); }
  44019. function iServer_Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = iServer_Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  44020. 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); }
  44021. 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); }
  44022. 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); }; }
  44023. 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); }
  44024. function iServer_Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44025. 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; } }
  44026. 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); }
  44027. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44028. * This program are made available under the terms of the Apache License, Version 2.0
  44029. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44030. /**
  44031. * @class Vector
  44032. * @deprecatedclass SuperMap.Vector
  44033. * @category iServer Map Layer
  44034. * @classdesc SuperMap 矢量图层类。
  44035. * @extends {UGCSubLayer}
  44036. * @param {Object} options - 可选参数。
  44037. * @param {ServerStyle} [options.style] - 矢量图层的风格。
  44038. * @usage
  44039. */
  44040. var Vector_Vector = /*#__PURE__*/function (_UGCSubLayer) {
  44041. iServer_Vector_inherits(Vector, _UGCSubLayer);
  44042. var _super = iServer_Vector_createSuper(Vector);
  44043. function Vector(options) {
  44044. var _this;
  44045. iServer_Vector_classCallCheck(this, Vector);
  44046. options = options || {};
  44047. _this = _super.call(this, options);
  44048. /**
  44049. * @member {ServerStyle} Vector.prototype.style
  44050. * @description 矢量图层的风格。
  44051. */
  44052. _this.style = null;
  44053. _this.CLASS_NAME = "SuperMap.Vector";
  44054. return _this;
  44055. }
  44056. /**
  44057. * @function Vector.prototype.destroy
  44058. * @description 销毁对象,将其属性置空。
  44059. * @override
  44060. */
  44061. iServer_Vector_createClass(Vector, [{
  44062. key: "destroy",
  44063. value: function destroy() {
  44064. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  44065. Util_Util.reset(this);
  44066. }
  44067. /**
  44068. * @function Vector.prototype.fromJson
  44069. * @description 将服务端 JSON 对象转换成当前客户端对象。
  44070. * @param {Object} jsonObject - 要转换的 JSON 对象。
  44071. */
  44072. }, {
  44073. key: "fromJson",
  44074. value: function fromJson(jsonObject) {
  44075. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "fromJson", this).call(this, jsonObject);
  44076. var sty = this.style;
  44077. if (sty) {
  44078. this.style = new ServerStyle(sty);
  44079. }
  44080. }
  44081. /**
  44082. * @function Vector.prototype.toServerJSONObject
  44083. * @description 转换成对应的 JSON 格式对象。
  44084. * @returns {Object} 对应的 JSON 格式对象
  44085. */
  44086. }, {
  44087. key: "toServerJSONObject",
  44088. value: function toServerJSONObject() {
  44089. var jsonObject = iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "toServerJSONObject", this).call(this);
  44090. if (jsonObject.style) {
  44091. if (jsonObject.style.toServerJSONObject) {
  44092. jsonObject.style = jsonObject.style.toServerJSONObject();
  44093. }
  44094. }
  44095. return jsonObject;
  44096. }
  44097. }]);
  44098. return Vector;
  44099. }(UGCSubLayer);
  44100. ;// CONCATENATED MODULE: ./src/common/iServer/GetLayersInfoService.js
  44101. 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); }
  44102. function GetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44103. 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); } }
  44104. 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; }
  44105. 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); }
  44106. function GetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  44107. 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); }
  44108. 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); }
  44109. 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); }; }
  44110. 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); }
  44111. function GetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44112. 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; } }
  44113. function GetLayersInfoService_getPrototypeOf(o) { GetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetLayersInfoService_getPrototypeOf(o); }
  44114. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44115. * This program are made available under the terms of the Apache License, Version 2.0
  44116. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44117. /**
  44118. * @class GetLayersInfoService
  44119. * @deprecatedclass SuperMap.GetLayersInfoService
  44120. * @category iServer Map Layer
  44121. * @classdesc 获取图层信息服务类构造函数。
  44122. * @extends {CommonServiceBase}
  44123. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  44124. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  44125. * 如 http://localhost:8090/iserver/services/map-world/rest/maps/World 。
  44126. * 如果查询临时图层的信息,请指定完成的url,包含临时图层ID信息,如:
  44127. * http://localhost:8090/iserver/services/map-world/rest/maps/World/tempLayersSet/resourceID
  44128. * @param {Object} options - 参数。
  44129. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  44130. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  44131. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  44132. * @param {Object} [options.headers] - 请求头。
  44133. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  44134. * @usage
  44135. */
  44136. var GetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  44137. GetLayersInfoService_inherits(GetLayersInfoService, _CommonServiceBase);
  44138. var _super = GetLayersInfoService_createSuper(GetLayersInfoService);
  44139. function GetLayersInfoService(url, options) {
  44140. var _this;
  44141. GetLayersInfoService_classCallCheck(this, GetLayersInfoService);
  44142. _this = _super.call(this, url, options);
  44143. /**
  44144. * @member {boolean} GetLayersInfoService.prototype.isTempLayers
  44145. * @description 当前url对应的图层是否是临时图层。
  44146. */
  44147. _this.isTempLayers = false;
  44148. if (options) {
  44149. Util_Util.extend(GetLayersInfoService_assertThisInitialized(_this), options);
  44150. }
  44151. _this.CLASS_NAME = "SuperMap.GetLayersInfoService";
  44152. return _this;
  44153. }
  44154. /**
  44155. * @function GetLayersInfoService.prototype.destroy
  44156. * @override
  44157. */
  44158. GetLayersInfoService_createClass(GetLayersInfoService, [{
  44159. key: "destroy",
  44160. value: function destroy() {
  44161. GetLayersInfoService_get(GetLayersInfoService_getPrototypeOf(GetLayersInfoService.prototype), "destroy", this).call(this);
  44162. Util_Util.reset(this);
  44163. }
  44164. /**
  44165. * @function GetLayersInfoService.prototype.processAsync
  44166. * @description 负责将客户端的更新参数传递到服务端。
  44167. */
  44168. }, {
  44169. key: "processAsync",
  44170. value: function processAsync() {
  44171. var me = this,
  44172. method = "GET";
  44173. if (!me.isTempLayers) {
  44174. me.url = Util_Util.urlPathAppend(me.url, 'layers');
  44175. }
  44176. me.request({
  44177. method: method,
  44178. params: null,
  44179. scope: me,
  44180. success: me.serviceProcessCompleted,
  44181. failure: me.serviceProcessFailed
  44182. });
  44183. }
  44184. /**
  44185. * @function GetLayersInfoService.prototype.serviceProcessCompleted
  44186. * @description 编辑完成,执行此方法。
  44187. * @param {Object} result - 服务器返回的结果对象。
  44188. */
  44189. }, {
  44190. key: "serviceProcessCompleted",
  44191. value: function serviceProcessCompleted(result, options) {
  44192. var me = this,
  44193. existRes,
  44194. layers,
  44195. len;
  44196. result = Util_Util.transformResult(result);
  44197. existRes = !!result && result.length > 0;
  44198. layers = existRes ? result[0].subLayers.layers : null;
  44199. len = layers ? layers.length : 0;
  44200. me.handleLayers(len, layers);
  44201. me.events.triggerEvent("processCompleted", {
  44202. result: result[0],
  44203. options: options
  44204. });
  44205. }
  44206. /**
  44207. * TODO 专题图时候可能会用到
  44208. * @function GetLayersInfoService.prototype.handleLayers
  44209. * @description 处理 iServer 新增图层组数据 (subLayers.layers 中可能还会含有 subLayers.layers)
  44210. * @param {number} len - subLayers.layers的长度
  44211. * @param {Array.<number>} layers - subLayers.layers的长度数组
  44212. */
  44213. }, {
  44214. key: "handleLayers",
  44215. value: function handleLayers(len, layers) {
  44216. var me = this,
  44217. tempLayer;
  44218. if (len) {
  44219. for (var i = 0; i < len; i++) {
  44220. if (layers[i].subLayers && layers[i].subLayers.layers && layers[i].subLayers.layers.length > 0) {
  44221. me.handleLayers(layers[i].subLayers.layers.length, layers[i].subLayers.layers);
  44222. } else {
  44223. var type = layers[i].ugcLayerType;
  44224. switch (type) {
  44225. case 'THEME':
  44226. tempLayer = new ServerTheme();
  44227. tempLayer.fromJson(layers[i]);
  44228. layers[i] = tempLayer;
  44229. break;
  44230. case 'GRID':
  44231. tempLayer = new Grid();
  44232. tempLayer.fromJson(layers[i]);
  44233. layers[i] = tempLayer;
  44234. break;
  44235. case 'IMAGE':
  44236. tempLayer = new UGCImage();
  44237. tempLayer.fromJson(layers[i]);
  44238. layers[i] = tempLayer;
  44239. break;
  44240. case 'VECTOR':
  44241. tempLayer = new Vector_Vector();
  44242. tempLayer.fromJson(layers[i]);
  44243. layers[i] = tempLayer;
  44244. break;
  44245. default:
  44246. break;
  44247. }
  44248. }
  44249. }
  44250. }
  44251. }
  44252. }]);
  44253. return GetLayersInfoService;
  44254. }(CommonServiceBase);
  44255. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystParameters.js
  44256. function InterpolationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44257. 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); } }
  44258. 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; }
  44259. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44260. * This program are made available under the terms of the Apache License, Version 2.0
  44261. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44262. /**
  44263. * @class InterpolationAnalystParameters
  44264. * @deprecatedclass SuperMap.InterpolationAnalystParameters
  44265. * @category iServer SpatialAnalyst InterpolationAnalyst
  44266. * @classdesc 插值分析参数类。
  44267. * @param {Object} options - 参数。
  44268. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  44269. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  44270. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  44271. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。
  44272. * @param {string} [options.dataset] - 待分析的数据集名称。当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  44273. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  44274. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  44275. * @param {number} [options.zValueScale=1] - 进行插值分析值的缩放比率。
  44276. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  44277. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  44278. * @param {PixelFormat} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  44279. * @param {string} [options.InterpolationAnalystType="dataset"] - 插值分析类型("dataset" 或 "geometry")。
  44280. * @usage
  44281. */
  44282. var InterpolationAnalystParameters = /*#__PURE__*/function () {
  44283. function InterpolationAnalystParameters(options) {
  44284. InterpolationAnalystParameters_classCallCheck(this, InterpolationAnalystParameters);
  44285. if (!options) {
  44286. return;
  44287. }
  44288. /**
  44289. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} InterpolationAnalystParameters.prototype.bounds
  44290. * @description 插值分析的范围,用于确定结果栅格数据集的范围。
  44291. * 如果缺省,则默认为原数据集的范围。鉴于此插值方法为内插方法,原数据集的范围内的插值结果才相对有参考价值,
  44292. * 因此建议此参数不大于原数据集范围。
  44293. */
  44294. this.bounds = null;
  44295. /**
  44296. * @member {number} [InterpolationAnalystParameters.prototype.searchRadius=0]
  44297. * @description 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  44298. * 计算某个位置的 Z 值时,会以该位置为圆心,以查找范围的值为半径,落在这个范围内的采样点都将参与运算。
  44299. * 该值需要根据待插值点数据的分布状况和点数据集范围进行设置。
  44300. */
  44301. this.searchRadius = 0;
  44302. /**
  44303. * @member {string} InterpolationAnalystParameters.prototype.zValueFieldName
  44304. * @description 数据集插值分析中,用于指定进行插值分析的目标字段名,插值分析不支持文本类型的字段。
  44305. * 含义为每个插值点在插值过程中的权重,可以将所有点此字段值设置为 1,即所有点在整体插值中权重相同。
  44306. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  44307. */
  44308. this.zValueFieldName = null;
  44309. /**
  44310. * @member {number} [InterpolationAnalystParameters.prototype.zValueScale=1]
  44311. * @description 用于进行插值分析值的缩放比率。
  44312. * 参加插值分析的值将乘以该参数值后再进行插值,也就是对进行插值分析的值进行统一的扩大或缩小。
  44313. */
  44314. this.zValueScale = 1;
  44315. /**
  44316. * @member {number} InterpolationAnalystParameters.prototype.resolution
  44317. * @description 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  44318. * 该值不能超过待分析数据集的范围边长。
  44319. * 且该值设置时,应该考虑点数据集范围大小来取值,一般为结果栅格行列值(即结果栅格数据集范围除以分辨率),在 500 以内可以较好地体现密度走势。
  44320. */
  44321. this.resolution = null;
  44322. /**
  44323. * @member {FilterParameter} [InterpolationAnalystParameters.prototype.filterQueryParameter]
  44324. * @description 过滤条件,对分析数据集中的点进行过滤,设置为 null 表示对数据集中的所有点进行分析。
  44325. */
  44326. this.filterQueryParameter = null;
  44327. /**
  44328. * @member {string} InterpolationAnalystParameters.prototype.outputDatasetName
  44329. * @description 插值分析结果数据集的名称。
  44330. */
  44331. this.outputDatasetName = null;
  44332. /**
  44333. * @member {string} InterpolationAnalystParameters.prototype.outputDatasourceName
  44334. * @description 插值分析结果数据源的名称。
  44335. */
  44336. this.outputDatasourceName = null;
  44337. /**
  44338. * @member {PixelFormat} [InterpolationAnalystParameters.prototype.pixelFormat]
  44339. * @description 指定结果栅格数据集存储的像素格式。支持存储的像素格式有 BIT16、BIT32、DOUBLE、SINGLE、UBIT1、UBIT4、UBIT8、UBIT24、UBIT32。
  44340. */
  44341. this.pixelFormat = null;
  44342. /**
  44343. * @member {string} [InterpolationAnalystParameters.prototype.dataset]
  44344. * @description 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。
  44345. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  44346. */
  44347. this.dataset = null;
  44348. /**
  44349. * @member {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [InterpolationAnalystParameters.prototype.inputPoints]
  44350. * @description 用于做插值分析的离散点(离散点包括Z值)集合。
  44351. * 当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  44352. * 通过离散点直接进行插值分析不需要指定输入数据集inputDatasourceName,inputDatasetName以及zValueFieldName。
  44353. */
  44354. this.inputPoints = null;
  44355. /**
  44356. * @member {string} [InterpolationAnalystParameters.prototype.InterpolationAnalystType="dataset"]
  44357. * @description 插值分析类型。插值分析包括数据集插值分析和几何插值分析两类,
  44358. * "dataset" 表示对数据集进行插值分析,"geometry" 表示对离散点数组进行插值分析。
  44359. */
  44360. this.InterpolationAnalystType = "dataset";
  44361. /**
  44362. * @member {ClipParameter} InterpolationAnalystParameters.prototype.clipParam
  44363. * @description 对插值分析结果进行裁剪的参数。
  44364. */
  44365. this.clipParam = null;
  44366. Util_Util.extend(this, options);
  44367. this.CLASS_NAME = "SuperMap.InterpolationAnalystParameters";
  44368. }
  44369. /**
  44370. * @function InterpolationAnalystParameters.prototype.destroy
  44371. * @description 释放资源,将引用资源的属性置空。
  44372. */
  44373. InterpolationAnalystParameters_createClass(InterpolationAnalystParameters, [{
  44374. key: "destroy",
  44375. value: function destroy() {
  44376. var me = this;
  44377. me.bounds = null;
  44378. me.searchRadius = null;
  44379. me.zValueFieldName = null;
  44380. me.zValueScale = null;
  44381. me.resolution = null;
  44382. me.filterQueryParameter = null;
  44383. me.outputDatasetName = null;
  44384. me.pixelFormat = null;
  44385. }
  44386. /**
  44387. * @function InterpolationAnalystParameters.toObject
  44388. * @param {InterpolationAnalystParameters} interpolationAnalystParameters - 插值分析参数类。
  44389. * @param {InterpolationAnalystParameters} tempObj - 插值分析参数对象。
  44390. * @description 将插值分析参数对象转换成 JSON 对象。
  44391. * @returns JSON 对象。
  44392. */
  44393. }], [{
  44394. key: "toObject",
  44395. value: function toObject(interpolationAnalystParameters, tempObj) {
  44396. for (var name in interpolationAnalystParameters) {
  44397. if (name === "inputPoints" && interpolationAnalystParameters.InterpolationAnalystType === "geometry") {
  44398. var objs = [];
  44399. for (var i = 0; i < interpolationAnalystParameters.inputPoints.length; i++) {
  44400. var item = interpolationAnalystParameters.inputPoints[i];
  44401. var obj = {
  44402. x: item.x,
  44403. y: item.y,
  44404. z: item.tag
  44405. };
  44406. objs.push(obj);
  44407. }
  44408. tempObj[name] = objs;
  44409. } else {
  44410. tempObj[name] = interpolationAnalystParameters[name];
  44411. }
  44412. }
  44413. }
  44414. }]);
  44415. return InterpolationAnalystParameters;
  44416. }();
  44417. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationRBFAnalystParameters.js
  44418. 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); }
  44419. function InterpolationRBFAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44420. 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); } }
  44421. 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; }
  44422. 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); }
  44423. function InterpolationRBFAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationRBFAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  44424. 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); }
  44425. 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); }
  44426. 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); }; }
  44427. 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); }
  44428. function InterpolationRBFAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44429. 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; } }
  44430. function InterpolationRBFAnalystParameters_getPrototypeOf(o) { InterpolationRBFAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationRBFAnalystParameters_getPrototypeOf(o); }
  44431. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44432. * This program are made available under the terms of the Apache License, Version 2.0
  44433. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44434. /**
  44435. * @class InterpolationRBFAnalystParameters
  44436. * @deprecatedclass SuperMap.InterpolationRBFAnalystParameters
  44437. * @category iServer SpatialAnalyst InterpolationAnalyst
  44438. * @classdesc 样条插值(径向基函数插值法)分析参数类。
  44439. * @extends {InterpolationAnalystParameters}
  44440. * @param {Object} options - 参数。
  44441. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  44442. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  44443. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  44444. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  44445. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  44446. * @param {number} [options.smooth=0.1] - 光滑系数,该值表示插值函数曲线与点的逼近程度,值域为0到1。
  44447. * @param {number} [options.tension=40] - 张力系数,用于调整结果栅格数据表面的特性。
  44448. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置参与插值运算的点数。
  44449. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  44450. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  44451. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  44452. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  44453. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  44454. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  44455. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  44456. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(InterpolationAnalystType)为 dataset 时。此为必选参数。
  44457. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。此为必选参数。
  44458. * @example
  44459. * var myInterpolationRBFAnalystParameters = new InterpolationRBFAnalystParameters({
  44460. * dataset:"SamplesP@Interpolation",
  44461. * smooth: 0.1,
  44462. * tension: 40,
  44463. * searchMode: "QUADTREE",
  44464. * maxPointCountForInterpolation: 20,
  44465. * maxPointCountInNode: 5,
  44466. * pixelFormat: "BIT16",
  44467. * zValueFieldName: "AVG_TMP",
  44468. * resolution: 3000,
  44469. * filterQueryParameter: {
  44470. * attributeFilter: ""
  44471. * },
  44472. * outputDatasetName: "myRBF"
  44473. * });
  44474. * @usage
  44475. */
  44476. var InterpolationRBFAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  44477. InterpolationRBFAnalystParameters_inherits(InterpolationRBFAnalystParameters, _InterpolationAnalyst);
  44478. var _super = InterpolationRBFAnalystParameters_createSuper(InterpolationRBFAnalystParameters);
  44479. function InterpolationRBFAnalystParameters(options) {
  44480. var _this;
  44481. InterpolationRBFAnalystParameters_classCallCheck(this, InterpolationRBFAnalystParameters);
  44482. _this = _super.call(this, options);
  44483. /**
  44484. * @member {number} [InterpolationRBFAnalystParameters.prototype.smooth=0.1]
  44485. * @description 光滑系数,值域为 0 到 1,常用取值如 0、0.001、0.01、0.1、和 0.5。
  44486. * 该值表示插值函数曲线与点的逼近程度,此数值越大,函数曲线与点的偏差越大,反之越小。
  44487. */
  44488. _this.smooth = 0.1;
  44489. /**
  44490. * @member {number} [InterpolationRBFAnalystParameters.prototype.tension=40]
  44491. * @description 张力系数,常用取值如 0、1、5 和 10。
  44492. * 用于调整结果栅格数据表面的特性,张力越大,插值时每个点对计算结果影响越小,反之越大。
  44493. */
  44494. _this.tension = 40;
  44495. /**
  44496. * @member {SearchMode} InterpolationRBFAnalystParameters.prototype.searchMode
  44497. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  44498. * 具体如下:
  44499. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  44500. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  44501. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  44502. */
  44503. _this.searchMode = null;
  44504. /**
  44505. * @member {number} [InterpolationRBFAnalystParameters.prototype.expectedCount=12]
  44506. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  44507. */
  44508. _this.expectedCount = 12;
  44509. /**
  44510. * @member {number} [InterpolationRBFAnalystParameters.prototype.maxPointCountForInterpolation=200]
  44511. * @description 【块查找】方式下,最多参与插值的点数。
  44512. */
  44513. _this.maxPointCountForInterpolation = 200;
  44514. /**
  44515. * @member {number} [InterpolationRBFAnalystParameters.prototype.maxPointCountInNode=50]
  44516. * @description 【块查找】方式下,单个块内最多参与运算点数。
  44517. */
  44518. _this.maxPointCountInNode = 50;
  44519. if (options) {
  44520. Util_Util.extend(InterpolationRBFAnalystParameters_assertThisInitialized(_this), options);
  44521. }
  44522. _this.CLASS_NAME = "SuperMap.InterpolationRBFAnalystParameters";
  44523. return _this;
  44524. }
  44525. /**
  44526. * @function InterpolationRBFAnalystParameters.prototype.destroy
  44527. * @description 释放资源,将引用资源的属性置空。
  44528. */
  44529. InterpolationRBFAnalystParameters_createClass(InterpolationRBFAnalystParameters, [{
  44530. key: "destroy",
  44531. value: function destroy() {
  44532. InterpolationRBFAnalystParameters_get(InterpolationRBFAnalystParameters_getPrototypeOf(InterpolationRBFAnalystParameters.prototype), "destroy", this).call(this);
  44533. var me = this;
  44534. me.smooth = null;
  44535. me.tension = null;
  44536. me.searchMode = null;
  44537. me.expectedCount = null;
  44538. me.maxPointCountForInterpolation = null;
  44539. me.maxPointCountInNode = null;
  44540. }
  44541. /**
  44542. * @function InterpolationRBFAnalystParameters.toObject
  44543. * @param {InterpolationRBFAnalystParameters} datasetInterpolationRBFAnalystParameters - 样条插值(径向基函数插值法)分析参数类。
  44544. * @param {InterpolationRBFAnalystParameters} tempObj - 样条插值(径向基函数插值法)分析参数对象。
  44545. * @description 将样条插值(径向基函数插值法)分析参数对象转换为 JSON 对象。
  44546. * @returns JSON 对象。
  44547. */
  44548. }], [{
  44549. key: "toObject",
  44550. value: function toObject(datasetInterpolationRBFAnalystParameters, tempObj) {
  44551. for (var name in datasetInterpolationRBFAnalystParameters) {
  44552. tempObj[name] = datasetInterpolationRBFAnalystParameters[name];
  44553. }
  44554. }
  44555. }]);
  44556. return InterpolationRBFAnalystParameters;
  44557. }(InterpolationAnalystParameters);
  44558. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationDensityAnalystParameters.js
  44559. 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); }
  44560. function InterpolationDensityAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44561. 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); } }
  44562. 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; }
  44563. 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); }
  44564. function InterpolationDensityAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationDensityAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  44565. 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); }
  44566. 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); }
  44567. 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); }; }
  44568. 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); }
  44569. function InterpolationDensityAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44570. 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; } }
  44571. function InterpolationDensityAnalystParameters_getPrototypeOf(o) { InterpolationDensityAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationDensityAnalystParameters_getPrototypeOf(o); }
  44572. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44573. * This program are made available under the terms of the Apache License, Version 2.0
  44574. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44575. /**
  44576. * @class InterpolationDensityAnalystParameters
  44577. * @deprecatedclass SuperMap.InterpolationDensityAnalystParameters
  44578. * @category iServer SpatialAnalyst InterpolationAnalyst
  44579. * @classdesc 点密度插值分析参数类。
  44580. * @param {Object} options - 参数。
  44581. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  44582. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  44583. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  44584. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  44585. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时。此为必选参数。
  44586. * @param {number} [options.zValueScale=1] - 进行插值分析值的缩放比率。
  44587. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  44588. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  44589. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  44590. * @param {string} [options.dataset] - 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时,此为必选参数。
  44591. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 geometry 时,此为必选参数。
  44592. * @extends {InterpolationAnalystParameters}
  44593. * @example
  44594. * var myInterpolationDensityAnalystParameters = new InterpolationDensityAnalystParameters({
  44595. * dataset: "SamplesP@Interpolation",
  44596. * searchRadius: "100000",
  44597. * pixelFormat: "BIT16",
  44598. * zValueFieldName: "AVG_TMP",
  44599. * resolution: 3000,
  44600. * filterQueryParameter: {
  44601. * attributeFilter: ""
  44602. * },
  44603. * outputDatasetName: "myDensity"
  44604. * });
  44605. * @usage
  44606. */
  44607. var InterpolationDensityAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  44608. InterpolationDensityAnalystParameters_inherits(InterpolationDensityAnalystParameters, _InterpolationAnalyst);
  44609. var _super = InterpolationDensityAnalystParameters_createSuper(InterpolationDensityAnalystParameters);
  44610. function InterpolationDensityAnalystParameters(options) {
  44611. var _this;
  44612. InterpolationDensityAnalystParameters_classCallCheck(this, InterpolationDensityAnalystParameters);
  44613. _this = _super.call(this, options);
  44614. if (options) {
  44615. Util_Util.extend(InterpolationDensityAnalystParameters_assertThisInitialized(_this), options);
  44616. }
  44617. _this.CLASS_NAME = "SuperMap.InterpolationDensityAnalystParameters";
  44618. return _this;
  44619. }
  44620. /**
  44621. * @function InterpolationDensityAnalystParameters.prototype.destroy
  44622. * @description 释放资源,将引用资源的属性置空。
  44623. */
  44624. InterpolationDensityAnalystParameters_createClass(InterpolationDensityAnalystParameters, [{
  44625. key: "destroy",
  44626. value: function destroy() {
  44627. InterpolationDensityAnalystParameters_get(InterpolationDensityAnalystParameters_getPrototypeOf(InterpolationDensityAnalystParameters.prototype), "destroy", this).call(this);
  44628. }
  44629. }]);
  44630. return InterpolationDensityAnalystParameters;
  44631. }(InterpolationAnalystParameters);
  44632. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationIDWAnalystParameters.js
  44633. 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); }
  44634. function InterpolationIDWAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44635. 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); } }
  44636. 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; }
  44637. 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); }
  44638. function InterpolationIDWAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationIDWAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  44639. 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); }
  44640. 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); }
  44641. 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); }; }
  44642. 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); }
  44643. function InterpolationIDWAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44644. 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; } }
  44645. function InterpolationIDWAnalystParameters_getPrototypeOf(o) { InterpolationIDWAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationIDWAnalystParameters_getPrototypeOf(o); }
  44646. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44647. * This program are made available under the terms of the Apache License, Version 2.0
  44648. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44649. /**
  44650. * @class InterpolationIDWAnalystParameters
  44651. * @deprecatedclass SuperMap.InterpolationIDWAnalystParameters
  44652. * @category iServer SpatialAnalyst InterpolationAnalyst
  44653. * @classdesc 反距离加权插值(IDW)分析参数类。
  44654. * @param {Object} options - 参数。
  44655. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  44656. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  44657. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  44658. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  44659. * @param {string} [options.zValueFieldName] - 进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  44660. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  44661. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置查找半径,即参与运算点的查找范围,与点数据集单位相同。
  44662. * @param {number} [options.power=2] - 距离权重计算的幂次。
  44663. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  44664. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  44665. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  44666. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  44667. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  44668. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,此为必选参数。
  44669. * @extends {InterpolationAnalystParameters}
  44670. * @example 例如:
  44671. * var myInterpolationIDWAnalystParameters = new InterpolationIDWAnalystParameters({
  44672. * dataset:"SamplesP@Interpolation",
  44673. * power: 2,
  44674. * searchMode: "KDTREE_FIXED_COUNT",
  44675. * expectedCount: 12,
  44676. * pixelFormat: "BIT16",
  44677. * zValueFieldName: "AVG_TMP",
  44678. * resolution: 3000,
  44679. * filterQueryParameter: {
  44680. * attributeFilter: ""
  44681. * },
  44682. * outputDatasetName: "myIDW"
  44683. * });
  44684. * @usage
  44685. */
  44686. var InterpolationIDWAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  44687. InterpolationIDWAnalystParameters_inherits(InterpolationIDWAnalystParameters, _InterpolationAnalyst);
  44688. var _super = InterpolationIDWAnalystParameters_createSuper(InterpolationIDWAnalystParameters);
  44689. function InterpolationIDWAnalystParameters(options) {
  44690. var _this;
  44691. InterpolationIDWAnalystParameters_classCallCheck(this, InterpolationIDWAnalystParameters);
  44692. _this = _super.call(this, options);
  44693. /**
  44694. * @member {number} [InterpolationIDWAnalystParameters.prototype.power=2]
  44695. * @description 距离权重计算的幂次。
  44696. * 该值决定了权值下降的速度,幂次越大,随距离的增大权值下降越快,距离预测点越远的点的权值也越小。
  44697. * 理论上,参数值必须大于0,但是0.5到3之间时运算结果更合理,因此推荐值为0.5~3。
  44698. */
  44699. _this.power = 2;
  44700. /**
  44701. * @member {SearchMode} InterpolationIDWAnalystParameters.prototype.searchMode
  44702. * @description 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  44703. * 具体如下:
  44704. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  44705. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  44706. */
  44707. _this.searchMode = null;
  44708. /**
  44709. * @member {number} [InterpolationIDWAnalystParameters.prototype.expectedCount=12]
  44710. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数。
  44711. */
  44712. _this.expectedCount = 12;
  44713. if (options) {
  44714. Util_Util.extend(InterpolationIDWAnalystParameters_assertThisInitialized(_this), options);
  44715. }
  44716. _this.CLASS_NAME = "SuperMap.InterpolationIDWAnalystParameters";
  44717. return _this;
  44718. }
  44719. /**
  44720. * @function InterpolationIDWAnalystParameters.prototype.destroy
  44721. * @description 释放资源,将引用资源的属性置空。
  44722. */
  44723. InterpolationIDWAnalystParameters_createClass(InterpolationIDWAnalystParameters, [{
  44724. key: "destroy",
  44725. value: function destroy() {
  44726. InterpolationIDWAnalystParameters_get(InterpolationIDWAnalystParameters_getPrototypeOf(InterpolationIDWAnalystParameters.prototype), "destroy", this).call(this);
  44727. var me = this;
  44728. me.power = null;
  44729. me.searchMode = null;
  44730. me.expectedCount = null;
  44731. }
  44732. }]);
  44733. return InterpolationIDWAnalystParameters;
  44734. }(InterpolationAnalystParameters);
  44735. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationKrigingAnalystParameters.js
  44736. 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); }
  44737. function InterpolationKrigingAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44738. 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); } }
  44739. 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; }
  44740. 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); }
  44741. function InterpolationKrigingAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationKrigingAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  44742. 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); }
  44743. 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); }
  44744. 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); }; }
  44745. 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); }
  44746. function InterpolationKrigingAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44747. 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; } }
  44748. function InterpolationKrigingAnalystParameters_getPrototypeOf(o) { InterpolationKrigingAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationKrigingAnalystParameters_getPrototypeOf(o); }
  44749. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44750. * This program are made available under the terms of the Apache License, Version 2.0
  44751. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44752. /**
  44753. * @class InterpolationKrigingAnalystParameters
  44754. * @deprecatedclass SuperMap.InterpolationKrigingAnalystParameters
  44755. * @category iServer SpatialAnalyst InterpolationAnalyst
  44756. * @classdesc 克吕金插值分析参数类。通过该类可以设置克吕金插值分析所需的参数。
  44757. * 克吕金(Kriging)法为地统计学上一种空间数据内插处理方法,主要的目的是利用各数据点间变异数(variance)的大小来推求某一未知点与各已知点的权重关系,
  44758. * 再由各数据点的值和其与未知点的权重关系推求未知点的值。Kriging 法最大的特色不仅是提供一个最小估计误差的预测值,并且可明确地指出误差值的大小。
  44759. * 一般而言,许多地质参数,如地形面,本身即具有连续性,故在一段距离内的任两点必有空间上的关系。反之,在一不规则面上的两点若相距甚远,
  44760. * 则在统计意义上可视为互为独立 (stastically indepedent)。这种随距离而改变的空间上连续性,可用半变异图 (semivariogram) 来表现。
  44761. * 因此,若想由已知的散乱点来推求某一未知点的值,则可利用半变异图推求各已知点与未知点的空间关系,即以下四个参数:<br>
  44762. * 1.块金值(nugget):当采样点间距为0时,理论上半变异函数值为0,但时间上两采样点非常接近时半变异函数值并不为0,即产生了块金效应,
  44763. * 对应的半变异函数值为块金值。块金值可能由于测量误差或者空间变异产生。<br>
  44764. * 2.基台值(sill):随着采样点间距的不断增大,半变异函数的值趋向一个稳定的常数,该常数成为基台值。到达基台值后,半变异函数的值不再随采样点间距而改变,
  44765. * 即大于此间距的采样点不再具有空间相关性。<br>
  44766. * 3.偏基台值:基台值与块金值的差值。<br>
  44767. * 4.自相关阈值(range):也称变程,是半变异函数值达到基台值时,采样点的间距。超过自相关阈值的采样点不再具有空间相关性,将不对预测结果产生影响。<br>
  44768. * 然后,由此空间参数推求半变异数,由各数据点间的半变异数可推求未知点与已知点间的权重关系,进而推求出未知点的值。
  44769. * 克吕金法的优点是以空间统计学作为其坚实的理论基础,物理含义明确;不但能估计测定参数的空间变异分布,而且还可以估算参数的方差分布。克吕金法的缺点是计算步骤较烦琐,
  44770. * 计算量大,且变异函数有时需要根据经验人为选定。
  44771. *
  44772. * 由上述可知,半变异函数是克吕金插值的关键,因此选择合适的半变异函数模型非常重要,SuperMap 提供了以下三种半变异函数模型:<br>
  44773. * 1.指数型(EXPONENTIAL):适用于空间相关关系随样本间距的增加呈指数递减的情况,其空间自相关关系在样本间距的无穷远处完全消失。<br>
  44774. * 2.球型(SPHERICAL):适用于空间自相关关系随样本间距的增加而逐渐减少,直到超出一定的距离时空间自相关关系消失的情况。<br>
  44775. * 3.高斯型(GAUSSIAN):适用于半变异函数值渐进地逼近基台值的情况。<br>
  44776. *
  44777. * 半变异函数中,有一个关键参数即插值的字段值的期望(平均值),由于对于此参数的不同处理方法而衍生出了不同的 Kriging 方法。SuperMap的插值功能基于以下三种常用 Kriging 算法:<br>
  44778. * 1.简单克吕金(Simple Kriging):该方法假定用于插值的字段值的期望(平均值)为已知的某一常数。<br>
  44779. * 2.普通克吕金(Kriging):该方法假定用于插值的字段值的期望(平均值)未知且恒定。它利用一定的数学函数,通过对给定的空间点进行拟合来估算单元格的值,
  44780. * 生成格网数据集。它不仅可以生成一个表面,还可以给出预测结果的精度或者确定性的度量。因此,此方法计算精度较高,常用于地学领域。<br>
  44781. * 3.泛克吕金(Universal Kriging):该方法假定用于插值的字段值的期望(平均值)是未知的变量。在样点数据中存在某种主导趋势且该趋势可以通过某一个确定
  44782. * 的函数或者多项式进行拟合的情况下,适用泛克吕金插值法。<br>
  44783. * @param {Object} options - 参数。
  44784. * @param {string} options.type - 克吕金插值的类型。
  44785. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  44786. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  44787. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  44788. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  44789. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时,此为必选参数。
  44790. * @param {number} [options.mean] - 【简单克吕金】类型下,插值字段的平均值。
  44791. * @param {number} [options.angle=0] - 克吕金算法中旋转角度值。
  44792. * @param {number} [options.nugget=0] - 克吕金算法中块金效应值。
  44793. * @param {number} [options.range=0] - 克吕金算法中自相关阈值,单位与原数据集单位相同。
  44794. * @param {number} [options.sill=0] - 克吕金算法中基台值。
  44795. * @param {string} [options.variogramMode="SPHERICAL"] - 克吕金插值时的半变函数类型。
  44796. * @param {string} [options.exponent='exp1'] - 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数,可选值为 exp1、exp2。
  44797. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数;【定长查找】方式下,设置查找的最小点数。
  44798. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  44799. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  44800. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  44801. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  44802. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  44803. * @param {FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  44804. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  44805. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如 ”数据集名称@数据源别名” 形式来表示。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 dataset 时。
  44806. * @param {Array.<GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystParameters.prototype.InterpolationAnalystType)为 geometry 时。
  44807. * @extends {InterpolationAnalystParameters}
  44808. * @example 例如:
  44809. * var myInterpolationKrigingAnalystParameters = new InterpolationKrigingAnalystParameters({
  44810. * dataset:"SamplesP@Interpolation",
  44811. * type: "KRIGING",
  44812. * angle: 0,
  44813. * mean: 5,
  44814. * nugget: 30,
  44815. * range: 50,
  44816. * sill: 300,
  44817. * variogramMode: "EXPONENTIAL",
  44818. * searchMode: "QUADTREE",
  44819. * maxPointCountForInterpolation: 20,
  44820. * maxPointCountInNode: 5,
  44821. * pixelFormat: "BIT16",
  44822. * zValueFieldName: "AVG_TMP",
  44823. * resolution: 30000,
  44824. * filterQueryParameter: {
  44825. * attributeFilter: ""
  44826. * },
  44827. * outputDatasetName: "myKriging"
  44828. * });
  44829. * @usage
  44830. */
  44831. var InterpolationKrigingAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  44832. InterpolationKrigingAnalystParameters_inherits(InterpolationKrigingAnalystParameters, _InterpolationAnalyst);
  44833. var _super = InterpolationKrigingAnalystParameters_createSuper(InterpolationKrigingAnalystParameters);
  44834. function InterpolationKrigingAnalystParameters(options) {
  44835. var _this;
  44836. InterpolationKrigingAnalystParameters_classCallCheck(this, InterpolationKrigingAnalystParameters);
  44837. _this = _super.call(this, options);
  44838. /**
  44839. * @member {InterpolationAlgorithmType} InterpolationKrigingAnalystParameters.prototype.type
  44840. * @description 克吕金插值的类型。
  44841. * 具体如下:<br>
  44842. * {KRIGING} 普通克吕金插值法。
  44843. * {SimpleKriging} 简单克吕金插值法。
  44844. * {UniversalKriging} 泛克吕金插值法。
  44845. */
  44846. _this.type = null;
  44847. /**
  44848. * @member {number} InterpolationKrigingAnalystParameters.prototype.mean
  44849. * @description 【简单克吕金】方式下,插值字段的平均值。
  44850. * 即采样点插值字段值总和除以采样点数目。
  44851. */
  44852. _this.mean = null;
  44853. /**
  44854. * @member {number} [InterpolationKrigingAnalystParameters.prototype.angle=0]
  44855. * @description 克吕金算法中旋转角度值。
  44856. * 此角度值指示了每个查找邻域相对于水平方向逆时针旋转的角度。
  44857. */
  44858. _this.angle = 0;
  44859. /**
  44860. * @member {number} [InterpolationKrigingAnalystParameters.prototype.nugget=0]
  44861. * @description 克吕金算法中块金效应值。
  44862. */
  44863. _this.nugget = 0;
  44864. /**
  44865. * @member {number} [InterpolationKrigingAnalystParameters.prototype.range=0]
  44866. * @description 克吕金算法中自相关阈值,单位与原数据集单位相同。
  44867. */
  44868. _this.range = 0;
  44869. /**
  44870. * @member {number} [InterpolationKrigingAnalystParameters.prototype.sill=0]
  44871. * @description 克吕金算法中基台值。
  44872. */
  44873. _this.sill = 0;
  44874. /**
  44875. * @member {VariogramMode} [InterpolationKrigingAnalystParameters.prototype.variogramMode=VariogramMode.SPHERICAL]
  44876. * @description 克吕金插值时的半变函数类型。
  44877. * 用户所选择的半变函数类型会影响未知点的预测,特别是曲线在原点处的不同形状有重要意义。
  44878. * 曲线在原点处越陡,则较近领域对该预测值的影响就越大,因此输出表面就会越不光滑。
  44879. */
  44880. _this.variogramMode = VariogramMode.SPHERICAL;
  44881. /**
  44882. * @member {Exponent} [InterpolationKrigingAnalystParameters.prototype.exponent=Exponent.EXP1]
  44883. * @description 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数。
  44884. */
  44885. _this.exponent = Exponent.EXP1;
  44886. /**
  44887. * @member {SearchMode} InterpolationKrigingAnalystParameters.prototype.searchMode
  44888. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。此为必选参数。
  44889. * 简单克吕金和泛克吕金不支持块查找。
  44890. * 具体如下:<br>
  44891. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。<br>
  44892. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。<br>
  44893. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  44894. */
  44895. _this.searchMode = null;
  44896. /**
  44897. * @member {number} [InterpolationKrigingAnalystParameters.prototype.expectedCount=12]
  44898. * @description 【固定点数查找】方式下,设置待查找的点数,即参与插值运算的点数,默认值为12。
  44899. * 【定长查找】方式下,设置查找的最小点数,默认值为12。
  44900. */
  44901. _this.expectedCount = 12;
  44902. /**
  44903. * @member {number} [InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=200]
  44904. * @description 【块查找】方式下,最多参与插值的点数。
  44905. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  44906. */
  44907. _this.maxPointCountForInterpolation = 200;
  44908. /**
  44909. * @member {number} [InterpolationKrigingAnalystParameters.prototype.maxPointCountInNode=50]
  44910. * @description 【块查找】方式下,设置单个块内最多参与运算点数。
  44911. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  44912. */
  44913. _this.maxPointCountInNode = 50;
  44914. if (options) {
  44915. Util_Util.extend(InterpolationKrigingAnalystParameters_assertThisInitialized(_this), options);
  44916. }
  44917. _this.CLASS_NAME = "SuperMap.InterpolationKrigingAnalystParameters";
  44918. return _this;
  44919. }
  44920. /**
  44921. * @function InterpolationKrigingAnalystParameters.prototype.destroy
  44922. * @description 释放资源,将引用资源的属性置空。
  44923. */
  44924. InterpolationKrigingAnalystParameters_createClass(InterpolationKrigingAnalystParameters, [{
  44925. key: "destroy",
  44926. value: function destroy() {
  44927. InterpolationKrigingAnalystParameters_get(InterpolationKrigingAnalystParameters_getPrototypeOf(InterpolationKrigingAnalystParameters.prototype), "destroy", this).call(this);
  44928. var me = this;
  44929. me.type = null;
  44930. me.mean = null;
  44931. me.angle = null;
  44932. me.nugget = null;
  44933. me.range = null;
  44934. me.sill = null;
  44935. me.variogramMode = null;
  44936. me.exponent = null;
  44937. me.searchMode = null;
  44938. me.expectedCount = null;
  44939. me.maxPointCountForInterpolation = null;
  44940. me.maxPointCountInNode = null;
  44941. }
  44942. }]);
  44943. return InterpolationKrigingAnalystParameters;
  44944. }(InterpolationAnalystParameters);
  44945. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystService.js
  44946. 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); }
  44947. function InterpolationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44948. 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); } }
  44949. 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; }
  44950. 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); }
  44951. function InterpolationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  44952. 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); }
  44953. 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); }
  44954. 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); }; }
  44955. 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); }
  44956. function InterpolationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  44957. 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; } }
  44958. function InterpolationAnalystService_getPrototypeOf(o) { InterpolationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationAnalystService_getPrototypeOf(o); }
  44959. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  44960. * This program are made available under the terms of the Apache License, Version 2.0
  44961. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44962. /**
  44963. * @class InterpolationAnalystService
  44964. * @deprecatedclass SuperMap.InterpolationAnalystService
  44965. * @category iServer SpatialAnalyst InterpolationAnalyst
  44966. * @classdesc 插值分析服务类。
  44967. * 插值分析可以将有限的采样点数据,通过插值算法对采样点周围的数值情况进行预测,可以掌握研究区域内数据的总体分布状况,从而使采样的离散点不仅仅反映其所在位置的数值情况,
  44968. * 还可以反映区域的数值分布。目前SuperMap iServer的插值功能提供从点数据集插值得到栅格数据集的功能,支持以下常用的内插方法,
  44969. * 包括:反距离加权插值、克吕金(Kriging)插值法、样条(径向基函数,Radial Basis Function)插值、点密度插值。
  44970. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  44971. * @param {Object} options - 参数。
  44972. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  44973. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  44974. * @param {Object} [options.headers] - 请求头。
  44975. * @extends {SpatialAnalystBase}
  44976. * @example 例如:
  44977. * (start code)
  44978. * var myTInterpolationAnalystService = new InterpolationAnalystService(url);
  44979. * myTInterpolationAnalystService.events.on({
  44980. * "processCompleted": processCompleted,
  44981. * "processFailed": processFailed
  44982. * }
  44983. * );
  44984. * (end)
  44985. * @usage
  44986. */
  44987. var InterpolationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  44988. InterpolationAnalystService_inherits(InterpolationAnalystService, _SpatialAnalystBase);
  44989. var _super = InterpolationAnalystService_createSuper(InterpolationAnalystService);
  44990. function InterpolationAnalystService(url, options) {
  44991. var _this;
  44992. InterpolationAnalystService_classCallCheck(this, InterpolationAnalystService);
  44993. _this = _super.call(this, url, options);
  44994. /**
  44995. * @member {string} InterpolationAnalystService.prototype.mode
  44996. * @description 插值分析类型。
  44997. */
  44998. _this.mode = null;
  44999. if (options) {
  45000. Util_Util.extend(InterpolationAnalystService_assertThisInitialized(_this), options);
  45001. }
  45002. return _this;
  45003. }
  45004. /**
  45005. * @function InterpolationAnalystService.prototype.destroy
  45006. * @description 释放资源,将引用资源的属性置空。
  45007. */
  45008. InterpolationAnalystService_createClass(InterpolationAnalystService, [{
  45009. key: "destroy",
  45010. value: function destroy() {
  45011. InterpolationAnalystService_get(InterpolationAnalystService_getPrototypeOf(InterpolationAnalystService.prototype), "destroy", this).call(this);
  45012. this.mode = null;
  45013. this.CLASS_NAME = "SuperMap.InterpolationAnalystService";
  45014. }
  45015. /**
  45016. * @function InterpolationAnalystService.prototype.processAsync
  45017. * @description 负责将客户端的查询参数传递到服务端。
  45018. * @param {InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationRBFAnalystParameters|InterpolationKrigingAnalystParameters} parameter - 插值分析参数类。
  45019. */
  45020. }, {
  45021. key: "processAsync",
  45022. value: function processAsync(parameter) {
  45023. var parameterObject = {};
  45024. var me = this;
  45025. if (parameter instanceof InterpolationDensityAnalystParameters) {
  45026. me.mode = 'Density';
  45027. if (parameter.InterpolationAnalystType === 'geometry') {
  45028. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/density');
  45029. } else {
  45030. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/density');
  45031. }
  45032. } else if (parameter instanceof InterpolationIDWAnalystParameters) {
  45033. me.mode = 'IDW';
  45034. if (parameter.InterpolationAnalystType === 'geometry') {
  45035. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/idw');
  45036. } else {
  45037. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/idw');
  45038. }
  45039. } else if (parameter instanceof InterpolationRBFAnalystParameters) {
  45040. me.mode = 'RBF';
  45041. if (parameter.InterpolationAnalystType === 'geometry') {
  45042. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/rbf');
  45043. } else {
  45044. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/rbf');
  45045. }
  45046. } else if (parameter instanceof InterpolationKrigingAnalystParameters) {
  45047. me.mode = 'Kriging';
  45048. if (parameter.InterpolationAnalystType === 'geometry') {
  45049. me.url = Util_Util.urlPathAppend(me.url, 'geometry/interpolation/kriging');
  45050. } else {
  45051. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/kriging');
  45052. }
  45053. }
  45054. InterpolationAnalystParameters.toObject(parameter, parameterObject);
  45055. var jsonParameters = Util_Util.toJSON(parameterObject);
  45056. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  45057. me.request({
  45058. method: "POST",
  45059. data: jsonParameters,
  45060. scope: me,
  45061. success: me.serviceProcessCompleted,
  45062. failure: me.serviceProcessFailed
  45063. });
  45064. }
  45065. }]);
  45066. return InterpolationAnalystService;
  45067. }(SpatialAnalystBase);
  45068. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
  45069. function KernelDensityJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45070. 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); } }
  45071. 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; }
  45072. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45073. * This program are made available under the terms of the Apache License, Version 2.0
  45074. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45075. /**
  45076. * @class KernelDensityJobParameter
  45077. * @deprecatedclass SuperMap.KernelDensityJobParameter
  45078. * @category iServer ProcessingService DensityAnalyst
  45079. * @classdesc 核密度分析服务参数类。
  45080. * @param {Object} options - 参数。
  45081. * @param {string} options.datasetName - 数据集名。
  45082. * @param {string} options.fields - 权重索引。
  45083. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  45084. * @param {number} [options.resolution=80] - 分辨率。
  45085. * @param {number} [options.method=0] - 分析方法。
  45086. * @param {number} [options.meshType=0] - 分析类型。
  45087. * @param {number} [options.radius=300] - 分析的影响半径。
  45088. * @param {AnalystSizeUnit} [options.meshSizeUnit=AnalystSizeUnit.METER] - 网格大小单位。
  45089. * @param {AnalystSizeUnit} [options.radiusUnit=AnalystSizeUnit.METER] - 搜索半径单位。
  45090. * @param {AnalystAreaUnit} [options.areaUnit=AnalystAreaUnit.SQUAREMILE] - 面积单位。
  45091. * @param {OutputSetting} [options.output] - 输出参数设置。
  45092. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  45093. * @usage
  45094. */
  45095. var KernelDensityJobParameter = /*#__PURE__*/function () {
  45096. function KernelDensityJobParameter(options) {
  45097. KernelDensityJobParameter_classCallCheck(this, KernelDensityJobParameter);
  45098. if (!options) {
  45099. return;
  45100. }
  45101. /**
  45102. * @member {string} KernelDensityJobParameter.prototype.datasetName
  45103. * @description 数据集名。
  45104. */
  45105. this.datasetName = "";
  45106. /**
  45107. * @member {SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject} [KernelDensityJobParameter.prototype.query]
  45108. * @description 分析范围。
  45109. */
  45110. this.query = "";
  45111. /**
  45112. * @member {number} [KernelDensityJobParameter.prototype.resolution=80]
  45113. * @description 网格大小。
  45114. */
  45115. this.resolution = 80;
  45116. /**
  45117. * @member {number} [KernelDensityJobParameter.prototype.method=0]
  45118. * @description 分析方法。
  45119. */
  45120. this.method = 0;
  45121. /**
  45122. * @member {number} [KernelDensityJobParameter.prototype.meshType=0]
  45123. * @description 分析类型。
  45124. */
  45125. this.meshType = 0;
  45126. /**
  45127. * @member {string} KernelDensityJobParameter.prototype.fields
  45128. * @description 权重索引。
  45129. */
  45130. this.fields = "";
  45131. /**
  45132. * @member {number} [KernelDensityJobParameter.prototype.radius=300]
  45133. * @description 分析的影响半径。
  45134. */
  45135. this.radius = 300;
  45136. /**
  45137. * @member {AnalystSizeUnit} [KernelDensityJobParameter.prototype.meshSizeUnit=AnalystSizeUnit.METER]
  45138. * @description 网格大小单位。
  45139. */
  45140. this.meshSizeUnit = AnalystSizeUnit.METER;
  45141. /**
  45142. * @member {AnalystSizeUnit} [KernelDensityJobParameter.prototype.radiusUnit=AnalystSizeUnit.METER]
  45143. * @description 搜索半径单位。
  45144. */
  45145. this.radiusUnit = AnalystSizeUnit.METER;
  45146. /**
  45147. * @member {AnalystAreaUnit} [KernelDensityJobParameter.prototype.areaUnit=AnalystAreaUnit.SQUAREMILE]
  45148. * @description 面积单位。
  45149. */
  45150. this.areaUnit = AnalystAreaUnit.SQUAREMILE;
  45151. /**
  45152. * @member {OutputSetting} KernelDensityJobParameter.prototype.output
  45153. * @description 输出参数设置类。
  45154. */
  45155. this.output = null;
  45156. /**
  45157. * @member {MappingParameters} [KernelDensityJobParameter.prototype.mappingParameters]
  45158. * @description 分析后结果可视化的参数类。
  45159. */
  45160. this.mappingParameters = null;
  45161. Util_Util.extend(this, options);
  45162. this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
  45163. }
  45164. /**
  45165. * @function KernelDensityJobParameter.prototype.destroy
  45166. * @description 释放资源,将引用资源的属性置空。
  45167. */
  45168. KernelDensityJobParameter_createClass(KernelDensityJobParameter, [{
  45169. key: "destroy",
  45170. value: function destroy() {
  45171. this.datasetName = null;
  45172. this.query = null;
  45173. this.resolution = null;
  45174. this.method = null;
  45175. this.radius = null;
  45176. this.meshType = null;
  45177. this.fields = null;
  45178. this.meshSizeUnit = null;
  45179. this.radiusUnit = null;
  45180. this.areaUnit = null;
  45181. if (this.output instanceof OutputSetting) {
  45182. this.output.destroy();
  45183. this.output = null;
  45184. }
  45185. if (this.mappingParameters instanceof MappingParameters) {
  45186. this.mappingParameters.destroy();
  45187. this.mappingParameters = null;
  45188. }
  45189. }
  45190. /**
  45191. * @function KernelDensityJobParameter.toObject
  45192. * @param {KernelDensityJobParameter} kernelDensityJobParameter - 核密度分析服务参数类。
  45193. * @param {KernelDensityJobParameter} tempObj - 核密度分析服务参数对象。
  45194. * @description 将核密度分析服务参数对象转换为 JSON 对象。
  45195. * @returns JSON 对象。
  45196. */
  45197. }], [{
  45198. key: "toObject",
  45199. value: function toObject(kernelDensityJobParameter, tempObj) {
  45200. for (var name in kernelDensityJobParameter) {
  45201. if (name === "datasetName") {
  45202. tempObj['input'] = tempObj['input'] || {};
  45203. tempObj['input'][name] = kernelDensityJobParameter[name];
  45204. continue;
  45205. }
  45206. if (name === "output") {
  45207. tempObj['output'] = tempObj['output'] || {};
  45208. tempObj['output'] = kernelDensityJobParameter[name];
  45209. continue;
  45210. }
  45211. tempObj['analyst'] = tempObj['analyst'] || {};
  45212. if (name === 'query' && kernelDensityJobParameter[name]) {
  45213. tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
  45214. } else {
  45215. tempObj['analyst'][name] = kernelDensityJobParameter[name];
  45216. }
  45217. if (name === 'mappingParameters') {
  45218. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  45219. tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
  45220. }
  45221. }
  45222. }
  45223. }]);
  45224. return KernelDensityJobParameter;
  45225. }();
  45226. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
  45227. 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); }
  45228. function KernelDensityJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45229. 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); } }
  45230. 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; }
  45231. 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); }
  45232. function KernelDensityJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KernelDensityJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  45233. 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); }
  45234. 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); }
  45235. 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); }; }
  45236. 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); }
  45237. function KernelDensityJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45238. 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; } }
  45239. function KernelDensityJobsService_getPrototypeOf(o) { KernelDensityJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KernelDensityJobsService_getPrototypeOf(o); }
  45240. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45241. * This program are made available under the terms of the Apache License, Version 2.0
  45242. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45243. /**
  45244. * @class KernelDensityJobsService
  45245. * @deprecatedclass SuperMap.KernelDensityJobsService
  45246. * @category iServer ProcessingService DensityAnalyst
  45247. * @classdesc 核密度分析服务类
  45248. * @extends {ProcessingServiceBase}
  45249. * @param {string} url - 服务地址。
  45250. * @param {Object} options - 可选参数。
  45251. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  45252. * @param {Object} [options.headers] - 请求头。
  45253. * @usage
  45254. */
  45255. var KernelDensityJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  45256. KernelDensityJobsService_inherits(KernelDensityJobsService, _ProcessingServiceBas);
  45257. var _super = KernelDensityJobsService_createSuper(KernelDensityJobsService);
  45258. function KernelDensityJobsService(url, options) {
  45259. var _this;
  45260. KernelDensityJobsService_classCallCheck(this, KernelDensityJobsService);
  45261. _this = _super.call(this, url, options);
  45262. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/density');
  45263. _this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
  45264. return _this;
  45265. }
  45266. /**
  45267. * @function KernelDensityJobsService.prototype.destroy
  45268. * @override
  45269. */
  45270. KernelDensityJobsService_createClass(KernelDensityJobsService, [{
  45271. key: "destroy",
  45272. value: function destroy() {
  45273. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "destroy", this).call(this);
  45274. }
  45275. /**
  45276. * @function KernelDensityJobsService.prototype.getKernelDensityJobs
  45277. * @description 获取核密度分析任务
  45278. */
  45279. }, {
  45280. key: "getKernelDensityJobs",
  45281. value: function getKernelDensityJobs() {
  45282. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, this.url);
  45283. }
  45284. /**
  45285. * @function KernelDensityJobsService.prototype.getKernelDensityJobs
  45286. * @description 获取指定id的核密度分析服务
  45287. * @param {string} id - 指定要获取数据的id
  45288. */
  45289. }, {
  45290. key: "getKernelDensityJob",
  45291. value: function getKernelDensityJob(id) {
  45292. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  45293. }
  45294. /**
  45295. * @function KernelDensityJobsService.prototype.addKernelDensityJob
  45296. * @description 新建核密度分析服务
  45297. * @param {KernelDensityJobParameter} params - 核密度分析服务参数类。
  45298. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  45299. */
  45300. }, {
  45301. key: "addKernelDensityJob",
  45302. value: function addKernelDensityJob(params, seconds) {
  45303. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "addJob", this).call(this, this.url, params, KernelDensityJobParameter, seconds);
  45304. }
  45305. }]);
  45306. return KernelDensityJobsService;
  45307. }(ProcessingServiceBase);
  45308. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMatrixCell.js
  45309. 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); } }
  45310. 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; }
  45311. function LabelMatrixCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45312. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45313. * This program are made available under the terms of the Apache License, Version 2.0
  45314. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45315. /**
  45316. * @class LabelMatrixCell
  45317. * @deprecatedclass SuperMap.LabelMatrixCell
  45318. * @category iServer Map Theme
  45319. * @classdesc 矩阵标签元素抽象类。该类可以包含 n*n 个矩阵标签元素,矩阵标签元素的类型可以是图片,符号,标签专题图等。
  45320. * 符号类型的矩阵标签元素类、图片类型的矩阵标签元素类和专题图类型的矩阵标签元素类均继承自该类。
  45321. * @usage
  45322. */
  45323. var LabelMatrixCell = /*#__PURE__*/LabelMatrixCell_createClass(function LabelMatrixCell() {
  45324. LabelMatrixCell_classCallCheck(this, LabelMatrixCell);
  45325. this.CLASS_NAME = "LabelMatrixCell";
  45326. });
  45327. ;// CONCATENATED MODULE: ./src/common/iServer/LabelImageCell.js
  45328. 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); }
  45329. function LabelImageCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45330. 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); } }
  45331. 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; }
  45332. 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); }
  45333. 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); }
  45334. 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); }; }
  45335. 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); }
  45336. function LabelImageCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45337. 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; } }
  45338. function LabelImageCell_getPrototypeOf(o) { LabelImageCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelImageCell_getPrototypeOf(o); }
  45339. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45340. * This program are made available under the terms of the Apache License, Version 2.0
  45341. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45342. /**
  45343. * @class LabelImageCell
  45344. * @deprecatedclass SuperMap.LabelImageCell
  45345. * @category iServer Map Theme
  45346. * @classdesc 图片类型的矩阵标签元素类。该类继承自 {@link LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  45347. * 矩阵标签专题图是标签专题图(ThemeLabel)的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  45348. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  45349. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  45350. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 是一个二维数组,
  45351. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  45352. * @extends {LabelMatrixCell}
  45353. * @param {Object} options - 可选参数。
  45354. * @param {number} [options.height=0] - 设置图片的高度,单位为毫米。
  45355. * @param {string} [options.pathField] - 设置矩阵标签元素所使用图片的路径。
  45356. * @param {number} [options.rotation=0.0] - 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  45357. * @param {number} [options.width=0] - 设置图片的宽度,单位为毫米。
  45358. * @param {boolean} [options.sizeFixed=false] - 是否固定图片的大小。
  45359. * @usage
  45360. */
  45361. var LabelImageCell = /*#__PURE__*/function (_LabelMatrixCell) {
  45362. LabelImageCell_inherits(LabelImageCell, _LabelMatrixCell);
  45363. var _super = LabelImageCell_createSuper(LabelImageCell);
  45364. function LabelImageCell(options) {
  45365. var _this;
  45366. LabelImageCell_classCallCheck(this, LabelImageCell);
  45367. _this = _super.call(this, options);
  45368. /**
  45369. * @member {number} LabelImageCell.prototype.height
  45370. * @description 设置图片的高度,单位为毫米。
  45371. */
  45372. _this.height = 0;
  45373. /**
  45374. * @member {string} LabelImageCell.prototype.pathField
  45375. * @description 设置矩阵标签元素所使用的图片路径对应的字段名。
  45376. */
  45377. _this.pathField = null;
  45378. /**
  45379. * @member {number} [LabelImageCell.prototype.rotation=0.0]
  45380. * @description 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  45381. */
  45382. _this.rotation = 0.0;
  45383. /**
  45384. * @member {number} LabelImageCell.prototype.width
  45385. * @description 设置图片的宽度,单位为毫米。
  45386. */
  45387. _this.width = 0;
  45388. /**
  45389. * @member {boolean} [LabelImageCell.prototype.sizeFixed=false]
  45390. * @description 是否固定图片的大小。
  45391. */
  45392. _this.sizeFixed = false;
  45393. /**
  45394. * @member {string} LabelImageCell.prototype.type
  45395. * @description 制作矩阵专题图时是必须的。
  45396. */
  45397. _this.type = "IMAGE";
  45398. if (options) {
  45399. Util_Util.extend(LabelImageCell_assertThisInitialized(_this), options);
  45400. }
  45401. _this.CLASS_NAME = "SuperMap.LabelImageCell";
  45402. return _this;
  45403. }
  45404. /**
  45405. * @function LabelImageCell.prototype.destroy
  45406. * @description 释放资源,将引用资源的属性置空。
  45407. */
  45408. LabelImageCell_createClass(LabelImageCell, [{
  45409. key: "destroy",
  45410. value: function destroy() {
  45411. var me = this;
  45412. me.height = null;
  45413. me.pathField = null;
  45414. me.rotation = null;
  45415. me.width = null;
  45416. me.sizeFixed = null;
  45417. }
  45418. }]);
  45419. return LabelImageCell;
  45420. }(LabelMatrixCell);
  45421. ;// CONCATENATED MODULE: ./src/common/iServer/LabelSymbolCell.js
  45422. 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); }
  45423. function LabelSymbolCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45424. 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); } }
  45425. 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; }
  45426. 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); }
  45427. 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); }
  45428. 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); }; }
  45429. 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); }
  45430. function LabelSymbolCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45431. 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; } }
  45432. function LabelSymbolCell_getPrototypeOf(o) { LabelSymbolCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelSymbolCell_getPrototypeOf(o); }
  45433. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45434. * This program are made available under the terms of the Apache License, Version 2.0
  45435. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45436. /**
  45437. * @class LabelSymbolCell
  45438. * @deprecatedclass SuperMap.LabelSymbolCell
  45439. * @category iServer Map Theme
  45440. * @classdesc 符号类型的矩阵标签元素类。
  45441. * 该类继承自 {@link LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  45442. * 矩阵标签专题图是标签专题图({@link ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  45443. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  45444. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  45445. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 属性是一个二维数组,
  45446. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  45447. * @extends {LabelMatrixCell}
  45448. * @param {Object} options - 参数。
  45449. * @param {ServerStyle} options.style - 获取或设置符号样式。
  45450. * @param {string} options.symbolIDField - 符号 ID 或符号 ID 所对应的字段名称。
  45451. * @usage
  45452. */
  45453. var LabelSymbolCell = /*#__PURE__*/function (_LabelMatrixCell) {
  45454. LabelSymbolCell_inherits(LabelSymbolCell, _LabelMatrixCell);
  45455. var _super = LabelSymbolCell_createSuper(LabelSymbolCell);
  45456. function LabelSymbolCell(options) {
  45457. var _this;
  45458. LabelSymbolCell_classCallCheck(this, LabelSymbolCell);
  45459. _this = _super.call(this, options);
  45460. /**
  45461. * @member {ServerStyle} LabelSymbolCell.prototype.style
  45462. * @description 获取或设置符号样式—— {@link ServerStyle} 对象,包括符号大小({@link ServerStyle#markerSize})
  45463. * 和符号旋转({@link ServerStyle#markerAngle})角度,其中用于设置符号 ID 的属性({@link ServerStyle#markerSymbolID})在此处不起作用。
  45464. */
  45465. _this.style = new ServerStyle();
  45466. /**
  45467. * @member {string} LabelSymbolCell.prototype.symbolIDField
  45468. * @description 获取或设置符号 ID 或符号 ID 所对应的字段名称。
  45469. */
  45470. _this.symbolIDField = null;
  45471. /**
  45472. * @member {string} LabelSymbolCell.prototype.type
  45473. * @description 制作矩阵专题图时是必须的。
  45474. */
  45475. _this.type = "SYMBOL";
  45476. if (options) {
  45477. Util_Util.extend(LabelSymbolCell_assertThisInitialized(_this), options);
  45478. }
  45479. _this.CLASS_NAME = "SuperMap.LabelSymbolCell";
  45480. return _this;
  45481. }
  45482. /**
  45483. * @function LabelSymbolCell.prototype.destroy
  45484. * @description 释放资源,将引用资源的属性置空。
  45485. */
  45486. LabelSymbolCell_createClass(LabelSymbolCell, [{
  45487. key: "destroy",
  45488. value: function destroy() {
  45489. var me = this;
  45490. if (me.style) {
  45491. me.style.destroy();
  45492. me.style = null;
  45493. }
  45494. me.symbolIDField = null;
  45495. }
  45496. }]);
  45497. return LabelSymbolCell;
  45498. }(LabelMatrixCell);
  45499. ;// CONCATENATED MODULE: ./src/common/iServer/LabelThemeCell.js
  45500. 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); }
  45501. function LabelThemeCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45502. 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); } }
  45503. 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; }
  45504. 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); }
  45505. 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); }
  45506. 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); }; }
  45507. 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); }
  45508. function LabelThemeCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45509. 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; } }
  45510. function LabelThemeCell_getPrototypeOf(o) { LabelThemeCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeCell_getPrototypeOf(o); }
  45511. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45512. * This program are made available under the terms of the Apache License, Version 2.0
  45513. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45514. /**
  45515. * @class LabelThemeCell
  45516. * @deprecatedclass SuperMap.LabelThemeCell
  45517. * @category iServer Map Theme
  45518. * @classdesc 专题图类型的矩阵标签元素类。
  45519. * 该类继承自 {@link LabelMatrixCell} 类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  45520. * 矩阵标签专题图是标签专题图({@link ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link LabelImageCell})、
  45521. * 符号类型({@link LabelSymbolCell})、专题图类型({@link LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  45522. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应)、大小等。
  45523. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link ThemeLabel#matrixCells} 属性即可。matrixCells 属性是一个二维数组,
  45524. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  45525. * @extends {LabelMatrixCell}
  45526. * @param {Object} options -参数。
  45527. * @param {ThemeLabel} options.themeLabel - 作为矩阵标签元素的标签专题图类。
  45528. * @usage
  45529. */
  45530. var LabelThemeCell = /*#__PURE__*/function (_LabelMatrixCell) {
  45531. LabelThemeCell_inherits(LabelThemeCell, _LabelMatrixCell);
  45532. var _super = LabelThemeCell_createSuper(LabelThemeCell);
  45533. function LabelThemeCell(options) {
  45534. var _this;
  45535. LabelThemeCell_classCallCheck(this, LabelThemeCell);
  45536. _this = _super.call(this, options);
  45537. /**
  45538. * @member {ThemeLabel} LabelThemeCell.prototype.themeLabel
  45539. * @description 使用专题图对象作为矩阵标签的一个元素。
  45540. */
  45541. _this.themeLabel = new ThemeLabel();
  45542. /**
  45543. * @member {string} LabelThemeCell.prototype.type
  45544. * @description 制作矩阵专题图时是必须的。
  45545. */
  45546. _this.type = "THEME";
  45547. if (options) {
  45548. Util_Util.extend(LabelThemeCell_assertThisInitialized(_this), options);
  45549. }
  45550. _this.CLASS_NAME = " SuperMap.LabelThemeCell";
  45551. return _this;
  45552. }
  45553. /**
  45554. * @function LabelThemeCell.prototype.destroy
  45555. * @description 释放资源,将引用资源的属性置空。
  45556. */
  45557. LabelThemeCell_createClass(LabelThemeCell, [{
  45558. key: "destroy",
  45559. value: function destroy() {
  45560. var me = this;
  45561. if (me.themeLabel) {
  45562. me.themeLabel.destroy();
  45563. me.themeLabel = null;
  45564. }
  45565. }
  45566. }]);
  45567. return LabelThemeCell;
  45568. }(LabelMatrixCell);
  45569. ;// CONCATENATED MODULE: ./src/common/iServer/LayerStatus.js
  45570. function LayerStatus_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45571. 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); } }
  45572. 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; }
  45573. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45574. * This program are made available under the terms of the Apache License, Version 2.0
  45575. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45576. /**
  45577. * @class LayerStatus
  45578. * @deprecatedclass SuperMap.LayerStatus
  45579. * @category iServer Map TempLayersSet
  45580. * @classdesc 子图层显示参数类。该类存储了各个子图层的名字和是否可见的状态。
  45581. * @param {Object} options - 参数。
  45582. * @param {string} options.layerName - 图层名称。
  45583. * @param {boolean} [options.isVisible=true] - 图层是否可见,true 表示可见。
  45584. * @param {string} [options.displayFilter] - 图层显示 SQL 过滤条件。
  45585. * @usage
  45586. */
  45587. var LayerStatus = /*#__PURE__*/function () {
  45588. function LayerStatus(options) {
  45589. LayerStatus_classCallCheck(this, LayerStatus);
  45590. /**
  45591. * @member {string} LayerStatus.prototype.layerName
  45592. * @description 获取或设置图层名称。
  45593. */
  45594. this.layerName = null;
  45595. /**
  45596. * @member {boolean} LayerStatus.prototype.isVisible
  45597. * @description 获取或设置图层是否可见,true 表示可见。
  45598. */
  45599. this.isVisible = null;
  45600. /**
  45601. * @member {string} [LayerStatus.prototype.displayFilter]
  45602. * @description 图层显示 SQL 过滤条件,如 layerStatus.displayFilter = "smid < 10",表示仅显示 smid 值小于 10 的对象。
  45603. */
  45604. this.displayFilter = null;
  45605. /**
  45606. * @member {Object} [LayerStatus.prototype.fieldValuesDisplayFilter]
  45607. * @property {Array.<number>} values - 要过滤的值。
  45608. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  45609. * @property {string} fieldValuesDisplayMode - 目前有两个 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  45610. */
  45611. this.fieldValuesDisplayFilter = null;
  45612. if (options) {
  45613. Util_Util.extend(this, options);
  45614. }
  45615. this.CLASS_NAME = "SuperMap.LayerStatus";
  45616. }
  45617. /**
  45618. * @function LayerStatus.prototype.destroy
  45619. * @description 释放资源,将引用资源的属性置空。
  45620. */
  45621. LayerStatus_createClass(LayerStatus, [{
  45622. key: "destroy",
  45623. value: function destroy() {
  45624. var me = this;
  45625. me.layerName = null;
  45626. me.isVisible = null;
  45627. me.displayFilter = null;
  45628. }
  45629. /**
  45630. * @function LayerStatus.prototype.toJSON
  45631. * @description 生成对应的 JSON。
  45632. * @returns {Object} 对应的 JSON。
  45633. */
  45634. }, {
  45635. key: "toJSON",
  45636. value: function toJSON() {
  45637. var json = '{';
  45638. json += '"type":"UGC",';
  45639. var v = [];
  45640. if (this.layerName) {
  45641. v.push('"name":"' + this.layerName + '"');
  45642. v.push('"visible":' + this.isVisible);
  45643. }
  45644. if (this.displayFilter) {
  45645. v.push('"displayFilter":"' + this.displayFilter + '"');
  45646. }
  45647. if (this.minScale || this.minScale == 0) {
  45648. v.push('"minScale":' + this.minScale);
  45649. }
  45650. if (this.maxScale || this.maxScale == 0) {
  45651. v.push('"maxScale":' + this.maxScale);
  45652. }
  45653. if (this.fieldValuesDisplayFilter) {
  45654. v.push('"fieldValuesDisplayFilter":' + Util_Util.toJSON(this.fieldValuesDisplayFilter));
  45655. }
  45656. json += v;
  45657. json += '}';
  45658. return json;
  45659. }
  45660. }]);
  45661. return LayerStatus;
  45662. }();
  45663. ;// CONCATENATED MODULE: ./src/common/iServer/LinkItem.js
  45664. function LinkItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45665. 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); } }
  45666. 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; }
  45667. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45668. * This program are made available under the terms of the Apache License, Version 2.0
  45669. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45670. /**
  45671. * @class LinkItem
  45672. * @deprecatedclass SuperMap.LinkItem
  45673. * @constructs LinkItem
  45674. * @category iServer Data FeatureResults
  45675. * @classdesc 关联信息类。该类用于矢量数据集与外部表的关联。外部表是另一个数据集(其中纯属性数据集中没有空间几何信息)中的 DBMS 表,
  45676. * 矢量数据集与外部表可以属于不同的数据源,但数据源类型目前只支持 SQL Server 和 Oracle 类型。使用 LinkItem 时,
  45677. * 空间数据和属性数据必须满足关联条件,即主空间数据集与外部属性表之间存在关联字段。{@link LinkItem}
  45678. * 只支持左连接,UDB、PostgreSQL 和 DB2 数据源不支持 {@link LinkItem};另外,用于建立关联关系的两个表可以不在同一个数据源下。注意:<br>
  45679. * 1.使用 {@link LinkItem} 的约束条件为:空间数据和属性数据必须有关联条件,即主空间数据集与外部属性表之间存在关联字段;<br>
  45680. * 2.使用外关联表制作专题图时,所关联的字段必须设置表名,例如,如果所关联的字段为 BaseMap_R 数据集的 SmID,就要写成 BaseMap_R.SMID。
  45681. * @param {Object} options - 参数。
  45682. * @param {DatasourceConnectionInfo} options.datasourceConnectionInfo - 关联的外部数据源信息。
  45683. * @param {Array.<string>} options.foreignKeys - 主空间数据集的外键。
  45684. * @param {string} options.foreignTable - 关联的外部属性表的名称。
  45685. * @param {Array.<string>} options.linkFields - 欲保留的外部属性表的字段。
  45686. * @param {string} options.linkFilter - 与外部属性表的连接条件。
  45687. * @param {string} options.name - 此关联信息对象的名称。
  45688. * @param {Array.<string>} options.primaryKeys - 关联的外部属性表的主键。
  45689. * @example 下面以 SQL 查询说明 linkitem 的使用方法:
  45690. * function queryBySQL() {
  45691. * // 设置关联的外部数据库信息,alias表示数据库别名
  45692. * var dc = new DatasourceConnectionInfo({
  45693. * dataBase: "RelQuery",
  45694. * server: "{ip}:{port}",
  45695. * user: "sa",
  45696. * password: "map",
  45697. * driver: "SQL Server",
  45698. * connect: true,
  45699. * OpenLinkTable: false,
  45700. * alias: "RelQuery",
  45701. * engineType: EngineType.SQLPLUS,
  45702. * readOnly: false,
  45703. * exclusive: false
  45704. * });
  45705. * // 设置关联信息
  45706. * var linkItem = new LinkItem({
  45707. * datasourceConnectionInfo: dc,
  45708. * foreignKeys: ["name"],
  45709. * foreignTable: "Pop_2011",
  45710. * linkFields: ["SmID as Pid","pop"],
  45711. * name: "link",
  45712. * primatryKeys: ["name"],
  45713. * });
  45714. * // 设置查询参数,在查询参数中添加linkItem关联条件信息
  45715. * var queryParam, queryBySQLParams, queryBySQLService;
  45716. * queryParam = new FilterParameter({
  45717. * name: "Province@RelQuery",
  45718. * fields: ["SmID","name"],
  45719. * attributeFilter: "SmID<7",
  45720. * linkItems: [linkItem]
  45721. * }),
  45722. * queryBySQLParams = new QueryBySQLParameters({
  45723. * queryParams: [queryParam]
  45724. * }),
  45725. * queryBySQLService = new QueryBySQLService(url, {
  45726. * eventListeners: {
  45727. * "processCompleted": processCompleted,
  45728. * "processFailed": processFailed
  45729. * }
  45730. * });
  45731. * queryBySQLService.processAsync(queryBySQLParams);
  45732. * }
  45733. * function processCompleted(queryEventArgs) {//todo}
  45734. * function processFailed(e) {//todo}
  45735. * @usage
  45736. */
  45737. var LinkItem = /*#__PURE__*/function () {
  45738. function LinkItem(options) {
  45739. LinkItem_classCallCheck(this, LinkItem);
  45740. /**
  45741. * @member {DatasourceConnectionInfo} LinkItem.prototype.datasourceConnectionInfo
  45742. * @description 关联的外部数据源信息。
  45743. */
  45744. this.datasourceConnectionInfo = null;
  45745. /**
  45746. * @member {Array.<string>} LinkItem.prototype.foreignKeys
  45747. * @description 主空间数据集的外键。
  45748. */
  45749. this.foreignKeys = null;
  45750. /**
  45751. * @member {string} LinkItem.prototype.foreignTable
  45752. * @description 关联的外部属性表的名称,目前仅支持 Supermap 管理的表,即另一个矢量数据集所对应的 DBMS 表。
  45753. */
  45754. this.foreignTable = null;
  45755. /**
  45756. * @member {Array.<string>} LinkItem.prototype.linkFields
  45757. * @description 欲保留的外部属性表的字段。如果不设置字段或者设置的字段在外部属性表中不存在的话则不返回任何外部属性表的属性信息。如果欲保留的外部表字段与主表字段存在同名,则还需要指定一个不存在字段名作为外部表的字段别名。
  45758. */
  45759. this.linkFields = null;
  45760. /**
  45761. * @member {string} LinkItem.prototype.linkFilter
  45762. * @description 与外部属性表的连接条件。
  45763. */
  45764. this.linkFilter = null;
  45765. /**
  45766. * @member {string} LinkItem.prototype.name
  45767. * @description 此关联信息对象的名称。
  45768. */
  45769. this.name = null;
  45770. /**
  45771. * @member {Array.<string>} LinkItem.prototype.primaryKeys
  45772. * @description 需要关联的外部属性表的主键。
  45773. */
  45774. this.primaryKeys = null;
  45775. if (options) {
  45776. Util_Util.extend(this, options);
  45777. }
  45778. this.CLASS_NAME = "SuperMap.LinkItem";
  45779. }
  45780. /**
  45781. * @function LinkItem.prototype.destroy
  45782. * @description 释放资源,将引用资源的属性置空。
  45783. */
  45784. LinkItem_createClass(LinkItem, [{
  45785. key: "destroy",
  45786. value: function destroy() {
  45787. var me = this;
  45788. if (me.datasourceConnectionInfo instanceof DatasourceConnectionInfo) {
  45789. me.datasourceConnectionInfo.destroy();
  45790. me.datasourceConnectionInfo = null;
  45791. }
  45792. me.foreignKeys = null;
  45793. me.foreignTable = null;
  45794. me.linkFields = null;
  45795. me.linkFilter = null;
  45796. me.name = null;
  45797. me.primaryKeys = null;
  45798. }
  45799. }]);
  45800. return LinkItem;
  45801. }();
  45802. ;// CONCATENATED MODULE: ./src/common/iServer/MapService.js
  45803. 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); }
  45804. function MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45805. 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); } }
  45806. 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; }
  45807. 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); }
  45808. function MapService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapService_getPrototypeOf(object); if (object === null) break; } return object; }
  45809. 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); }
  45810. 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); }
  45811. 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); }; }
  45812. 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); }
  45813. function MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45814. 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; } }
  45815. function MapService_getPrototypeOf(o) { MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapService_getPrototypeOf(o); }
  45816. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45817. * This program are made available under the terms of the Apache License, Version 2.0
  45818. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45819. /**
  45820. * @class MapService
  45821. * @deprecatedclass SuperMap.MapService
  45822. * @category iServer Map
  45823. * @classdesc 地图信息服务类。
  45824. * @extends {CommonServiceBase}
  45825. * @example
  45826. * var myMapService = new MapService(url, {
  45827. * eventListeners:{
  45828. * "processCompleted": MapServiceCompleted,
  45829. * "processFailed": MapServiceFailed
  45830. * }
  45831. * });
  45832. *
  45833. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  45834. * @param {Object} options - 参数。
  45835. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  45836. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  45837. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  45838. * @param {Object} [options.headers] - 请求头。
  45839. * @usage
  45840. */
  45841. var MapService = /*#__PURE__*/function (_CommonServiceBase) {
  45842. MapService_inherits(MapService, _CommonServiceBase);
  45843. var _super = MapService_createSuper(MapService);
  45844. function MapService(url, options) {
  45845. var _this;
  45846. MapService_classCallCheck(this, MapService);
  45847. _this = _super.call(this, url, options);
  45848. /**
  45849. * @member {string} MapService.prototype.projection
  45850. * @description 根据投影参数获取地图状态信息。如"EPSG:4326"
  45851. */
  45852. _this.projection = null;
  45853. _this.CLASS_NAME = "SuperMap.MapService";
  45854. if (options) {
  45855. Util_Util.extend(MapService_assertThisInitialized(_this), options);
  45856. }
  45857. var me = MapService_assertThisInitialized(_this);
  45858. if (me.projection) {
  45859. var arr = me.projection.split(":");
  45860. if (arr instanceof Array) {
  45861. if (arr.length === 2) {
  45862. me.url = Util_Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[1], "\"}"))));
  45863. }
  45864. if (arr.length === 1) {
  45865. me.url = Util_Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[0], "\"}"))));
  45866. }
  45867. }
  45868. }
  45869. _this.eventCount = 0;
  45870. return _this;
  45871. }
  45872. /**
  45873. * @function destroy
  45874. * @description 释放资源,将引用的资源属性置空。
  45875. */
  45876. MapService_createClass(MapService, [{
  45877. key: "destroy",
  45878. value: function destroy() {
  45879. MapService_get(MapService_getPrototypeOf(MapService.prototype), "destroy", this).call(this);
  45880. var me = this;
  45881. if (me.events) {
  45882. me.events.un(me.eventListeners);
  45883. me.events.listeners = null;
  45884. me.events.destroy();
  45885. me.events = null;
  45886. me.eventListeners = null;
  45887. }
  45888. }
  45889. /**
  45890. * @function MapService.prototype.processAsync
  45891. * @description 负责将客户端的设置的参数传递到服务端,与服务端完成异步通讯。
  45892. */
  45893. }, {
  45894. key: "processAsync",
  45895. value: function processAsync(callback) {
  45896. var eventId = ++this.eventCount;
  45897. var eventListeners = {
  45898. scope: this,
  45899. processCompleted: function processCompleted(result) {
  45900. if (eventId === result.result.eventId && callback) {
  45901. delete result.result.eventId;
  45902. callback(result);
  45903. this.events && this.events.un(eventListeners);
  45904. return false;
  45905. }
  45906. },
  45907. processFailed: function processFailed(result) {
  45908. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  45909. callback(result);
  45910. this.events && this.events.un(eventListeners);
  45911. return false;
  45912. }
  45913. }
  45914. };
  45915. this.events.on(eventListeners);
  45916. var me = this;
  45917. me.request({
  45918. method: "GET",
  45919. scope: me,
  45920. success: function success(result, options) {
  45921. result.eventId = eventId;
  45922. this.serviceProcessCompleted(result, options);
  45923. },
  45924. failure: function failure(result, options) {
  45925. if (result.error) {
  45926. result.error.eventId = eventId;
  45927. }
  45928. result.eventId = eventId;
  45929. this.serviceProcessFailed(result, options);
  45930. }
  45931. });
  45932. }
  45933. /*
  45934. * Method: getMapStatusCompleted
  45935. * 获取地图状态完成,执行此方法。
  45936. *
  45937. * Parameters:
  45938. * {Object} result - 服务器返回的结果对象。
  45939. */
  45940. }, {
  45941. key: "serviceProcessCompleted",
  45942. value: function serviceProcessCompleted(result, options) {
  45943. var me = this;
  45944. result = Util_Util.transformResult(result);
  45945. var codeStatus = result.code >= 200 && result.code < 300 || result.code == 0 || result.code === 304;
  45946. var isCodeValid = result.code && codeStatus;
  45947. if (!result.code || isCodeValid) {
  45948. me.events && me.events.triggerEvent("processCompleted", {
  45949. result: result,
  45950. options: options
  45951. });
  45952. } else {
  45953. ////在没有token是返回的是200,但是其实是没有权限,所以这里也应该是触发失败事件
  45954. me.events.triggerEvent("processFailed", {
  45955. error: result,
  45956. options: options
  45957. });
  45958. }
  45959. }
  45960. }]);
  45961. return MapService;
  45962. }(CommonServiceBase);
  45963. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisParameters.js
  45964. function MathExpressionAnalysisParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45965. 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); } }
  45966. 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; }
  45967. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  45968. * This program are made available under the terms of the Apache License, Version 2.0
  45969. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45970. /**
  45971. * @class MathExpressionAnalysisParameters
  45972. * @deprecatedclass SuperMap.MathExpressionAnalysisParameters
  45973. * @category iServer SpatialAnalyst GridMathAnalyst
  45974. * @classdesc 栅格代数运算参数类。
  45975. * @param {Object} options - 参数。
  45976. * @param {string} options.dataset - 指定栅格代数运算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:BaseMap_P@Jingjin。
  45977. * @param {string} options.resultGridName - 指定结果数据集名称。
  45978. * @param {string} options.expression - 指定的栅格运算表达式。如:[DatasourceAlias1.Raster1]*2-10。
  45979. * @param {string} options.targetDatasource - 指定存储结果数据集的数据源。
  45980. * @param {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [options.extractRegion] - 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  45981. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  45982. * @param {boolean} [options.isZip=false] - 是否对结果数据集进行压缩处理。
  45983. * @param {boolean} [options.ignoreNoValue=false] - 是否忽略无值栅格数据。true 表示忽略无值数据,即无值栅格不参与运算。
  45984. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  45985. * @usage
  45986. */
  45987. var MathExpressionAnalysisParameters = /*#__PURE__*/function () {
  45988. function MathExpressionAnalysisParameters(options) {
  45989. MathExpressionAnalysisParameters_classCallCheck(this, MathExpressionAnalysisParameters);
  45990. if (!options) {
  45991. return;
  45992. }
  45993. /**
  45994. * @member {string} MathExpressionAnalysisParameters.prototype.dataset
  45995. * @description 要用来做栅格代数运算数据源中数据集的名称。
  45996. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  45997. *
  45998. */
  45999. this.dataset = null;
  46000. /**
  46001. * @member {GeometryPolygon|L.Polygon|ol.geom.Polygon|GeoJSONObject} [MathExpressionAnalysisParameters.prototype.extractRegion]
  46002. * @description 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  46003. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  46004. */
  46005. this.extractRegion = null;
  46006. /**
  46007. * @member {string} MathExpressionAnalysisParameters.prototype.expression
  46008. * @description 指定的栅格运算表达式。如:"[DatasourceAlias1.Raster1]*2-10"。
  46009. */
  46010. this.expression = null;
  46011. /**
  46012. * @member {boolean} [MathExpressionAnalysisParameters.prototype.isZip=false]
  46013. * @description 是否对结果数据集进行压缩处理。
  46014. */
  46015. this.isZip = false;
  46016. /**
  46017. * @member {boolean} [MathExpressionAnalysisParameters.prototype.ignoreNoValue=false]
  46018. * @description 是否忽略无值栅格数据。
  46019. */
  46020. this.ignoreNoValue = false;
  46021. /**
  46022. * @member {string} MathExpressionAnalysisParameters.prototype.targetDatasource
  46023. * @description 指定存储结果数据集的数据源。
  46024. */
  46025. this.targetDatasource = null;
  46026. /**
  46027. * @member {string} MathExpressionAnalysisParameters.prototype.resultGridName
  46028. * @description 指定结果数据集名称。
  46029. */
  46030. this.resultGridName = null;
  46031. /**
  46032. * @member {boolean} [MathExpressionAnalysisParameters.prototype.deleteExistResultDataset=false]
  46033. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  46034. */
  46035. this.deleteExistResultDataset = false;
  46036. Util_Util.extend(this, options);
  46037. this.CLASS_NAME = "SuperMap.MathExpressionAnalysisParameters";
  46038. }
  46039. /**
  46040. * @function MathExpressionAnalysisParameters.prototype.destroy
  46041. * @description 释放资源,将引用资源的属性置空。
  46042. */
  46043. MathExpressionAnalysisParameters_createClass(MathExpressionAnalysisParameters, [{
  46044. key: "destroy",
  46045. value: function destroy() {
  46046. var me = this;
  46047. me.dataset = null;
  46048. me.bounds = null;
  46049. me.expression = null;
  46050. me.isZip = true;
  46051. me.ignoreNoValue = true;
  46052. me.targetDatasource = null;
  46053. me.resultGridName = null;
  46054. me.deleteExistResultDataset = null;
  46055. }
  46056. /**
  46057. * @function MathExpressionAnalysisParameters.toObject
  46058. * @param {Object} mathExpressionAnalysisParameters - 栅格代数运算参数。
  46059. * @param {Object} tempObj - 目标对象。
  46060. * @description 生成栅格代数运算对象。
  46061. */
  46062. }], [{
  46063. key: "toObject",
  46064. value: function toObject(mathExpressionAnalysisParameters, tempObj) {
  46065. for (var name in mathExpressionAnalysisParameters) {
  46066. if (name !== "dataset") {
  46067. tempObj[name] = mathExpressionAnalysisParameters[name];
  46068. }
  46069. if (name === "extractRegion") {
  46070. if (mathExpressionAnalysisParameters[name]) {
  46071. var bs = mathExpressionAnalysisParameters[name].components[0].components;
  46072. var region = {},
  46073. points = [],
  46074. type = "REGION";
  46075. var len = bs.length;
  46076. for (var i = 0; i < len - 1; i++) {
  46077. var poi = {};
  46078. poi["x"] = bs[i].x;
  46079. poi["y"] = bs[i].y;
  46080. points.push(poi);
  46081. }
  46082. region["points"] = points;
  46083. region["type"] = type;
  46084. tempObj[name] = region;
  46085. }
  46086. }
  46087. }
  46088. }
  46089. }]);
  46090. return MathExpressionAnalysisParameters;
  46091. }();
  46092. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisService.js
  46093. 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); }
  46094. function MathExpressionAnalysisService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46095. 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); } }
  46096. 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; }
  46097. 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); }
  46098. function MathExpressionAnalysisService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MathExpressionAnalysisService_getPrototypeOf(object); if (object === null) break; } return object; }
  46099. 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); }
  46100. 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); }
  46101. 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); }; }
  46102. 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); }
  46103. function MathExpressionAnalysisService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46104. 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; } }
  46105. function MathExpressionAnalysisService_getPrototypeOf(o) { MathExpressionAnalysisService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MathExpressionAnalysisService_getPrototypeOf(o); }
  46106. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46107. * This program are made available under the terms of the Apache License, Version 2.0
  46108. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46109. /**
  46110. * @class MathExpressionAnalysisService
  46111. * @deprecatedclass SuperMap.MathExpressionAnalysisService
  46112. * @category iServer SpatialAnalyst GridMathAnalyst
  46113. * @classdesc 栅格代数运算服务类。
  46114. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  46115. * @param {Object} options - 参数。
  46116. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  46117. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46118. * @param {Object} [options.headers] - 请求头。
  46119. * @extends {SpatialAnalystBase}
  46120. * @example 例如:
  46121. * (start code)
  46122. * var myMathExpressionAnalysisService = new MathExpressionAnalysisService(url);
  46123. * myMathExpressionAnalysisService.on({
  46124. * "processCompleted": processCompleted,
  46125. * "processFailed": processFailed
  46126. * }
  46127. * );
  46128. * (end)
  46129. * @usage
  46130. */
  46131. var MathExpressionAnalysisService = /*#__PURE__*/function (_SpatialAnalystBase) {
  46132. MathExpressionAnalysisService_inherits(MathExpressionAnalysisService, _SpatialAnalystBase);
  46133. var _super = MathExpressionAnalysisService_createSuper(MathExpressionAnalysisService);
  46134. function MathExpressionAnalysisService(url, options) {
  46135. var _this;
  46136. MathExpressionAnalysisService_classCallCheck(this, MathExpressionAnalysisService);
  46137. _this = _super.call(this, url, options);
  46138. _this.CLASS_NAME = "SuperMap.MathExpressionAnalysisService";
  46139. return _this;
  46140. }
  46141. /**
  46142. * @override
  46143. */
  46144. MathExpressionAnalysisService_createClass(MathExpressionAnalysisService, [{
  46145. key: "destroy",
  46146. value: function destroy() {
  46147. MathExpressionAnalysisService_get(MathExpressionAnalysisService_getPrototypeOf(MathExpressionAnalysisService.prototype), "destroy", this).call(this);
  46148. }
  46149. /**
  46150. * @function MathExpressionAnalysisService.prototype.processAsync
  46151. * @description 负责将客户端的查询参数传递到服务端。
  46152. * @param {MathExpressionAnalysisParameters} parameter - 栅格代数运算参数类。
  46153. */
  46154. }, {
  46155. key: "processAsync",
  46156. value: function processAsync(parameter) {
  46157. var me = this;
  46158. var parameterObject = {};
  46159. if (parameter instanceof MathExpressionAnalysisParameters) {
  46160. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/mathanalyst');
  46161. }
  46162. MathExpressionAnalysisParameters.toObject(parameter, parameterObject);
  46163. var jsonParameters = Util_Util.toJSON(parameterObject);
  46164. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  46165. me.request({
  46166. method: "POST",
  46167. data: jsonParameters,
  46168. scope: me,
  46169. success: me.serviceProcessCompleted,
  46170. failure: me.serviceProcessFailed
  46171. });
  46172. }
  46173. }]);
  46174. return MathExpressionAnalysisService;
  46175. }(SpatialAnalystBase);
  46176. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureParameters.js
  46177. function MeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46178. 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); } }
  46179. 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; }
  46180. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46181. * This program are made available under the terms of the Apache License, Version 2.0
  46182. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46183. /**
  46184. * @class MeasureParameters
  46185. * @deprecatedclass SuperMap.MeasureParameters
  46186. * @category iServer Map Measure
  46187. * @classdesc 量算参数类。
  46188. * @param {GeoJSONObject} geometry - 要量算的几何对象。
  46189. * @param {Object} options - 可选参数。
  46190. * @param {Unit} [options.unit=Unit.METER] - 量算单位。
  46191. * @param {string} [options.prjCoordSys] - 用来指定该量算操作所使用的投影。
  46192. * @param {string} [options.distanceMode="Geodesic"] - 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  46193. * @usage
  46194. */
  46195. var MeasureParameters = /*#__PURE__*/function () {
  46196. function MeasureParameters(geometry, options) {
  46197. MeasureParameters_classCallCheck(this, MeasureParameters);
  46198. if (!geometry) {
  46199. return;
  46200. }
  46201. /**
  46202. * @member {GeoJSONObject} MeasureParameters.prototype.geometry
  46203. * @description 要量算的几何对象。<br>
  46204. * 点类型可以是:{@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>
  46205. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  46206. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。
  46207. */
  46208. this.geometry = geometry;
  46209. /**
  46210. * @member {Unit} [MeasureParameters.prototype.unit=Unit.METER]
  46211. * @description 量算单位。即量算结果以米为单位。
  46212. */
  46213. this.unit = Unit.METER;
  46214. /**
  46215. * @member {string} [MeasureParameters.prototype.prjCoordSys]
  46216. * @description 用来指定该量算操作所使用的投影。
  46217. */
  46218. this.prjCoordSys = null;
  46219. /**
  46220. * @member {string} [MeasureParameters.prototype.distanceMode="Geodesic"]
  46221. * @description 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  46222. * @example
  46223. * var param = new MeasureParameters(getmetry,{distanceMode:'Planar'});
  46224. */
  46225. this.distanceMode = null;
  46226. if (options) {
  46227. Util_Util.extend(this, options);
  46228. }
  46229. this.CLASS_NAME = "SuperMap.MeasureParameters";
  46230. }
  46231. /**
  46232. * @function MeasureParameters.prototype.destroy
  46233. * @description 释放资源,将引用资源的属性置空。
  46234. */
  46235. MeasureParameters_createClass(MeasureParameters, [{
  46236. key: "destroy",
  46237. value: function destroy() {
  46238. var me = this;
  46239. me.geometry = null;
  46240. me.unit = null;
  46241. me.prjCoordSys = null;
  46242. }
  46243. }]);
  46244. return MeasureParameters;
  46245. }();
  46246. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureService.js
  46247. 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); }
  46248. function MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46249. 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); } }
  46250. 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; }
  46251. 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); }
  46252. function MeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  46253. 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); }
  46254. 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); }
  46255. 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); }; }
  46256. 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); }
  46257. function MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46258. 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; } }
  46259. function MeasureService_getPrototypeOf(o) { MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MeasureService_getPrototypeOf(o); }
  46260. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46261. * This program are made available under the terms of the Apache License, Version 2.0
  46262. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46263. /**
  46264. * @class MeasureService
  46265. * @deprecatedclass SuperMap.MeasureService
  46266. * @category iServer Map Measure
  46267. * @classdesc 量算服务类。
  46268. * 该类负责将量算参数传递到服务端,并获取服务端返回的量算结果。
  46269. * @extends {CommonServiceBase}
  46270. * @example
  46271. * var myMeasuerService = new MeasureService(url, {
  46272. * measureMode: MeasureMode.DISTANCE,
  46273. * eventListeners:{
  46274. * "processCompleted": measureCompleted
  46275. * }
  46276. * });
  46277. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  46278. * @param {Object} options - 参数。
  46279. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  46280. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  46281. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46282. * @param {Object} [options.headers] - 请求头。
  46283. * @param {MeasureMode} options.measureMode - 量算模式,包括距离量算模式和面积量算模式。
  46284. * @usage
  46285. */
  46286. var MeasureService = /*#__PURE__*/function (_CommonServiceBase) {
  46287. MeasureService_inherits(MeasureService, _CommonServiceBase);
  46288. var _super = MeasureService_createSuper(MeasureService);
  46289. function MeasureService(url, options) {
  46290. var _this;
  46291. MeasureService_classCallCheck(this, MeasureService);
  46292. _this = _super.call(this, url, options);
  46293. /**
  46294. * @member {MeasureMode} [MeasureService.prototype.measureMode=MeasureMode.DISTANCE]
  46295. * @description 量算模式,包括距离量算模式和面积量算模式。
  46296. */
  46297. _this.measureMode = MeasureMode.DISTANCE;
  46298. if (options) {
  46299. Util_Util.extend(MeasureService_assertThisInitialized(_this), options);
  46300. }
  46301. _this.eventCount = 0;
  46302. _this.CLASS_NAME = "SuperMap.MeasureService";
  46303. return _this;
  46304. }
  46305. /**
  46306. * @override
  46307. */
  46308. MeasureService_createClass(MeasureService, [{
  46309. key: "destroy",
  46310. value: function destroy() {
  46311. MeasureService_get(MeasureService_getPrototypeOf(MeasureService.prototype), "destroy", this).call(this);
  46312. var me = this;
  46313. me.measureMode = null;
  46314. }
  46315. /**
  46316. * @function MeasureService.prototype.processAsync
  46317. * @description 负责将客户端的量算参数传递到服务端。
  46318. * @param {MeasureParameters} params - 量算参数。
  46319. */
  46320. }, {
  46321. key: "processAsync",
  46322. value: function processAsync(params, callback) {
  46323. if (!(params instanceof MeasureParameters)) {
  46324. return;
  46325. }
  46326. var eventId = ++this.eventCount;
  46327. var eventListeners = {
  46328. scope: this,
  46329. processCompleted: function processCompleted(result) {
  46330. if (eventId === result.result.eventId && callback) {
  46331. delete result.result.eventId;
  46332. callback(result);
  46333. this.events && this.events.un(eventListeners);
  46334. return false;
  46335. }
  46336. },
  46337. processFailed: function processFailed(result) {
  46338. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  46339. callback(result);
  46340. this.events && this.events.un(eventListeners);
  46341. return false;
  46342. }
  46343. }
  46344. };
  46345. this.events.on(eventListeners);
  46346. var me = this,
  46347. geometry = params.geometry,
  46348. pointsCount = 0,
  46349. point2ds = null;
  46350. if (!geometry) {
  46351. return;
  46352. }
  46353. me.url = Util_Util.urlPathAppend(me.url, me.measureMode === MeasureMode.AREA ? 'area' : 'distance');
  46354. var serverGeometry = ServerGeometry.fromGeometry(geometry);
  46355. if (!serverGeometry) {
  46356. return;
  46357. }
  46358. pointsCount = serverGeometry.parts[0];
  46359. point2ds = serverGeometry.points.splice(0, pointsCount);
  46360. var prjCoordSysTemp, prjCodeTemp, paramsTemp;
  46361. if (params.prjCoordSys) {
  46362. if (MeasureService_typeof(params.prjCoordSys) === "object") {
  46363. prjCodeTemp = params.prjCoordSys.projCode;
  46364. prjCoordSysTemp = '{"epsgCode"' + prjCodeTemp.substring(prjCodeTemp.indexOf(":"), prjCodeTemp.length) + "}";
  46365. } else if (typeof params.prjCoordSys === "string") {
  46366. prjCoordSysTemp = '{"epsgCode"' + params.prjCoordSys.substring(params.prjCoordSys.indexOf(":"), params.prjCoordSys.length) + "}";
  46367. }
  46368. paramsTemp = {
  46369. "point2Ds": Util_Util.toJSON(point2ds),
  46370. "unit": params.unit,
  46371. "prjCoordSys": prjCoordSysTemp,
  46372. "distanceMode": params.distanceMode || 'Geodesic'
  46373. };
  46374. } else {
  46375. paramsTemp = {
  46376. "point2Ds": Util_Util.toJSON(point2ds),
  46377. "unit": params.unit,
  46378. "distanceMode": params.distanceMode || 'Geodesic'
  46379. };
  46380. }
  46381. me.request({
  46382. method: "GET",
  46383. params: paramsTemp,
  46384. scope: me,
  46385. success: function success(result, options) {
  46386. result.eventId = eventId;
  46387. this.serviceProcessCompleted(result, options);
  46388. },
  46389. failure: function failure(result, options) {
  46390. if (result.error) {
  46391. result.error.eventId = eventId;
  46392. }
  46393. result.eventId = eventId;
  46394. this.serviceProcessFailed(result, options);
  46395. }
  46396. });
  46397. }
  46398. }]);
  46399. return MeasureService;
  46400. }(CommonServiceBase);
  46401. ;// CONCATENATED MODULE: ./src/common/iServer/OverlapDisplayedOptions.js
  46402. function OverlapDisplayedOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46403. 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); } }
  46404. 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; }
  46405. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46406. * This program are made available under the terms of the Apache License, Version 2.0
  46407. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46408. /**
  46409. * @class OverlapDisplayedOptions
  46410. * @deprecatedclass SuperMap.OverlapDisplayedOptions
  46411. * @category iServer Map Layer
  46412. * @classdesc 地图压盖过滤显示选项。在文本或专题图元素显示较密集的区域,文本之间或专题元素之间会发生相互压盖的现象,
  46413. * 该类可以分别控制各种类型的对象的压盖显示情况,进而很好地处理地图中各种类型对象的压盖显示问题。
  46414. * @param {Object} options - 可选参数。
  46415. * @param {boolean} [options.allowPointOverlap=true] - 点和点压盖时是否显示压盖的点对象。
  46416. * @param {boolean} [options.allowPointWithTextDisplay=true] - 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  46417. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  46418. * @param {boolean} [options.allowTextOverlap=false] - 文本压盖时是否显示压盖的文本对象。
  46419. * @param {boolean} [options.allowTextAndPointOverlap=true] - 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  46420. * @param {boolean} [options.allowThemeGraduatedSymbolOverlap=false] - 等级符号元素压盖时是否显示压盖的等级符号元素。
  46421. * @param {boolean} [options.allowThemeGraphOverlap=false] - 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  46422. * @param {number} [options.horizontalOverlappedSpaceSize=0] - 两个对象之间的横向压盖间距,单位为 0.1 毫米,跟 verticalOverlappedSpaceSize 结合使用,
  46423. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  46424. * @param {number} [options.verticalOverlappedSpaceSize=0] - 两个对象之间的纵向压盖间距,单位为 0.1 毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  46425. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  46426. * @usage
  46427. */
  46428. var OverlapDisplayedOptions = /*#__PURE__*/function () {
  46429. function OverlapDisplayedOptions(options) {
  46430. OverlapDisplayedOptions_classCallCheck(this, OverlapDisplayedOptions);
  46431. options = options || {};
  46432. /**
  46433. * @member {boolean} [OverlapDisplayedOptions.prototype.allowPointOverlap=true]
  46434. * @description 点和点压盖时是否显示压盖的点对象。
  46435. */
  46436. this.allowPointOverlap = true;
  46437. /**
  46438. * @member {boolean} [OverlapDisplayedOptions.prototype.allowPointWithTextDisplay=true]
  46439. * @description 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  46440. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  46441. */
  46442. this.allowPointWithTextDisplay = true;
  46443. /**
  46444. * @member {boolean} [OverlapDisplayedOptions.prototype.allowTextOverlap=false]
  46445. * @description 文本压盖时是否显示压盖的文本对象。
  46446. */
  46447. this.allowTextOverlap = false;
  46448. /**
  46449. * @member {boolean} [OverlapDisplayedOptions.prototype.allowTextAndPointOverlap=true]
  46450. * @description 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  46451. */
  46452. this.allowTextAndPointOverlap = true;
  46453. /**
  46454. * @member {boolean} [OverlapDisplayedOptions.prototype.allowThemeGraduatedSymbolOverlap=false]
  46455. * @description 等级符号元素压盖时是否显示压盖的等级符号元素。
  46456. */
  46457. this.allowThemeGraduatedSymbolOverlap = false;
  46458. /**
  46459. * @member {boolean} [OverlapDisplayedOptions.prototype.allowThemeGraphOverlap=false]
  46460. * @description 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  46461. */
  46462. this.allowThemeGraphOverlap = false;
  46463. /**
  46464. * @member {number} [OverlapDisplayedOptions.prototype.horizontalOverlappedSpaceSize=0]
  46465. * @description 两个对象之间的横向压盖间距,单位为0.1毫米,跟 verticalOverlappedSpaceSize 结合使用,
  46466. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  46467. */
  46468. this.horizontalOverlappedSpaceSize = 0;
  46469. /**
  46470. * @member {number} [OverlapDisplayedOptions.prototype.verticalOverlappedSpaceSize=0]
  46471. * @description 两个对象之间的纵向压盖间距,单位为0.1毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  46472. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  46473. */
  46474. this.verticalOverlappedSpaceSize = 0;
  46475. Util_Util.extend(this, options);
  46476. this.ugcLayer = new UGCLayer(options);
  46477. this.CLASS_NAME = "SuperMap.OverlapDisplayedOptions";
  46478. }
  46479. /**
  46480. * @function OverlapDisplayedOptions.prototype.destroy
  46481. * @description 释放资源,将资源的属性置空。
  46482. */
  46483. OverlapDisplayedOptions_createClass(OverlapDisplayedOptions, [{
  46484. key: "destroy",
  46485. value: function destroy() {
  46486. Util_Util.reset(this);
  46487. }
  46488. /**
  46489. * @function OverlapDisplayedOptions.prototype.fromJson
  46490. * @description 将服务端 JSON 对象转换成当前客户端对象。
  46491. * @param {Object} jsonObject - 要转换的 JSON 对象。
  46492. */
  46493. }, {
  46494. key: "fromJson",
  46495. value: function fromJson(jsonObject) {
  46496. this.ugcLayer.fromJson.apply(this, [jsonObject]);
  46497. }
  46498. /**
  46499. * @function OverlapDisplayedOptions.prototype.toServerJSONObject
  46500. * @description 转换成对应的 JSON 格式对象。
  46501. * @returns {Object} 对应的 JSON 格式对象。
  46502. */
  46503. }, {
  46504. key: "toServerJSONObject",
  46505. value: function toServerJSONObject() {
  46506. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  46507. return jsonObject;
  46508. }
  46509. /**
  46510. * @function OverlapDisplayedOptions.prototype.toString
  46511. * @description 转换成对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  46512. * @returns {string} 对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  46513. */
  46514. }, {
  46515. key: "toString",
  46516. value: function toString() {
  46517. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  46518. var str = "{";
  46519. for (var attr in jsonObject) {
  46520. if (jsonObject.hasOwnProperty(attr)) {
  46521. str += "'" + attr + "':" + jsonObject[attr] + ",";
  46522. }
  46523. }
  46524. str = str.substr(0, str.length - 1);
  46525. str += "}";
  46526. return str;
  46527. }
  46528. }]);
  46529. return OverlapDisplayedOptions;
  46530. }();
  46531. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystService.js
  46532. 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); }
  46533. function OverlayAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46534. 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); } }
  46535. 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; }
  46536. 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); }
  46537. function OverlayAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  46538. 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); }
  46539. 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); }
  46540. 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); }; }
  46541. 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); }
  46542. function OverlayAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46543. 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; } }
  46544. function OverlayAnalystService_getPrototypeOf(o) { OverlayAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayAnalystService_getPrototypeOf(o); }
  46545. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46546. * This program are made available under the terms of the Apache License, Version 2.0
  46547. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46548. /**
  46549. * @class OverlayAnalystService
  46550. * @deprecatedclass SuperMap.OverlayAnalystService
  46551. * @category iServer SpatialAnalyst OverlayAnalyst
  46552. * @classdesc 叠加分析服务类。
  46553. * 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  46554. * 叠加分析结果通过该类支持的事件的监听函数参数获取
  46555. * @param {string} url - 服务地址。如http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  46556. * @param {Object} options - 参数。
  46557. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  46558. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46559. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  46560. * @param {Object} [options.headers] - 请求头。
  46561. * @extends {CommonServiceBase}
  46562. * @example 例如:
  46563. * (start code)
  46564. * var myOverlayAnalystService = new OverlayAnalystService(url, {
  46565. * eventListeners: {
  46566. * "processCompleted": OverlayCompleted,
  46567. * "processFailed": OverlayFailed
  46568. * }
  46569. * });
  46570. * (end)
  46571. * @usage
  46572. */
  46573. var OverlayAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  46574. OverlayAnalystService_inherits(OverlayAnalystService, _SpatialAnalystBase);
  46575. var _super = OverlayAnalystService_createSuper(OverlayAnalystService);
  46576. function OverlayAnalystService(url, options) {
  46577. var _this;
  46578. OverlayAnalystService_classCallCheck(this, OverlayAnalystService);
  46579. _this = _super.call(this, url, options);
  46580. /**
  46581. * @member {string} OverlayAnalystService.prototype.mode
  46582. * @description 叠加分析类型
  46583. */
  46584. _this.mode = null;
  46585. if (options) {
  46586. Util_Util.extend(OverlayAnalystService_assertThisInitialized(_this), options);
  46587. }
  46588. _this.CLASS_NAME = "SuperMap.OverlayAnalystService";
  46589. return _this;
  46590. }
  46591. /**
  46592. * @override
  46593. */
  46594. OverlayAnalystService_createClass(OverlayAnalystService, [{
  46595. key: "destroy",
  46596. value: function destroy() {
  46597. OverlayAnalystService_get(OverlayAnalystService_getPrototypeOf(OverlayAnalystService.prototype), "destroy", this).call(this);
  46598. this.mode = null;
  46599. }
  46600. /**
  46601. * @function OverlayAnalystService.prototype.processAsync
  46602. * @description 负责将客户端的查询参数传递到服务端。
  46603. * @param {OverlayAnalystParameters} parameter - 叠加分析参数类。
  46604. */
  46605. }, {
  46606. key: "processAsync",
  46607. value: function processAsync(parameter) {
  46608. var parameterObject = {};
  46609. var me = this;
  46610. if (parameter instanceof DatasetOverlayAnalystParameters) {
  46611. me.mode = "datasets";
  46612. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.sourceDataset + '/overlay');
  46613. DatasetOverlayAnalystParameters.toObject(parameter, parameterObject);
  46614. } else if (parameter instanceof GeometryOverlayAnalystParameters) {
  46615. me.mode = "geometry";
  46616. //支持传入多个几何要素进行叠加分析
  46617. if (parameter.operateGeometries && parameter.sourceGeometries) {
  46618. me.url = Util_Util.urlPathAppend(me.url, 'geometry/overlay/batch');
  46619. me.url = Util_Util.urlAppend(me.url, 'ignoreAnalystParam=true');
  46620. } else {
  46621. me.url = Util_Util.urlPathAppend(me.url, 'geometry/overlay');
  46622. }
  46623. GeometryOverlayAnalystParameters.toObject(parameter, parameterObject);
  46624. }
  46625. this.returnContent = true;
  46626. var jsonParameters = Util_Util.toJSON(parameterObject);
  46627. me.request({
  46628. method: "POST",
  46629. data: jsonParameters,
  46630. scope: me,
  46631. success: me.serviceProcessCompleted,
  46632. failure: me.serviceProcessFailed
  46633. });
  46634. }
  46635. }, {
  46636. key: "dataFormat",
  46637. value: function dataFormat() {
  46638. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  46639. }
  46640. }]);
  46641. return OverlayAnalystService;
  46642. }(SpatialAnalystBase);
  46643. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
  46644. function OverlayGeoJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46645. 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); } }
  46646. 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; }
  46647. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46648. * This program are made available under the terms of the Apache License, Version 2.0
  46649. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46650. /**
  46651. * @class OverlayGeoJobParameter
  46652. * @deprecatedclass SuperMap.OverlayGeoJobParameter
  46653. * @category iServer ProcessingService OverlayAnalyst
  46654. * @classdesc 叠加分析任务参数类。
  46655. * @param {Object} options - 参数。
  46656. * @param {string} options.datasetName - 数据集名。
  46657. * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
  46658. * @param {string} options.srcFields - 输入数据需要保留的字段。
  46659. * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
  46660. * @param {string} [options.mode] - 叠加分析模式。
  46661. * @param {OutputSetting} [options.output] - 输出参数设置。
  46662. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  46663. * @usage
  46664. */
  46665. var OverlayGeoJobParameter = /*#__PURE__*/function () {
  46666. function OverlayGeoJobParameter(options) {
  46667. OverlayGeoJobParameter_classCallCheck(this, OverlayGeoJobParameter);
  46668. if (!options) {
  46669. return;
  46670. }
  46671. /**
  46672. * @member {string} OverlayGeoJobParameter.prototype.datasetName
  46673. * @description 数据集名。
  46674. */
  46675. this.datasetName = "";
  46676. /**
  46677. * @member {string} OverlayGeoJobParameter.prototype.datasetOverlay
  46678. * @description 叠加对象所在的数据集名称。
  46679. */
  46680. this.datasetOverlay = "";
  46681. /**
  46682. * @member {string} [OverlayGeoJobParameter.prototype.mode]
  46683. * @description 叠加分析模式。
  46684. */
  46685. this.mode = "";
  46686. /**
  46687. * @member {string} OverlayGeoJobParameter.prototype.srcFields
  46688. * @description 输入数据需要保留的字段。
  46689. */
  46690. this.srcFields = "";
  46691. /**
  46692. * @member {string} OverlayGeoJobParameter.prototype.overlayFields
  46693. * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
  46694. */
  46695. this.overlayFields = "";
  46696. /**
  46697. * @member {OutputSetting} [OverlayGeoJobParameter.prototype.output]
  46698. * @description 输出参数设置类。
  46699. */
  46700. this.output = null;
  46701. /**
  46702. * @member {MappingParameters} [OverlayGeoJobParameter.prototype.mappingParameters]
  46703. * @description 分析后结果可视化的参数类。
  46704. */
  46705. this.mappingParameters = null;
  46706. Util_Util.extend(this, options);
  46707. this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
  46708. }
  46709. /**
  46710. * @function OverlayGeoJobParameter.prototype.destroy
  46711. * @description 释放资源,将资源的属性置空。
  46712. */
  46713. OverlayGeoJobParameter_createClass(OverlayGeoJobParameter, [{
  46714. key: "destroy",
  46715. value: function destroy() {
  46716. this.datasetName = null;
  46717. this.datasetOverlay = null;
  46718. this.mode = null;
  46719. this.srcFields = null;
  46720. this.overlayFields = null;
  46721. if (this.output instanceof OutputSetting) {
  46722. this.output.destroy();
  46723. this.output = null;
  46724. }
  46725. if (this.mappingParameters instanceof MappingParameters) {
  46726. this.mappingParameters.destroy();
  46727. this.mappingParameters = null;
  46728. }
  46729. }
  46730. /**
  46731. * @function OverlayGeoJobParameter.toObject
  46732. * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
  46733. * @param {Object} tempObj - 目标对象。
  46734. * @description 生成点聚合分析任务对象。
  46735. */
  46736. }], [{
  46737. key: "toObject",
  46738. value: function toObject(_OverlayGeoJobParameter, tempObj) {
  46739. for (var name in _OverlayGeoJobParameter) {
  46740. if (name == "datasetName") {
  46741. tempObj['input'] = tempObj['input'] || {};
  46742. tempObj['input'][name] = _OverlayGeoJobParameter[name];
  46743. continue;
  46744. }
  46745. if (name === "output") {
  46746. tempObj['output'] = tempObj['output'] || {};
  46747. tempObj['output'] = _OverlayGeoJobParameter[name];
  46748. continue;
  46749. }
  46750. tempObj['analyst'] = tempObj['analyst'] || {};
  46751. tempObj['analyst'][name] = _OverlayGeoJobParameter[name];
  46752. if (name === 'mappingParameters') {
  46753. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  46754. tempObj['analyst']['mappingParameters'] = _OverlayGeoJobParameter[name];
  46755. }
  46756. }
  46757. }
  46758. }]);
  46759. return OverlayGeoJobParameter;
  46760. }();
  46761. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
  46762. 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); }
  46763. function OverlayGeoJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46764. 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); } }
  46765. 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; }
  46766. 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); }
  46767. function OverlayGeoJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayGeoJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  46768. 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); }
  46769. 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); }
  46770. 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); }; }
  46771. 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); }
  46772. function OverlayGeoJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46773. 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; } }
  46774. function OverlayGeoJobsService_getPrototypeOf(o) { OverlayGeoJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayGeoJobsService_getPrototypeOf(o); }
  46775. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46776. * This program are made available under the terms of the Apache License, Version 2.0
  46777. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46778. /**
  46779. * @class OverlayGeoJobsService
  46780. * @deprecatedclass SuperMap.OverlayGeoJobsService
  46781. * @category iServer ProcessingService OverlayAnalyst
  46782. * @classdesc 叠加分析任务类。
  46783. * @param {string} url - 服务地址。
  46784. * @param {Object} options - 参数。
  46785. * @param {Events} options.events - 处理所有事件的对象。
  46786. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  46787. * @param {number} options.index - 服务访问地址在数组中的位置。
  46788. * @param {number} options.length - 服务访问地址数组长度。
  46789. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46790. * @param {Object} [options.headers] - 请求头。
  46791. * @usage
  46792. */
  46793. var OverlayGeoJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  46794. OverlayGeoJobsService_inherits(OverlayGeoJobsService, _ProcessingServiceBas);
  46795. var _super = OverlayGeoJobsService_createSuper(OverlayGeoJobsService);
  46796. function OverlayGeoJobsService(url, options) {
  46797. var _this;
  46798. OverlayGeoJobsService_classCallCheck(this, OverlayGeoJobsService);
  46799. _this = _super.call(this, url, options);
  46800. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/overlay');
  46801. _this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
  46802. return _this;
  46803. }
  46804. /**
  46805. * @override
  46806. */
  46807. OverlayGeoJobsService_createClass(OverlayGeoJobsService, [{
  46808. key: "destroy",
  46809. value: function destroy() {
  46810. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "destroy", this).call(this);
  46811. }
  46812. /**
  46813. * @function OverlayGeoJobsService.prototype.getOverlayGeoJobs
  46814. * @description 获取叠加分析任务
  46815. */
  46816. }, {
  46817. key: "getOverlayGeoJobs",
  46818. value: function getOverlayGeoJobs() {
  46819. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, this.url);
  46820. }
  46821. /**
  46822. * @function OverlayGeoJobsService.prototype.getOverlayGeoJob
  46823. * @description 获取指定id的叠加分析任务
  46824. * @param {string} id - 指定要获取数据的id
  46825. */
  46826. }, {
  46827. key: "getOverlayGeoJob",
  46828. value: function getOverlayGeoJob(id) {
  46829. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  46830. }
  46831. /**
  46832. * @function OverlayGeoJobsService.prototype.addOverlayGeoJob
  46833. * @description 新建点叠加析服务
  46834. * @param {OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
  46835. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  46836. */
  46837. }, {
  46838. key: "addOverlayGeoJob",
  46839. value: function addOverlayGeoJob(params, seconds) {
  46840. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "addJob", this).call(this, this.url, params, OverlayGeoJobParameter, seconds);
  46841. }
  46842. }]);
  46843. return OverlayGeoJobsService;
  46844. }(ProcessingServiceBase);
  46845. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsParameters.js
  46846. 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); }
  46847. function QueryByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46848. 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); } }
  46849. 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; }
  46850. 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); }
  46851. function QueryByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  46852. 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); }
  46853. 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); }
  46854. 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); }; }
  46855. 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); }
  46856. function QueryByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46857. 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; } }
  46858. function QueryByBoundsParameters_getPrototypeOf(o) { QueryByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsParameters_getPrototypeOf(o); }
  46859. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46860. * This program are made available under the terms of the Apache License, Version 2.0
  46861. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46862. /**
  46863. * @class QueryByBoundsParameters
  46864. * @deprecatedclass SuperMap.QueryByBoundsParameters
  46865. * @category iServer Map QueryResults
  46866. * @classdesc Bounds 查询参数类。该类用于设置 Bounds 查询的相关参数。
  46867. * @extends {QueryParameters}
  46868. * @param {Object} options - 参数。
  46869. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} options.bounds - 指定的查询范围。
  46870. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  46871. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  46872. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  46873. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  46874. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  46875. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  46876. * @param {number} [options.startRecord=0] - 查询起始记录号。
  46877. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  46878. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  46879. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  46880. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  46881. * @usage
  46882. */
  46883. var QueryByBoundsParameters = /*#__PURE__*/function (_QueryParameters) {
  46884. QueryByBoundsParameters_inherits(QueryByBoundsParameters, _QueryParameters);
  46885. var _super = QueryByBoundsParameters_createSuper(QueryByBoundsParameters);
  46886. function QueryByBoundsParameters(options) {
  46887. var _this;
  46888. QueryByBoundsParameters_classCallCheck(this, QueryByBoundsParameters);
  46889. options = options || {};
  46890. _this = _super.call(this, options);
  46891. /**
  46892. * @member {boolean} [QueryByBoundsParameters.prototype.returnContent=true]
  46893. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  46894. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  46895. * 为 false,则返回的是查询结果资源的 URI。
  46896. */
  46897. _this.returnContent = true;
  46898. /**
  46899. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} QueryByBoundsParameters.prototype.bounds
  46900. * @description 指定的查询范围。
  46901. */
  46902. _this.bounds = null;
  46903. Util_Util.extend(QueryByBoundsParameters_assertThisInitialized(_this), options);
  46904. _this.CLASS_NAME = "SuperMap.QueryByBoundsParameters";
  46905. return _this;
  46906. }
  46907. /**
  46908. * @function QueryByBoundsParameters.prototype.destroy
  46909. * @description 释放资源,将引用资源的属性置空。
  46910. */
  46911. QueryByBoundsParameters_createClass(QueryByBoundsParameters, [{
  46912. key: "destroy",
  46913. value: function destroy() {
  46914. QueryByBoundsParameters_get(QueryByBoundsParameters_getPrototypeOf(QueryByBoundsParameters.prototype), "destroy", this).call(this);
  46915. var me = this;
  46916. me.returnContent = null;
  46917. if (me.bounds) {
  46918. me.bounds = null;
  46919. }
  46920. }
  46921. }]);
  46922. return QueryByBoundsParameters;
  46923. }(QueryParameters);
  46924. ;// CONCATENATED MODULE: ./src/common/iServer/QueryServiceBase.js
  46925. 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); }
  46926. function QueryServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46927. 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); } }
  46928. 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; }
  46929. 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); }
  46930. function QueryServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  46931. 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); }
  46932. 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); }
  46933. 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); }; }
  46934. 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); }
  46935. function QueryServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  46936. 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; } }
  46937. function QueryServiceBase_getPrototypeOf(o) { QueryServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryServiceBase_getPrototypeOf(o); }
  46938. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  46939. * This program are made available under the terms of the Apache License, Version 2.0
  46940. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46941. /**
  46942. * @class QueryService
  46943. * @deprecatedclass SuperMap.QueryService
  46944. * @category iServer Map QueryResults
  46945. * @classdesc 查询服务基类。
  46946. * @extends {CommonServiceBase}
  46947. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  46948. * @param {Object} options - 参数。
  46949. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  46950. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  46951. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  46952. * @param {Object} [options.headers] - 请求头。
  46953. * @example
  46954. * var myService = new QueryService(url, {
  46955. * eventListeners: {
  46956. * "processCompleted": queryCompleted,
  46957. * "processFailed": queryError
  46958. * }
  46959. * };
  46960. * @usage
  46961. */
  46962. var QueryServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  46963. QueryServiceBase_inherits(QueryServiceBase, _CommonServiceBase);
  46964. var _super = QueryServiceBase_createSuper(QueryServiceBase);
  46965. function QueryServiceBase(url, options) {
  46966. var _this;
  46967. QueryServiceBase_classCallCheck(this, QueryServiceBase);
  46968. _this = _super.call(this, url, options);
  46969. /**
  46970. * @member {boolean} QueryService.prototype.returnContent
  46971. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  46972. */
  46973. _this.returnContent = false;
  46974. /**
  46975. * @member {string} QueryService.prototype.format
  46976. * @description 查询结果返回格式,目前支持iServerJSON、GeoJSON、FGB三种格式。参数格式为"ISERVER","GEOJSON","FGB"。
  46977. */
  46978. _this.format = DataFormat.GEOJSON;
  46979. _this.returnFeatureWithFieldCaption = false;
  46980. if (options) {
  46981. Util_Util.extend(QueryServiceBase_assertThisInitialized(_this), options);
  46982. }
  46983. _this.CLASS_NAME = "SuperMap.QueryService";
  46984. if (!_this.url) {
  46985. return QueryServiceBase_possibleConstructorReturn(_this);
  46986. }
  46987. if (options && options.format) {
  46988. _this.format = options.format.toUpperCase();
  46989. }
  46990. _this.url = Util_Util.urlPathAppend(_this.url, 'queryResults');
  46991. return _this;
  46992. }
  46993. /**
  46994. * @function QueryService.prototype.destroy
  46995. * @description 释放资源,将引用资源的属性置空。
  46996. */
  46997. QueryServiceBase_createClass(QueryServiceBase, [{
  46998. key: "destroy",
  46999. value: function destroy() {
  47000. QueryServiceBase_get(QueryServiceBase_getPrototypeOf(QueryServiceBase.prototype), "destroy", this).call(this);
  47001. var me = this;
  47002. me.returnContent = null;
  47003. me.format = null;
  47004. }
  47005. /**
  47006. * @function QueryService.prototype.processAsync
  47007. * @description 负责将客户端的查询参数传递到服务端。
  47008. * @param {QueryParameters} params - 查询参数。
  47009. */
  47010. }, {
  47011. key: "processAsync",
  47012. value: function processAsync(params) {
  47013. if (!(params instanceof QueryParameters)) {
  47014. return;
  47015. }
  47016. var me = this,
  47017. returnCustomResult = null,
  47018. jsonParameters = null;
  47019. me.returnContent = params.returnContent;
  47020. jsonParameters = me.getJsonParameters(params);
  47021. if (!me.returnContent) {
  47022. //仅供三维使用 获取高亮图片的bounds
  47023. returnCustomResult = params.returnCustomResult;
  47024. if (returnCustomResult) {
  47025. me.url = Util_Util.urlAppend(me.url, 'returnCustomResult=' + returnCustomResult);
  47026. }
  47027. }
  47028. me.returnFeatureWithFieldCaption = params.returnFeatureWithFieldCaption;
  47029. me.request({
  47030. method: "POST",
  47031. data: jsonParameters,
  47032. scope: me,
  47033. success: me.serviceProcessCompleted,
  47034. failure: me.serviceProcessFailed
  47035. });
  47036. }
  47037. /**
  47038. * @function QueryService.prototype.serviceProcessCompleted
  47039. * @description 查询完成,执行此方法。
  47040. * @param {Object} result - 服务器返回的结果对象。
  47041. */
  47042. }, {
  47043. key: "serviceProcessCompleted",
  47044. value: function serviceProcessCompleted(result, options) {
  47045. var me = this;
  47046. result = Util_Util.transformResult(result);
  47047. var geoJSONFormat = new GeoJSON();
  47048. if (result && result.recordsets) {
  47049. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  47050. if (recordsets[i].features) {
  47051. if (me.returnFeatureWithFieldCaption === true) {
  47052. recordsets[i].features.map(function (feature) {
  47053. feature.fieldNames = recordsets[i].fieldCaptions;
  47054. return feature;
  47055. });
  47056. }
  47057. if (me.format === DataFormat.GEOJSON) {
  47058. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  47059. }
  47060. }
  47061. }
  47062. }
  47063. me.events.triggerEvent("processCompleted", {
  47064. result: result,
  47065. options: options
  47066. });
  47067. }
  47068. }, {
  47069. key: "dataFormat",
  47070. value: function dataFormat() {
  47071. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  47072. }
  47073. /**
  47074. * @function QueryService.prototype.getQueryParameters
  47075. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  47076. * @param {Object} params - JSON 字符串表示的查询参数。
  47077. * @returns {QueryParameters} 返回转化后的 QueryParameters 对象。
  47078. */
  47079. }, {
  47080. key: "getQueryParameters",
  47081. value: function getQueryParameters(params) {
  47082. return new QueryParameters({
  47083. customParams: params.customParams,
  47084. expectCount: params.expectCount,
  47085. networkType: params.networkType,
  47086. queryOption: params.queryOption,
  47087. queryParams: params.queryParams,
  47088. startRecord: params.startRecord,
  47089. prjCoordSys: params.prjCoordSys,
  47090. holdTime: params.holdTime
  47091. });
  47092. }
  47093. }]);
  47094. return QueryServiceBase;
  47095. }(CommonServiceBase);
  47096. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsService.js
  47097. 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); }
  47098. function QueryByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47099. 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); } }
  47100. 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; }
  47101. 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); }
  47102. function QueryByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  47103. 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); }
  47104. 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); }
  47105. 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); }; }
  47106. 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); }
  47107. function QueryByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47108. 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; } }
  47109. function QueryByBoundsService_getPrototypeOf(o) { QueryByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsService_getPrototypeOf(o); }
  47110. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47111. * This program are made available under the terms of the Apache License, Version 2.0
  47112. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47113. /**
  47114. * @class QueryByBoundsService
  47115. * @deprecatedclass SuperMap.QueryByBoundsService
  47116. * @category iServer Map QueryResults
  47117. * @classdesc Bounds 查询服务类。
  47118. * @augments {QueryService}
  47119. * @example
  47120. * (start end)
  47121. * var myQueryByBoundsService = new QueryByBoundsService(url, {
  47122. * eventListeners: {
  47123. * "processCompleted": queryCompleted,
  47124. * "processFailed": queryError
  47125. * }
  47126. * });
  47127. * function queryCompleted(object){//todo};
  47128. * function queryError(object){//todo};
  47129. * (end)
  47130. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  47131. * @param {Object} options - 参数。
  47132. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  47133. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  47134. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47135. * @param {Object} [options.headers] - 请求头。
  47136. * @usage
  47137. */
  47138. var QueryByBoundsService = /*#__PURE__*/function (_QueryServiceBase) {
  47139. QueryByBoundsService_inherits(QueryByBoundsService, _QueryServiceBase);
  47140. var _super = QueryByBoundsService_createSuper(QueryByBoundsService);
  47141. function QueryByBoundsService(url, options) {
  47142. var _this;
  47143. QueryByBoundsService_classCallCheck(this, QueryByBoundsService);
  47144. _this = _super.call(this, url, options);
  47145. _this.CLASS_NAME = "SuperMap.QueryByBoundsService";
  47146. return _this;
  47147. }
  47148. /**
  47149. * @override
  47150. */
  47151. QueryByBoundsService_createClass(QueryByBoundsService, [{
  47152. key: "destroy",
  47153. value: function destroy() {
  47154. QueryByBoundsService_get(QueryByBoundsService_getPrototypeOf(QueryByBoundsService.prototype), "destroy", this).call(this);
  47155. }
  47156. /**
  47157. * @function QueryByBoundsService.prototype.getJsonParameters
  47158. * @description 将查询参数转化为 JSON 字符串。
  47159. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds 等)。
  47160. * @param {QueryByBoundsParameters} params - Bounds 查询参数。
  47161. * @returns {Object} 转化后的 JSON 字符串。
  47162. */
  47163. }, {
  47164. key: "getJsonParameters",
  47165. value: function getJsonParameters(params) {
  47166. if (!(params instanceof QueryByBoundsParameters)) {
  47167. return null;
  47168. }
  47169. var me = this,
  47170. jsonParameters = "",
  47171. qp = null,
  47172. bounds = params.bounds;
  47173. qp = me.getQueryParameters(params);
  47174. jsonParameters += "'queryMode':'BoundsQuery','queryParameters':";
  47175. jsonParameters += Util_Util.toJSON(qp);
  47176. jsonParameters += ",'bounds': {'rightTop':{'y':" + bounds.top + ",'x':" + bounds.right + "},'leftBottom':{'y':" + bounds.bottom + ",'x':" + bounds.left + "}}";
  47177. jsonParameters = "{" + jsonParameters + "}";
  47178. return jsonParameters;
  47179. }
  47180. }]);
  47181. return QueryByBoundsService;
  47182. }(QueryServiceBase);
  47183. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceParameters.js
  47184. 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); }
  47185. function QueryByDistanceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47186. 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); } }
  47187. 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; }
  47188. 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); }
  47189. function QueryByDistanceParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  47190. 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); }
  47191. 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); }
  47192. 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); }; }
  47193. 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); }
  47194. function QueryByDistanceParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47195. 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; } }
  47196. function QueryByDistanceParameters_getPrototypeOf(o) { QueryByDistanceParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceParameters_getPrototypeOf(o); }
  47197. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47198. * This program are made available under the terms of the Apache License, Version 2.0
  47199. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47200. /**
  47201. * @class QueryByDistanceParameters
  47202. * @deprecatedclass SuperMap.QueryByDistanceParameters
  47203. * @category iServer Map QueryResults
  47204. * @classdesc Distance 查询参数类。
  47205. * 该类用于设置 Distance 查询的相关参数。
  47206. * @extends {QueryParameters}
  47207. * @param {Object} options - 参数。
  47208. * @param {GeoJSONObject} options.geometry - 用于查询的几何对象。
  47209. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  47210. * @param {number} options.distance - 查询距离,单位与所查询图层对应的数据集单位相同。距离查询时,表示距离地物的距离。最近地物查询时,表示搜索的范围。此为必选参数。
  47211. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  47212. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  47213. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  47214. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  47215. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  47216. * @param {number} [options.startRecord=0] - 查询起始记录号。
  47217. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  47218. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  47219. * @param {boolean} [options.isNearest=false] - 是否为最近距离查询。
  47220. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  47221. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  47222. * @usage
  47223. */
  47224. var QueryByDistanceParameters = /*#__PURE__*/function (_QueryParameters) {
  47225. QueryByDistanceParameters_inherits(QueryByDistanceParameters, _QueryParameters);
  47226. var _super = QueryByDistanceParameters_createSuper(QueryByDistanceParameters);
  47227. function QueryByDistanceParameters(options) {
  47228. var _this;
  47229. QueryByDistanceParameters_classCallCheck(this, QueryByDistanceParameters);
  47230. options = options || {};
  47231. _this = _super.call(this, options);
  47232. /**
  47233. * @member {number} [QueryByDistanceParameters.prototype.distance=0]
  47234. * @description 查询距离,单位与所查询图层对应的数据集单位相同。
  47235. * 距离查询时,表示距离地物的距离。最近地物查询时,表示搜索的范围。
  47236. */
  47237. /**
  47238. * @member {GeoJSONObject} QueryByDistanceParameters.prototype.geometry
  47239. * @description 用于查询的地理对象。<br>
  47240. * 点类型可以是:{@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>
  47241. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  47242. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  47243. */
  47244. _this.geometry = null;
  47245. /**
  47246. * @member {boolean} [QueryByDistanceParameters.prototype.isNearest=false]
  47247. * @description 是否为最近距离查询。<br>
  47248. * 建议该属性与 expectCount(继承自 {@link QueryParameters})属性联合使用。
  47249. * 当该属性为 true 时,即表示查找最近地物,如果查询结果数大于期望返回的结果记录数(expectCount),
  47250. * 则查找结果为查询总记录中距离中心最近的 expectCount 个地物。
  47251. * 当该属性为不为 true 时,如果查询结果数大于期望返回的结果记录数(expectCount),
  47252. * 则查找结果为从查询总记录中随机抽取的 expectCount 个地物。
  47253. * 目前查询结果不支持按远近距离排序。
  47254. */
  47255. _this.isNearest = null;
  47256. /**
  47257. * @member {boolean} [QueryByDistanceParameters.prototype.returnContent=true]
  47258. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  47259. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  47260. * 为 false,则返回的是查询结果资源的 URI。
  47261. */
  47262. _this.returnContent = true;
  47263. Util_Util.extend(QueryByDistanceParameters_assertThisInitialized(_this), options);
  47264. _this.CLASS_NAME = "SuperMap.QueryByDistanceParameters";
  47265. return _this;
  47266. }
  47267. /**
  47268. * @function QueryByDistanceParameters.prototype.destroy
  47269. * @description 释放资源,将引用资源的属性置空。
  47270. */
  47271. QueryByDistanceParameters_createClass(QueryByDistanceParameters, [{
  47272. key: "destroy",
  47273. value: function destroy() {
  47274. QueryByDistanceParameters_get(QueryByDistanceParameters_getPrototypeOf(QueryByDistanceParameters.prototype), "destroy", this).call(this);
  47275. var me = this;
  47276. me.returnContent = null;
  47277. me.distance = null;
  47278. me.isNearest = null;
  47279. if (me.geometry) {
  47280. me.geometry.destroy();
  47281. me.geometry = null;
  47282. }
  47283. }
  47284. }]);
  47285. return QueryByDistanceParameters;
  47286. }(QueryParameters);
  47287. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceService.js
  47288. 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); }
  47289. function QueryByDistanceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47290. 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); } }
  47291. 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; }
  47292. 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); }
  47293. function QueryByDistanceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceService_getPrototypeOf(object); if (object === null) break; } return object; }
  47294. 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); }
  47295. 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); }
  47296. 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); }; }
  47297. 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); }
  47298. function QueryByDistanceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47299. 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; } }
  47300. function QueryByDistanceService_getPrototypeOf(o) { QueryByDistanceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceService_getPrototypeOf(o); }
  47301. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47302. * This program are made available under the terms of the Apache License, Version 2.0
  47303. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47304. /**
  47305. * @class QueryByDistanceService
  47306. * @deprecatedclass SuperMap.QueryByDistanceService
  47307. * @category iServer Map QueryResults
  47308. * @classdesc Distance查询服务类。
  47309. * @extends {QueryServiceBase}
  47310. * @example
  47311. * var myQueryByDistService = new QueryByDistanceService(url, {
  47312. * eventListeners: {
  47313. * "processCompleted": queryCompleted,
  47314. * "processFailed": queryError
  47315. * }
  47316. * });
  47317. * function queryCompleted(object){//todo};
  47318. * function queryError(object){//todo};
  47319. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  47320. * @param {Object} options - 参数。
  47321. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  47322. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  47323. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47324. * @param {Object} [options.headers] - 请求头。
  47325. * @usage
  47326. */
  47327. var QueryByDistanceService = /*#__PURE__*/function (_QueryServiceBase) {
  47328. QueryByDistanceService_inherits(QueryByDistanceService, _QueryServiceBase);
  47329. var _super = QueryByDistanceService_createSuper(QueryByDistanceService);
  47330. function QueryByDistanceService(url, options) {
  47331. var _this;
  47332. QueryByDistanceService_classCallCheck(this, QueryByDistanceService);
  47333. _this = _super.call(this, url, options);
  47334. _this.CLASS_NAME = "SuperMap.QueryByDistanceService";
  47335. return _this;
  47336. }
  47337. /**
  47338. * @override
  47339. */
  47340. QueryByDistanceService_createClass(QueryByDistanceService, [{
  47341. key: "destroy",
  47342. value: function destroy() {
  47343. QueryByDistanceService_get(QueryByDistanceService_getPrototypeOf(QueryByDistanceService.prototype), "destroy", this).call(this);
  47344. }
  47345. /**
  47346. * @function QueryByDistanceService.prototype.getJsonParameters
  47347. * @description 将查询参数转化为 JSON 字符串。
  47348. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  47349. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  47350. * @returns {Object} 转化后的 JSON 字符串。
  47351. */
  47352. }, {
  47353. key: "getJsonParameters",
  47354. value: function getJsonParameters(params) {
  47355. if (!(params instanceof QueryByDistanceParameters)) {
  47356. return;
  47357. }
  47358. var me = this,
  47359. jsonParameters = "",
  47360. qp = me.getQueryParameters(params);
  47361. var sg = ServerGeometry.fromGeometry(params.geometry);
  47362. jsonParameters += params.isNearest ? "'queryMode':'FindNearest','queryParameters':" : "'queryMode':'DistanceQuery','queryParameters':";
  47363. jsonParameters += Util_Util.toJSON(qp);
  47364. jsonParameters += ",'geometry':" + Util_Util.toJSON(sg) + ",'distance':" + params.distance;
  47365. jsonParameters = "{" + jsonParameters + "}";
  47366. return jsonParameters;
  47367. }
  47368. }]);
  47369. return QueryByDistanceService;
  47370. }(QueryServiceBase);
  47371. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryParameters.js
  47372. 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); }
  47373. function QueryByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47374. 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); } }
  47375. 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; }
  47376. 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); }
  47377. function QueryByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  47378. 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); }
  47379. 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); }
  47380. 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); }; }
  47381. 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); }
  47382. function QueryByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47383. 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; } }
  47384. function QueryByGeometryParameters_getPrototypeOf(o) { QueryByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryParameters_getPrototypeOf(o); }
  47385. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47386. * This program are made available under the terms of the Apache License, Version 2.0
  47387. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47388. /**
  47389. * @class QueryByGeometryParameters
  47390. * @deprecatedclass SuperMap.QueryByGeometryParameters
  47391. * @category iServer Map QueryResults
  47392. * @classdesc Geometry 查询参数类。
  47393. * 该类用于设置 Geometry查询的相关参数。
  47394. * @extends {QueryParameters}
  47395. * @param {Object} options - 参数。
  47396. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  47397. * @param {GeoJSONObject} options.geometry - 查询的几何对象。
  47398. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  47399. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  47400. * @param {Object} [options.prjCoordSys] -自定义参数,供SuperMap Online提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  47401. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  47402. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  47403. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  47404. * @param {number} [options.startRecord=0] - 查询起始记录号。
  47405. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  47406. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  47407. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  47408. * @param {SpatialQueryMode} [spatialQueryMode=SpatialQueryMode.INTERSECT] - 空间查询模式。
  47409. * @usage
  47410. */
  47411. var QueryByGeometryParameters = /*#__PURE__*/function (_QueryParameters) {
  47412. QueryByGeometryParameters_inherits(QueryByGeometryParameters, _QueryParameters);
  47413. var _super = QueryByGeometryParameters_createSuper(QueryByGeometryParameters);
  47414. function QueryByGeometryParameters(options) {
  47415. var _this;
  47416. QueryByGeometryParameters_classCallCheck(this, QueryByGeometryParameters);
  47417. options = options || {};
  47418. _this = _super.call(this, options);
  47419. /**
  47420. * @member {boolean} [QueryByGeometryParameters.prototype.returnContent=true]
  47421. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。<br>
  47422. * 如果为 true,则直接返回新创建资源,即查询结果的表述。<br>
  47423. * 为 false,则返回的是查询结果资源的 URI。
  47424. */
  47425. _this.returnContent = true;
  47426. /**
  47427. * @member {GeoJSONObject} QueryByGeometryParameters.prototype.geometry
  47428. * @description 用于查询的几何对象。<br>
  47429. * 点类型可以是:{@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>
  47430. * 线类型可以是:{@link GeometryLineString}|{@link GeometryLinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}|{@link GeoJSONObject}。<br>
  47431. * 面类型可以是:{@link GeometryPolygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}|{@link mapboxgl.LngLatBounds}|{@link GeoJSONObject}。
  47432. */
  47433. _this.geometry = null;
  47434. /**
  47435. * @member {SpatialQueryMode} [QueryByGeometryParameters.prototype.spatialQueryMode=SpatialQueryMode.INTERSECT]
  47436. * @description 空间查询模式。
  47437. */
  47438. _this.spatialQueryMode = SpatialQueryMode.INTERSECT;
  47439. Util_Util.extend(QueryByGeometryParameters_assertThisInitialized(_this), options);
  47440. _this.CLASS_NAME = "SuperMap.QueryByGeometryParameters";
  47441. return _this;
  47442. }
  47443. /**
  47444. * @function QueryByGeometryParameters.prototype.destroy
  47445. * @description 释放资源,将引用资源的属性置空。
  47446. */
  47447. QueryByGeometryParameters_createClass(QueryByGeometryParameters, [{
  47448. key: "destroy",
  47449. value: function destroy() {
  47450. QueryByGeometryParameters_get(QueryByGeometryParameters_getPrototypeOf(QueryByGeometryParameters.prototype), "destroy", this).call(this);
  47451. var me = this;
  47452. me.returnContent = null;
  47453. me.geometry = null;
  47454. me.spatialQueryMode = null;
  47455. }
  47456. }]);
  47457. return QueryByGeometryParameters;
  47458. }(QueryParameters);
  47459. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryService.js
  47460. 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); }
  47461. function QueryByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47462. 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); } }
  47463. 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; }
  47464. 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); }
  47465. function QueryByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  47466. 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); }
  47467. 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); }
  47468. 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); }; }
  47469. 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); }
  47470. function QueryByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47471. 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; } }
  47472. function QueryByGeometryService_getPrototypeOf(o) { QueryByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryService_getPrototypeOf(o); }
  47473. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47474. * This program are made available under the terms of the Apache License, Version 2.0
  47475. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47476. /**
  47477. * @class QueryByGeometryService
  47478. * @deprecatedclass SuperMap.QueryByGeometryService
  47479. * @category iServer Map QueryResults
  47480. * @classdesc Geometry查询服务类。
  47481. * @extends {QueryServiceBase}
  47482. * @example
  47483. * var myQueryByGeometryService = new QueryByGeometryService(url, {
  47484. * eventListeners: {
  47485. * "processCompleted": queryCompleted,
  47486. * "processFailed": queryError
  47487. * }
  47488. * });
  47489. * function queryCompleted(object){//todo};
  47490. * function queryError(object){//todo};
  47491. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  47492. * @param {Object} options - 参数。
  47493. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  47494. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  47495. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47496. * @param {Object} [options.headers] - 请求头。
  47497. * @usage
  47498. */
  47499. var QueryByGeometryService = /*#__PURE__*/function (_QueryServiceBase) {
  47500. QueryByGeometryService_inherits(QueryByGeometryService, _QueryServiceBase);
  47501. var _super = QueryByGeometryService_createSuper(QueryByGeometryService);
  47502. function QueryByGeometryService(url, options) {
  47503. var _this;
  47504. QueryByGeometryService_classCallCheck(this, QueryByGeometryService);
  47505. _this = _super.call(this, url, options);
  47506. _this.CLASS_NAME = "SuperMap.QueryByGeometryService";
  47507. return _this;
  47508. }
  47509. /**
  47510. * @override
  47511. */
  47512. QueryByGeometryService_createClass(QueryByGeometryService, [{
  47513. key: "destroy",
  47514. value: function destroy() {
  47515. QueryByGeometryService_get(QueryByGeometryService_getPrototypeOf(QueryByGeometryService.prototype), "destroy", this).call(this);
  47516. }
  47517. /**
  47518. * @function QueryByGeometryService.prototype.getJsonParameters
  47519. * @description 将查询参数转化为 JSON 字符串。
  47520. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  47521. * @param {QueryByGeometryParameters} params - Geometry 查询参数类。
  47522. * @returns {Object} 转化后的 JSON 字符串。
  47523. */
  47524. }, {
  47525. key: "getJsonParameters",
  47526. value: function getJsonParameters(params) {
  47527. if (!(params instanceof QueryByGeometryParameters)) {
  47528. return;
  47529. }
  47530. var me = this,
  47531. jsonParameters = "",
  47532. qp = null,
  47533. geometry = params.geometry,
  47534. sg = ServerGeometry.fromGeometry(geometry);
  47535. qp = me.getQueryParameters(params);
  47536. jsonParameters += "'queryMode':'SpatialQuery','queryParameters':";
  47537. jsonParameters += Util_Util.toJSON(qp) + ",'geometry':" + Util_Util.toJSON(sg) + ",'spatialQueryMode':" + Util_Util.toJSON(params.spatialQueryMode);
  47538. jsonParameters = "{" + jsonParameters + "}";
  47539. return jsonParameters;
  47540. }
  47541. }]);
  47542. return QueryByGeometryService;
  47543. }(QueryServiceBase);
  47544. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLParameters.js
  47545. 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); }
  47546. function QueryBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47547. 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); } }
  47548. 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; }
  47549. 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); }
  47550. function QueryBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  47551. 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); }
  47552. 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); }
  47553. 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); }; }
  47554. 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); }
  47555. function QueryBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47556. 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; } }
  47557. function QueryBySQLParameters_getPrototypeOf(o) { QueryBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLParameters_getPrototypeOf(o); }
  47558. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47559. * This program are made available under the terms of the Apache License, Version 2.0
  47560. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47561. /**
  47562. * @class QueryBySQLParameters
  47563. * @deprecatedclass SuperMap.QueryBySQLParameters
  47564. * @category iServer Map QueryResults
  47565. * @classdesc SQL 查询参数类。
  47566. * 该类用于设置 SQL 查询的相关参数。
  47567. * @extends {QueryParameters}
  47568. * @param {Object} options - 参数。
  47569. * @param {Array.<FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  47570. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  47571. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  47572. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  47573. * @param {GeometryType} [options.networkType=GeometryType.LINE] - 网络数据集对应的查询类型。
  47574. * @param {QueryOption} [options.queryOption=QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  47575. * @param {number} [options.startRecord=0] - 查询起始记录号。
  47576. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  47577. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  47578. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  47579. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  47580. * @usage
  47581. */
  47582. var QueryBySQLParameters = /*#__PURE__*/function (_QueryParameters) {
  47583. QueryBySQLParameters_inherits(QueryBySQLParameters, _QueryParameters);
  47584. var _super = QueryBySQLParameters_createSuper(QueryBySQLParameters);
  47585. function QueryBySQLParameters(options) {
  47586. var _this;
  47587. QueryBySQLParameters_classCallCheck(this, QueryBySQLParameters);
  47588. options = options || {};
  47589. _this = _super.call(this, options);
  47590. /**
  47591. * @member {boolean} [QueryBySQLParameters.prototype.returnContent=true]
  47592. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  47593. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  47594. * 为 false,则返回的是查询结果资源的 URI。
  47595. */
  47596. _this.returnContent = true;
  47597. Util_Util.extend(QueryBySQLParameters_assertThisInitialized(_this), options);
  47598. _this.CLASS_NAME = "SuperMap.QueryBySQLParameters";
  47599. return _this;
  47600. }
  47601. /**
  47602. * @function QueryBySQLParameters.prototype.destroy
  47603. * @description 释放资源,将引用资源的属性置空。
  47604. */
  47605. QueryBySQLParameters_createClass(QueryBySQLParameters, [{
  47606. key: "destroy",
  47607. value: function destroy() {
  47608. QueryBySQLParameters_get(QueryBySQLParameters_getPrototypeOf(QueryBySQLParameters.prototype), "destroy", this).call(this);
  47609. var me = this;
  47610. me.returnContent = null;
  47611. }
  47612. }]);
  47613. return QueryBySQLParameters;
  47614. }(QueryParameters);
  47615. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLService.js
  47616. 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); }
  47617. function QueryBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47618. 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); } }
  47619. 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; }
  47620. 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); }
  47621. function QueryBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  47622. 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); }
  47623. 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); }
  47624. 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); }; }
  47625. 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); }
  47626. function QueryBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47627. 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; } }
  47628. function QueryBySQLService_getPrototypeOf(o) { QueryBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLService_getPrototypeOf(o); }
  47629. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47630. * This program are made available under the terms of the Apache License, Version 2.0
  47631. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47632. /**
  47633. * @class QueryBySQLService
  47634. * @deprecatedclass SuperMap.QueryBySQLService
  47635. * @category iServer Map QueryResults
  47636. * @classdesc SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  47637. * @extends {QueryServiceBase}
  47638. * @example
  47639. * var queryParam = new FilterParameter({
  47640. * name: "Countries@World.1",
  47641. * attributeFilter: "Pop_1994>1000000000 and SmArea>900"
  47642. * });
  47643. * var queryBySQLParams = new QueryBySQLParameters({
  47644. * queryParams: [queryParam]
  47645. * });
  47646. * var myQueryBySQLService = new QueryBySQLService(url, {eventListeners: {
  47647. * "processCompleted": queryCompleted,
  47648. * "processFailed": queryError
  47649. * }
  47650. * });
  47651. * queryBySQLService.processAsync(queryBySQLParams);
  47652. * function queryCompleted(object){//todo};
  47653. * function queryError(object){//todo};
  47654. * @param {string} url - 服务地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  47655. * @param {Object} options - 参数。
  47656. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  47657. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON、GeoJSON、FGB 三种格式。参数格式为 "ISERVER","GEOJSON","FGB"。
  47658. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47659. * @param {Object} [options.headers] - 请求头。
  47660. * @usage
  47661. */
  47662. var QueryBySQLService = /*#__PURE__*/function (_QueryServiceBase) {
  47663. QueryBySQLService_inherits(QueryBySQLService, _QueryServiceBase);
  47664. var _super = QueryBySQLService_createSuper(QueryBySQLService);
  47665. function QueryBySQLService(url, options) {
  47666. var _this;
  47667. QueryBySQLService_classCallCheck(this, QueryBySQLService);
  47668. _this = _super.call(this, url, options);
  47669. _this.CLASS_NAME = "SuperMap.QueryBySQLService";
  47670. return _this;
  47671. }
  47672. /**
  47673. * @override
  47674. */
  47675. QueryBySQLService_createClass(QueryBySQLService, [{
  47676. key: "destroy",
  47677. value: function destroy() {
  47678. QueryBySQLService_get(QueryBySQLService_getPrototypeOf(QueryBySQLService.prototype), "destroy", this).call(this);
  47679. }
  47680. /**
  47681. * @function QueryBySQLService.prototype.getJsonParameters
  47682. * @description 将查询参数转化为 JSON 字符串。
  47683. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  47684. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  47685. * @returns {Object} 转化后的 JSON 字符串。
  47686. */
  47687. }, {
  47688. key: "getJsonParameters",
  47689. value: function getJsonParameters(params) {
  47690. if (!(params instanceof QueryBySQLParameters)) {
  47691. return;
  47692. }
  47693. var me = this,
  47694. jsonParameters = "",
  47695. qp = null;
  47696. qp = me.getQueryParameters(params);
  47697. jsonParameters += "'queryMode':'SqlQuery','queryParameters':";
  47698. jsonParameters += Util_Util.toJSON(qp);
  47699. jsonParameters = "{" + jsonParameters + "}";
  47700. return jsonParameters;
  47701. }
  47702. }]);
  47703. return QueryBySQLService;
  47704. }(QueryServiceBase);
  47705. ;// CONCATENATED MODULE: ./src/common/iServer/QueryService.js
  47706. function QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47707. 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); } }
  47708. 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; }
  47709. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47710. * This program are made available under the terms of the Apache License, Version 2.0
  47711. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47712. /**
  47713. * @class QueryService
  47714. * @category iServer Map QueryResults
  47715. * @classdesc 地图查询服务类。
  47716. * 提供:范围查询,SQL 查询,几何查询,距离查询。
  47717. * @extends {ServiceBase}
  47718. * @param {string} url - 服务地址。
  47719. * @param {Object} options - 参数。
  47720. * @param {string} [options.proxy] - 服务代理地址。
  47721. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  47722. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47723. * @param {Object} [options.headers] - 请求头。
  47724. * @example
  47725. * new QueryService(url)
  47726. * .queryByBounds(param,function(result){
  47727. * //doSomething
  47728. * })
  47729. * @usage
  47730. */
  47731. var QueryService = /*#__PURE__*/function () {
  47732. function QueryService(url, options) {
  47733. QueryService_classCallCheck(this, QueryService);
  47734. this.options = options || {};
  47735. this.url = url;
  47736. }
  47737. /**
  47738. * @function QueryService.prototype.queryByBounds
  47739. * @description Bounds 查询地图服务。
  47740. * @param {QueryByBoundsParameters} params - Bounds 查询参数类。
  47741. * @param {RequestCallback} callback - 回调函数。
  47742. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  47743. */
  47744. QueryService_createClass(QueryService, [{
  47745. key: "queryByBounds",
  47746. value: function queryByBounds(params, callback, resultFormat) {
  47747. var me = this;
  47748. var queryService = new QueryByBoundsService(me.url, {
  47749. proxy: me.options.proxy,
  47750. withCredentials: me.options.withCredentials,
  47751. crossOrigin: me.options.crossOrigin,
  47752. headers: me.options.headers,
  47753. eventListeners: {
  47754. scope: me,
  47755. processCompleted: callback,
  47756. processFailed: callback
  47757. },
  47758. format: me._processFormat(resultFormat)
  47759. });
  47760. queryService.processAsync(params);
  47761. }
  47762. /**
  47763. * @function QueryService.prototype.queryByDistance
  47764. * @description 地图距离查询服务。
  47765. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  47766. * @param {RequestCallback} callback - 回调函数。
  47767. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型
  47768. */
  47769. }, {
  47770. key: "queryByDistance",
  47771. value: function queryByDistance(params, callback, resultFormat) {
  47772. var me = this;
  47773. var queryByDistanceService = new QueryByDistanceService(me.url, {
  47774. proxy: me.options.proxy,
  47775. withCredentials: me.options.withCredentials,
  47776. crossOrigin: me.options.crossOrigin,
  47777. headers: me.options.headers,
  47778. eventListeners: {
  47779. scope: me,
  47780. processCompleted: callback,
  47781. processFailed: callback
  47782. },
  47783. format: resultFormat
  47784. });
  47785. queryByDistanceService.processAsync(params);
  47786. }
  47787. /**
  47788. * @function QueryService.prototype.queryBySQL
  47789. * @description 地图 SQL 查询服务。
  47790. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  47791. * @param {RequestCallback} callback - 回调函数。
  47792. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  47793. */
  47794. }, {
  47795. key: "queryBySQL",
  47796. value: function queryBySQL(params, callback, resultFormat) {
  47797. var me = this;
  47798. var queryBySQLService = new QueryBySQLService(me.url, {
  47799. proxy: me.options.proxy,
  47800. withCredentials: me.options.withCredentials,
  47801. crossOrigin: me.options.crossOrigin,
  47802. headers: me.options.headers,
  47803. eventListeners: {
  47804. scope: me,
  47805. processCompleted: callback,
  47806. processFailed: callback
  47807. },
  47808. format: resultFormat
  47809. });
  47810. queryBySQLService.processAsync(params);
  47811. }
  47812. /**
  47813. * @function QueryService.prototype.queryByGeometry
  47814. * @description 地图几何查询服务。
  47815. * @param {QueryByGeometryParameters} params - Geometry 查询参数类。
  47816. * @param {RequestCallback} callback - 回调函数。
  47817. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  47818. */
  47819. }, {
  47820. key: "queryByGeometry",
  47821. value: function queryByGeometry(params, callback, resultFormat) {
  47822. var me = this;
  47823. var queryByGeometryService = new QueryByGeometryService(me.url, {
  47824. proxy: me.options.proxy,
  47825. withCredentials: me.options.withCredentials,
  47826. crossOrigin: me.options.crossOrigin,
  47827. headers: me.options.headers,
  47828. eventListeners: {
  47829. scope: me,
  47830. processCompleted: callback,
  47831. processFailed: callback
  47832. },
  47833. format: resultFormat
  47834. });
  47835. queryByGeometryService.processAsync(params);
  47836. }
  47837. }, {
  47838. key: "_processFormat",
  47839. value: function _processFormat(resultFormat) {
  47840. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  47841. }
  47842. }]);
  47843. return QueryService;
  47844. }();
  47845. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureParameters.js
  47846. function RouteCalculateMeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47847. 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); } }
  47848. 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; }
  47849. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47850. * This program are made available under the terms of the Apache License, Version 2.0
  47851. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47852. /**
  47853. * @class RouteCalculateMeasureParameters
  47854. * @deprecatedclass SuperMap.RouteCalculateMeasureParameters
  47855. * @category iServer SpatialAnalyst RouteCalculateMeasure
  47856. * @classdesc 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  47857. * @param {Object} options - 参数。
  47858. * @param {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} options.sourceRoute - 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  47859. * @param {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>} options.point - 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  47860. * @param {number} [options.tolerance] - 容限值。
  47861. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。
  47862. * @usage
  47863. */
  47864. var RouteCalculateMeasureParameters = /*#__PURE__*/function () {
  47865. function RouteCalculateMeasureParameters(options) {
  47866. RouteCalculateMeasureParameters_classCallCheck(this, RouteCalculateMeasureParameters);
  47867. if (!options) {
  47868. return this;
  47869. }
  47870. /**
  47871. * @member {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} RouteCalculateMeasureParameters.prototype.sourceRoute
  47872. * @description 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  47873. */
  47874. this.sourceRoute = null;
  47875. /**
  47876. * @member {GeometryPoint|L.LatLng|L.Point|ol.geom.Point|mapboxgl.LngLat|Array.<number>} RouteCalculateMeasureParameters.prototype.point
  47877. * @description 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  47878. */
  47879. this.point = null;
  47880. /**
  47881. * @member {number} [RouteCalculateMeasureParameters.prototype.tolerance]
  47882. * @description 容限值。
  47883. */
  47884. this.tolerance = null;
  47885. /**
  47886. * @member {boolean} [RouteCalculateMeasureParameters.prototype.isIgnoreGap=false]
  47887. * @description 是否忽略子对象之间的距离。
  47888. */
  47889. this.isIgnoreGap = false;
  47890. Util_Util.extend(this, options);
  47891. this.CLASS_NAME = "SuperMap.RouteCalculateMeasureParameters";
  47892. }
  47893. /**
  47894. * @function RouteCalculateMeasureParameters.prototype.destroy
  47895. * @description 释放资源,将引用资源的属性置空。
  47896. */
  47897. RouteCalculateMeasureParameters_createClass(RouteCalculateMeasureParameters, [{
  47898. key: "destroy",
  47899. value: function destroy() {
  47900. var me = this;
  47901. me.sourceRoute = null;
  47902. me.point = null;
  47903. if (me.tolerance) {
  47904. me.tolerance = null;
  47905. }
  47906. if (me.isIgnoreGap) {
  47907. me.isIgnoreGap = false;
  47908. }
  47909. }
  47910. }]);
  47911. return RouteCalculateMeasureParameters;
  47912. }();
  47913. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureService.js
  47914. 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); }
  47915. function RouteCalculateMeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47916. 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); } }
  47917. 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; }
  47918. 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); }
  47919. function RouteCalculateMeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteCalculateMeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  47920. 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); }
  47921. 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); }
  47922. 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); }; }
  47923. 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); }
  47924. function RouteCalculateMeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  47925. 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; } }
  47926. function RouteCalculateMeasureService_getPrototypeOf(o) { RouteCalculateMeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteCalculateMeasureService_getPrototypeOf(o); }
  47927. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  47928. * This program are made available under the terms of the Apache License, Version 2.0
  47929. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47930. /**
  47931. * @class RouteCalculateMeasureService
  47932. * @deprecatedclass SuperMap.RouteCalculateMeasureService
  47933. * @category iServer SpatialAnalyst RouteCalculateMeasure
  47934. * @classdesc 基于路由对象计算指定点 M 值操作的服务类。
  47935. * 该类负责将客户设置的计算指定点的 M 值参数传递给服务端,并接收服务端返回的
  47936. * 指定点的 M 值。通过该类支持的事件的监听函数参数获取。
  47937. * @extends {SpatialAnalystBase}
  47938. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  47939. * @param {Object} options - 参数。
  47940. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  47941. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  47942. * @param {Object} [options.headers] - 请求头。
  47943. * @example 实例化该类如下例所示:
  47944. * (start code)
  47945. * var parameters = new RouteCalculateMeasureParameters({
  47946. * "sourceRoute":{
  47947. * "type":"LINEM",
  47948. * "parts":[4],
  47949. * "points":[
  47950. * {
  47951. * "measure":0,
  47952. * "y":-6674.466867067764,
  47953. * "x":3817.3527876130133
  47954. * },
  47955. * {
  47956. * "measure":199.57954019411724,
  47957. * "y":-6670.830929417594,
  47958. * "x":3617.806369901496
  47959. * },
  47960. * {
  47961. * "measure":609.3656478634477,
  47962. * "y":-6877.837541432356,
  47963. * "x":3264.1498746678444
  47964. * },
  47965. * {
  47966. * "measure":936.0174126282958,
  47967. * "y":-7038.687780615184,
  47968. * "x":2979.846206068903
  47969. * }
  47970. * ]
  47971. * },
  47972. * "tolerance":1,
  47973. * "point":{
  47974. * "x":3330.7754269417,
  47975. * "y":-6838.8394457216
  47976. * },
  47977. * "isIgnoreGap":false
  47978. * });
  47979. *
  47980. * var routeCalculateMeasureService = new RouteCalculateMeasureService(spatialAnalystURL, {
  47981. * eventListeners:{
  47982. * processCompleted:calculateCompleted,
  47983. * processFailed:calculateFailded
  47984. * }
  47985. * );
  47986. * routeCalculateMeasureService.processAsync(parameters);
  47987. *
  47988. * //执行
  47989. * function calculateCompleted(){todo}
  47990. * function calculateFailded(){todo}
  47991. * (end)
  47992. * @usage
  47993. */
  47994. var RouteCalculateMeasureService = /*#__PURE__*/function (_SpatialAnalystBase) {
  47995. RouteCalculateMeasureService_inherits(RouteCalculateMeasureService, _SpatialAnalystBase);
  47996. var _super = RouteCalculateMeasureService_createSuper(RouteCalculateMeasureService);
  47997. function RouteCalculateMeasureService(url, options) {
  47998. var _this;
  47999. RouteCalculateMeasureService_classCallCheck(this, RouteCalculateMeasureService);
  48000. _this = _super.call(this, url, options);
  48001. _this.CLASS_NAME = "SuperMap.RouteCalculateMeasureService";
  48002. return _this;
  48003. }
  48004. /**
  48005. * @override
  48006. */
  48007. RouteCalculateMeasureService_createClass(RouteCalculateMeasureService, [{
  48008. key: "destroy",
  48009. value: function destroy() {
  48010. RouteCalculateMeasureService_get(RouteCalculateMeasureService_getPrototypeOf(RouteCalculateMeasureService.prototype), "destroy", this).call(this);
  48011. }
  48012. /**
  48013. * @function RouteCalculateMeasureService.prototype.processAsync
  48014. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  48015. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  48016. */
  48017. }, {
  48018. key: "processAsync",
  48019. value: function processAsync(params) {
  48020. if (!(params instanceof RouteCalculateMeasureParameters)) {
  48021. return;
  48022. }
  48023. var me = this,
  48024. jsonParameters;
  48025. jsonParameters = me.getJsonParameters(params);
  48026. me.request({
  48027. method: "POST",
  48028. data: jsonParameters,
  48029. scope: me,
  48030. success: me.serviceProcessCompleted,
  48031. failure: me.serviceProcessFailed
  48032. });
  48033. }
  48034. /**
  48035. * @function RouteCalculateMeasureService.prototype.getJsonParameters
  48036. * @description 将参数转化为 JSON 字符串。
  48037. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  48038. * @returns {Object} 转化后的 JSON 字符串。
  48039. */
  48040. }, {
  48041. key: "getJsonParameters",
  48042. value: function getJsonParameters(params) {
  48043. var jsonParameters,
  48044. jsonStr = "geometry/calculatemeasure",
  48045. me = this;
  48046. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  48047. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  48048. jsonParameters = Util_Util.toJSON(params);
  48049. return jsonParameters;
  48050. }
  48051. }]);
  48052. return RouteCalculateMeasureService;
  48053. }(SpatialAnalystBase);
  48054. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorParameters.js
  48055. function RouteLocatorParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48056. 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); } }
  48057. 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; }
  48058. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48059. * This program are made available under the terms of the Apache License, Version 2.0
  48060. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48061. /**
  48062. * @class RouteLocatorParameters
  48063. * @deprecatedclass SuperMap.RouteLocatorParameters
  48064. * @category iServer SpatialAnalyst RouteLocator
  48065. * @classdesc 路由对象定位空间对象的参数类。
  48066. * 参数有两种方式,分别为 Geometry 和 Dataset 两种,前者需要指定 sourceRoute 对象作为参数,后者需要 dataset,routeIDField,routeID 三个参数。如果用户两种参数均设置,优先选择 Dataset 方式。
  48067. * @param {Object} options - 参数。
  48068. * @param {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} options.sourceRoute - 路由对象。
  48069. * @param {number} options.measure - 定位点的 M 值。只当路由对象定位点时有意义。
  48070. * @param {string} [options.type] - 类型:点 or 线。
  48071. * @param {number} [options.offset=0] - 定位点偏移量。只当路由对象定位点时有意义。
  48072. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。即不忽略子对象之间的距离。
  48073. * @param {number} [options.startMeasure] - 定位线的起始 M 值。只当路由对象定位线时有意义。
  48074. * @param {number} [options.endMeasure] - 定位线的终止 M 值。只当路由对象定位线时有意义。
  48075. * @usage
  48076. */
  48077. var RouteLocatorParameters = /*#__PURE__*/function () {
  48078. function RouteLocatorParameters(options) {
  48079. RouteLocatorParameters_classCallCheck(this, RouteLocatorParameters);
  48080. if (!options) {
  48081. return this;
  48082. }
  48083. /**
  48084. * @member {(Route|L.Polyline|ol.geom.LineString|GeoJSONObject)} RouteLocatorParameters.prototype.sourceRoute
  48085. * @description 路由对象。
  48086. */
  48087. this.sourceRoute = null;
  48088. /**
  48089. * @member {string} RouteLocatorParameters.prototype.dataset
  48090. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  48091. */
  48092. this.dataset = null;
  48093. /**
  48094. * @member {string} RouteLocatorParameters.prototype.routeIDField
  48095. * @description 路由对象所在的字段名称。
  48096. *
  48097. */
  48098. this.routeIDField = null;
  48099. /**
  48100. * @member {number} RouteLocatorParameters.prototype.routeID
  48101. * @description 路由对象标识。
  48102. *
  48103. */
  48104. this.routeID = null;
  48105. /**
  48106. * @member {string} [RouteLocatorParameters.prototype.type]
  48107. * @description 类型:点 or 线。
  48108. * 可选值为:
  48109. * LINE :根据起始 M 值及终止 M 值定位线对象。
  48110. * POINT : 根据 M 值定位点对象。
  48111. */
  48112. this.type = null;
  48113. /**
  48114. * @member {number} RouteLocatorParameters.prototype.measure
  48115. * @description 定位点的 M 值。只当路由对象定位点时有意义。
  48116. */
  48117. this.measure = null;
  48118. /**
  48119. * @member {number} [RouteLocatorParameters.prototype.offset=0]
  48120. * @description 定位点偏移量。只当路由对象定位点时有意义。
  48121. */
  48122. this.offset = 0;
  48123. /**
  48124. * @member {boolean} [RouteLocatorParameters.prototype.isIgnoreGap=false]
  48125. * @description 是否忽略子对象之间的距离。
  48126. */
  48127. this.isIgnoreGap = false;
  48128. /**
  48129. * @member {number} [RouteLocatorParameters.prototype.startMeasure]
  48130. * @description 定位线的起始 M 值。只当路由对象定位线时有意义。
  48131. */
  48132. this.startMeasure = null;
  48133. /**
  48134. * @member {number} [RouteLocatorParameters.prototype.endMeasure]
  48135. * @description 定位线的终止 M 值。只当路由对象定位线时有意义。
  48136. */
  48137. this.endMeasure = null;
  48138. var routeFromClient = options.sourceRoute;
  48139. var routeHandle = {};
  48140. if (routeFromClient && routeFromClient instanceof Geometry_Geometry && routeFromClient.components) {
  48141. routeHandle.type = routeFromClient.type;
  48142. routeHandle.parts = routeFromClient.parts;
  48143. var parts = [];
  48144. for (var i = 0, len = routeFromClient.components.length; i < len; i++) {
  48145. parts = parts.concat(routeFromClient.components[i].components);
  48146. }
  48147. routeHandle.points = parts;
  48148. options.sourceRoute = routeHandle;
  48149. }
  48150. Util_Util.extend(this, options);
  48151. this.CLASS_NAME = "SuperMap.RouteLocatorParameters";
  48152. }
  48153. /**
  48154. * @function RouteLocatorParameters.prototype.destroy
  48155. * @description 释放资源,将引用资源的属性置空。
  48156. */
  48157. RouteLocatorParameters_createClass(RouteLocatorParameters, [{
  48158. key: "destroy",
  48159. value: function destroy() {
  48160. var me = this;
  48161. me.sourceRoute = null;
  48162. me.type = null;
  48163. me.measure = null;
  48164. me.offset = 0;
  48165. me.isIgnoreGap = false;
  48166. me.startMeasure = null;
  48167. me.endMeasure = null;
  48168. me.dataset = null;
  48169. me.routeID = null;
  48170. me.routeIDField = null;
  48171. }
  48172. }]);
  48173. return RouteLocatorParameters;
  48174. }();
  48175. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorService.js
  48176. 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); }
  48177. function RouteLocatorService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48178. 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); } }
  48179. 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; }
  48180. 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); }
  48181. function RouteLocatorService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteLocatorService_getPrototypeOf(object); if (object === null) break; } return object; }
  48182. 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); }
  48183. 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); }
  48184. 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); }; }
  48185. 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); }
  48186. function RouteLocatorService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48187. 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; } }
  48188. function RouteLocatorService_getPrototypeOf(o) { RouteLocatorService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteLocatorService_getPrototypeOf(o); }
  48189. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48190. * This program are made available under the terms of the Apache License, Version 2.0
  48191. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48192. /**
  48193. * @class RouteLocatorService
  48194. * @deprecatedclass SuperMap.RouteLocatorService
  48195. * @category iServer SpatialAnalyst RouteLocator
  48196. * @classdesc 路由对象定位空间对象的服务类。
  48197. * @extends {SpatialAnalystBase}
  48198. * @param {string} url -服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  48199. * @param {Object} options - 参数。
  48200. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  48201. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48202. * @param {Object} [options.headers] - 请求头。
  48203. * @example 实例化该类如下例所示:
  48204. * (start code)
  48205. * var routeLocatorParameters_point = new RouteLocatorParameters({
  48206. * "sourceRoute":{
  48207. * "type":"LINEM",
  48208. * "parts":[4],
  48209. * "points":[
  48210. * {
  48211. * "measure":0,
  48212. * "y":-6674.466867067764,
  48213. * "x":3817.3527876130133
  48214. * },
  48215. * {
  48216. * "measure":199.57954019411724,
  48217. * "y":-6670.830929417594,
  48218. * "x":3617.806369901496
  48219. * },
  48220. * {
  48221. * "measure":609.3656478634477,
  48222. * "y":-6877.837541432356,
  48223. * "x":3264.1498746678444
  48224. * },
  48225. * {
  48226. * "measure":936.0174126282958,
  48227. * "y":-7038.687780615184,
  48228. * "x":2979.846206068903
  48229. * }
  48230. * ]
  48231. * },
  48232. * "type":"POINT",
  48233. * "measure":10,
  48234. * "offset":3,
  48235. * "isIgnoreGap":true
  48236. * });
  48237. * var routeLocatorService = new RouteLocatorService(spatialAnalystURL, {
  48238. * eventListeners:{
  48239. * processCompleted:routeLocatorCompleted,
  48240. * processFailed:routeLocatorFailded
  48241. * }
  48242. * );
  48243. * routeLocatorService.processAsync(routeLocatorParameters_point);
  48244. *
  48245. * //执行
  48246. * function routeLocatorCompleted(){todo}
  48247. * function routeLocatorFailded(){todo}
  48248. * (end)
  48249. * @usage
  48250. */
  48251. var RouteLocatorService = /*#__PURE__*/function (_SpatialAnalystBase) {
  48252. RouteLocatorService_inherits(RouteLocatorService, _SpatialAnalystBase);
  48253. var _super = RouteLocatorService_createSuper(RouteLocatorService);
  48254. function RouteLocatorService(url, options) {
  48255. var _this;
  48256. RouteLocatorService_classCallCheck(this, RouteLocatorService);
  48257. _this = _super.call(this, url, options);
  48258. _this.CLASS_NAME = "SuperMap.RouteLocatorService";
  48259. return _this;
  48260. }
  48261. /**
  48262. * @override
  48263. */
  48264. RouteLocatorService_createClass(RouteLocatorService, [{
  48265. key: "destroy",
  48266. value: function destroy() {
  48267. RouteLocatorService_get(RouteLocatorService_getPrototypeOf(RouteLocatorService.prototype), "destroy", this).call(this);
  48268. }
  48269. /**
  48270. * @function RouteLocatorService.prototype.processAsync
  48271. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  48272. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  48273. */
  48274. }, {
  48275. key: "processAsync",
  48276. value: function processAsync(params) {
  48277. if (!(params instanceof RouteLocatorParameters)) {
  48278. return;
  48279. }
  48280. var me = this,
  48281. jsonParameters;
  48282. jsonParameters = me.getJsonParameters(params);
  48283. me.request({
  48284. method: "POST",
  48285. data: jsonParameters,
  48286. scope: me,
  48287. success: me.serviceProcessCompleted,
  48288. failure: me.serviceProcessFailed
  48289. });
  48290. }
  48291. /**
  48292. * @function RouteLocatorService.prototype.processAsync
  48293. * @description 将参数转化为 JSON 字符串。
  48294. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  48295. * @returns {Object} 转化后的JSON字符串。
  48296. */
  48297. }, {
  48298. key: "getJsonParameters",
  48299. value: function getJsonParameters(params) {
  48300. var jsonParameters,
  48301. jsonStr = "geometry/routelocator",
  48302. me = this;
  48303. if (params.dataset) {
  48304. jsonStr = "datasets/" + params.dataset + "/linearreferencing/routelocator";
  48305. params.sourceRoute = null;
  48306. }
  48307. me.url = Util_Util.urlPathAppend(me.url, jsonStr);
  48308. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  48309. jsonParameters = Util_Util.toJSON(params);
  48310. return jsonParameters;
  48311. }
  48312. }]);
  48313. return RouteLocatorService;
  48314. }(SpatialAnalystBase);
  48315. ;// CONCATENATED MODULE: ./src/common/iServer/ServerFeature.js
  48316. function ServerFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48317. 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); } }
  48318. 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; }
  48319. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48320. * This program are made available under the terms of the Apache License, Version 2.0
  48321. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48322. /**
  48323. * @class ServerFeature
  48324. * @deprecatedclass SuperMap.ServerFeature
  48325. * @category iServer Data Feature
  48326. * @classdesc 服务端矢量要素类。该类描述了服务端返回的矢量要素的相关信息,包括字段和几何信息。
  48327. * @param {ServerGeometry} geometry - 矢量要素的几何信息。
  48328. * @param {Object} options - 参数。
  48329. * @param {Array.<string>} [options.fieldNames] - 矢量要素的属性字段名集合。
  48330. * @param {Array.<string>} [options.fieldValues] - 矢量要素的属性字段值集合。
  48331. * @usage
  48332. */
  48333. var ServerFeature = /*#__PURE__*/function () {
  48334. function ServerFeature(options) {
  48335. ServerFeature_classCallCheck(this, ServerFeature);
  48336. /**
  48337. * @member {Array.<string>} [ServerFeature.prototype.fieldNames]
  48338. * @description 矢量要素的属性字段名集合。
  48339. */
  48340. this.fieldNames = null;
  48341. /**
  48342. * @member {Array.<string>} [ServerFeature.prototype.fieldValues]
  48343. * @description 矢量要素的属性字段值集合。
  48344. */
  48345. this.fieldValues = null;
  48346. /**
  48347. * @member {ServerGeometry} ServerFeature.prototype.geometry
  48348. * @description 矢量要素的几何信息。
  48349. */
  48350. this.geometry = null;
  48351. if (options) {
  48352. Util_Util.extend(this, options);
  48353. }
  48354. this.CLASS_NAME = "SuperMap.ServerFeature";
  48355. }
  48356. /**
  48357. * @function ServerFeature.prototype.destroy
  48358. * @description 释放资源,将引用资源的属性置空。
  48359. */
  48360. ServerFeature_createClass(ServerFeature, [{
  48361. key: "destroy",
  48362. value: function destroy() {
  48363. var me = this;
  48364. me.fieldNames = null;
  48365. me.fieldValues = null;
  48366. if (me.geometry) {
  48367. me.geometry.destroy();
  48368. me.geometry = null;
  48369. }
  48370. }
  48371. /**
  48372. * @function ServerFeature.prototype.toFeature
  48373. * @description 将服务端矢量要素 ServerFeature 转换为客户端矢量要素 Feature。
  48374. * @returns {Vector} 转换后的客户端矢量要素。
  48375. */
  48376. }, {
  48377. key: "toFeature",
  48378. value: function toFeature() {
  48379. var names,
  48380. values,
  48381. geo,
  48382. attr = {},
  48383. me = this,
  48384. feature;
  48385. names = me.fieldNames;
  48386. values = me.fieldValues;
  48387. for (var i in names) {
  48388. attr[names[i]] = values[i];
  48389. }
  48390. if (me.geometry) {
  48391. geo = me.geometry.toGeometry();
  48392. }
  48393. feature = new Vector(geo, attr);
  48394. if (me.geometry && me.geometry.id) {
  48395. feature.fid = me.geometry.id;
  48396. }
  48397. return feature;
  48398. }
  48399. /**
  48400. * @function ServerFeature.prototype.fromJson
  48401. * @description 将 JSON 对象表示服务端矢量要素转换为 ServerFeature。
  48402. * @param {Object} jsonObject - 要转换的 JSON 对象。
  48403. * @returns {ServerFeature} 转化后的 ServerFeature 对象。
  48404. */
  48405. }], [{
  48406. key: "fromJson",
  48407. value: function fromJson(jsonObject) {
  48408. var geo = null;
  48409. if (!jsonObject) {
  48410. return;
  48411. }
  48412. geo = jsonObject.geometry;
  48413. if (geo) {
  48414. geo = ServerGeometry.fromJson(geo);
  48415. }
  48416. return new ServerFeature({
  48417. fieldNames: jsonObject.fieldNames,
  48418. fieldValues: jsonObject.fieldValues,
  48419. geometry: geo
  48420. });
  48421. }
  48422. }]);
  48423. return ServerFeature;
  48424. }();
  48425. ;// CONCATENATED MODULE: ./src/common/iServer/SetDatasourceParameters.js
  48426. function SetDatasourceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48427. 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); } }
  48428. 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; }
  48429. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48430. * This program are made available under the terms of the Apache License, Version 2.0
  48431. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48432. /**
  48433. * @class SetDatasourceParameters
  48434. * @deprecatedclass SuperMap.SetDatasourceParameters
  48435. * @category iServer Data Datasource
  48436. * @classdesc 设置数据源信息参数类。
  48437. * @param {Object} options - 参数。
  48438. * @param {string} options.datasourceName - 数据源名称。
  48439. * @param {string} options.description - 数据源描述信息。
  48440. * @param {string} options.coordUnit - 坐标单位。
  48441. * @param {string} options.distanceUnit - 距离单位。
  48442. * @usage
  48443. */
  48444. var SetDatasourceParameters = /*#__PURE__*/function () {
  48445. function SetDatasourceParameters(options) {
  48446. SetDatasourceParameters_classCallCheck(this, SetDatasourceParameters);
  48447. if (!options) {
  48448. return;
  48449. }
  48450. /**
  48451. * @member {string} SetDatasourceParameters.prototype.datasourceName
  48452. * @description 数据源名称。
  48453. */
  48454. this.datasourceName = null;
  48455. /**
  48456. * @member {string} SetDatasourceParameters.prototype.description
  48457. * @description 数据源描述信息。
  48458. */
  48459. this.description = null;
  48460. /**
  48461. * @member {string} SetDatasourceParameters.prototype.coordUnit
  48462. * @description 坐标单位。
  48463. */
  48464. this.coordUnit = null;
  48465. /**
  48466. * @member {string} SetDatasourceParameters.prototype.distanceUnit
  48467. * @description 距离单位。
  48468. */
  48469. this.distanceUnit = null;
  48470. if (options) {
  48471. Util_Util.extend(this, options);
  48472. }
  48473. this.CLASS_NAME = "SuperMap.SetDatasourceParameters";
  48474. }
  48475. /**
  48476. * @function SetDatasourceParameters.prototype.destroy
  48477. * @description 释放资源,将引用资源的属性置空。
  48478. */
  48479. SetDatasourceParameters_createClass(SetDatasourceParameters, [{
  48480. key: "destroy",
  48481. value: function destroy() {
  48482. var me = this;
  48483. me.datasourceName = null;
  48484. me.description = null;
  48485. me.coordUnit = null;
  48486. me.distanceUnit = null;
  48487. }
  48488. }]);
  48489. return SetDatasourceParameters;
  48490. }();
  48491. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoParameters.js
  48492. function SetLayerInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48493. 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); } }
  48494. 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; }
  48495. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48496. * This program are made available under the terms of the Apache License, Version 2.0
  48497. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48498. /**
  48499. * @class SetLayerInfoParameters
  48500. * @deprecatedclass SuperMap.SetLayerInfoParameters
  48501. * @category iServer Map TempLayersSet
  48502. * @classdesc 设置图层信息参数类。
  48503. * @param {Object} options - 参数。
  48504. * @param {string} options.resourceID - 临时图层的资源 ID。
  48505. * @param {string} options.tempLayerName - 临时图层下的子图层名。
  48506. * @param {string} options.layerInfo - 要更新的图层信息。
  48507. * @usage
  48508. */
  48509. var SetLayerInfoParameters = /*#__PURE__*/function () {
  48510. function SetLayerInfoParameters(options) {
  48511. SetLayerInfoParameters_classCallCheck(this, SetLayerInfoParameters);
  48512. options = options || {};
  48513. /**
  48514. * @member {string} SetLayerInfoParameters.prototype.resourceID
  48515. * @description 临时图层的资源 ID。
  48516. */
  48517. this.resourceID = null;
  48518. /**
  48519. * @member {string} SetLayerInfoParameters.prototype.tempLayerName
  48520. * @description 临时图层下子图层(或者其子图层)名,如:Countries@World.3@@World。
  48521. */
  48522. this.tempLayerName = null;
  48523. /**
  48524. * @member {Object} SetLayerInfoParameters.prototype.layerInfo
  48525. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  48526. */
  48527. this.layerInfo = null;
  48528. Util_Util.extend(this, options);
  48529. this.CLASS_NAME = "SuperMap.SetLayerInfoParameters";
  48530. }
  48531. /**
  48532. * @function SetLayerInfoParameters.prototype.destroy
  48533. * @description 释放资源,将引用资源的属性置空。
  48534. */
  48535. SetLayerInfoParameters_createClass(SetLayerInfoParameters, [{
  48536. key: "destroy",
  48537. value: function destroy() {
  48538. var me = this;
  48539. me.resourceID = null;
  48540. me.tempLayerName = null;
  48541. me.layerInfo = null;
  48542. }
  48543. }]);
  48544. return SetLayerInfoParameters;
  48545. }();
  48546. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoService.js
  48547. 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); }
  48548. function SetLayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48549. 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); } }
  48550. 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; }
  48551. 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); }
  48552. function SetLayerInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  48553. 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); }
  48554. 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); }
  48555. 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); }; }
  48556. 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); }
  48557. function SetLayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48558. 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; } }
  48559. function SetLayerInfoService_getPrototypeOf(o) { SetLayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerInfoService_getPrototypeOf(o); }
  48560. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48561. * This program are made available under the terms of the Apache License, Version 2.0
  48562. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48563. /**
  48564. * @class SetLayerInfoService
  48565. * @deprecatedclass SuperMap.SetLayerInfoService
  48566. * @category iServer Map TempLayersSet
  48567. * @classdesc 设置图层信息服务类。可以实现临时图层中子图层的修改
  48568. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  48569. * @extends {CommonServiceBase}
  48570. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  48571. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World";
  48572. * @param {Object} options - 参数。
  48573. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  48574. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  48575. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48576. * @param {Object} [options.headers] - 请求头。
  48577. * @usage
  48578. */
  48579. var SetLayerInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  48580. SetLayerInfoService_inherits(SetLayerInfoService, _CommonServiceBase);
  48581. var _super = SetLayerInfoService_createSuper(SetLayerInfoService);
  48582. function SetLayerInfoService(url, options) {
  48583. var _this;
  48584. SetLayerInfoService_classCallCheck(this, SetLayerInfoService);
  48585. _this = _super.call(this, url, options);
  48586. if (options) {
  48587. Util_Util.extend(SetLayerInfoService_assertThisInitialized(_this), options);
  48588. }
  48589. _this.CLASS_NAME = "SuperMap.SetLayerInfoService";
  48590. return _this;
  48591. }
  48592. /**
  48593. * @override
  48594. */
  48595. SetLayerInfoService_createClass(SetLayerInfoService, [{
  48596. key: "destroy",
  48597. value: function destroy() {
  48598. SetLayerInfoService_get(SetLayerInfoService_getPrototypeOf(SetLayerInfoService.prototype), "destroy", this).call(this);
  48599. Util_Util.reset(this);
  48600. }
  48601. /**
  48602. * @function SetLayerInfoService.prototype.processAsync
  48603. * @description 负责将客户端的更新参数传递到服务端。
  48604. * @param {Object} params - 修改后的图层资源信息。
  48605. * 该参数可以使用获取图层信息服务<{@link GetLayersInfoService}>返回图层信息,解析结果result.subLayers.layers[i],然后对其属性进行修改来获取。
  48606. */
  48607. }, {
  48608. key: "processAsync",
  48609. value: function processAsync(params) {
  48610. if (!params) {
  48611. return;
  48612. }
  48613. var me = this;
  48614. var jsonParamsStr = Util_Util.toJSON(params);
  48615. me.request({
  48616. method: "PUT",
  48617. data: jsonParamsStr,
  48618. scope: me,
  48619. success: me.serviceProcessCompleted,
  48620. failure: me.serviceProcessFailed
  48621. });
  48622. }
  48623. }]);
  48624. return SetLayerInfoService;
  48625. }(CommonServiceBase);
  48626. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoParameters.js
  48627. function SetLayersInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48628. 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); } }
  48629. 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; }
  48630. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48631. * This program are made available under the terms of the Apache License, Version 2.0
  48632. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48633. /**
  48634. * @class SetLayersInfoParameters
  48635. * @deprecatedclass SuperMap.SetLayersInfoParameters
  48636. * @category iServer Map TempLayersSet
  48637. * @classdesc 设置图层信息参数类。
  48638. * @param {Object} options - 参数。
  48639. * @param {boolean} [options.isTempLayers=false] - 是否是临时图层。
  48640. * @param {string} options.resourceID - 临时图层资源 ID。
  48641. * @param {Object} options.layersInfo - 要更新的图层信息。
  48642. * @usage
  48643. */
  48644. var SetLayersInfoParameters = /*#__PURE__*/function () {
  48645. function SetLayersInfoParameters(options) {
  48646. SetLayersInfoParameters_classCallCheck(this, SetLayersInfoParameters);
  48647. options = options || {};
  48648. /**
  48649. * @member {boolean} [SetLayersInfoParameters.prototype.isTempLayers=false]
  48650. * @description 是否是临时图层。
  48651. */
  48652. this.isTempLayers = null;
  48653. /**
  48654. * @member {string} SetLayersInfoParameters.prototype.resourceID
  48655. * @description 临时图层资源 ID。
  48656. */
  48657. this.resourceID = null;
  48658. /**
  48659. * @member {Object} SetLayersInfoParameters.prototype.layersInfo
  48660. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  48661. */
  48662. this.layersInfo = null;
  48663. Util_Util.extend(this, options);
  48664. this.CLASS_NAME = "SuperMap.SetLayersInfoParameters";
  48665. }
  48666. /**
  48667. * @function SetLayersInfoParameters.prototype.destroy
  48668. * @description 释放资源,将引用资源的属性置空。
  48669. */
  48670. SetLayersInfoParameters_createClass(SetLayersInfoParameters, [{
  48671. key: "destroy",
  48672. value: function destroy() {
  48673. var me = this;
  48674. me.isTempLayers = null;
  48675. me.resourceID = null;
  48676. me.layersInfo = null;
  48677. }
  48678. }]);
  48679. return SetLayersInfoParameters;
  48680. }();
  48681. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoService.js
  48682. 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); }
  48683. function SetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48684. 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); } }
  48685. 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; }
  48686. 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); }
  48687. function SetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  48688. 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); }
  48689. 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); }
  48690. 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); }; }
  48691. 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); }
  48692. function SetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48693. 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; } }
  48694. function SetLayersInfoService_getPrototypeOf(o) { SetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayersInfoService_getPrototypeOf(o); }
  48695. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48696. * This program are made available under the terms of the Apache License, Version 2.0
  48697. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48698. /**
  48699. * @class SetLayersInfoService
  48700. * @deprecatedclass SuperMap.SetLayersInfoService
  48701. * @category iServer Map TempLayersSet
  48702. * @classdesc 设置图层信息服务类。可以实现创建新的临时图层和对现有临时图层的修改,
  48703. * 当 isTempLayers 为 false的时候执行创建临时图层。当 isTempLayers 为 ture 并且临时图层资源 resourceID 被设置有效时执行对临时图层的编辑。
  48704. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  48705. * @extends {CommonServiceBase}
  48706. * @param url - {string} 服务地址。请求地图服务,URL 应为:
  48707. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  48708. * @param {Object} options - 参数。
  48709. * @param {string} options.resourceID - 图层资源ID,临时图层的资源ID标记。
  48710. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  48711. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  48712. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  48713. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48714. * @param {Object} [options.headers] - 请求头。
  48715. * @usage
  48716. */
  48717. var SetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  48718. SetLayersInfoService_inherits(SetLayersInfoService, _CommonServiceBase);
  48719. var _super = SetLayersInfoService_createSuper(SetLayersInfoService);
  48720. function SetLayersInfoService(url, options) {
  48721. var _this;
  48722. SetLayersInfoService_classCallCheck(this, SetLayersInfoService);
  48723. _this = _super.call(this, url, options);
  48724. /**
  48725. * @member {string} SetLayersInfoService.prototype.resourceID
  48726. * @description 图层资源ID,临时图层的资源ID标记。
  48727. */
  48728. _this.resourceID = null;
  48729. /**
  48730. * @function {boolean} SetLayersInfoService.prototype.isTempLayers
  48731. * @description 当前url对应的图层是否是临时图层。
  48732. */
  48733. _this.isTempLayers = false;
  48734. if (options) {
  48735. Util_Util.extend(SetLayersInfoService_assertThisInitialized(_this), options);
  48736. }
  48737. _this.CLASS_NAME = "SuperMap.SetLayersInfoService";
  48738. return _this;
  48739. }
  48740. /**
  48741. * @override
  48742. */
  48743. SetLayersInfoService_createClass(SetLayersInfoService, [{
  48744. key: "destroy",
  48745. value: function destroy() {
  48746. SetLayersInfoService_get(SetLayersInfoService_getPrototypeOf(SetLayersInfoService.prototype), "destroy", this).call(this);
  48747. Util_Util.reset(this);
  48748. }
  48749. /**
  48750. * @function SetLayersInfoService.prototype.processAsync
  48751. * @description 负责将客户端的更新参数传递到服务端。
  48752. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务 <{@link GetLayersInfoService}>返回图层信息,然后对其属性进行修改来获取。
  48753. */
  48754. }, {
  48755. key: "processAsync",
  48756. value: function processAsync(params) {
  48757. if (!params) {
  48758. return;
  48759. }
  48760. var jsonParams,
  48761. subLayers = [],
  48762. me = this,
  48763. method = "";
  48764. //创建临时图层和设置修改临时图层信息对应不同的资源URL
  48765. if (me.isTempLayers) {
  48766. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + me.resourceID);
  48767. method = "PUT";
  48768. } else {
  48769. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet");
  48770. method = "POST";
  48771. }
  48772. if (!params.subLayers) {
  48773. params.subLayers = {
  48774. layers: []
  48775. };
  48776. }
  48777. if (!params.subLayers.layers) {
  48778. params.subLayers.layers = [];
  48779. }
  48780. var layers = params.subLayers.layers,
  48781. len = layers.length;
  48782. for (var i in layers) {
  48783. if (layers[i].ugcLayerType === "GRID") {
  48784. var colorDictionary = {};
  48785. var colorDics = layers[i].colorDictionarys;
  48786. for (var j in colorDics) {
  48787. var key = colorDics[j].elevation;
  48788. colorDictionary[key] = colorDics[j].color;
  48789. }
  48790. }
  48791. layers[i].colorDictionary = colorDictionary;
  48792. delete layers[i].colorDictionarys;
  48793. }
  48794. for (var _i2 = 0; _i2 < len; _i2++) {
  48795. if (layers[_i2].toJsonObject) {
  48796. //将图层信息转换成服务端能识别的简单json对象
  48797. subLayers.push(layers[_i2].toJsonObject());
  48798. } else {
  48799. subLayers.push(layers[_i2]);
  48800. }
  48801. }
  48802. jsonParams = Util_Util.extend(jsonParams, params);
  48803. jsonParams.subLayers = {
  48804. "layers": subLayers
  48805. };
  48806. jsonParams.object = null;
  48807. var jsonParamsStr = Util_Util.toJSON([jsonParams]);
  48808. me.request({
  48809. method: method,
  48810. data: jsonParamsStr,
  48811. scope: me,
  48812. success: me.serviceProcessCompleted,
  48813. failure: me.serviceProcessFailed
  48814. });
  48815. }
  48816. }]);
  48817. return SetLayersInfoService;
  48818. }(CommonServiceBase);
  48819. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusParameters.js
  48820. function SetLayerStatusParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48821. 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); } }
  48822. 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; }
  48823. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48824. * This program are made available under the terms of the Apache License, Version 2.0
  48825. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48826. /**
  48827. * @class SetLayerStatusParameters
  48828. * @deprecatedclass SuperMap.SetLayerStatusParameters
  48829. * @category iServer Map TempLayersSet
  48830. * @classdesc 子图层显示控制参数类,该类存储了各子图层是否可见的状态。
  48831. * 注意在 SuperMap iClient 系列产品中所说的图层与 SuperMap Deskpro 的地图对应,子图层与 SuperMap Deskpro 的图层对应。
  48832. * @param {Object} options - 参数。
  48833. * @param {Array.<LayerStatus>} options.layerStatusList - 获取或设置图层可见状态({@link LayerStatus})集合,
  48834. * 集合中的每个 {@link LayerStatus} 对象代表一个子图层的可视状态。
  48835. * @param {number} [options.holdTime=15] - 获取或设置资源在服务端保存的时间。
  48836. * @param {string} [options.resourceID] - 获取或设置资源服务 ID。
  48837. * @usage
  48838. */
  48839. var SetLayerStatusParameters = /*#__PURE__*/function () {
  48840. function SetLayerStatusParameters(options) {
  48841. SetLayerStatusParameters_classCallCheck(this, SetLayerStatusParameters);
  48842. /**
  48843. * @member {Array.<LayerStatus>} SetLayerStatusParameters.prototype.layerStatusList
  48844. * @description 获取或设置图层可见状态({@link LayerStatus})集合,集合中的每个 {@link LayerStatus} 对象代表一个子图层的可视状态。
  48845. */
  48846. this.layerStatusList = [];
  48847. /**
  48848. * @member {number} [SetLayerStatusParameters.prototype.holdTime=15]
  48849. * @description 获取或设置资源在服务端保存的时间。单位为分钟。
  48850. */
  48851. this.holdTime = 15;
  48852. /**
  48853. * @member {string} SetLayerStatusParameters.prototype.resourceID
  48854. * @description 获取或设置资源服务ID。如果设置该参数则会在指定的 TempLayer 中进行图层的显示控制;
  48855. * 如果不设置该参数,则会首先创建一个 TempLayer ,然后在新创建的 TempLayer 中进行图层的显示控制。
  48856. */
  48857. this.resourceID = null;
  48858. if (options) {
  48859. Util_Util.extend(this, options);
  48860. }
  48861. }
  48862. /**
  48863. * @function SetLayerStatusParameters.prototype.destroy
  48864. * @description 释放资源,将引用资源的属性置空。
  48865. */
  48866. SetLayerStatusParameters_createClass(SetLayerStatusParameters, [{
  48867. key: "destroy",
  48868. value: function destroy() {
  48869. var me = this;
  48870. me.layerStatusList = null;
  48871. me.holdTime = null;
  48872. me.resourceID = null;
  48873. }
  48874. /**
  48875. * @function SetLayerStatusParameters.prototype.toJSON
  48876. * @description 生成 JSON。
  48877. * @returns {Object} 对应的 JSON 对象。
  48878. */
  48879. }, {
  48880. key: "toJSON",
  48881. value: function toJSON() {
  48882. var json = '{';
  48883. json += '"layers":[';
  48884. var v = [];
  48885. for (var i = 0, len = this.layerStatusList.length; i < len; i++) {
  48886. v.push(this.layerStatusList[i].toJSON());
  48887. }
  48888. json += v;
  48889. json += ']';
  48890. json += '}';
  48891. return json;
  48892. }
  48893. }]);
  48894. return SetLayerStatusParameters;
  48895. }();
  48896. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusService.js
  48897. 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); }
  48898. function SetLayerStatusService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48899. 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); } }
  48900. 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; }
  48901. 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); }
  48902. function SetLayerStatusService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerStatusService_getPrototypeOf(object); if (object === null) break; } return object; }
  48903. 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); }
  48904. 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); }
  48905. 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); }; }
  48906. 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); }
  48907. function SetLayerStatusService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  48908. 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; } }
  48909. function SetLayerStatusService_getPrototypeOf(o) { SetLayerStatusService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerStatusService_getPrototypeOf(o); }
  48910. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  48911. * This program are made available under the terms of the Apache License, Version 2.0
  48912. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48913. /**
  48914. * @class SetLayerStatusService
  48915. * @deprecatedclass SuperMap.SetLayerStatusService
  48916. * @category iServer Map TempLayersSet
  48917. * @classdesc 子图层显示控制服务类。该类负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  48918. * 用户获取服务端返回的各子图层显示状态有两种方式:
  48919. * 一种是通过监听 SetLayerEvent.PROCESS_COMPLETE 事件;
  48920. * 一种是使用 AsyncResponder 类实现异步处理。
  48921. * @extends {CommonServiceBase}
  48922. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  48923. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  48924. * @param {Object} options - 参数。
  48925. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  48926. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  48927. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  48928. * @param {Object} [options.headers] - 请求头。
  48929. * @usage
  48930. */
  48931. var SetLayerStatusService = /*#__PURE__*/function (_CommonServiceBase) {
  48932. SetLayerStatusService_inherits(SetLayerStatusService, _CommonServiceBase);
  48933. var _super = SetLayerStatusService_createSuper(SetLayerStatusService);
  48934. function SetLayerStatusService(url, options) {
  48935. var _this;
  48936. SetLayerStatusService_classCallCheck(this, SetLayerStatusService);
  48937. _this = _super.call(this, url, options);
  48938. _this.lastparams = null;
  48939. _this.mapUrl = url;
  48940. if (options) {
  48941. Util_Util.extend(SetLayerStatusService_assertThisInitialized(_this), options);
  48942. }
  48943. _this.CLASS_NAME = "SuperMap.SetLayerStatusService";
  48944. return _this;
  48945. }
  48946. /**
  48947. * @override
  48948. */
  48949. SetLayerStatusService_createClass(SetLayerStatusService, [{
  48950. key: "destroy",
  48951. value: function destroy() {
  48952. SetLayerStatusService_get(SetLayerStatusService_getPrototypeOf(SetLayerStatusService.prototype), "destroy", this).call(this);
  48953. Util_Util.reset(this);
  48954. }
  48955. /**
  48956. * @function SetLayerStatusService.prototype.processAsync
  48957. * @description 负责将客户端的更新参数传递到服务端。
  48958. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务{@link SetLayerStatusParameters}
  48959. * 返回图层信息,然后对其属性进行修改来获取。
  48960. */
  48961. }, {
  48962. key: "processAsync",
  48963. value: function processAsync(params) {
  48964. if (!(params instanceof SetLayerStatusParameters)) {
  48965. return;
  48966. }
  48967. var me = this,
  48968. method = "POST";
  48969. me.url = me.mapUrl;
  48970. if (params.resourceID == null) {
  48971. me.url = Util_Util.urlPathAppend(me.url, 'tempLayersSet');
  48972. me.lastparams = params;
  48973. me.request({
  48974. method: method,
  48975. scope: me,
  48976. success: me.createTempLayerComplete,
  48977. failure: me.serviceProcessFailed
  48978. });
  48979. } else {
  48980. me.url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + params.resourceID);
  48981. me.url = Util_Util.urlAppend(me.url, "elementRemain=true&reference=" + params.resourceID + "&holdTime=" + params.holdTime.toString());
  48982. var jsonParameters = '[{';
  48983. jsonParameters += '"type":"UGC",';
  48984. if (params.layerStatusList != null && params.layerStatusList.length > 0) {
  48985. jsonParameters += '"subLayers":' + params.toJSON();
  48986. }
  48987. jsonParameters += ',"visible":' + true + ',';
  48988. jsonParameters += '"name":"' + this.getMapName(this.mapUrl) + '"';
  48989. jsonParameters += '}]';
  48990. me.request({
  48991. method: "PUT",
  48992. data: jsonParameters,
  48993. scope: me,
  48994. success: me.serviceProcessCompleted,
  48995. failure: me.serviceProcessFailed
  48996. });
  48997. }
  48998. }
  48999. /**
  49000. * @function SetLayerStatusService.prototype.createTempLayerComplete
  49001. * @description 设置完成,执行此方法。
  49002. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  49003. */
  49004. }, {
  49005. key: "createTempLayerComplete",
  49006. value: function createTempLayerComplete(result) {
  49007. var me = this;
  49008. result = Util_Util.transformResult(result);
  49009. if (result.succeed) {
  49010. me.lastparams.resourceID = result.newResourceID;
  49011. }
  49012. me.processAsync(me.lastparams);
  49013. }
  49014. /**
  49015. * @function SetLayerStatusService.prototype.getMapName
  49016. * @description 获取地图名称。
  49017. * @param {Object} url - 服务地址。
  49018. */
  49019. }, {
  49020. key: "getMapName",
  49021. value: function getMapName(url) {
  49022. var mapUrl = url;
  49023. if (mapUrl.charAt(mapUrl.length - 1) === "/") {
  49024. mapUrl = mapUrl.substr(0, mapUrl.length - 1);
  49025. }
  49026. var index = mapUrl.lastIndexOf("/");
  49027. var mapName = mapUrl.substring(index + 1, mapUrl.length);
  49028. return mapName;
  49029. }
  49030. /**
  49031. * @function SetLayerStatusService.prototype.setLayerCompleted
  49032. * @description 设置完成,执行此方法。
  49033. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  49034. */
  49035. }, {
  49036. key: "serviceProcessCompleted",
  49037. value: function serviceProcessCompleted(result, options) {
  49038. var me = this;
  49039. result = Util_Util.transformResult(result);
  49040. if (result != null && me.lastparams != null) {
  49041. result.newResourceID = me.lastparams.resourceID;
  49042. }
  49043. me.events.triggerEvent("processCompleted", {
  49044. result: result,
  49045. options: options
  49046. });
  49047. }
  49048. }]);
  49049. return SetLayerStatusService;
  49050. }(CommonServiceBase);
  49051. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
  49052. function SingleObjectQueryJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49053. 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); } }
  49054. 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; }
  49055. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49056. * This program are made available under the terms of the Apache License, Version 2.0
  49057. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49058. /**
  49059. * @class SingleObjectQueryJobsParameter
  49060. * @deprecatedclass SuperMap.SingleObjectQueryJobsParameter
  49061. * @category iServer ProcessingService Query
  49062. * @classdesc 单对象空间查询分析任务参数类。
  49063. * @param {Object} options - 参数。
  49064. * @param {string} options.datasetName - 数据集名。
  49065. * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
  49066. * @param {SpatialQueryMode} [options.mode=SpatialQueryMode.CONTAIN] - 空间查询模式。
  49067. * @param {OutputSetting} [options.output] - 输出参数设置。
  49068. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  49069. * @usage
  49070. */
  49071. var SingleObjectQueryJobsParameter = /*#__PURE__*/function () {
  49072. function SingleObjectQueryJobsParameter(options) {
  49073. SingleObjectQueryJobsParameter_classCallCheck(this, SingleObjectQueryJobsParameter);
  49074. if (!options) {
  49075. return;
  49076. }
  49077. /**
  49078. * @member {string} SingleObjectQueryJobsParameter.prototype.datasetName
  49079. * @description 数据集名。
  49080. */
  49081. this.datasetName = "";
  49082. /**
  49083. * @member {string} SingleObjectQueryJobsParameter.prototype.datasetQuery
  49084. * @description 查询对象所在的数据集名称。
  49085. */
  49086. this.datasetQuery = "";
  49087. /**
  49088. * @member {string} SingleObjectQueryJobsParameter.prototype.geometryQuery
  49089. * @description 查询对象所在的几何对象。
  49090. */
  49091. this.geometryQuery = "";
  49092. /**
  49093. * @member {SpatialQueryMode} [SingleObjectQueryJobsParameter.prototype.mode=SpatialQueryMode.CONTAIN]
  49094. * @description 空间查询模式 。
  49095. */
  49096. this.mode = SpatialQueryMode.CONTAIN;
  49097. /**
  49098. * @member {OutputSetting} [SingleObjectQueryJobsParameter.prototype.output]
  49099. * @description 输出参数设置类。
  49100. */
  49101. this.output = null;
  49102. /**
  49103. * @member {MappingParameters} [SingleObjectQueryJobsParameter.prototype.mappingParameters]
  49104. * @description 分析后结果可视化的参数类。
  49105. */
  49106. this.mappingParameters = null;
  49107. Util_Util.extend(this, options);
  49108. this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
  49109. }
  49110. /**
  49111. * @function SingleObjectQueryJobsParameter.prototype.destroy
  49112. * @description 释放资源,将引用资源的属性置空。
  49113. */
  49114. SingleObjectQueryJobsParameter_createClass(SingleObjectQueryJobsParameter, [{
  49115. key: "destroy",
  49116. value: function destroy() {
  49117. this.datasetName = null;
  49118. this.datasetQuery = null;
  49119. this.geometryQuery = null;
  49120. this.mode = null;
  49121. if (this.output instanceof OutputSetting) {
  49122. this.output.destroy();
  49123. this.output = null;
  49124. }
  49125. if (this.mappingParameters instanceof MappingParameters) {
  49126. this.mappingParameters.destroy();
  49127. this.mappingParameters = null;
  49128. }
  49129. }
  49130. /**
  49131. * @function SingleObjectQueryJobsParameter.toObject
  49132. * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
  49133. * @param {Object} tempObj - 目标对象。
  49134. * @description 生成单对象空间查询分析任务对象。
  49135. */
  49136. }], [{
  49137. key: "toObject",
  49138. value: function toObject(singleObjectQueryJobsParameter, tempObj) {
  49139. for (var name in singleObjectQueryJobsParameter) {
  49140. if (name === "datasetName") {
  49141. tempObj['input'] = tempObj['input'] || {};
  49142. tempObj['input'][name] = singleObjectQueryJobsParameter[name];
  49143. continue;
  49144. }
  49145. if (name === "output") {
  49146. tempObj['output'] = tempObj['output'] || {};
  49147. tempObj['output'] = singleObjectQueryJobsParameter[name];
  49148. continue;
  49149. }
  49150. tempObj['analyst'] = tempObj['analyst'] || {};
  49151. tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
  49152. if (name === 'mappingParameters') {
  49153. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  49154. tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
  49155. }
  49156. }
  49157. }
  49158. }]);
  49159. return SingleObjectQueryJobsParameter;
  49160. }();
  49161. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
  49162. 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); }
  49163. function SingleObjectQueryJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49164. 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); } }
  49165. 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; }
  49166. 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); }
  49167. function SingleObjectQueryJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SingleObjectQueryJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  49168. 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); }
  49169. 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); }
  49170. 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); }; }
  49171. 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); }
  49172. function SingleObjectQueryJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49173. 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; } }
  49174. function SingleObjectQueryJobsService_getPrototypeOf(o) { SingleObjectQueryJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SingleObjectQueryJobsService_getPrototypeOf(o); }
  49175. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49176. * This program are made available under the terms of the Apache License, Version 2.0
  49177. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49178. /**
  49179. * @class SingleObjectQueryJobsService
  49180. * @deprecatedclass SuperMap.SingleObjectQueryJobsService
  49181. * @category iServer ProcessingService Query
  49182. * @classdesc 单对象查询分析服务类
  49183. * @extends {ProcessingServiceBase}
  49184. * @param {string} url - 服务地址。
  49185. * @param {Object} options - 可选参数。
  49186. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49187. * @param {Object} [options.headers] - 请求头。
  49188. * @usage
  49189. */
  49190. var SingleObjectQueryJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  49191. SingleObjectQueryJobsService_inherits(SingleObjectQueryJobsService, _ProcessingServiceBas);
  49192. var _super = SingleObjectQueryJobsService_createSuper(SingleObjectQueryJobsService);
  49193. function SingleObjectQueryJobsService(url, options) {
  49194. var _this;
  49195. SingleObjectQueryJobsService_classCallCheck(this, SingleObjectQueryJobsService);
  49196. _this = _super.call(this, url, options);
  49197. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/query');
  49198. _this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
  49199. return _this;
  49200. }
  49201. /**
  49202. *@override
  49203. */
  49204. SingleObjectQueryJobsService_createClass(SingleObjectQueryJobsService, [{
  49205. key: "destroy",
  49206. value: function destroy() {
  49207. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "destroy", this).call(this);
  49208. }
  49209. /**
  49210. * @function SingleObjectQueryJobsService.protitype.getQueryJobs
  49211. * @description 获取单对象空间查询分析所有任务
  49212. */
  49213. }, {
  49214. key: "getQueryJobs",
  49215. value: function getQueryJobs() {
  49216. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, this.url);
  49217. }
  49218. /**
  49219. * @function KernelDensityJobsService.protitype.getQueryJob
  49220. * @description 获取指定id的单对象空间查询分析服务
  49221. * @param {string} id - 指定要获取数据的id
  49222. */
  49223. }, {
  49224. key: "getQueryJob",
  49225. value: function getQueryJob(id) {
  49226. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  49227. }
  49228. /**
  49229. * @function SingleObjectQueryJobsService.protitype.addQueryJob
  49230. * @description 新建单对象空间查询分析服务
  49231. * @param {SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  49232. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  49233. */
  49234. }, {
  49235. key: "addQueryJob",
  49236. value: function addQueryJob(params, seconds) {
  49237. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "addJob", this).call(this, this.url, params, SingleObjectQueryJobsParameter, seconds);
  49238. }
  49239. }]);
  49240. return SingleObjectQueryJobsService;
  49241. }(ProcessingServiceBase);
  49242. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryParameters.js
  49243. function StopQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49244. 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); } }
  49245. 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; }
  49246. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49247. * This program are made available under the terms of the Apache License, Version 2.0
  49248. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49249. /**
  49250. * @class StopQueryParameters
  49251. * @deprecatedclass SuperMap.StopQueryParameters
  49252. * @category iServer TrafficTransferAnalyst TransferStops
  49253. * @classdesc 站点查询参数类。
  49254. * @param {Object} options - 参数。
  49255. * @param {string} options.keyWord - 站点名称关键字。
  49256. * @param {boolean} [options.returnPosition=false] - 是否返回站点坐标信息。
  49257. * @usage
  49258. */
  49259. var StopQueryParameters = /*#__PURE__*/function () {
  49260. function StopQueryParameters(options) {
  49261. StopQueryParameters_classCallCheck(this, StopQueryParameters);
  49262. options = options || {};
  49263. /**
  49264. * @member {string} StopQueryParameters.prototype.keyWord
  49265. * @description 站点名称关键字。
  49266. */
  49267. this.keyWord = null;
  49268. /**
  49269. * @member {boolean} [StopQueryParameters.prototype.returnPosition=false]
  49270. * @description 是否返回站点坐标信息。
  49271. */
  49272. this.returnPosition = false;
  49273. Util_Util.extend(this, options);
  49274. this.CLASS_NAME = "SuperMap.StopQueryParameters";
  49275. }
  49276. /**
  49277. * @function StopQueryParameters.prototype.destroy
  49278. * @description 释放资源,将引用资源的属性置空。
  49279. */
  49280. StopQueryParameters_createClass(StopQueryParameters, [{
  49281. key: "destroy",
  49282. value: function destroy() {
  49283. Util_Util.reset(this);
  49284. }
  49285. }]);
  49286. return StopQueryParameters;
  49287. }();
  49288. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryService.js
  49289. 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); }
  49290. function StopQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49291. 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); } }
  49292. 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; }
  49293. 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); }
  49294. function StopQueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = StopQueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  49295. 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); }
  49296. 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); }
  49297. 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); }; }
  49298. 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); }
  49299. function StopQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49300. 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; } }
  49301. function StopQueryService_getPrototypeOf(o) { StopQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return StopQueryService_getPrototypeOf(o); }
  49302. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49303. * This program are made available under the terms of the Apache License, Version 2.0
  49304. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49305. /**
  49306. * @class StopQueryService
  49307. * @deprecatedclass SuperMap.StopQueryService
  49308. * @category iServer TrafficTransferAnalyst TransferStops
  49309. * @classdesc 站点查询服务类。
  49310. * 返回结果通过该类支持的事件的监听函数参数获取
  49311. * @extends {CommonServiceBase}
  49312. * @param {string} url - 服务地址。
  49313. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  49314. * @param {Object} options - 参数。
  49315. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  49316. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49317. * @param {Object} [options.headers] - 请求头。
  49318. * @example 例如:
  49319. * (start code)
  49320. * var myService = new StopQueryService(url, {eventListeners: {
  49321. * "processCompleted": StopQueryCompleted,
  49322. * "processFailed": StopQueryError
  49323. * }
  49324. * };
  49325. * (end)
  49326. * @usage
  49327. *
  49328. */
  49329. var StopQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  49330. StopQueryService_inherits(StopQueryService, _CommonServiceBase);
  49331. var _super = StopQueryService_createSuper(StopQueryService);
  49332. function StopQueryService(url, options) {
  49333. var _this;
  49334. StopQueryService_classCallCheck(this, StopQueryService);
  49335. _this = _super.call(this, url, options);
  49336. options = options || {};
  49337. Util_Util.extend(StopQueryService_assertThisInitialized(_this), options);
  49338. _this.CLASS_NAME = "SuperMap.StopQueryService";
  49339. return _this;
  49340. }
  49341. /**
  49342. *@override
  49343. */
  49344. StopQueryService_createClass(StopQueryService, [{
  49345. key: "destroy",
  49346. value: function destroy() {
  49347. StopQueryService_get(StopQueryService_getPrototypeOf(StopQueryService.prototype), "destroy", this).call(this);
  49348. Util_Util.reset(this);
  49349. }
  49350. /**
  49351. * @function StopQueryService.prototype.processAsync
  49352. * @description 负责将客户端的更新参数传递到服务端。
  49353. * @param {StopQueryParameters} params - 交通换乘参数。
  49354. */
  49355. }, {
  49356. key: "processAsync",
  49357. value: function processAsync(params) {
  49358. if (!(params instanceof StopQueryParameters)) {
  49359. return;
  49360. }
  49361. var me = this;
  49362. me.url = Util_Util.urlPathAppend(me.url, 'stops/keyword/' + params.keyWord);
  49363. me.request({
  49364. method: "GET",
  49365. params: {
  49366. returnPosition: params.returnPosition
  49367. },
  49368. scope: me,
  49369. success: me.serviceProcessCompleted,
  49370. failure: me.serviceProcessFailed
  49371. });
  49372. }
  49373. }]);
  49374. return StopQueryService;
  49375. }(CommonServiceBase);
  49376. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
  49377. function SummaryAttributesJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49378. 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); } }
  49379. 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; }
  49380. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49381. * This program are made available under the terms of the Apache License, Version 2.0
  49382. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49383. /**
  49384. * @class SummaryAttributesJobsParameter
  49385. * @deprecatedclass SuperMap.SummaryAttributesJobsParameter
  49386. * @category iServer ProcessingService SummaryAttributes
  49387. * @classdesc 属性汇总分析任务参数类。
  49388. * @param {Object} options - 参数。
  49389. * @param {string} options.datasetName - 数据集名。
  49390. * @param {string} options.groupField - 分组字段。
  49391. * @param {string} options.attributeField - 属性字段。
  49392. * @param {string} options.statisticModes - 统计模式。
  49393. * @param {OutputSetting} [options.output] -输出参数设置。
  49394. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  49395. * @usage
  49396. */
  49397. var SummaryAttributesJobsParameter = /*#__PURE__*/function () {
  49398. function SummaryAttributesJobsParameter(options) {
  49399. SummaryAttributesJobsParameter_classCallCheck(this, SummaryAttributesJobsParameter);
  49400. if (!options) {
  49401. return;
  49402. }
  49403. /**
  49404. * @member {string} SummaryAttributesJobsParameter.prototype.datasetName
  49405. * @description 汇总数据集名称。
  49406. */
  49407. this.datasetName = "";
  49408. /**
  49409. * @member {string} SummaryAttributesJobsParameter.prototype.groupField
  49410. * @description 分组字段。
  49411. */
  49412. this.groupField = "";
  49413. /**
  49414. * @member {string} SummaryAttributesJobsParameter.prototype.attributeField
  49415. * @description 属性字段。
  49416. */
  49417. this.attributeField = "";
  49418. /**
  49419. * @member {string} SummaryAttributesJobsParameter.prototype.statisticModes
  49420. * @description 属性汇总统计模式。
  49421. */
  49422. this.statisticModes = "";
  49423. /**
  49424. * @member {OutputSetting} SummaryAttributesJobsParameter.prototype.output
  49425. * @description 输出参数设置类。
  49426. */
  49427. this.output = null;
  49428. /**
  49429. * @member {MappingParameters} [SummaryAttributesJobsParameter.prototype.mappingParameters]
  49430. * @description 分析后结果可视化的参数类。
  49431. */
  49432. this.mappingParameters = null;
  49433. Util_Util.extend(this, options);
  49434. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
  49435. }
  49436. /**
  49437. * @function SummaryAttributesJobsParameter.prototype.destroy
  49438. * @description 释放资源,将资源的属性置空。
  49439. */
  49440. SummaryAttributesJobsParameter_createClass(SummaryAttributesJobsParameter, [{
  49441. key: "destroy",
  49442. value: function destroy() {
  49443. this.datasetName = null;
  49444. this.groupField = null;
  49445. this.attributeField = null;
  49446. this.statisticModes = null;
  49447. if (this.output instanceof OutputSetting) {
  49448. this.output.destroy();
  49449. this.output = null;
  49450. }
  49451. if (this.mappingParameters instanceof MappingParameters) {
  49452. this.mappingParameters.destroy();
  49453. this.mappingParameters = null;
  49454. }
  49455. }
  49456. /**
  49457. * @function SummaryAttributesJobsParameter.toObject
  49458. * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
  49459. * @param {Object} tempObj - 目标对象。
  49460. * @description 生成属性汇总分析任务对象。
  49461. */
  49462. }], [{
  49463. key: "toObject",
  49464. value: function toObject(_SummaryAttributesJobsParameter, tempObj) {
  49465. for (var name in _SummaryAttributesJobsParameter) {
  49466. if (name === "datasetName") {
  49467. tempObj['input'] = tempObj['input'] || {};
  49468. tempObj['input'][name] = _SummaryAttributesJobsParameter[name];
  49469. continue;
  49470. }
  49471. if (name === "output") {
  49472. tempObj['output'] = tempObj['output'] || {};
  49473. tempObj['output'] = _SummaryAttributesJobsParameter[name];
  49474. continue;
  49475. }
  49476. tempObj['analyst'] = tempObj['analyst'] || {};
  49477. tempObj['analyst'][name] = _SummaryAttributesJobsParameter[name];
  49478. if (name === 'mappingParameters') {
  49479. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  49480. tempObj['analyst']['mappingParameters'] = _SummaryAttributesJobsParameter[name];
  49481. }
  49482. }
  49483. }
  49484. }]);
  49485. return SummaryAttributesJobsParameter;
  49486. }();
  49487. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
  49488. 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); }
  49489. function SummaryAttributesJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49490. 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); } }
  49491. 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; }
  49492. 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); }
  49493. function SummaryAttributesJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryAttributesJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  49494. 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); }
  49495. 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); }
  49496. 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); }; }
  49497. 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); }
  49498. function SummaryAttributesJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49499. 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; } }
  49500. function SummaryAttributesJobsService_getPrototypeOf(o) { SummaryAttributesJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryAttributesJobsService_getPrototypeOf(o); }
  49501. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49502. * This program are made available under the terms of the Apache License, Version 2.0
  49503. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49504. /**
  49505. * @class SummaryAttributesJobsService
  49506. * @deprecatedclass SuperMap.SummaryAttributesJobsService
  49507. * @category iServer ProcessingService SummaryAttributes
  49508. * @classdesc 属性汇总分析服务类
  49509. * @extends {ProcessingServiceBase}
  49510. * @param {string} url - 服务地址。
  49511. * @param {Object} options - 可选参数。
  49512. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49513. * @param {Object} [options.headers] - 请求头。
  49514. * @usage
  49515. */
  49516. var SummaryAttributesJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  49517. SummaryAttributesJobsService_inherits(SummaryAttributesJobsService, _ProcessingServiceBas);
  49518. var _super = SummaryAttributesJobsService_createSuper(SummaryAttributesJobsService);
  49519. function SummaryAttributesJobsService(url, options) {
  49520. var _this;
  49521. SummaryAttributesJobsService_classCallCheck(this, SummaryAttributesJobsService);
  49522. _this = _super.call(this, url, options);
  49523. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/summaryattributes');
  49524. _this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
  49525. return _this;
  49526. }
  49527. /**
  49528. *@override
  49529. */
  49530. SummaryAttributesJobsService_createClass(SummaryAttributesJobsService, [{
  49531. key: "destroy",
  49532. value: function destroy() {
  49533. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "destroy", this).call(this);
  49534. }
  49535. /**
  49536. * @function SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
  49537. * @description 获取属性汇总分析所有任务
  49538. */
  49539. }, {
  49540. key: "getSummaryAttributesJobs",
  49541. value: function getSummaryAttributesJobs() {
  49542. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, this.url);
  49543. }
  49544. /**
  49545. * @function SummaryAttributesJobsService.protitype.getSummaryAttributesJob
  49546. * @description 获取指定id的属性汇总分析服务
  49547. * @param {string} id - 指定要获取数据的id
  49548. */
  49549. }, {
  49550. key: "getSummaryAttributesJob",
  49551. value: function getSummaryAttributesJob(id) {
  49552. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  49553. }
  49554. /**
  49555. * @function SummaryAttributesJobsService.protitype.addSummaryAttributesJob
  49556. * @description 新建属性汇总分析服务
  49557. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析任务参数类。
  49558. * @param {number} seconds - 创建成功结果的时间间隔。
  49559. */
  49560. }, {
  49561. key: "addSummaryAttributesJob",
  49562. value: function addSummaryAttributesJob(params, seconds) {
  49563. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryAttributesJobsParameter, seconds);
  49564. }
  49565. }]);
  49566. return SummaryAttributesJobsService;
  49567. }(ProcessingServiceBase);
  49568. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
  49569. function SummaryMeshJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49570. 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); } }
  49571. 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; }
  49572. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49573. * This program are made available under the terms of the Apache License, Version 2.0
  49574. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49575. /**
  49576. * @class SummaryMeshJobParameter
  49577. * @deprecatedclass SuperMap.SummaryMeshJobParameter
  49578. * @category iServer ProcessingService AggregatePoints
  49579. * @classdesc 点聚合分析任务参数类。
  49580. * @param {Object} options - 参数。
  49581. * @param {string} options.datasetName - 数据集名。
  49582. * @param {string} [options.regionDataset ] - 聚合面数据集(聚合类型为多边形聚合时使用的参数)
  49583. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  49584. * @param {number} options.fields - 权重索引。
  49585. * @param {number} [options.resolution=100] - 分辨率。
  49586. * @param {StatisticAnalystMode} [options.statisticModes=StatisticAnalystMode.AVERAGE] - 分析模式。
  49587. * @param {number} [options.meshType=0] - 分析类型。
  49588. * @param {SummaryType} [options.type=SummaryType.SUMMARYMESH] - 聚合类型。
  49589. * @param {OutputSetting} [options.output] - 输出参数设置。
  49590. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  49591. * @usage
  49592. */
  49593. var SummaryMeshJobParameter = /*#__PURE__*/function () {
  49594. function SummaryMeshJobParameter(options) {
  49595. SummaryMeshJobParameter_classCallCheck(this, SummaryMeshJobParameter);
  49596. if (!options) {
  49597. return;
  49598. }
  49599. /**
  49600. * @member {string} SummaryMeshJobParameter.prototype.datasetName
  49601. * @description 数据集名。
  49602. */
  49603. this.datasetName = "";
  49604. /**
  49605. * @member {string} SummaryMeshJobParameter.prototype.regionDataset
  49606. * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
  49607. */
  49608. this.regionDataset = "";
  49609. /**
  49610. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} SummaryMeshJobParameter.prototype.query
  49611. * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
  49612. */
  49613. this.query = "";
  49614. /**
  49615. * @member {number} [SummaryMeshJobParameter.prototype.resolution=100]
  49616. * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
  49617. */
  49618. this.resolution = 100;
  49619. /**
  49620. * @member {number} [SummaryMeshJobParameter.prototype.meshType=0]
  49621. * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
  49622. */
  49623. this.meshType = 0;
  49624. /**
  49625. * @member {StatisticAnalystMode} [SummaryMeshJobParameter.prototype.statisticModes=StatisticAnalystMode.AVERAGE]
  49626. * @description 统计模式。
  49627. */
  49628. this.statisticModes = StatisticAnalystMode.AVERAGE;
  49629. /**
  49630. * @member {number} SummaryMeshJobParameter.prototype.fields
  49631. * @description 权重字段。
  49632. */
  49633. this.fields = "";
  49634. /**
  49635. * @member {SummaryType} [SummaryMeshJobParameter.prototype.type=SummaryType.SUMMARYMESH]
  49636. * @description 聚合类型。
  49637. */
  49638. this.type = SummaryType.SUMMARYMESH;
  49639. /**
  49640. * @member {OutputSetting} [SummaryMeshJobParameter.prototype.output]
  49641. * @description 输出参数设置类。
  49642. */
  49643. this.output = null;
  49644. /**
  49645. * @member {MappingParameters} [SummaryMeshJobParameter.prototype.mappingParameters]
  49646. * @description 分析后结果可视化的参数类。
  49647. */
  49648. this.mappingParameters = null;
  49649. Util_Util.extend(this, options);
  49650. this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
  49651. }
  49652. /**
  49653. * @function SummaryMeshJobParameter.prototype.destroy
  49654. * @description 释放资源,将资源的属性置空。
  49655. */
  49656. SummaryMeshJobParameter_createClass(SummaryMeshJobParameter, [{
  49657. key: "destroy",
  49658. value: function destroy() {
  49659. this.datasetName = null;
  49660. this.query = null;
  49661. this.resolution = null;
  49662. this.statisticModes = null;
  49663. this.meshType = null;
  49664. this.fields = null;
  49665. this.regionDataset = null;
  49666. this.type = null;
  49667. if (this.output instanceof OutputSetting) {
  49668. this.output.destroy();
  49669. this.output = null;
  49670. }
  49671. if (this.mappingParameters instanceof MappingParameters) {
  49672. this.mappingParameters.destroy();
  49673. this.mappingParameters = null;
  49674. }
  49675. }
  49676. /**
  49677. * @function SummaryMeshJobParameter.toObject
  49678. * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
  49679. * @param {Object} tempObj - 目标对象。
  49680. * @description 生成点聚合分析任务对象。
  49681. */
  49682. }], [{
  49683. key: "toObject",
  49684. value: function toObject(summaryMeshJobParameter, tempObj) {
  49685. for (var name in summaryMeshJobParameter) {
  49686. if (name === "datasetName") {
  49687. tempObj['input'] = tempObj['input'] || {};
  49688. tempObj['input'][name] = summaryMeshJobParameter[name];
  49689. continue;
  49690. }
  49691. if (name === "type") {
  49692. tempObj['type'] = summaryMeshJobParameter[name];
  49693. continue;
  49694. }
  49695. if (name === "output") {
  49696. tempObj['output'] = tempObj['output'] || {};
  49697. tempObj['output'] = summaryMeshJobParameter[name];
  49698. continue;
  49699. }
  49700. if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
  49701. tempObj['analyst'] = tempObj['analyst'] || {};
  49702. if (name === 'query' && summaryMeshJobParameter[name]) {
  49703. tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
  49704. } else {
  49705. tempObj['analyst'][name] = summaryMeshJobParameter[name];
  49706. }
  49707. if (name === 'mappingParameters') {
  49708. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  49709. tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
  49710. }
  49711. }
  49712. }
  49713. function contains(arr, obj) {
  49714. var i = arr.length;
  49715. while (i--) {
  49716. if (arr[i] === obj) {
  49717. return true;
  49718. }
  49719. }
  49720. return false;
  49721. }
  49722. }
  49723. }]);
  49724. return SummaryMeshJobParameter;
  49725. }();
  49726. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
  49727. 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); }
  49728. function SummaryMeshJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49729. 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); } }
  49730. 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; }
  49731. 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); }
  49732. function SummaryMeshJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryMeshJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  49733. 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); }
  49734. 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); }
  49735. 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); }; }
  49736. 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); }
  49737. function SummaryMeshJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49738. 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; } }
  49739. function SummaryMeshJobsService_getPrototypeOf(o) { SummaryMeshJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryMeshJobsService_getPrototypeOf(o); }
  49740. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49741. * This program are made available under the terms of the Apache License, Version 2.0
  49742. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49743. /**
  49744. * @class SummaryMeshJobsService
  49745. * @deprecatedclass SuperMap.SummaryMeshJobsService
  49746. * @category iServer ProcessingService AggregatePoints
  49747. * @classdesc 点聚合分析任务类。
  49748. * @param {string} url - 服务地址。
  49749. * @param {Object} options - 参数。
  49750. * @param {Events} options.events - 处理所有事件的对象。
  49751. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  49752. * @param {number} options.index - 服务地址在数组中的位置。
  49753. * @param {number} options.length - 服务地址数组长度。
  49754. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  49755. * @param {Object} [options.headers] - 请求头。
  49756. * @usage
  49757. */
  49758. var SummaryMeshJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  49759. SummaryMeshJobsService_inherits(SummaryMeshJobsService, _ProcessingServiceBas);
  49760. var _super = SummaryMeshJobsService_createSuper(SummaryMeshJobsService);
  49761. function SummaryMeshJobsService(url, options) {
  49762. var _this;
  49763. SummaryMeshJobsService_classCallCheck(this, SummaryMeshJobsService);
  49764. _this = _super.call(this, url, options);
  49765. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/aggregatepoints');
  49766. _this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
  49767. return _this;
  49768. }
  49769. /**
  49770. * @override
  49771. */
  49772. SummaryMeshJobsService_createClass(SummaryMeshJobsService, [{
  49773. key: "destroy",
  49774. value: function destroy() {
  49775. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "destroy", this).call(this);
  49776. }
  49777. /**
  49778. * @function SummaryMeshJobsService.prototype.getSummaryMeshJobs
  49779. * @description 获取点聚合分析任务
  49780. */
  49781. }, {
  49782. key: "getSummaryMeshJobs",
  49783. value: function getSummaryMeshJobs() {
  49784. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, this.url);
  49785. }
  49786. /**
  49787. * @function SummaryMeshJobsService.prototype.getSummaryMeshJob
  49788. * @description 获取指定ip的点聚合分析任务
  49789. * @param {string} id - 指定要获取数据的id
  49790. */
  49791. }, {
  49792. key: "getSummaryMeshJob",
  49793. value: function getSummaryMeshJob(id) {
  49794. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  49795. }
  49796. /**
  49797. * @function SummaryMeshJobsService.prototype.addSummaryMeshJob
  49798. * @description 新建点聚合分析服务
  49799. * @param {SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
  49800. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  49801. */
  49802. }, {
  49803. key: "addSummaryMeshJob",
  49804. value: function addSummaryMeshJob(params, seconds) {
  49805. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryMeshJobParameter, seconds);
  49806. }
  49807. }]);
  49808. return SummaryMeshJobsService;
  49809. }(ProcessingServiceBase);
  49810. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
  49811. function SummaryRegionJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49812. 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); } }
  49813. 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; }
  49814. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  49815. * This program are made available under the terms of the Apache License, Version 2.0
  49816. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49817. /**
  49818. * @class SummaryRegionJobParameter
  49819. * @deprecatedclass SuperMap.SummaryRegionJobParameter
  49820. * @category iServer ProcessingService SummaryRegion
  49821. * @classdesc 区域汇总分析任务参数类。
  49822. * @param {Object} options - 参数。
  49823. * @param {string} options.datasetName - 数据集名。
  49824. * @param {string} [options.regionDataset] - 汇总数据源(多边形汇总时用到的参数)。
  49825. * @param {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} [options.query] - 分析范围(默认为全图范围)。
  49826. * @param {string} [options.standardFields] - 标准属性字段名称。
  49827. * @param {string} [options.weightedFields] - 权重字段名称。
  49828. * @param {StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  49829. * @param {StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  49830. * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
  49831. * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属性字段统计。
  49832. * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
  49833. * @param {number} [options.resolution=100] - 网格大小。
  49834. * @param {number} [options.meshType=0] - 网格面汇总类型。
  49835. * @param {AnalystSizeUnit} [options.meshSizeUnit=AnalystSizeUnit.METER] - 网格大小单位。
  49836. * @param {SummaryType} [options.type=SummaryType.SUMMARYMESH] - 汇总类型。
  49837. * @param {OutputSetting} [options.output] - 输出参数设置。
  49838. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  49839. * @usage
  49840. */
  49841. var SummaryRegionJobParameter = /*#__PURE__*/function () {
  49842. function SummaryRegionJobParameter(options) {
  49843. SummaryRegionJobParameter_classCallCheck(this, SummaryRegionJobParameter);
  49844. if (!options) {
  49845. return;
  49846. }
  49847. /**
  49848. * @member {string} SummaryRegionJobParameter.prototype.datasetName
  49849. * @description 数据集名。
  49850. */
  49851. this.datasetName = "";
  49852. /**
  49853. * @member {string} SummaryRegionJobParameter.prototype.regionDataset
  49854. * @description 汇总数据源(多边形汇总时用到的参数)。
  49855. */
  49856. this.regionDataset = "";
  49857. /**
  49858. * @member {boolean} [SummaryRegionJobParameter.prototype.sumShape=true]
  49859. * @description 是否统计长度或面积。
  49860. */
  49861. this.sumShape = true;
  49862. /**
  49863. * @member {(SuperMap.Bounds|L.Bounds|L.LatLngBounds|ol.extent|mapboxgl.LngLatBounds|GeoJSONObject)} SummaryRegionJobParameter.prototype.query
  49864. * @description 分析范围。
  49865. */
  49866. this.query = "";
  49867. /**
  49868. * @member {boolean} [SummaryRegionJobParameter.prototype.standardSummaryFields=false]
  49869. * @description 是否以标准属字段统计。
  49870. */
  49871. this.standardSummaryFields = false;
  49872. /**
  49873. * @member {string} SummaryRegionJobParameter.prototype.standardFields
  49874. * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
  49875. */
  49876. this.standardFields = "";
  49877. /**
  49878. * @member {StatisticAnalystMode} SummaryRegionJobParameter.prototype.standardStatisticModes
  49879. * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  49880. */
  49881. this.standardStatisticModes = "";
  49882. /**
  49883. * @member {boolean} [SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
  49884. * @description 是否以权重字段统计。
  49885. */
  49886. this.weightedSummaryFields = false;
  49887. /**
  49888. * @member {string} SummaryRegionJobParameter.prototype.weightedFields
  49889. * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
  49890. */
  49891. this.weightedFields = "";
  49892. /**
  49893. * @member {StatisticAnalystMode} SummaryRegionJobParameter.prototype.weightedStatisticModes
  49894. * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  49895. */
  49896. this.weightedStatisticModes = "";
  49897. /**
  49898. * @member {number} [SummaryRegionJobParameter.prototype.meshType=0]
  49899. * @description 网格面汇总类型。
  49900. */
  49901. this.meshType = 0;
  49902. /**
  49903. * @member {number} [SummaryRegionJobParameter.prototype.resolution=100]
  49904. * @description 网格大小。
  49905. */
  49906. this.resolution = 100;
  49907. /**
  49908. * @member {AnalystSizeUnit} [SummaryRegionJobParameter.prototype.meshSizeUnit=AnalystSizeUnit.METER]
  49909. * @description 网格大小单位。
  49910. */
  49911. this.meshSizeUnit = AnalystSizeUnit.METER;
  49912. /**
  49913. * @member {SummaryType} [SummaryRegionJobParameter.prototype.type=SummaryType.SUMMARYMESH]
  49914. * @description 汇总类型。
  49915. */
  49916. this.type = SummaryType.SUMMARYMESH;
  49917. /**
  49918. * @member {OutputSetting} SummaryRegionJobParameter.prototype.output
  49919. * @description 输出参数设置类。
  49920. */
  49921. this.output = null;
  49922. /**
  49923. * @member {MappingParameters} [SummaryRegionJobParameter.prototype.mappingParameters]
  49924. * @description 分析后结果可视化的参数类。
  49925. */
  49926. this.mappingParameters = null;
  49927. Util_Util.extend(this, options);
  49928. this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
  49929. }
  49930. /**
  49931. * @function SummaryRegionJobParameter.prototype.destroy
  49932. * @description 释放资源,将引用资源的属性置空。
  49933. */
  49934. SummaryRegionJobParameter_createClass(SummaryRegionJobParameter, [{
  49935. key: "destroy",
  49936. value: function destroy() {
  49937. this.datasetName = null;
  49938. this.sumShape = null;
  49939. this.regionDataset = null;
  49940. this.query = null;
  49941. this.standardSummaryFields = null;
  49942. this.standardFields = null;
  49943. this.standardStatisticModes = null;
  49944. this.weightedSummaryFields = null;
  49945. this.weightedFields = null;
  49946. this.weightedStatisticModes = null;
  49947. this.meshType = null;
  49948. this.resolution = null;
  49949. this.meshSizeUnit = null;
  49950. this.type = null;
  49951. if (this.output instanceof OutputSetting) {
  49952. this.output.destroy();
  49953. this.output = null;
  49954. }
  49955. if (this.mappingParameters instanceof MappingParameters) {
  49956. this.mappingParameters.destroy();
  49957. this.mappingParameters = null;
  49958. }
  49959. }
  49960. /**
  49961. * @function SummaryRegionJobParameter.toObject
  49962. * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
  49963. * @param {Object} tempObj - 目标对象。
  49964. * @description 生成区域汇总分析服务对象。
  49965. */
  49966. }], [{
  49967. key: "toObject",
  49968. value: function toObject(summaryRegionJobParameter, tempObj) {
  49969. for (var name in summaryRegionJobParameter) {
  49970. if (name === "datasetName") {
  49971. tempObj['input'] = tempObj['input'] || {};
  49972. tempObj['input'][name] = summaryRegionJobParameter[name];
  49973. continue;
  49974. }
  49975. if (name === "type") {
  49976. tempObj['type'] = summaryRegionJobParameter[name];
  49977. continue;
  49978. }
  49979. if (name === "type") {
  49980. tempObj['type'] = summaryRegionJobParameter[name];
  49981. continue;
  49982. }
  49983. if (name === "output") {
  49984. tempObj['output'] = tempObj['output'] || {};
  49985. tempObj['output'] = summaryRegionJobParameter[name];
  49986. continue;
  49987. }
  49988. if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
  49989. tempObj['analyst'] = tempObj['analyst'] || {};
  49990. if (name === 'query' && summaryRegionJobParameter[name]) {
  49991. tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
  49992. } else {
  49993. tempObj['analyst'][name] = summaryRegionJobParameter[name];
  49994. }
  49995. if (name === 'mappingParameters') {
  49996. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  49997. tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
  49998. }
  49999. }
  50000. }
  50001. }
  50002. }]);
  50003. return SummaryRegionJobParameter;
  50004. }();
  50005. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
  50006. 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); }
  50007. function SummaryRegionJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50008. 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); } }
  50009. 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; }
  50010. 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); }
  50011. function SummaryRegionJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryRegionJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  50012. 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); }
  50013. 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); }
  50014. 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); }; }
  50015. 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); }
  50016. function SummaryRegionJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50017. 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; } }
  50018. function SummaryRegionJobsService_getPrototypeOf(o) { SummaryRegionJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryRegionJobsService_getPrototypeOf(o); }
  50019. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50020. * This program are made available under the terms of the Apache License, Version 2.0
  50021. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50022. /**
  50023. * @class SummaryRegionJobsService
  50024. * @deprecatedclass SuperMap.SummaryRegionJobsService
  50025. * @category iServer ProcessingService SummaryRegion
  50026. * @classdesc 区域汇总分析服务类
  50027. * @extends {ProcessingServiceBase}
  50028. * @param {string} url - 服务地址。
  50029. * @param {Object} options - 可选参数。
  50030. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50031. * @param {Object} [options.headers] - 请求头。
  50032. * @usage
  50033. */
  50034. var SummaryRegionJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  50035. SummaryRegionJobsService_inherits(SummaryRegionJobsService, _ProcessingServiceBas);
  50036. var _super = SummaryRegionJobsService_createSuper(SummaryRegionJobsService);
  50037. function SummaryRegionJobsService(url, options) {
  50038. var _this;
  50039. SummaryRegionJobsService_classCallCheck(this, SummaryRegionJobsService);
  50040. _this = _super.call(this, url, options);
  50041. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/summaryregion');
  50042. _this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
  50043. return _this;
  50044. }
  50045. /**
  50046. *@override
  50047. */
  50048. SummaryRegionJobsService_createClass(SummaryRegionJobsService, [{
  50049. key: "destroy",
  50050. value: function destroy() {
  50051. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "destroy", this).call(this);
  50052. }
  50053. /**
  50054. * @function SummaryRegionJobsService.prototype.getSummaryRegionJobs
  50055. * @description 获取区域汇总分析任务集合。
  50056. */
  50057. }, {
  50058. key: "getSummaryRegionJobs",
  50059. value: function getSummaryRegionJobs() {
  50060. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, this.url);
  50061. }
  50062. /**
  50063. * @function SummaryRegionJobsService.prototype.getSummaryRegionJob
  50064. * @description 获取指定id的区域汇总分析任务。
  50065. * @param {string} id -要获取区域汇总分析任务的id
  50066. */
  50067. }, {
  50068. key: "getSummaryRegionJob",
  50069. value: function getSummaryRegionJob(id) {
  50070. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  50071. }
  50072. /**
  50073. * @function SummaryRegionJobsService.prototype.addSummaryRegionJob
  50074. * @description 新建区域汇总任务。
  50075. * @param {SummaryRegionJobParameter} params - 区域汇总分析任务参数类。
  50076. * @param {number} seconds - 创建成功结果的时间间隔。
  50077. */
  50078. }, {
  50079. key: "addSummaryRegionJob",
  50080. value: function addSummaryRegionJob(params, seconds) {
  50081. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryRegionJobParameter, seconds);
  50082. }
  50083. }]);
  50084. return SummaryRegionJobsService;
  50085. }(ProcessingServiceBase);
  50086. ;// CONCATENATED MODULE: ./src/common/iServer/SupplyCenter.js
  50087. function SupplyCenter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50088. 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); } }
  50089. 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; }
  50090. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50091. * This program are made available under the terms of the Apache License, Version 2.0
  50092. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50093. /**
  50094. * @class SupplyCenter
  50095. * @deprecatedclass SuperMap.SupplyCenter
  50096. * @category iServer NetworkAnalyst Location
  50097. * @classdesc 资源供给中心类。在资源分配和选址分区分析两个功能中使用。
  50098. * @param {Object} options - 参数。
  50099. * @param {number} options.maxWeight - 最大耗费值。
  50100. * @param {number} options.nodeID - 结点 ID 号。资源供给中心必须是结点。
  50101. * @param {number} options.resourceValue - 能提供的最大服务量或商品数量。
  50102. * @param {SupplyCenterType} [options.type] - 资源供给中心点的类型常量。
  50103. * @usage
  50104. */
  50105. var SupplyCenter = /*#__PURE__*/function () {
  50106. function SupplyCenter(options) {
  50107. SupplyCenter_classCallCheck(this, SupplyCenter);
  50108. /**
  50109. * @member {number} SupplyCenter.prototype.maxWeight
  50110. * @description 资源供给中心的最大耗费值。中心点最大阻值设置越小,表示中心点所提供的资源可影响范围越大。
  50111. * 最大阻力值是用来限制需求点到中心点的花费。
  50112. * 如果需求点(弧段或结点)到此中心的花费大于最大阻力值,则该需求点不属于该资源供给中心提供资源的范围。
  50113. */
  50114. this.maxWeight = null;
  50115. /**
  50116. * @member {number} SupplyCenter.prototype.nodeID
  50117. * @description 资源供给中心点的结点 ID 号,资源供给中心必须是结点。
  50118. */
  50119. this.nodeID = null;
  50120. /**
  50121. * @member {number} SupplyCenter.prototype.resourceValue
  50122. * @description 资源供给中心能提供的最大服务量或商品数量。例如资源中心为学校,资源中心资源量表示该学校能够接纳多少学生。
  50123. */
  50124. this.resourceValue = null;
  50125. /**
  50126. * @member {SupplyCenterType} [SupplyCenter.prototype.type]
  50127. * @description 资源供给中心点的类型常量。资源供给中心点的类型包括非中心,固定中心和可选中心。
  50128. * 固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  50129. */
  50130. this.type = null;
  50131. if (options) {
  50132. Util_Util.extend(this, options);
  50133. }
  50134. this.CLASS_NAME = "SuperMap.SupplyCenter";
  50135. }
  50136. /**
  50137. * @function SupplyCenter.prototype.destroy
  50138. * @description 释放资源,将引用资源的属性置空。
  50139. */
  50140. SupplyCenter_createClass(SupplyCenter, [{
  50141. key: "destroy",
  50142. value: function destroy() {
  50143. var me = this;
  50144. me.maxWeight = null;
  50145. me.nodeID = null;
  50146. me.resourceValue = null;
  50147. me.type = null;
  50148. }
  50149. /**
  50150. * @function SupplyCenter.fromJson
  50151. * @description 将服务端 JSON 对象转换成当前客户端对象。
  50152. * @param {Object} jsonObject - 要转换的 JSON 对象。
  50153. * @returns {SupplyCenter} SupplyCenter 对象。
  50154. */
  50155. }], [{
  50156. key: "fromJson",
  50157. value: function fromJson(jsonObject) {
  50158. if (!jsonObject) {
  50159. return;
  50160. }
  50161. return new SupplyCenter({
  50162. maxWeight: jsonObject.maxWeight,
  50163. nodeID: jsonObject.nodeID,
  50164. resourceValue: jsonObject.resourceValue,
  50165. type: jsonObject.type
  50166. });
  50167. }
  50168. }]);
  50169. return SupplyCenter;
  50170. }();
  50171. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystService.js
  50172. 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); }
  50173. function SurfaceAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50174. 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); } }
  50175. 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; }
  50176. 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); }
  50177. function SurfaceAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SurfaceAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  50178. 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); }
  50179. 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); }
  50180. 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); }; }
  50181. 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); }
  50182. function SurfaceAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50183. 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; } }
  50184. function SurfaceAnalystService_getPrototypeOf(o) { SurfaceAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SurfaceAnalystService_getPrototypeOf(o); }
  50185. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50186. * This program are made available under the terms of the Apache License, Version 2.0
  50187. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50188. /**
  50189. * @class SurfaceAnalystService
  50190. * @deprecatedclass SuperMap.SurfaceAnalystService
  50191. * @category iServer SpatialAnalyst SurfaceAnalyst
  50192. * @classdesc 表面分析服务类。
  50193. * 该类负责将客户设置的表面分析服务参数传递给服务端,并接收服务端返回的表面分析服务分析结果数据。
  50194. * 表面分析结果通过该类支持的事件的监听函数参数获取
  50195. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  50196. * @param {Object} options - 参数。
  50197. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  50198. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50199. * @param {Object} [options.headers] - 请求头。
  50200. * @extends {SpatialAnalystBase}
  50201. * @example 例如:
  50202. * (start code)
  50203. * var mySurfaceAnalystService = new SurfaceAnalystService(url, {
  50204. * eventListeners: {
  50205. * "processCompleted": surfaceAnalysCompleted,
  50206. * "processFailed": surfaceAnalysFailed
  50207. * }
  50208. * });
  50209. * (end)
  50210. * @usage
  50211. */
  50212. var SurfaceAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  50213. SurfaceAnalystService_inherits(SurfaceAnalystService, _SpatialAnalystBase);
  50214. var _super = SurfaceAnalystService_createSuper(SurfaceAnalystService);
  50215. function SurfaceAnalystService(url, options) {
  50216. var _this;
  50217. SurfaceAnalystService_classCallCheck(this, SurfaceAnalystService);
  50218. _this = _super.call(this, url, options);
  50219. _this.CLASS_NAME = "SuperMap.SurfaceAnalystService";
  50220. return _this;
  50221. }
  50222. /**
  50223. * @function SurfaceAnalystService.prototype.destroy
  50224. * @description 释放资源,将引用的资源属性置空。
  50225. */
  50226. SurfaceAnalystService_createClass(SurfaceAnalystService, [{
  50227. key: "destroy",
  50228. value: function destroy() {
  50229. SurfaceAnalystService_get(SurfaceAnalystService_getPrototypeOf(SurfaceAnalystService.prototype), "destroy", this).call(this);
  50230. }
  50231. /**
  50232. * @function SurfaceAnalystService.prototype.processAsync
  50233. * @description 负责将客户端的表面分析服务参数传递到服务端。
  50234. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  50235. */
  50236. }, {
  50237. key: "processAsync",
  50238. value: function processAsync(params) {
  50239. if (!(params instanceof SurfaceAnalystParameters)) {
  50240. return;
  50241. }
  50242. var me = this,
  50243. jsonParameters;
  50244. jsonParameters = me.getJsonParameters(params);
  50245. me.request({
  50246. method: "POST",
  50247. data: jsonParameters,
  50248. scope: me,
  50249. success: me.serviceProcessCompleted,
  50250. failure: me.serviceProcessFailed
  50251. });
  50252. }
  50253. /**
  50254. * @function SurfaceAnalystService.prototype.getJsonParameters
  50255. * @description 将参数转化为 JSON 字符串。
  50256. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  50257. * @returns {Object} 转化后的JSON字符串。
  50258. */
  50259. }, {
  50260. key: "getJsonParameters",
  50261. value: function getJsonParameters(params) {
  50262. var jsonParameters = '';
  50263. var parameterObject = {};
  50264. var me = this;
  50265. if (params instanceof DatasetSurfaceAnalystParameters) {
  50266. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + params.dataset + '/' + params.surfaceAnalystMethod.toLowerCase());
  50267. DatasetSurfaceAnalystParameters.toObject(params, parameterObject);
  50268. jsonParameters = Util_Util.toJSON(parameterObject);
  50269. } else if (params instanceof GeometrySurfaceAnalystParameters) {
  50270. me.url = Util_Util.urlPathAppend(me.url, 'geometry/' + params.surfaceAnalystMethod.toLowerCase());
  50271. jsonParameters = Util_Util.toJSON(params);
  50272. } else {
  50273. return;
  50274. }
  50275. this.returnContent = true;
  50276. return jsonParameters;
  50277. }
  50278. }, {
  50279. key: "dataFormat",
  50280. value: function dataFormat() {
  50281. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  50282. }
  50283. }]);
  50284. return SurfaceAnalystService;
  50285. }(SpatialAnalystBase);
  50286. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationParameters.js
  50287. function TerrainCurvatureCalculationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50288. 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); } }
  50289. 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; }
  50290. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50291. * This program are made available under the terms of the Apache License, Version 2.0
  50292. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50293. /**
  50294. * @class TerrainCurvatureCalculationParameters
  50295. * @deprecatedclass SuperMap.TerrainCurvatureCalculationParameters
  50296. * @category iServer SpatialAnalyst TerrainCalculation
  50297. * @classdesc 地形曲率计算参数类。
  50298. * @param {Object} options - 参数。
  50299. * @param {string} options.dataset - 地形曲率计算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  50300. * @param {string} options.averageCurvatureName - 结果数据集:平均曲率数据集的名称。
  50301. * @param {string} options.profileCurvatureName - 结果数据集:剖面曲率数据集的名称。
  50302. * @param {string} options.planCurvatureName - 结果数据集:平面曲率数据集的名称。
  50303. * @param {number} [options.zFactor=1.0] - 指定的高程缩放系数。1.0 表示不缩放。
  50304. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  50305. * @usage
  50306. */
  50307. var TerrainCurvatureCalculationParameters = /*#__PURE__*/function () {
  50308. function TerrainCurvatureCalculationParameters(options) {
  50309. TerrainCurvatureCalculationParameters_classCallCheck(this, TerrainCurvatureCalculationParameters);
  50310. if (!options) {
  50311. return;
  50312. }
  50313. /**
  50314. * @member {string} TerrainCurvatureCalculationParameters.prototype.dataset
  50315. * @description 要用来做地形曲率计算数据源中数据集的名称。
  50316. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  50317. * 注:地形曲率计算必须为栅格数据集。
  50318. */
  50319. this.dataset = null;
  50320. /**
  50321. * @member {number} [TerrainCurvatureCalculationParameters.prototype.zFactor=1.0]
  50322. * @description 指定的高程缩放系数。1.0 表示不缩放。
  50323. * 该值是指在 DEM 栅格数据中,栅格值( Z 坐标,即高程值)相对于 X 和 Y 坐标的单位变换系数。
  50324. * 通常有 X,Y,Z 都参加的计算中,需要将高程值乘以一个高程缩放系数,使得三者单位一致。
  50325. * 例如,X、Y 方向上的单位是米,而 Z 方向的单位是英尺,由于 1 英尺等于 0.3048 米,则需要指定缩放系数为 0.3048。
  50326. */
  50327. this.zFactor = 1.0;
  50328. /**
  50329. * @member {string} TerrainCurvatureCalculationParameters.prototype.averageCurvatureName
  50330. * @description 结果数据集:平均曲率数据集的名称。
  50331. */
  50332. this.averageCurvatureName = null;
  50333. /**
  50334. * @member {string} TerrainCurvatureCalculationParameters.prototype.profileCurvatureName
  50335. * @description 结果数据集:剖面曲率数据集的名称。
  50336. */
  50337. this.profileCurvatureName = "";
  50338. /**
  50339. * @member {string} TerrainCurvatureCalculationParameters.prototype.planCurvatureName
  50340. * @description 结果数据集:平面曲率数据集的名称。
  50341. */
  50342. this.planCurvatureName = "";
  50343. /**
  50344. * @member {boolean} [TerrainCurvatureCalculationParameters.prototype.deleteExistResultDataset=false]
  50345. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  50346. */
  50347. this.deleteExistResultDataset = false;
  50348. Util_Util.extend(this, options);
  50349. this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationParameters";
  50350. }
  50351. /**
  50352. * @function TerrainCurvatureCalculationParameters.prototype.destroy
  50353. * @description 释放资源,将引用资源的属性置空。
  50354. */
  50355. TerrainCurvatureCalculationParameters_createClass(TerrainCurvatureCalculationParameters, [{
  50356. key: "destroy",
  50357. value: function destroy() {
  50358. var me = this;
  50359. me.dataset = null;
  50360. me.zFactor = 1.0;
  50361. me.averageCurvatureName = null;
  50362. me.profileCurvatureName = null;
  50363. me.planCurvatureName = null;
  50364. me.deleteExistResultDataset = true;
  50365. }
  50366. /**
  50367. * @function TerrainCurvatureCalculationParameters.toObject
  50368. * @param {Object} derrainCurvatureCalculationParameters - 地形曲率计算参数。
  50369. * @param {Object} tempObj - 目标对象。
  50370. * @description 生成地形曲率计算对象。
  50371. */
  50372. }], [{
  50373. key: "toObject",
  50374. value: function toObject(derrainCurvatureCalculationParameters, tempObj) {
  50375. for (var name in derrainCurvatureCalculationParameters) {
  50376. if (name !== "dataset") {
  50377. tempObj[name] = derrainCurvatureCalculationParameters[name];
  50378. }
  50379. }
  50380. }
  50381. }]);
  50382. return TerrainCurvatureCalculationParameters;
  50383. }();
  50384. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationService.js
  50385. 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); }
  50386. function TerrainCurvatureCalculationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50387. 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); } }
  50388. 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; }
  50389. 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); }
  50390. function TerrainCurvatureCalculationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TerrainCurvatureCalculationService_getPrototypeOf(object); if (object === null) break; } return object; }
  50391. 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); }
  50392. 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); }
  50393. 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); }; }
  50394. 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); }
  50395. function TerrainCurvatureCalculationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50396. 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; } }
  50397. function TerrainCurvatureCalculationService_getPrototypeOf(o) { TerrainCurvatureCalculationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TerrainCurvatureCalculationService_getPrototypeOf(o); }
  50398. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50399. * This program are made available under the terms of the Apache License, Version 2.0
  50400. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50401. /**
  50402. * @class TerrainCurvatureCalculationService
  50403. * @deprecatedclass SuperMap.TerrainCurvatureCalculationService
  50404. * @category iServer SpatialAnalyst TerrainCalculation
  50405. * @classdesc 地形曲率计算服务类。
  50406. * @extends {SpatialAnalystBase}
  50407. * @param {Object} options - 参数。
  50408. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  50409. * @param {string} options.url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  50410. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  50411. * @param {Object} [options.headers] - 请求头。
  50412. * @example 例如:
  50413. * (start code)
  50414. * var myTerrainCurvatureCalculationService = new TerrainCurvatureCalculationService(url);
  50415. * myTerrainCurvatureCalculationService.on({
  50416. * "processCompleted": processCompleted,
  50417. * "processFailed": processFailed
  50418. * }
  50419. * );
  50420. * (end)
  50421. * @usage
  50422. */
  50423. var TerrainCurvatureCalculationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  50424. TerrainCurvatureCalculationService_inherits(TerrainCurvatureCalculationService, _SpatialAnalystBase);
  50425. var _super = TerrainCurvatureCalculationService_createSuper(TerrainCurvatureCalculationService);
  50426. function TerrainCurvatureCalculationService(url, options) {
  50427. var _this;
  50428. TerrainCurvatureCalculationService_classCallCheck(this, TerrainCurvatureCalculationService);
  50429. _this = _super.call(this, url, options);
  50430. _this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationService";
  50431. return _this;
  50432. }
  50433. /**
  50434. *@override
  50435. */
  50436. TerrainCurvatureCalculationService_createClass(TerrainCurvatureCalculationService, [{
  50437. key: "destroy",
  50438. value: function destroy() {
  50439. TerrainCurvatureCalculationService_get(TerrainCurvatureCalculationService_getPrototypeOf(TerrainCurvatureCalculationService.prototype), "destroy", this).call(this);
  50440. }
  50441. /**
  50442. * @function TerrainCurvatureCalculationService.prototype.processAsync
  50443. * @description 负责将客户端的查询参数传递到服务端。
  50444. * @param {TerrainCurvatureCalculationParameters} parameter - 地形曲率计算参数类。
  50445. */
  50446. }, {
  50447. key: "processAsync",
  50448. value: function processAsync(parameter) {
  50449. var me = this;
  50450. var parameterObject = {};
  50451. if (parameter instanceof TerrainCurvatureCalculationParameters) {
  50452. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/terraincalculation/curvature');
  50453. }
  50454. TerrainCurvatureCalculationParameters.toObject(parameter, parameterObject);
  50455. var jsonParameters = Util_Util.toJSON(parameterObject);
  50456. me.url = Util_Util.urlAppend(me.url, 'returnContent=true');
  50457. me.request({
  50458. method: "POST",
  50459. data: jsonParameters,
  50460. scope: me,
  50461. success: me.serviceProcessCompleted,
  50462. failure: me.serviceProcessFailed
  50463. });
  50464. }
  50465. }]);
  50466. return TerrainCurvatureCalculationService;
  50467. }(SpatialAnalystBase);
  50468. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeFlow.js
  50469. function ThemeFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50470. 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); } }
  50471. 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; }
  50472. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50473. * This program are made available under the terms of the Apache License, Version 2.0
  50474. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50475. /**
  50476. * @class ThemeFlow
  50477. * @deprecatedclass SuperMap.ThemeFlow
  50478. * @private
  50479. * @category iServer Map Theme
  50480. * @classdesc 标签或符号流动显示和牵引线风格设置类。
  50481. * 通过该类可以设置专题图中符号是否流动显示、是否使用牵引线以及牵引线风格。
  50482. * @param {Object} options - 可选参数。
  50483. * @param {boolean} [options.flowEnabled=false] - 是否流动显示标签或符号。
  50484. * @param {boolean} [options.leaderLineDisplayed=false] - 是否显示标签或符号和它标注的对象之间的牵引线。
  50485. * @param {ServerStyle} [options.leaderLineStyle] - 标签或符号与其标注对象之间牵引线的风格。
  50486. * @usage
  50487. */
  50488. var ThemeFlow = /*#__PURE__*/function () {
  50489. function ThemeFlow(options) {
  50490. ThemeFlow_classCallCheck(this, ThemeFlow);
  50491. /**
  50492. * @member {boolean} [ThemeFlow.prototype.flowEnabled=false]
  50493. * @description 是否流动显示标签或符号。<br>
  50494. * 对于标签专题图而言,对于跨越比较大的区域和线条状的几何对象,在一个地图窗口中不能完全显示的情况下,如果其标签位置比较固定,
  50495. * 在当前地图窗口中该对象的标签不可见,则需要通过平移地图来查看对象的标签信息。如果采用了流动显示的效果,在当前地图窗口中,对象即使是部分显示,
  50496. * 其标签也会显示在当前地图窗口中。当平移地图时,对象的标签会随之移动,以保证在当前地图窗口中部分或全部显示的对象其标签都可见,从而可以方便地查看各要素的标签信息。
  50497. */
  50498. this.flowEnabled = false;
  50499. /**
  50500. * @member {boolean} [ThemeFlow.prototype.leaderLineDisplayed=false]
  50501. * @description 是否显示标签或符号和它标注的对象之间的牵引线。false表示不显示标签或符号和它标注的对象之间的牵引线。<br>
  50502. * 只有当 flowEnabled 为 true 时,牵引线才起作用。在当标签流动显示时,其位置不固定,由于牵引线始终指向要素的内点,
  50503. * 因而通过牵引线显示功能可以找到流动的标签或符号实际对应的要素。或者渲染符号偏移它所指向的对象时,图与对象之间可以采用牵引线进行连接。
  50504. */
  50505. this.leaderLineDisplayed = false;
  50506. /**
  50507. * @member {ServerStyle} ThemeFlow.prototype.leaderLineStyle
  50508. * @description 标签或符号与其标注对象之间牵引线的风格。
  50509. */
  50510. this.leaderLineStyle = new ServerStyle();
  50511. if (options) {
  50512. Util_Util.extend(this, options);
  50513. }
  50514. this.CLASS_NAME = "SuperMap.ThemeFlow";
  50515. }
  50516. /**
  50517. * @function ThemeFlow.prototype.destroy
  50518. * @description 释放资源,将引用资源的属性置空。
  50519. */
  50520. ThemeFlow_createClass(ThemeFlow, [{
  50521. key: "destroy",
  50522. value: function destroy() {
  50523. var me = this;
  50524. me.flowEnabled = null;
  50525. me.leaderLineDisplayed = null;
  50526. if (me.leaderLineStyle) {
  50527. me.leaderLineStyle.destroy();
  50528. me.leaderLineStyle = null;
  50529. }
  50530. }
  50531. /**
  50532. * @function ThemeFlow.fromObj
  50533. * @description 从传入对象获取标签或符号流动显示和牵引线风格设置类。
  50534. * @param {Object} obj - 传入对象。
  50535. * @returns {ThemeFlow} ThemeFlow 对象。
  50536. */
  50537. }], [{
  50538. key: "fromObj",
  50539. value: function fromObj(obj) {
  50540. if (!obj) {
  50541. return;
  50542. }
  50543. var res = new ThemeFlow();
  50544. Util_Util.copy(res, obj);
  50545. res.leaderLineStyle = ServerStyle.fromJson(obj.leaderLineStyle);
  50546. return res;
  50547. }
  50548. }]);
  50549. return ThemeFlow;
  50550. }();
  50551. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRangeItem.js
  50552. function ThemeGridRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50553. 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); } }
  50554. 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; }
  50555. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50556. * This program are made available under the terms of the Apache License, Version 2.0
  50557. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50558. /**
  50559. * @class ThemeGridRangeItem
  50560. * @deprecatedclass SuperMap.ThemeGridRangeItem
  50561. * @category iServer Map Theme
  50562. * @classdesc 栅格分段专题图子项类。在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  50563. * 本类用来设置每个范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  50564. * @param {Object} options - 参数。
  50565. * @param {ServerColor} options.color - 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  50566. * @param {string} [options.caption] - 栅格分段专题图子项的标题。
  50567. * @param {number} [options.end=0] - 栅格分段专题图子项的终止值。
  50568. * @param {number} [options.start=0] - 栅格分段专题图子项的起始值。
  50569. * @param {boolean} [options.visible=true] - 栅格分段专题图子项是否可见。
  50570. * @usage
  50571. */
  50572. var ThemeGridRangeItem = /*#__PURE__*/function () {
  50573. function ThemeGridRangeItem(options) {
  50574. ThemeGridRangeItem_classCallCheck(this, ThemeGridRangeItem);
  50575. /**
  50576. * @member {string} [ThemeGridRangeItem.prototype.caption]
  50577. * @description 栅格分段专题图子项的标题。
  50578. */
  50579. this.caption = null;
  50580. /**
  50581. * @member {ServerColor} ThemeGridRangeItem.prototype.color
  50582. * @description 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  50583. */
  50584. this.color = new ServerColor();
  50585. /**
  50586. * @member {number} [ThemeGridRangeItem.prototype.end=0]
  50587. * @description 栅格分段专题图子项的终止值,即该段专题值范围的最大值。
  50588. */
  50589. this.end = 0;
  50590. /**
  50591. * @member {number} [ThemeGridRangeItem.prototype.start=0]
  50592. * @description 栅格分段专题图子项的起始值,即该段专题值范围的最小值。
  50593. */
  50594. this.start = 0;
  50595. /**
  50596. * @member {boolean} [ThemeGridRangeItem.prototype.visible=true]
  50597. * @description 栅格分段专题图子项是否可见。
  50598. */
  50599. this.visible = true;
  50600. if (options) {
  50601. Util_Util.extend(this, options);
  50602. }
  50603. this.CLASS_NAME = "SuperMap.ThemeGridRangeItem";
  50604. }
  50605. /**
  50606. * @function ThemeGridRangeItem.prototype.destroy
  50607. * @description 释放资源,将引用资源的属性置空。
  50608. */
  50609. ThemeGridRangeItem_createClass(ThemeGridRangeItem, [{
  50610. key: "destroy",
  50611. value: function destroy() {
  50612. var me = this;
  50613. me.caption = null;
  50614. me.end = null;
  50615. me.start = null;
  50616. //需要验证是够存在destroy方法
  50617. if (me.color) {
  50618. me.color.destroy();
  50619. me.color = null;
  50620. }
  50621. me.visible = null;
  50622. }
  50623. /**
  50624. * @function ThemeGridRangeItem.prototype.toServerJSONObject
  50625. * @description 转换成对应的 JSON 格式对象。
  50626. * @returns {Object} 对应的 JSON 格式对象。
  50627. */
  50628. }, {
  50629. key: "toServerJSONObject",
  50630. value: function toServerJSONObject() {
  50631. var obj = {};
  50632. obj = Util_Util.copyAttributes(obj, this);
  50633. if (obj.color) {
  50634. if (obj.color.toServerJSONObject) {
  50635. obj.color = obj.color.toServerJSONObject();
  50636. }
  50637. }
  50638. return obj;
  50639. }
  50640. /**
  50641. * @function ThemeGridRangeItem.fromObj
  50642. * @description 从传入对象获取栅格分段专题图子项类。
  50643. * @param {Object} obj - 传入对象。
  50644. * @returns {ThemeGridRangeItem} ThemeGridRangeItem 对象。
  50645. */
  50646. }], [{
  50647. key: "fromObj",
  50648. value: function fromObj(obj) {
  50649. if (!obj) {
  50650. return;
  50651. }
  50652. var res = new ThemeGridRangeItem();
  50653. Util_Util.copy(res, obj);
  50654. res.color = ServerColor.fromJson(obj.color);
  50655. return res;
  50656. }
  50657. }]);
  50658. return ThemeGridRangeItem;
  50659. }();
  50660. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRange.js
  50661. 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); }
  50662. function ThemeGridRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50663. 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); } }
  50664. 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; }
  50665. 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); }
  50666. function ThemeGridRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridRange_getPrototypeOf(object); if (object === null) break; } return object; }
  50667. 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); }
  50668. 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); }
  50669. 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); }; }
  50670. 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); }
  50671. function ThemeGridRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50672. 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; } }
  50673. function ThemeGridRange_getPrototypeOf(o) { ThemeGridRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridRange_getPrototypeOf(o); }
  50674. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50675. * This program are made available under the terms of the Apache License, Version 2.0
  50676. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50677. /**
  50678. * @class ThemeGridRange
  50679. * @deprecatedclass SuperMap.ThemeGridRange
  50680. * @category iServer Map Theme
  50681. * @classdesc 栅格分段专题图。栅格分段专题图,是将所有单元格的值按照某种分段方式分成多个范围段,值在同一个范围段中的单元格使用相同的颜色进行显示。一般用来反映连续分布现象的数量或程度特征。
  50682. * 比如某年的全国降水量分布图,将各气象站点的观测值经过内插之后生成的栅格数据进行分段显示。
  50683. * 该类类似于分段专题图类,不同点在于分段专题图的操作对象是矢量数据,而栅格分段专题图的操作对象是栅格数据。
  50684. * @extends {CommonTheme}
  50685. * @param {Object} options - 参数。
  50686. * @param {Array.<ThemeGridRangeItem>} options.items - 栅格分段专题图子项数组。
  50687. * @param {boolean} [options.reverseColor=false] - 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  50688. * @param {RangeMode} [options.rangeMode=RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  50689. * @param {number} [options.rangeParameter=0] - 分段参数。
  50690. * @param {ColorGradientType} [options.colorGradientType=ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  50691. * @usage
  50692. */
  50693. var ThemeGridRange = /*#__PURE__*/function (_Theme) {
  50694. ThemeGridRange_inherits(ThemeGridRange, _Theme);
  50695. var _super = ThemeGridRange_createSuper(ThemeGridRange);
  50696. function ThemeGridRange(options) {
  50697. var _this;
  50698. ThemeGridRange_classCallCheck(this, ThemeGridRange);
  50699. _this = _super.call(this, "GRIDRANGE", options);
  50700. /**
  50701. * @member {Array.<ThemeGridRangeItem>} ThemeGridRange.prototype.items
  50702. * @description 栅格分段专题图子项数组。<br>
  50703. * 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  50704. * 本类用来设置每个栅格范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  50705. */
  50706. _this.items = null;
  50707. /**
  50708. * @member {RangeMode} [ThemeGridRange.prototype.rangeMode=RangeMode.EQUALINTERVAL]
  50709. * @description 分段专题图的分段模式。<br>
  50710. * 在栅格分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  50711. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  50712. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  50713. */
  50714. _this.rangeMode = RangeMode.EQUALINTERVAL;
  50715. /**
  50716. * @member {number} [ThemeGridRange.prototype.rangeParameter=0]
  50717. * @description 分段参数。<br>
  50718. * 当分段模式为等距离分段法,平方根分段,对数分段法,等计数分段法其中一种模式时,该参数用于设置分段个数,必设;当分段模式为标准差分段法时,
  50719. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  50720. */
  50721. _this.rangeParameter = 0;
  50722. /**
  50723. * @member {ColorGradientType} [ThemeGridRange.prototype.colorGradientType=ColorGradientType.YELLOW_RED]
  50724. * @description 渐变颜色枚举类。
  50725. *
  50726. */
  50727. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  50728. /**
  50729. * @member {boolean} ThemeGridRange.prototype.reverseColor
  50730. * @description 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  50731. */
  50732. _this.reverseColor = false;
  50733. if (options) {
  50734. Util_Util.extend(ThemeGridRange_assertThisInitialized(_this), options);
  50735. }
  50736. _this.CLASS_NAME = "SuperMap.ThemeGridRange";
  50737. return _this;
  50738. }
  50739. /**
  50740. * @function ThemeGridRange.prototype.destroy
  50741. * @override
  50742. */
  50743. ThemeGridRange_createClass(ThemeGridRange, [{
  50744. key: "destroy",
  50745. value: function destroy() {
  50746. ThemeGridRange_get(ThemeGridRange_getPrototypeOf(ThemeGridRange.prototype), "destroy", this).call(this);
  50747. var me = this;
  50748. if (me.items) {
  50749. if (me.items.length > 0) {
  50750. for (var item in me.items) {
  50751. me.items[item].destroy();
  50752. me.items[item] = null;
  50753. }
  50754. }
  50755. me.items = null;
  50756. }
  50757. me.reverseColor = null;
  50758. me.rangeMode = null;
  50759. me.rangeParameter = null;
  50760. me.colorGradientType = null;
  50761. }
  50762. /**
  50763. * @function ThemeGridRange.fromObj
  50764. * @description 从传入对象获取栅格分段专题图。
  50765. * @param {Object} obj - 传入对象。
  50766. * @returns {ThemeGridRange} ThemeGridRange 对象。
  50767. */
  50768. }], [{
  50769. key: "fromObj",
  50770. value: function fromObj(obj) {
  50771. if (!obj) {
  50772. return;
  50773. }
  50774. var res = new ThemeGridRange();
  50775. Util_Util.copy(res, obj);
  50776. var itemsR = obj.items;
  50777. var len = itemsR ? itemsR.length : 0;
  50778. res.items = [];
  50779. for (var i = 0; i < len; i++) {
  50780. res.items.push(ThemeGridRangeItem.fromObj(itemsR[i]));
  50781. }
  50782. return res;
  50783. }
  50784. }]);
  50785. return ThemeGridRange;
  50786. }(Theme);
  50787. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUniqueItem.js
  50788. function ThemeGridUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50789. 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); } }
  50790. 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; }
  50791. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50792. * This program are made available under the terms of the Apache License, Version 2.0
  50793. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50794. /**
  50795. * @class ThemeGridUniqueItem
  50796. * @deprecatedclass SuperMap.ThemeGridUniqueItem
  50797. * @category iServer Map Theme
  50798. * @classdesc 栅格单值专题图子项类。
  50799. * 栅格单值专题图是将值相同的单元格归为一类,每一类是一个专题图子项。
  50800. * @param {Object} options - 可选参数。
  50801. * @param {string} [options.caption] - 子项的名称。
  50802. * @param {ServerColor} [options.color] - 子项的显示颜色。
  50803. * @param {number} options.unique - 子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  50804. * @param {boolean} [options.visible=true] - 子项是否可见。
  50805. * @usage
  50806. */
  50807. var ThemeGridUniqueItem = /*#__PURE__*/function () {
  50808. function ThemeGridUniqueItem(options) {
  50809. ThemeGridUniqueItem_classCallCheck(this, ThemeGridUniqueItem);
  50810. /**
  50811. * @member {string} [ThemeGridUniqueItem.prototype.caption]
  50812. * @description 栅格单值专题图子项的名称。
  50813. */
  50814. this.caption = null;
  50815. /**
  50816. * @member {ServerColor} [ThemeGridUniqueItem.prototype.color]
  50817. * @description 栅格单值专题图子项的显示颜色。
  50818. */
  50819. this.color = new ServerColor();
  50820. /**
  50821. * @member {number} ThemeGridUniqueItem.prototype.unique
  50822. * @description 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  50823. */
  50824. this.unique = null;
  50825. /**
  50826. * @member {boolean} [ThemeGridUniqueItem.prototype.visible=true]
  50827. * @description 栅格单值专题图子项是否可见。
  50828. */
  50829. this.visible = true;
  50830. if (options) {
  50831. Util_Util.extend(this, options);
  50832. }
  50833. this.CLASS_NAME = "SuperMap.ThemeGridUniqueItem";
  50834. }
  50835. /**
  50836. * @function ThemeGridUniqueItem.prototype.destroy
  50837. * @description 释放资源,将引用资源的属性置空。
  50838. */
  50839. ThemeGridUniqueItem_createClass(ThemeGridUniqueItem, [{
  50840. key: "destroy",
  50841. value: function destroy() {
  50842. var me = this;
  50843. me.caption = null;
  50844. me.unique = null;
  50845. if (me.color) {
  50846. me.color.destroy();
  50847. me.color = null;
  50848. }
  50849. me.visible = null;
  50850. }
  50851. /**
  50852. * @function ThemeGridUniqueItem.prototype.toServerJSONObject
  50853. * @description 转换成对应的 JSON 格式对象。
  50854. * @returns {Object} 对应的 JSON 格式对象。
  50855. */
  50856. }, {
  50857. key: "toServerJSONObject",
  50858. value: function toServerJSONObject() {
  50859. var obj = {};
  50860. obj = Util_Util.copyAttributes(obj, this);
  50861. if (obj.color) {
  50862. if (obj.color.toServerJSONObject) {
  50863. obj.color = obj.color.toServerJSONObject();
  50864. }
  50865. }
  50866. return obj;
  50867. }
  50868. /**
  50869. * @function ThemeGridUniqueItem.fromObj
  50870. * @description 从传入对象获取栅格单值专题图子项类。
  50871. * @param {Object} obj - 传入对象。
  50872. * @returns {ThemeGridUniqueItem} ThemeGridUniqueItem 对象。
  50873. */
  50874. }], [{
  50875. key: "fromObj",
  50876. value: function fromObj(obj) {
  50877. var res = new ThemeGridUniqueItem();
  50878. Util_Util.copy(res, obj);
  50879. res.color = ServerColor.fromJson(obj.color);
  50880. return res;
  50881. }
  50882. }]);
  50883. return ThemeGridUniqueItem;
  50884. }();
  50885. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUnique.js
  50886. 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); }
  50887. function ThemeGridUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50888. 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); } }
  50889. 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; }
  50890. 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); }
  50891. function ThemeGridUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  50892. 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); }
  50893. 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); }
  50894. 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); }; }
  50895. 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); }
  50896. function ThemeGridUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50897. 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; } }
  50898. function ThemeGridUnique_getPrototypeOf(o) { ThemeGridUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridUnique_getPrototypeOf(o); }
  50899. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  50900. * This program are made available under the terms of the Apache License, Version 2.0
  50901. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50902. /**
  50903. * @class ThemeGridUnique
  50904. * @deprecatedclass SuperMap.ThemeGridUnique
  50905. * @category iServer Map Theme
  50906. * @classdesc 栅格单值专题图类。栅格单值专题图是将单元格值相同的归为一类,为每一类设定一种颜色,从而用来区分不同的类别。
  50907. * 适用于离散栅格数据和部分连续栅格数据,对于单元格值各不相同的那些连续栅格数据,使用栅格单值专题图不具有任何意义。
  50908. * @extends {CommonTheme}
  50909. * @param {Object} options - 参数。
  50910. * @param {Array.<ThemeGridUniqueItem>} options.items - 栅格单值专题图子项数组。
  50911. * @param {ServerColor} [options.defaultcolor] - 栅格单值专题图的默认颜色。
  50912. * @usage
  50913. */
  50914. var ThemeGridUnique = /*#__PURE__*/function (_Theme) {
  50915. ThemeGridUnique_inherits(ThemeGridUnique, _Theme);
  50916. var _super = ThemeGridUnique_createSuper(ThemeGridUnique);
  50917. function ThemeGridUnique(options) {
  50918. var _this;
  50919. ThemeGridUnique_classCallCheck(this, ThemeGridUnique);
  50920. _this = _super.call(this, "GRIDUNIQUE", options);
  50921. /**
  50922. * @member {ServerColor} ThemeGridUnique.prototype.defaultcolor
  50923. * @description 栅格单值专题图的默认颜色。
  50924. * 对于那些未在格网单值专题图子项之列的要素使用该颜色显示。
  50925. */
  50926. _this.defaultcolor = new ServerColor();
  50927. /**
  50928. * @member {Array.<ThemeGridUniqueItem>} ThemeGridUnique.prototype.items
  50929. * @description 栅格单值专题图子项数组。
  50930. * 栅格单值专题图将值相同的单元格归为一类,每一类是一个专题图子项。
  50931. */
  50932. _this.items = null;
  50933. if (options) {
  50934. Util_Util.extend(ThemeGridUnique_assertThisInitialized(_this), options);
  50935. }
  50936. _this.CLASS_NAME = "SuperMap.ThemeGridUnique";
  50937. return _this;
  50938. }
  50939. /**
  50940. * @function ThemeGridUnique.prototype.destroy
  50941. * @override
  50942. */
  50943. ThemeGridUnique_createClass(ThemeGridUnique, [{
  50944. key: "destroy",
  50945. value: function destroy() {
  50946. ThemeGridUnique_get(ThemeGridUnique_getPrototypeOf(ThemeGridUnique.prototype), "destroy", this).call(this);
  50947. var me = this;
  50948. if (me.items) {
  50949. if (me.items.length > 0) {
  50950. for (var item in me.items) {
  50951. me.items[item].destroy();
  50952. me.items[item] = null;
  50953. }
  50954. }
  50955. me.items = null;
  50956. }
  50957. if (me.defaultcolor) {
  50958. me.defaultcolor.destroy();
  50959. me.defaultcolor = null;
  50960. }
  50961. }
  50962. /**
  50963. * @function ThemeGridUnique.prototype.toServerJSONObject
  50964. * @description 转换成对应的 JSON 格式对象。
  50965. * @returns {Object} 对应的 JSON 格式对象
  50966. */
  50967. }, {
  50968. key: "toServerJSONObject",
  50969. value: function toServerJSONObject() {
  50970. var obj = {};
  50971. obj = Util_Util.copyAttributes(obj, this);
  50972. if (obj.defaultcolor) {
  50973. if (obj.defaultcolor.toServerJSONObject) {
  50974. obj.defaultcolor = obj.defaultcolor.toServerJSONObject();
  50975. }
  50976. }
  50977. if (obj.items) {
  50978. var items = [],
  50979. len = obj.items.length;
  50980. for (var i = 0; i < len; i++) {
  50981. items.push(obj.items[i].toServerJSONObject());
  50982. }
  50983. obj.items = items;
  50984. }
  50985. return obj;
  50986. }
  50987. /**
  50988. * @function ThemeGridUnique.fromObj
  50989. * @description 从传入对象获取栅格单值专题图类。
  50990. * @param {Object} obj - 传入对象
  50991. * @returns {ThemeGridUnique} ThemeGridUnique 对象
  50992. */
  50993. }], [{
  50994. key: "fromObj",
  50995. value: function fromObj(obj) {
  50996. var res = new ThemeGridUnique();
  50997. var uItems = obj.items;
  50998. var len = uItems ? uItems.length : 0;
  50999. Util_Util.extend(res, obj);
  51000. res.items = [];
  51001. res.defaultcolor = ServerColor.fromJson(obj.defaultcolor);
  51002. for (var i = 0; i < len; i++) {
  51003. res.items.push(ThemeGridUniqueItem.fromObj(uItems[i]));
  51004. }
  51005. return res;
  51006. }
  51007. }]);
  51008. return ThemeGridUnique;
  51009. }(Theme);
  51010. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelUniqueItem.js
  51011. function ThemeLabelUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51012. 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); } }
  51013. 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; }
  51014. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51015. * This program are made available under the terms of the Apache License, Version 2.0
  51016. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51017. /**
  51018. * @class ThemeLabelUniqueItem
  51019. * @deprecatedclass SuperMap.ThemeLabelUniqueItem
  51020. * @category iServer Map Theme
  51021. * @classdesc 单值标签专题图的子项。标签专题图用专题值对点、线、面等对象做标注,值得注意的是,单值标签专题图允许用户通过 uniqueExpression
  51022. * 字段指定用于单值的字段,同一值的标签具有相同的显示风格,其中每一个值就是一个专题图子项,
  51023. * 每一个子项都具有其名称、风格、指定的单值、X 方向偏移量和 Y 方向偏移量。
  51024. * @param {Object} options - 参数。
  51025. * @param {string} options.unique - 子项的值,可以为数字、字符串等。
  51026. * @param {string} [options.caption] - 子项的名称。
  51027. * @param {number} [options.offsetX=0] - 标签在 X 方向偏移量。
  51028. * @param {number} [options.offsetY=0] - 标签在 Y 方向偏移量。
  51029. * @param {boolean} [options.visible=true] - 子项是否可见。
  51030. * @param {ServerTextStyle} [options.style] - 子项文本的显示风格。
  51031. * @usage
  51032. */
  51033. var ThemeLabelUniqueItem = /*#__PURE__*/function () {
  51034. function ThemeLabelUniqueItem(options) {
  51035. ThemeLabelUniqueItem_classCallCheck(this, ThemeLabelUniqueItem);
  51036. /**
  51037. * @member {string} [ThemeLabelUniqueItem.prototype.caption]
  51038. * @description 标签专题子项的标题。
  51039. */
  51040. this.caption = null;
  51041. /**
  51042. * @member {string} ThemeLabelUniqueItem.prototype.unique
  51043. * @description 单值专题图子项的值,可以为数字、字符串等。
  51044. */
  51045. this.unique = null;
  51046. /**
  51047. * @member {number} [ThemeLabelUniqueItem.prototype.offsetX=0]
  51048. * @description 标签在 X 方向偏移量。
  51049. */
  51050. this.offsetX = 0;
  51051. /**
  51052. * @member {number} [ThemeLabelUniqueItem.prototype.offsetY=0]
  51053. * @description 标签在 Y 方向偏移量。
  51054. */
  51055. this.offsetY = 0;
  51056. /**
  51057. * @member {boolean} [ThemeLabelUniqueItem.prototype.visible=true]
  51058. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  51059. */
  51060. this.visible = true;
  51061. /**
  51062. * @member {ServerTextStyle} ThemeLabelUniqueItem.prototype.style
  51063. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  51064. * uniformMixedStyle(标签文本的复合风格),ThemeLabelUniqueItem.style(单值子项的文本风格),uniformStyle(统一文本风格)。
  51065. */
  51066. this.style = new ServerTextStyle();
  51067. if (options) {
  51068. Util_Util.extend(this, options);
  51069. }
  51070. this.CLASS_NAME = "SuperMap.ThemeLabelUniqueItem";
  51071. }
  51072. /**
  51073. * @function ThemeLabelUniqueItem.prototype.destroy
  51074. * @description 释放资源,将引用资源的属性置空。
  51075. */
  51076. ThemeLabelUniqueItem_createClass(ThemeLabelUniqueItem, [{
  51077. key: "destroy",
  51078. value: function destroy() {
  51079. var me = this;
  51080. me.unique = null;
  51081. me.caption = null;
  51082. me.offsetX = null;
  51083. me.offsetY = null;
  51084. if (me.style) {
  51085. me.style.destroy();
  51086. me.style = null;
  51087. }
  51088. me.visible = null;
  51089. }
  51090. /**
  51091. * @function ThemeLabelUniqueItem.fromObj
  51092. * @description 从传入对象获取单值标签专题图的子项类。
  51093. * @param {Object} obj - 传入对象。
  51094. * @returns {ThemeLabelUniqueItem} ThemeLabelUniqueItem 对象。
  51095. */
  51096. }], [{
  51097. key: "fromObj",
  51098. value: function fromObj(obj) {
  51099. if (!obj) {
  51100. return;
  51101. }
  51102. var t = new ThemeLabelUniqueItem();
  51103. Util_Util.copy(t, obj);
  51104. return t;
  51105. }
  51106. }]);
  51107. return ThemeLabelUniqueItem;
  51108. }();
  51109. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeMemoryData.js
  51110. function ThemeMemoryData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51111. 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); } }
  51112. 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; }
  51113. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51114. * This program are made available under the terms of the Apache License, Version 2.0
  51115. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51116. /**
  51117. * @class ThemeMemoryData
  51118. * @deprecatedclass SuperMap.ThemeMemoryData
  51119. * @category iServer Map Theme
  51120. * @classdesc 专题图内存数据类。
  51121. * @param {Array} srcData - 原始值数组。
  51122. * @param {Array} targetData - 外部值数组。
  51123. * @usage
  51124. */
  51125. var ThemeMemoryData = /*#__PURE__*/function () {
  51126. function ThemeMemoryData(srcData, targetData) {
  51127. ThemeMemoryData_classCallCheck(this, ThemeMemoryData);
  51128. /**
  51129. * @member {Array} ThemeMemoryData.prototype.srcData
  51130. * @description 原始值数组,该属性值将被 targetData 属性所指定的值替换掉,然后制作专题图,但数据库中的值并不会改变。
  51131. */
  51132. this.srcData = srcData;
  51133. /**
  51134. * @member {Array} ThemeMemoryData.prototype.targetData
  51135. * @description 外部值数组,即用于制作专题图的内存数据,设定该属性值后,会将 srcData 属性所指定的原始值替换掉制作专题图,但数据库中的值并不会改变。
  51136. */
  51137. this.targetData = targetData;
  51138. this.CLASS_NAME = "SuperMap.ThemeMemoryData";
  51139. }
  51140. /**
  51141. * @function ThemeMemoryData.prototype.destroy
  51142. * @description 释放资源,将引用资源的属性置空。
  51143. */
  51144. ThemeMemoryData_createClass(ThemeMemoryData, [{
  51145. key: "destroy",
  51146. value: function destroy() {
  51147. var me = this;
  51148. me.srcData = null;
  51149. me.targetData = null;
  51150. }
  51151. /**
  51152. * @function ThemeMemoryData.prototype.toJSON
  51153. * @description 将 ThemeMemoryData 对象转化为 JSON 字符串。
  51154. * @returns {string} 返回转换后的 JSON 字符串。
  51155. */
  51156. }, {
  51157. key: "toJSON",
  51158. value: function toJSON() {
  51159. if (this.srcData && this.targetData) {
  51160. var memoryDataStr = "";
  51161. var count = Math.min(this.srcData.length, this.targetData.length);
  51162. for (var i = 0; i < count; i++) {
  51163. memoryDataStr += "\'" + this.srcData[i] + "\':\'" + this.targetData[i] + "\',";
  51164. }
  51165. //去除多余的逗号
  51166. if (i > 0) {
  51167. memoryDataStr = memoryDataStr.substring(0, memoryDataStr.length - 1);
  51168. }
  51169. return "{" + memoryDataStr + "}";
  51170. } else {
  51171. return null;
  51172. }
  51173. }
  51174. }]);
  51175. return ThemeMemoryData;
  51176. }();
  51177. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeParameters.js
  51178. function ThemeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51179. 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); } }
  51180. 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; }
  51181. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51182. * This program are made available under the terms of the Apache License, Version 2.0
  51183. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51184. /**
  51185. * @class ThemeParameters
  51186. * @deprecatedclass SuperMap.ThemeParameters
  51187. * @category iServer Map Theme
  51188. * @classdesc 专题图参数类。
  51189. * 该类存储了制作专题所需的参数,包括数据源、数据集名称和专题图对象。
  51190. * @param {Object} options - 参数。
  51191. * @param {Array.<string>} options.datasetNames - 数据集数组。
  51192. * @param {Array.<string>} options.dataSourceNames - 数据源数组。
  51193. * @param {Array.<JoinItem>} [options.joinItems] - 专题图外部表的连接信息 JoinItem 数组。
  51194. * @param {Array.<CommonTheme>} options.themes - 专题图对象列表。
  51195. * @param {Array.<string>} [options.displayFilters] - 专题图属性过滤条件。
  51196. * @param {Array.<string>} [options.displayOrderBys] - 专题图对象生成符号叠加次序排序字段。
  51197. * @param {Object} [options.fieldValuesDisplayFilter] - 图层要素的显示和隐藏的过滤属性,其带有三个属性,分别是:values、fieldName、fieldValuesDisplayMode。
  51198. * @usage
  51199. */
  51200. var ThemeParameters = /*#__PURE__*/function () {
  51201. function ThemeParameters(options) {
  51202. ThemeParameters_classCallCheck(this, ThemeParameters);
  51203. /**
  51204. * @member {Array.<string>} ThemeParameters.prototype.datasetNames
  51205. * @description 要制作专题图的数据集数组。
  51206. */
  51207. this.datasetNames = null;
  51208. /**
  51209. * @member {Array.<string>} ThemeParameters.prototype.dataSourceNames
  51210. * @description 要制作专题图的数据集所在的数据源数组。
  51211. */
  51212. this.dataSourceNames = null;
  51213. /**
  51214. * @member {Array.<JoinItem>} [ThemeParameters.prototype.joinItems]
  51215. * @description 设置与外部表的连接信息 JoinItem 数组。
  51216. * 使用此属性可以制作与外部表连接的专题图。
  51217. */
  51218. this.joinItems = null;
  51219. /**
  51220. * @member {Array.<CommonTheme>} ThemeParameters.prototype.themes
  51221. * @description 专题图对象列表。
  51222. * 该参数为实例化的各类专题图对象的集合。
  51223. */
  51224. this.themes = null;
  51225. /**
  51226. * @member {Array.<string>} [ThemeParameters.prototype.displayFilters]
  51227. * @description 专题图属性过滤条件。
  51228. */
  51229. this.displayFilters = null;
  51230. /**
  51231. * @member {Array.<string>} [ThemeParameters.prototype.displayOrderBys]
  51232. * @description 专题图对象生成符号叠加次序排序字段。
  51233. */
  51234. this.displayOrderBys = null;
  51235. /**
  51236. * @member {Object} [ThemeParameters.prototype.fieldValuesDisplayFilter]
  51237. * @property {Array.<number>} values - 待过滤的值。
  51238. * @property {string} fieldName - 待过滤的字段名称只支持数字类型的字段。
  51239. * @property {string} fieldValuesDisplayMode - 目前为 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  51240. */
  51241. this.fieldValuesDisplayFilter = null;
  51242. if (options) {
  51243. Util_Util.extend(this, options);
  51244. }
  51245. this.CLASS_NAME = "SuperMap.ThemeParameters";
  51246. }
  51247. /**
  51248. * @function ThemeParameters.prototype.destroy
  51249. * @description 释放资源,将引用资源的属性置空。
  51250. */
  51251. ThemeParameters_createClass(ThemeParameters, [{
  51252. key: "destroy",
  51253. value: function destroy() {
  51254. var me = this;
  51255. me.datasetNames = null;
  51256. me.dataSourceNames = null;
  51257. if (me.joinItems) {
  51258. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  51259. joinItems[i].destroy();
  51260. }
  51261. me.joinItems = null;
  51262. }
  51263. if (me.themes) {
  51264. for (var _i2 = 0, themes = me.themes, _len2 = themes.length; _i2 < _len2; _i2++) {
  51265. themes[_i2].destroy();
  51266. }
  51267. me.themes = null;
  51268. }
  51269. }
  51270. }]);
  51271. return ThemeParameters;
  51272. }();
  51273. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeService.js
  51274. 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); }
  51275. function ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51276. 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); } }
  51277. 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; }
  51278. 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); }
  51279. function ThemeService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeService_getPrototypeOf(object); if (object === null) break; } return object; }
  51280. 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); }
  51281. 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); }
  51282. 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); }; }
  51283. 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); }
  51284. function ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51285. 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; } }
  51286. function ThemeService_getPrototypeOf(o) { ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeService_getPrototypeOf(o); }
  51287. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51288. * This program are made available under the terms of the Apache License, Version 2.0
  51289. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51290. /**
  51291. * @class ThemeService
  51292. * @deprecatedclass SuperMap.ThemeService
  51293. * @category iServer Map Theme
  51294. * @classdesc 专题图服务类。
  51295. * @extends {CommonServiceBase}
  51296. * @example
  51297. * var myThemeService = new ThemeService(url, {
  51298. * eventListeners: {
  51299. * "processCompleted": themeCompleted,
  51300. * "processFailed": themeFailed
  51301. * }
  51302. * });
  51303. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  51304. * @param {Object} options - 参数。
  51305. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  51306. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  51307. * @param {Object} [options.headers] - 请求头。
  51308. * @usage
  51309. */
  51310. var ThemeService = /*#__PURE__*/function (_CommonServiceBase) {
  51311. ThemeService_inherits(ThemeService, _CommonServiceBase);
  51312. var _super = ThemeService_createSuper(ThemeService);
  51313. function ThemeService(url, options) {
  51314. var _this;
  51315. ThemeService_classCallCheck(this, ThemeService);
  51316. _this = _super.call(this, url, options);
  51317. if (options) {
  51318. Util_Util.extend(ThemeService_assertThisInitialized(_this), options);
  51319. }
  51320. _this.eventCount = 0;
  51321. _this.url = Util_Util.urlPathAppend(_this.url, 'tempLayersSet');
  51322. _this.CLASS_NAME = 'SuperMap.ThemeService';
  51323. return _this;
  51324. }
  51325. /**
  51326. * @override
  51327. */
  51328. ThemeService_createClass(ThemeService, [{
  51329. key: "destroy",
  51330. value: function destroy() {
  51331. ThemeService_get(ThemeService_getPrototypeOf(ThemeService.prototype), "destroy", this).call(this);
  51332. }
  51333. /**
  51334. * @function ThemeService.prototype.processAsync
  51335. * @description 负责将客户端的专题图参数传递到服务端。
  51336. * @param {ThemeParameters} params - 专题图参数类。
  51337. */
  51338. }, {
  51339. key: "processAsync",
  51340. value: function processAsync(params, callback) {
  51341. if (!(params instanceof ThemeParameters)) {
  51342. return;
  51343. }
  51344. var me = this,
  51345. jsonParameters = null;
  51346. jsonParameters = me.getJsonParameters(params);
  51347. var eventId = ++this.eventCount;
  51348. var eventListeners = {
  51349. scope: this,
  51350. processCompleted: function processCompleted(result) {
  51351. if (eventId === result.result.eventId && callback) {
  51352. delete result.result.eventId;
  51353. callback(result);
  51354. this.events && this.events.un(eventListeners);
  51355. return false;
  51356. }
  51357. },
  51358. processFailed: function processFailed(result) {
  51359. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  51360. callback(result);
  51361. this.events && this.events.un(eventListeners);
  51362. return false;
  51363. }
  51364. }
  51365. };
  51366. this.events.on(eventListeners);
  51367. me.request({
  51368. method: "POST",
  51369. data: jsonParameters,
  51370. scope: me,
  51371. success: function success(result, options) {
  51372. result.eventId = eventId;
  51373. this.serviceProcessCompleted(result, options);
  51374. },
  51375. failure: function failure(result, options) {
  51376. if (result.error) {
  51377. result.error.eventId = eventId;
  51378. }
  51379. result.eventId = eventId;
  51380. this.serviceProcessFailed(result, options);
  51381. }
  51382. });
  51383. }
  51384. /**
  51385. * @function ThemeService.prototype.getJsonParameters
  51386. * @description 将专题图参数参数转化为 JSON 字符串。
  51387. * @param {ThemeParameters} parameter - 专题图参数类。
  51388. * @returns {Object} 转化后的JSON字符串。
  51389. */
  51390. }, {
  51391. key: "getJsonParameters",
  51392. value: function getJsonParameters(parameter) {
  51393. var jsonParameters = "",
  51394. themeObj = null,
  51395. filters = null,
  51396. orderBys = null,
  51397. fieldValuesDisplayFilter;
  51398. jsonParameters += "[{'type': 'UGC','subLayers': {'layers': [";
  51399. for (var i = 0; i < parameter.themes.length; i++) {
  51400. themeObj = parameter.themes[i];
  51401. var jsonTheme = Util_Util.toJSON(themeObj);
  51402. jsonTheme = jsonTheme.slice(0, -1);
  51403. jsonParameters += "{'theme': " + jsonTheme + "},'type': 'UGC','ugcLayerType': 'THEME',";
  51404. filters = parameter.displayFilters;
  51405. if (filters && filters.length > 0) {
  51406. if (filters.length === 1) {
  51407. jsonParameters += "'displayFilter':\"" + filters[0] + "\",";
  51408. } else {
  51409. jsonParameters += "'displayFilter':\"" + filters[i] + "\",";
  51410. }
  51411. }
  51412. orderBys = parameter.displayOrderBy;
  51413. if (orderBys && orderBys.length > 0) {
  51414. if (orderBys.length === 1) {
  51415. jsonParameters += "'displayOrderBy':'" + orderBys[0] + "',";
  51416. } else {
  51417. jsonParameters += "'displayOrderBy':'" + orderBys[i] + "',";
  51418. }
  51419. }
  51420. fieldValuesDisplayFilter = parameter.fieldValuesDisplayFilter;
  51421. if (fieldValuesDisplayFilter) {
  51422. jsonParameters += "'fieldValuesDisplayFilter':" + Util_Util.toJSON(fieldValuesDisplayFilter) + ",";
  51423. }
  51424. if (parameter.joinItems && parameter.joinItems.length > 0 && parameter.joinItems[i]) {
  51425. jsonParameters += "'joinItems':[" + Util_Util.toJSON(parameter.joinItems[i]) + "],";
  51426. }
  51427. if (parameter.datasetNames && parameter.dataSourceNames) {
  51428. var datasetID = parameter.datasetNames[i] ? i : parameter.datasetNames.length - 1;
  51429. var dataSourceID = parameter.dataSourceNames[i] ? i : parameter.dataSourceNames.length - 1;
  51430. jsonParameters += "'datasetInfo': {'name': '" + parameter.datasetNames[datasetID] + "','dataSourceName': '" + parameter.dataSourceNames[dataSourceID] + "'}},";
  51431. } else {
  51432. jsonParameters += "},";
  51433. }
  51434. }
  51435. //去除多余的逗号
  51436. if (parameter.themes && parameter.themes.length > 0) {
  51437. jsonParameters = jsonParameters.substring(0, jsonParameters.length - 1);
  51438. }
  51439. jsonParameters += "]},";
  51440. var urlArray = this.url.split("/");
  51441. var jsonMapName = urlArray[urlArray.length - 2];
  51442. jsonParameters += "'name': '" + jsonMapName + "'}]";
  51443. return jsonParameters;
  51444. }
  51445. }]);
  51446. return ThemeService;
  51447. }(CommonServiceBase);
  51448. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystService.js
  51449. 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); }
  51450. function ThiessenAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51451. 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); } }
  51452. 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; }
  51453. 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); }
  51454. function ThiessenAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThiessenAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  51455. 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); }
  51456. 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); }
  51457. 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); }; }
  51458. 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); }
  51459. function ThiessenAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51460. 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; } }
  51461. function ThiessenAnalystService_getPrototypeOf(o) { ThiessenAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThiessenAnalystService_getPrototypeOf(o); }
  51462. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51463. * This program are made available under the terms of the Apache License, Version 2.0
  51464. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51465. /**
  51466. * @class ThiessenAnalystService
  51467. * @deprecatedclass SuperMap.ThiessenAnalystService
  51468. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  51469. * @classdesc
  51470. * 泰森多边形分析服务类
  51471. * 该类负责将客户设置的泰森多边形分析参数传递给服务端,并接收服务端返回的分析结果数据。
  51472. * 泰森多边形分析结果通过该类支持的事件的监听函数参数获取
  51473. * 泰森多边形分析的参数支持两种,当参数为 {@link DatasetThiessenAnalystParameters} 类型
  51474. * 时,执行数据集泰森多边形分析,当参数为 {@link GeometryThiessenAnalystParameters} 类型时,
  51475. * 执行几何对象泰森多边形分析。
  51476. * @param {string} url - 服务地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  51477. * @param {Object} options - 参数。
  51478. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  51479. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  51480. * @param {Object} [options.headers] - 请求头。
  51481. * @extends {SpatialAnalystBase}
  51482. * @example 例如:
  51483. * (start code)
  51484. * var myThiessenAnalystService = new ThiessenAnalystService(url, {
  51485. * eventListeners: {
  51486. * "processCompleted": bufferCompleted,
  51487. * "processFailed": bufferFailed
  51488. * }
  51489. * });
  51490. * (end)
  51491. * @usage
  51492. */
  51493. var ThiessenAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  51494. ThiessenAnalystService_inherits(ThiessenAnalystService, _SpatialAnalystBase);
  51495. var _super = ThiessenAnalystService_createSuper(ThiessenAnalystService);
  51496. function ThiessenAnalystService(url, options) {
  51497. var _this;
  51498. ThiessenAnalystService_classCallCheck(this, ThiessenAnalystService);
  51499. _this = _super.call(this, url, options);
  51500. /**
  51501. * @member {string} ThiessenAnalystService.prototype.mode
  51502. * @description 缓冲区分析类型
  51503. */
  51504. _this.mode = null;
  51505. if (options) {
  51506. Util_Util.extend(ThiessenAnalystService_assertThisInitialized(_this), options);
  51507. }
  51508. _this.CLASS_NAME = "SuperMap.ThiessenAnalystService";
  51509. return _this;
  51510. }
  51511. /**
  51512. * @override
  51513. */
  51514. ThiessenAnalystService_createClass(ThiessenAnalystService, [{
  51515. key: "destroy",
  51516. value: function destroy() {
  51517. ThiessenAnalystService_get(ThiessenAnalystService_getPrototypeOf(ThiessenAnalystService.prototype), "destroy", this).call(this);
  51518. this.mode = null;
  51519. }
  51520. /**
  51521. * @function ThiessenAnalystService.prototype.processAsync
  51522. * @description 负责将客户端的查询参数传递到服务端。
  51523. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} parameter - 泰森多边形分析参数基类。
  51524. */
  51525. }, {
  51526. key: "processAsync",
  51527. value: function processAsync(parameter) {
  51528. var parameterObject = {};
  51529. var me = this;
  51530. if (parameter instanceof DatasetThiessenAnalystParameters) {
  51531. me.mode = "datasets";
  51532. me.url = Util_Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/thiessenpolygon');
  51533. DatasetThiessenAnalystParameters.toObject(parameter, parameterObject);
  51534. } else if (parameter instanceof GeometryThiessenAnalystParameters) {
  51535. me.mode = "geometry";
  51536. me.url = Util_Util.urlPathAppend(me.url, 'geometry/thiessenpolygon');
  51537. GeometryThiessenAnalystParameters.toObject(parameter, parameterObject);
  51538. }
  51539. var jsonParameters = Util_Util.toJSON(parameterObject);
  51540. this.returnContent = true;
  51541. me.request({
  51542. method: "POST",
  51543. data: jsonParameters,
  51544. scope: me,
  51545. success: me.serviceProcessCompleted,
  51546. failure: me.serviceProcessFailed
  51547. });
  51548. }
  51549. }, {
  51550. key: "dataFormat",
  51551. value: function dataFormat() {
  51552. return [DataFormat.GEOJSON, DataFormat.ISERVER, DataFormat.FGB];
  51553. }
  51554. }]);
  51555. return ThiessenAnalystService;
  51556. }(SpatialAnalystBase);
  51557. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBatchAnalystService.js
  51558. 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); }
  51559. function GeometryBatchAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51560. 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); } }
  51561. 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; }
  51562. 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); }
  51563. function GeometryBatchAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBatchAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  51564. 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); }
  51565. 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); }
  51566. 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); }; }
  51567. 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); }
  51568. function GeometryBatchAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51569. 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; } }
  51570. function GeometryBatchAnalystService_getPrototypeOf(o) { GeometryBatchAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBatchAnalystService_getPrototypeOf(o); }
  51571. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51572. * This program are made available under the terms of the Apache License, Version 2.0
  51573. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51574. /**
  51575. * @class GeometryBatchAnalystService
  51576. * @deprecatedclass SuperMap.GeometryBatchAnalystService
  51577. * @category iServer SpatialAnalyst BatchAnalyst
  51578. * @classdesc 批量空间分析服务类
  51579. * @description 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  51580. * 获取的结果数据包括 originResult 、result 两种,
  51581. * 其中,originResult 为服务端返回的用 JSON 对象表示的量算结果数据,result 为服务端返回的量算结果数据。
  51582. * @extends {SpatialAnalystBase}
  51583. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  51584. * @param {Object} options - 参数。
  51585. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  51586. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  51587. * @param {Object} [options.headers] - 请求头。
  51588. * @example
  51589. * var myOverlayAnalystService = new GeometryBatchAnalystService(url, {
  51590. * eventListeners: {
  51591. * "processCompleted": OverlayCompleted,
  51592. * "processFailed": OverlayFailed
  51593. * }
  51594. * });
  51595. * @usage
  51596. */
  51597. var GeometryBatchAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  51598. GeometryBatchAnalystService_inherits(GeometryBatchAnalystService, _SpatialAnalystBase);
  51599. var _super = GeometryBatchAnalystService_createSuper(GeometryBatchAnalystService);
  51600. function GeometryBatchAnalystService(url, options) {
  51601. var _this;
  51602. GeometryBatchAnalystService_classCallCheck(this, GeometryBatchAnalystService);
  51603. _this = _super.call(this, url, options);
  51604. if (options) {
  51605. Util_Util.extend(GeometryBatchAnalystService_assertThisInitialized(_this), options);
  51606. }
  51607. _this.CLASS_NAME = "SuperMap.GeometryBatchAnalystService";
  51608. return _this;
  51609. }
  51610. /**
  51611. * @function GeometryBatchAnalystService.prototype.processAsync
  51612. * @description 负责将客户端的查询参数传递到服务端。
  51613. * @param {GeometryOverlayAnalystParameter} parameter - 批量几何对象叠加分析参数类
  51614. *
  51615. */
  51616. GeometryBatchAnalystService_createClass(GeometryBatchAnalystService, [{
  51617. key: "processAsync",
  51618. value: function processAsync(parameters) {
  51619. var me = this;
  51620. me.url = Util_Util.urlPathAppend(me.url, 'geometry/batchanalyst');
  51621. me.url = Util_Util.urlAppend(me.url, 'returnContent=true&ignoreAnalystParam=true');
  51622. var parameterObjects = me._processParams(parameters);
  51623. var jsonParameters = Util_Util.toJSON(parameterObjects);
  51624. me.request({
  51625. method: "POST",
  51626. data: jsonParameters,
  51627. scope: me,
  51628. success: me.serviceProcessCompleted,
  51629. failure: me.serviceProcessFailed
  51630. });
  51631. }
  51632. }, {
  51633. key: "_processParams",
  51634. value: function _processParams(parameters) {
  51635. var me = this;
  51636. if (!Util_Util.isArray(parameters)) {
  51637. return;
  51638. }
  51639. var processParams = [];
  51640. parameters.map(function (item) {
  51641. processParams.push(me._toJSON(item));
  51642. return item;
  51643. });
  51644. return processParams;
  51645. }
  51646. }, {
  51647. key: "_toJSON",
  51648. value: function _toJSON(parameter) {
  51649. var tempObj = {};
  51650. if (parameter.analystName === "buffer") {
  51651. tempObj.analystName = "buffer";
  51652. tempObj.param = {};
  51653. //几何对象的批量空间分析,
  51654. GeometryBufferAnalystParameters.toObject(parameter.param, tempObj.param);
  51655. } else if (parameter.analystName === "overlay") {
  51656. tempObj.analystName = "overlay";
  51657. tempObj.param = {};
  51658. GeometryOverlayAnalystParameters.toObject(parameter.param, tempObj.param);
  51659. } else if (parameter.analystName === "interpolationDensity") {
  51660. tempObj.analystName = "interpolationDensity";
  51661. tempObj.param = {};
  51662. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  51663. } else if (parameter.analystName === "interpolationidw") {
  51664. tempObj.analystName = "interpolationidw";
  51665. tempObj.param = {};
  51666. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  51667. } else if (parameter.analystName === "interpolationRBF") {
  51668. tempObj.analystName = "interpolationRBF";
  51669. tempObj.param = {};
  51670. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  51671. } else if (parameter.analystName === "interpolationKriging") {
  51672. tempObj.analystName = "interpolationKriging";
  51673. tempObj.param = {};
  51674. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  51675. } else if (parameter.analystName === "thiessenpolygon") {
  51676. tempObj.analystName = "thiessenpolygon";
  51677. tempObj.param = {};
  51678. GeometryThiessenAnalystParameters.toObject(parameter.param, tempObj.param);
  51679. } else {
  51680. //isoline; isoregion; calculatemeasure; routelocator 四种分析不需要再处理参数
  51681. return parameter;
  51682. }
  51683. return tempObj;
  51684. }
  51685. /**
  51686. * @override
  51687. */
  51688. }, {
  51689. key: "destroy",
  51690. value: function destroy() {
  51691. GeometryBatchAnalystService_get(GeometryBatchAnalystService_getPrototypeOf(GeometryBatchAnalystService.prototype), "destroy", this).call(this);
  51692. }
  51693. }]);
  51694. return GeometryBatchAnalystService;
  51695. }(SpatialAnalystBase);
  51696. ;// CONCATENATED MODULE: ./src/common/iServer/TilesetsService.js
  51697. 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); }
  51698. function TilesetsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51699. 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); } }
  51700. 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; }
  51701. 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); }
  51702. function TilesetsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TilesetsService_getPrototypeOf(object); if (object === null) break; } return object; }
  51703. 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); }
  51704. 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); }
  51705. 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); }; }
  51706. 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); }
  51707. function TilesetsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51708. 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; } }
  51709. function TilesetsService_getPrototypeOf(o) { TilesetsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TilesetsService_getPrototypeOf(o); }
  51710. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51711. * This program are made available under the terms of the Apache License, Version 2.0
  51712. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51713. /**
  51714. * @class TilesetsService
  51715. * @deprecatedclass SuperMap.TilesetsService
  51716. * @category iServer Map Tilesets
  51717. * @classdesc 切片列表信息查询服务类;即查询切片地图服务的切片列表,返回切片集名称、地图切片元数据信息、切片版本集信息。
  51718. * @extends {CommonServiceBase}
  51719. * @param {string} url - 服务地址。URL 应为:
  51720. * http://{服务器地址}:{服务端口号}/iserver/services/{服务名}/rest/maps/map;
  51721. * 例如: "http://localhost:8090/iserver/services/test/rest/maps/tianlocal"。
  51722. * @param {Object} options - 参数。
  51723. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  51724. * @param {DataFormat} [options.format=DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  51725. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  51726. * @param {Object} [options.headers] - 请求头。
  51727. * @usage
  51728. */
  51729. var TilesetsService = /*#__PURE__*/function (_CommonServiceBase) {
  51730. TilesetsService_inherits(TilesetsService, _CommonServiceBase);
  51731. var _super = TilesetsService_createSuper(TilesetsService);
  51732. function TilesetsService(url, options) {
  51733. var _this;
  51734. TilesetsService_classCallCheck(this, TilesetsService);
  51735. _this = _super.call(this, url, options);
  51736. _this.CLASS_NAME = "SuperMap.TilesetsService";
  51737. return _this;
  51738. }
  51739. /**
  51740. * @override
  51741. */
  51742. TilesetsService_createClass(TilesetsService, [{
  51743. key: "destroy",
  51744. value: function destroy() {
  51745. TilesetsService_get(TilesetsService_getPrototypeOf(TilesetsService.prototype), "destroy", this).call(this);
  51746. }
  51747. /**
  51748. * @function TilesetsService.prototype.processAsync
  51749. * @description 负责将客户端的查询参数传递到服务端。
  51750. */
  51751. }, {
  51752. key: "processAsync",
  51753. value: function processAsync() {
  51754. if (!this.url) {
  51755. return;
  51756. }
  51757. var me = this;
  51758. me.url = Util_Util.urlPathAppend(me.url, 'tilesets');
  51759. me.request({
  51760. method: "GET",
  51761. scope: me,
  51762. success: me.serviceProcessCompleted,
  51763. failure: me.serviceProcessFailed
  51764. });
  51765. }
  51766. }]);
  51767. return TilesetsService;
  51768. }(CommonServiceBase);
  51769. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
  51770. function TopologyValidatorJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51771. 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); } }
  51772. 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; }
  51773. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51774. * This program are made available under the terms of the Apache License, Version 2.0
  51775. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51776. /**
  51777. * @class TopologyValidatorJobsParameter
  51778. * @deprecatedclass SuperMap.TopologyValidatorJobsParameter
  51779. * @category iServer ProcessingService TopologyValidator
  51780. * @classdesc 拓扑检查分析任务参数类。
  51781. * @param {Object} options - 参数。
  51782. * @param {string} options.datasetName - 数据集名。
  51783. * @param {string} options.datasetTopology -检查对象所在的数据集名称。
  51784. * @param {TopologyValidatorRule} [options.rule=TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
  51785. * @param {string} [options.tolerance] - 容限。
  51786. * @param {OutputSetting} [options.output] - 输出参数设置。
  51787. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  51788. * @usage
  51789. */
  51790. var TopologyValidatorJobsParameter = /*#__PURE__*/function () {
  51791. function TopologyValidatorJobsParameter(options) {
  51792. TopologyValidatorJobsParameter_classCallCheck(this, TopologyValidatorJobsParameter);
  51793. if (!options) {
  51794. return;
  51795. }
  51796. /**
  51797. * @member {string} TopologyValidatorJobsParameter.prototype.datasetName
  51798. * @description 数据集名。
  51799. */
  51800. this.datasetName = "";
  51801. /**
  51802. * @member {string} TopologyValidatorJobsParameter.prototype.datasetTopology
  51803. * @description 拓扑检查对象所在的数据集名称。
  51804. */
  51805. this.datasetTopology = "";
  51806. /**
  51807. * @member {string} [TopologyValidatorJobsParameter.prototype.tolerance]
  51808. * @description 容限,指定的拓扑错误检查时使用的容限。
  51809. */
  51810. this.tolerance = "";
  51811. /**
  51812. * @member {TopologyValidatorRule} [TopologyValidatorJobsParameter.prototype.rule=TopologyValidatorRule.REGIONNOOVERLAP]
  51813. * @description 拓扑检查模式。
  51814. */
  51815. this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
  51816. /**
  51817. * @member {OutputSetting} [TopologyValidatorJobsParameter.prototype.output]
  51818. * @description 输出参数设置类。
  51819. */
  51820. this.output = null;
  51821. /**
  51822. * @member {MappingParameters} [TopologyValidatorJobsParameter.prototype.mappingParameters]
  51823. * @description 分析后结果可视化的参数类。
  51824. */
  51825. this.mappingParameters = null;
  51826. Util_Util.extend(this, options);
  51827. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
  51828. }
  51829. /**
  51830. * @function TopologyValidatorJobsParameter.prototype.destroy
  51831. * @description 释放资源,将引用资源的属性置空。
  51832. */
  51833. TopologyValidatorJobsParameter_createClass(TopologyValidatorJobsParameter, [{
  51834. key: "destroy",
  51835. value: function destroy() {
  51836. this.datasetName = null;
  51837. this.datasetTopology = null;
  51838. this.tolerance = null;
  51839. this.rule = null;
  51840. if (this.output instanceof OutputSetting) {
  51841. this.output.destroy();
  51842. this.output = null;
  51843. }
  51844. if (this.mappingParameters instanceof MappingParameters) {
  51845. this.mappingParameters.destroy();
  51846. this.mappingParameters = null;
  51847. }
  51848. }
  51849. /**
  51850. * @function TopologyValidatorJobsParameter.toObject
  51851. * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
  51852. * @param {Object} tempObj - 目标对象。
  51853. * @description 生成拓扑检查分析任务对象。
  51854. */
  51855. }], [{
  51856. key: "toObject",
  51857. value: function toObject(_TopologyValidatorJobsParameter, tempObj) {
  51858. for (var name in _TopologyValidatorJobsParameter) {
  51859. if (name === "datasetName") {
  51860. tempObj['input'] = tempObj['input'] || {};
  51861. tempObj['input'][name] = _TopologyValidatorJobsParameter[name];
  51862. continue;
  51863. }
  51864. if (name === "output") {
  51865. tempObj['output'] = tempObj['output'] || {};
  51866. tempObj['output'] = _TopologyValidatorJobsParameter[name];
  51867. continue;
  51868. }
  51869. tempObj['analyst'] = tempObj['analyst'] || {};
  51870. tempObj['analyst'][name] = _TopologyValidatorJobsParameter[name];
  51871. if (name === 'mappingParameters') {
  51872. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  51873. tempObj['analyst']['mappingParameters'] = _TopologyValidatorJobsParameter[name];
  51874. }
  51875. }
  51876. }
  51877. }]);
  51878. return TopologyValidatorJobsParameter;
  51879. }();
  51880. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
  51881. 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); }
  51882. function TopologyValidatorJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51883. 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); } }
  51884. 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; }
  51885. 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); }
  51886. function TopologyValidatorJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TopologyValidatorJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  51887. 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); }
  51888. 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); }
  51889. 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); }; }
  51890. 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); }
  51891. function TopologyValidatorJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51892. 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; } }
  51893. function TopologyValidatorJobsService_getPrototypeOf(o) { TopologyValidatorJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TopologyValidatorJobsService_getPrototypeOf(o); }
  51894. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51895. * This program are made available under the terms of the Apache License, Version 2.0
  51896. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51897. /**
  51898. * @class TopologyValidatorJobsService
  51899. * @deprecatedclass SuperMap.TopologyValidatorJobsService
  51900. * @category iServer ProcessingService TopologyValidator
  51901. * @classdesc 拓扑检查分析服务类
  51902. * @extends {ProcessingServiceBase}
  51903. * @param {string} url - 服务地址。
  51904. * @param {Object} options - 可选参数。
  51905. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  51906. * @param {Object} [options.headers] - 请求头。
  51907. * @usage
  51908. */
  51909. var TopologyValidatorJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  51910. TopologyValidatorJobsService_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
  51911. var _super = TopologyValidatorJobsService_createSuper(TopologyValidatorJobsService);
  51912. function TopologyValidatorJobsService(url, options) {
  51913. var _this;
  51914. TopologyValidatorJobsService_classCallCheck(this, TopologyValidatorJobsService);
  51915. _this = _super.call(this, url, options);
  51916. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/topologyvalidator');
  51917. _this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
  51918. return _this;
  51919. }
  51920. /**
  51921. *@override
  51922. */
  51923. TopologyValidatorJobsService_createClass(TopologyValidatorJobsService, [{
  51924. key: "destroy",
  51925. value: function destroy() {
  51926. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "destroy", this).call(this);
  51927. }
  51928. /**
  51929. * @function TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
  51930. * @description 获取拓扑检查分析所有任务
  51931. */
  51932. }, {
  51933. key: "getTopologyValidatorJobs",
  51934. value: function getTopologyValidatorJobs() {
  51935. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, this.url);
  51936. }
  51937. /**
  51938. * @function TopologyValidatorJobsService.protitype.getTopologyValidatorJob
  51939. * @description 获取指定id的拓扑检查分析服务
  51940. * @param {string} id - 指定要获取数据的id
  51941. */
  51942. }, {
  51943. key: "getTopologyValidatorJob",
  51944. value: function getTopologyValidatorJob(id) {
  51945. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  51946. }
  51947. /**
  51948. * @function TopologyValidatorJobsService.protitype.addTopologyValidatorJob
  51949. * @description 新建拓扑检查分析服务
  51950. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析任务参数类。
  51951. * @param {number} seconds -创建成功结果的时间间隔。
  51952. */
  51953. }, {
  51954. key: "addTopologyValidatorJob",
  51955. value: function addTopologyValidatorJob(params, seconds) {
  51956. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "addJob", this).call(this, this.url, params, TopologyValidatorJobsParameter, seconds);
  51957. }
  51958. }]);
  51959. return TopologyValidatorJobsService;
  51960. }(ProcessingServiceBase);
  51961. ;// CONCATENATED MODULE: ./src/common/iServer/TransferLine.js
  51962. function TransferLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51963. 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); } }
  51964. 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; }
  51965. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  51966. * This program are made available under the terms of the Apache License, Version 2.0
  51967. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51968. /**
  51969. * @class TransferLine
  51970. * @deprecatedclass SuperMap.TransferLine
  51971. * @category iServer TrafficTransferAnalyst TransferPath
  51972. * @classdesc 换乘路线信息类。
  51973. * @param {Object} options - 参数。
  51974. * @param {number} options.lineID - 乘车路线 ID。
  51975. * @param {string} options.lineName - 乘车路线名称。
  51976. * @param {string} options.lineAliasName - 乘车路线别名。
  51977. * @param {number} options.startStopIndex - 上车站点在本公交路线中的索引。
  51978. * @param {string} options.startStopName - 上车站点名称。
  51979. * @param {string} options.startStopAliasName - 上车站点别名。
  51980. * @param {number} options.endStopIndex - 下车站点在本公交路线中的索引。
  51981. * @param {string} options.endStopName - 下车站点名称。
  51982. * @param {string} options.endStopAliasName - 下车站点别名。
  51983. * @usage
  51984. */
  51985. var TransferLine = /*#__PURE__*/function () {
  51986. function TransferLine(options) {
  51987. TransferLine_classCallCheck(this, TransferLine);
  51988. options = options || {};
  51989. /**
  51990. * @member {number} TransferLine.prototype.lineID
  51991. * @description 乘车路线 ID。
  51992. */
  51993. this.lineID = null;
  51994. /**
  51995. * @member {string} TransferLine.prototype.lineName
  51996. * @description 乘车路线名称。
  51997. */
  51998. this.lineName = null;
  51999. /**
  52000. * @member {string} TransferLine.prototype.lineAliasName
  52001. * @description 乘车路线别名。
  52002. */
  52003. this.lineAliasName = null;
  52004. /**
  52005. * @member {number} TransferLine.prototype.startStopIndex
  52006. * @description 上车站点在本公交路线中的索引。
  52007. */
  52008. this.startStopIndex = null;
  52009. /**
  52010. * @member {string} TransferLine.prototype.startStopName
  52011. * @description 上车站点名称。
  52012. */
  52013. this.startStopName = null;
  52014. /**
  52015. * @member {string} TransferLine.prototype.startStopAliasName
  52016. * @description 上车站点别名。
  52017. */
  52018. this.startStopAliasName = null;
  52019. /**
  52020. * @member {number} TransferLine.prototype.endStopIndex
  52021. * @description 下车站点在本公交路线中的索引。
  52022. */
  52023. this.endStopIndex = null;
  52024. /**
  52025. * @member {string} TransferLine.prototype.endStopName
  52026. * @description 下车站点名称。
  52027. */
  52028. this.endStopName = null;
  52029. /**
  52030. * @member {string} TransferLine.prototype.endStopAliasName
  52031. * @description 下车站点别名。
  52032. */
  52033. this.endStopAliasName = null;
  52034. Util_Util.extend(this, options);
  52035. this.CLASS_NAME = "SuperMap.TransferLine";
  52036. }
  52037. /**
  52038. * @function TransferLine.prototype.destroy
  52039. * @description 释放资源,将引用资源的属性置空。
  52040. */
  52041. TransferLine_createClass(TransferLine, [{
  52042. key: "destroy",
  52043. value: function destroy() {
  52044. Util_Util.reset(this);
  52045. }
  52046. /**
  52047. * @function TransferLine.fromJson
  52048. * @description 将返回结果转化为 {@link TransferLine} 对象。
  52049. * @param {Object} jsonObject - 新的返回结果。
  52050. * @returns {TransferLine} 转化后的 {@link TransferLine} 对象。
  52051. */
  52052. }], [{
  52053. key: "fromJson",
  52054. value: function fromJson(jsonObject) {
  52055. if (!jsonObject) {
  52056. return;
  52057. }
  52058. return new TransferLine({
  52059. lineID: jsonObject['lineID'],
  52060. lineName: jsonObject['lineName'],
  52061. lineAliasName: jsonObject['lineAliasName'],
  52062. startStopIndex: jsonObject['startStopIndex'],
  52063. startStopName: jsonObject['startStopName'],
  52064. startStopAliasName: jsonObject['startStopAliasName'],
  52065. endStopIndex: jsonObject['endStopIndex'],
  52066. endStopName: jsonObject['endStopName'],
  52067. endStopAliasName: jsonObject['endStopAliasName']
  52068. });
  52069. }
  52070. }]);
  52071. return TransferLine;
  52072. }();
  52073. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathParameters.js
  52074. function TransferPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52075. 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); } }
  52076. 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; }
  52077. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52078. * This program are made available under the terms of the Apache License, Version 2.0
  52079. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52080. /**
  52081. * @class TransferPathParameters
  52082. * @deprecatedclass SuperMap.TransferPathParameters
  52083. * @category iServer TrafficTransferAnalyst TransferPath
  52084. * @classdesc 交通换乘线路查询参数类。
  52085. * @param {Object} options - 参数。
  52086. * @param {Array.<TransferLine>} options.transferLines - 本换乘分段内可乘车的路线集合。
  52087. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} options.points - 两种查询方式:按照公交站点的起止 ID 进行查询和按照起止点的坐标进行查询。
  52088. * @usage
  52089. */
  52090. var TransferPathParameters = /*#__PURE__*/function () {
  52091. function TransferPathParameters(options) {
  52092. TransferPathParameters_classCallCheck(this, TransferPathParameters);
  52093. options = options || {};
  52094. /**
  52095. * @member {Array.<TransferLine>} TransferPathParameters.prototype.transferLines
  52096. * @description 本换乘分段内可乘车的路线集合,通过交通换乘方案查询得到。
  52097. */
  52098. this.transferLines = null;
  52099. /**
  52100. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} TransferPathParameters.prototype.points
  52101. * @description 两种查询方式:<br>
  52102. * 1. 按照公交站点的起止ID进行查询,则 points 参数的类型为 int[],形如:[起点ID、终点ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  52103. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  52104. */
  52105. this.points = null;
  52106. Util_Util.extend(this, options);
  52107. this.CLASS_NAME = "SuperMap.TransferPathParameters";
  52108. }
  52109. /**
  52110. * @function TransferPathParameters.prototype.destroy
  52111. * @description 释放资源,将引用资源的属性置空。
  52112. */
  52113. TransferPathParameters_createClass(TransferPathParameters, [{
  52114. key: "destroy",
  52115. value: function destroy() {
  52116. Util_Util.reset(this);
  52117. }
  52118. /**
  52119. * @function TransferPathParameters.toJson
  52120. * @description 将 {@link TransferPathParameters} 对象参数转换为 JSON 字符串。
  52121. * @param {TransferPathParameters} params - 交通换乘参数。
  52122. * @returns {string} 转化后的 JSON 字符串。
  52123. */
  52124. }], [{
  52125. key: "toJson",
  52126. value: function toJson(params) {
  52127. if (params) {
  52128. return Util_Util.toJSON(params);
  52129. }
  52130. }
  52131. }]);
  52132. return TransferPathParameters;
  52133. }();
  52134. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathService.js
  52135. 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); }
  52136. function TransferPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52137. 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); } }
  52138. 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; }
  52139. 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); }
  52140. function TransferPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  52141. 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); }
  52142. 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); }
  52143. 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); }; }
  52144. 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); }
  52145. function TransferPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52146. 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; } }
  52147. function TransferPathService_getPrototypeOf(o) { TransferPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferPathService_getPrototypeOf(o); }
  52148. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52149. * This program are made available under the terms of the Apache License, Version 2.0
  52150. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52151. /**
  52152. * @class TransferPathService
  52153. * @deprecatedclass SuperMap.TransferPathService
  52154. * @category iServer TrafficTransferAnalyst TransferPath
  52155. * @classdesc 交通换乘线路查询服务类,根据交通换乘分析结果(TransferSolutionResult),获取某一条乘车路线的详细信息。
  52156. * 返回结果通过该类支持的事件的监听函数参数获取
  52157. * @extends {CommonServiceBase}
  52158. * @example 例如:
  52159. * var myService = new TransferPathService(url, {eventListeners: {
  52160. * "processCompleted": TrafficTransferCompleted,
  52161. * "processFailed": TrafficTransferError
  52162. * }
  52163. * };
  52164. * @param {string} url - 服务地址。
  52165. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  52166. * @param {Object} options - 参数。
  52167. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  52168. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  52169. * @param {Object} [options.headers] - 请求头。
  52170. * @usage
  52171. */
  52172. var TransferPathService = /*#__PURE__*/function (_CommonServiceBase) {
  52173. TransferPathService_inherits(TransferPathService, _CommonServiceBase);
  52174. var _super = TransferPathService_createSuper(TransferPathService);
  52175. function TransferPathService(url, options) {
  52176. var _this;
  52177. TransferPathService_classCallCheck(this, TransferPathService);
  52178. _this = _super.call(this, url, options);
  52179. _this.CLASS_NAME = "SuperMap.TransferPathService";
  52180. return _this;
  52181. }
  52182. /**
  52183. * @override
  52184. */
  52185. TransferPathService_createClass(TransferPathService, [{
  52186. key: "destroy",
  52187. value: function destroy() {
  52188. TransferPathService_get(TransferPathService_getPrototypeOf(TransferPathService.prototype), "destroy", this).call(this);
  52189. }
  52190. /**
  52191. * @function TransferPathService.prototype.processAsync
  52192. * @description 负责将客户端的更新参数传递到服务端。
  52193. * @param {TransferPathParameters} params - 交通换乘参数。
  52194. */
  52195. }, {
  52196. key: "processAsync",
  52197. value: function processAsync(params) {
  52198. if (!(params instanceof TransferPathParameters)) {
  52199. return;
  52200. }
  52201. var me = this,
  52202. method = "GET",
  52203. jsonParameters;
  52204. me.url = Util_Util.urlPathAppend(me.url, 'path');
  52205. jsonParameters = {
  52206. points: Util_Util.toJSON(params.points),
  52207. transferLines: Util_Util.toJSON(params['transferLines'])
  52208. };
  52209. me.request({
  52210. method: method,
  52211. params: jsonParameters,
  52212. scope: me,
  52213. success: me.serviceProcessCompleted,
  52214. failure: me.serviceProcessFailed
  52215. });
  52216. }
  52217. }]);
  52218. return TransferPathService;
  52219. }(CommonServiceBase);
  52220. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionParameters.js
  52221. function TransferSolutionParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52222. 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); } }
  52223. 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; }
  52224. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52225. * This program are made available under the terms of the Apache License, Version 2.0
  52226. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52227. /**
  52228. * @class TransferSolutionParameters
  52229. * @deprecatedclass SuperMap.TransferSolutionParameters
  52230. * @category iServer TrafficTransferAnalyst TransferSolutions
  52231. * @classdesc 交通换乘方案查询参数类。
  52232. * @param {Object} options - 参数。
  52233. * @param {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} options.points - 两种查询方式:按照公交站点的起止ID进行查询和按照起止点的坐标进行查询。
  52234. * @param {number} [options.solutionCount=6] - 乘车方案的数量。
  52235. * @param {TransferTactic} [options.transferTactic=TransferTactic.LESS_TIME] - 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  52236. * @param {TransferPreference} [options.transferPreference=TransferPreference.NONE] - 乘车偏好枚举。
  52237. * @param {number} [options.walkingRatio=10] - 步行与公交的消耗权重比。
  52238. * @param {Array.<number>} [options.evadeLines] - 避让路线的 ID。
  52239. * @param {Array.<number>} [options.evadeStops] - 避让站点的 ID。
  52240. * @param {Array.<number>} [options.priorLines] - 优先路线的 ID。
  52241. * @param {Array.<number>} [options.priorStops] - 优先站点的 ID。
  52242. * @param {string} [options.travelTime] - 出行的时间。
  52243. * @usage
  52244. */
  52245. var TransferSolutionParameters = /*#__PURE__*/function () {
  52246. function TransferSolutionParameters(options) {
  52247. TransferSolutionParameters_classCallCheck(this, TransferSolutionParameters);
  52248. options = options || {};
  52249. /**
  52250. * @member {number} [TransferSolutionParameters.prototype.solutionCount=6]
  52251. * @description 乘车方案的数量。
  52252. */
  52253. this.solutionCount = 6;
  52254. /**
  52255. * @member {TransferPreference} [TransferSolutionParameters.prototype.transferPreference=TransferPreference.NONE]
  52256. * @description 乘车偏好枚举。
  52257. */
  52258. this.transferPreference = TransferPreference.NONE;
  52259. /**
  52260. * @member {TransferTactic} [TransferSolutionParameters.prototype.transferTactic=TransferTactic|TransferTactic.LESS_TIME]
  52261. * @description 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  52262. */
  52263. this.transferTactic = TransferTactic.LESS_TIME;
  52264. /**
  52265. * @member {number} [TransferSolutionParameters.prototype.walkingRatio=10]
  52266. * @description 步行与公交的消耗权重比。此值越大,则步行因素对于方案选择的影响越大。例如:</br>
  52267. * 例如现在有两种换乘方案(在仅考虑消耗因素的情况下):</br>
  52268. * 方案1:坐车 10 公里,走路 1 公里;</br>
  52269. * 方案2:坐车 15 公里,走路 0.5 公里;</br>
  52270. * 1. 假设权重比为 15:</br>
  52271. * •方案 1 的总消耗为:10 + 1*15 = 25</br>
  52272. * •方案 2 的总消耗为:15 + 0.5*15 = 22.5</br>
  52273. * 此时方案 2 消耗更低。</br>
  52274. * 2. 假设权重比为2:</br>
  52275. * •方案 1 的总消耗为:10+1*2 = 12</br>
  52276. * •方案 2 的总消耗为:15+0.5*2 = 17</br>
  52277. * 此时方案 1 消耗更低。</br>
  52278. */
  52279. this.walkingRatio = null;
  52280. /**
  52281. * @member {Array.<GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|Array.<number>|number>} TransferSolutionParameters.prototype.points
  52282. * @description 两种查询方式:</br>
  52283. * 1. 按照公交站点的起止 ID 进行查询,则 points 参数的类型为 int[],形如:[起点 ID、终点 ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  52284. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  52285. */
  52286. this.points = false;
  52287. /**
  52288. * @member {Array.<number>} [TransferSolutionParameters.prototype.evadeLinesnull]
  52289. * @description 避让路线 ID。
  52290. * */
  52291. this.evadeLines = null;
  52292. /**
  52293. * @member {Array.<number>} [TransferSolutionParameters.prototype.evadeStops=TransferLine]
  52294. * @description 避让站点 ID。
  52295. * */
  52296. this.evadeStops = null;
  52297. /**
  52298. * @member {Array.<number>} [TransferSolutionParameters.prototype.priorLines]
  52299. * @description 优先路线 ID。
  52300. * */
  52301. this.priorLines = null;
  52302. /**
  52303. * @member {Array.<number>} [TransferSolutionParameters.prototype.priorStops]
  52304. * @description 优先站点 ID。
  52305. * */
  52306. this.priorStops = null;
  52307. /**
  52308. * @member {string} TransferSolutionParameters.prototype.travelTime
  52309. * @description 出行的时间;格式是:"小时:分钟",如:"08:30"。如果设置了该参数,在分析时,则会考虑线路的首末班车时间的限制,即在返回的结果中会提示公交的首末班发车时间。
  52310. */
  52311. this.travelTime = null;
  52312. Util_Util.extend(this, options);
  52313. this.CLASS_NAME = "SuperMap.TransferSolutionParameters";
  52314. }
  52315. /**
  52316. * @function TransferSolutionParameters.prototype.destroy
  52317. * @description 释放资源,将引用资源的属性置空。
  52318. */
  52319. TransferSolutionParameters_createClass(TransferSolutionParameters, [{
  52320. key: "destroy",
  52321. value: function destroy() {
  52322. Util_Util.reset(this);
  52323. }
  52324. /**
  52325. * @function TransferSolutionParameters.toJsonParameters
  52326. * @description 将 {@link TransferSolutionParameters} 对象参数转换为 JSON 字符串。
  52327. * @param {TransferSolutionParameters} params - 交通换乘参数。
  52328. * @returns {string} 转化后的 JSON 字符串。
  52329. */
  52330. }], [{
  52331. key: "toJson",
  52332. value: function toJson(params) {
  52333. if (params) {
  52334. return Util_Util.toJSON(params);
  52335. }
  52336. }
  52337. }]);
  52338. return TransferSolutionParameters;
  52339. }();
  52340. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionService.js
  52341. 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); }
  52342. function TransferSolutionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52343. 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); } }
  52344. 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; }
  52345. 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); }
  52346. function TransferSolutionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferSolutionService_getPrototypeOf(object); if (object === null) break; } return object; }
  52347. 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); }
  52348. 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); }
  52349. 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); }; }
  52350. 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); }
  52351. function TransferSolutionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52352. 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; } }
  52353. function TransferSolutionService_getPrototypeOf(o) { TransferSolutionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferSolutionService_getPrototypeOf(o); }
  52354. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52355. * This program are made available under the terms of the Apache License, Version 2.0
  52356. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52357. /**
  52358. * @class TransferSolutionService
  52359. * @deprecatedclass SuperMap.TransferSolutionService
  52360. * @category iServer TrafficTransferAnalyst TransferSolutions
  52361. * @classdesc 交通换乘方案查询服务类。
  52362. * 返回结果通过该类支持的事件的监听函数参数获取。
  52363. * @param {string} url - 服务地址。
  52364. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  52365. * @param {Object} options - 参数。</br>
  52366. * @param {Object} options.eventListeners - 需要被注册的监听器对象。</br>
  52367. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  52368. * @param {Object} [options.headers] - 请求头。
  52369. * @extends {CommonServiceBase}
  52370. * @example 例如:
  52371. * (start code)
  52372. * var myService = new TransferSolutionService(url, {eventListeners: {
  52373. * "processCompleted": trafficTransferCompleted,
  52374. * "processFailed": trafficTransferError
  52375. * }
  52376. * };
  52377. * (end)
  52378. * @usage
  52379. */
  52380. var TransferSolutionService = /*#__PURE__*/function (_CommonServiceBase) {
  52381. TransferSolutionService_inherits(TransferSolutionService, _CommonServiceBase);
  52382. var _super = TransferSolutionService_createSuper(TransferSolutionService);
  52383. function TransferSolutionService(url, options) {
  52384. var _this;
  52385. TransferSolutionService_classCallCheck(this, TransferSolutionService);
  52386. _this = _super.call(this, url, options);
  52387. _this.CLASS_NAME = "SuperMap.TransferSolutionService";
  52388. return _this;
  52389. }
  52390. /**
  52391. * @override
  52392. */
  52393. TransferSolutionService_createClass(TransferSolutionService, [{
  52394. key: "destroy",
  52395. value: function destroy() {
  52396. TransferSolutionService_get(TransferSolutionService_getPrototypeOf(TransferSolutionService.prototype), "destroy", this).call(this);
  52397. }
  52398. /**
  52399. * @function TransferSolutionService.prototype.processAsync
  52400. * @description 负责将客户端的更新参数传递到服务端。
  52401. * @param {TransferSolutionParameters} params - 交通换乘参数。
  52402. */
  52403. }, {
  52404. key: "processAsync",
  52405. value: function processAsync(params) {
  52406. if (!(params instanceof TransferSolutionParameters)) {
  52407. return;
  52408. }
  52409. var me = this,
  52410. method = "GET",
  52411. jsonParameters;
  52412. me.url = Util_Util.urlPathAppend(me.url, 'solutions');
  52413. jsonParameters = {
  52414. points: Util_Util.toJSON(params.points),
  52415. walkingRatio: params['walkingRatio'],
  52416. transferTactic: params['transferTactic'],
  52417. solutionCount: params['solutionCount'],
  52418. transferPreference: params["transferPreference"]
  52419. };
  52420. if (params.evadeLines) {
  52421. jsonParameters["evadeLines"] = Util_Util.toJSON(params.evadeLines);
  52422. }
  52423. if (params.evadeStops) {
  52424. jsonParameters["evadeStops"] = Util_Util.toJSON(params.evadeStops);
  52425. }
  52426. if (params.priorLines) {
  52427. jsonParameters["priorLines"] = Util_Util.toJSON(params.priorLines);
  52428. }
  52429. if (params.priorStops) {
  52430. jsonParameters["priorStops"] = Util_Util.toJSON(params.priorStops);
  52431. }
  52432. if (params.travelTime) {
  52433. jsonParameters["travelTime"] = params.travelTime;
  52434. }
  52435. me.request({
  52436. method: method,
  52437. params: jsonParameters,
  52438. scope: me,
  52439. success: me.serviceProcessCompleted,
  52440. failure: me.serviceProcessFailed
  52441. });
  52442. }
  52443. }]);
  52444. return TransferSolutionService;
  52445. }(CommonServiceBase);
  52446. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightParameters.js
  52447. function UpdateEdgeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52448. 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); } }
  52449. 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; }
  52450. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52451. * This program are made available under the terms of the Apache License, Version 2.0
  52452. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52453. /**
  52454. * @class UpdateEdgeWeightParameters
  52455. * @deprecatedclass SuperMap.UpdateEdgeWeightParameters
  52456. * @category iServer NetworkAnalyst EdgeWeight
  52457. * @classdesc 边的耗费权重更新服务参数类。
  52458. * @param {Object} options - 参数。
  52459. * @param {string} options.edgeId - 所在边的 ID。
  52460. * @param {string} options.fromNodeId - 起始转向点的 ID。
  52461. * @param {string} options.toNodeId - 终止转向点的 ID。
  52462. * @param {string} options.weightField - 边的耗费字段。
  52463. * @param {string} options.edgeWeight - 耗费权重。
  52464. * @usage
  52465. */
  52466. var UpdateEdgeWeightParameters = /*#__PURE__*/function () {
  52467. function UpdateEdgeWeightParameters(options) {
  52468. UpdateEdgeWeightParameters_classCallCheck(this, UpdateEdgeWeightParameters);
  52469. if (!options) {
  52470. return;
  52471. }
  52472. /**
  52473. * @member {string} UpdateEdgeWeightParameters.prototype.edgeId
  52474. * @description 所在边的 ID。
  52475. */
  52476. this.edgeId = "";
  52477. /**
  52478. * @member {string} UpdateEdgeWeightParameters.prototype.fromNodeId
  52479. * @description 起始转向点的 ID。
  52480. */
  52481. this.fromNodeId = "";
  52482. /**
  52483. * @member {string} UpdateEdgeWeightParameters.prototype.toNodeId
  52484. * @description 终止转向点的 ID。
  52485. */
  52486. this.toNodeId = "";
  52487. /**
  52488. * @member {string} UpdateEdgeWeightParameters.prototype.weightField
  52489. * @description 边的耗费字段。
  52490. */
  52491. this.weightField = "";
  52492. /**
  52493. * @member {string} UpdateEdgeWeightParameters.prototype.edgeWeight
  52494. * @description 耗费权重。
  52495. */
  52496. this.edgeWeight = "";
  52497. Util_Util.extend(this, options);
  52498. this.CLASS_NAME = "SuperMap.UpdateEdgeWeightParameters";
  52499. }
  52500. /**
  52501. * @function UpdateEdgeWeightParameters.prototype.destroy
  52502. * @description 释放资源,将引用资源的属性置空。
  52503. */
  52504. UpdateEdgeWeightParameters_createClass(UpdateEdgeWeightParameters, [{
  52505. key: "destroy",
  52506. value: function destroy() {
  52507. this.edgeId = null;
  52508. this.fromNodeId = null;
  52509. this.toNodeId = null;
  52510. this.weightField = null;
  52511. this.edgeWeight = null;
  52512. }
  52513. }]);
  52514. return UpdateEdgeWeightParameters;
  52515. }();
  52516. ;// CONCATENATED MODULE: ./src/common/iServer/CreateDatasetParameters.js
  52517. function CreateDatasetParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52518. 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); } }
  52519. 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; }
  52520. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52521. * This program are made available under the terms of the Apache License, Version 2.0
  52522. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52523. /**
  52524. * @class CreateDatasetParameters
  52525. * @deprecatedclass SuperMap.CreateDatasetParameters
  52526. * @category iServer Data Dataset
  52527. * @classdesc 数据集创建参数类。
  52528. * @param {Object} options - 参数。
  52529. * @param {string} options.datasourceName - 数据源名称,此为必选参数。
  52530. * @param {string} options.datasetName - 数据集名称,此为必选参数。
  52531. * @param {string} options.datasetType - 数据集类型。目前支持创建的数据集类型有:点、线、面、文本、复合(CAD)和属性数据集。
  52532. * @usage
  52533. */
  52534. var CreateDatasetParameters = /*#__PURE__*/function () {
  52535. function CreateDatasetParameters(options) {
  52536. CreateDatasetParameters_classCallCheck(this, CreateDatasetParameters);
  52537. if (!options) {
  52538. return;
  52539. }
  52540. /**
  52541. * @member {string} CreateDatasetParameters.prototype.datasourceName
  52542. * @description 数据源名称,此为必选参数。
  52543. */
  52544. this.datasourceName = null;
  52545. /**
  52546. * @member {string} CreateDatasetParameters.prototype.datasetName
  52547. * @description 数据集名称,此为必选参数。
  52548. */
  52549. this.datasetName = null;
  52550. /**
  52551. * @member {string} CreateDatasetParameters.prototype.datasetType
  52552. * @description 数据集类型。目前支持创建的数据集类型有:点、线、面、文本、复合(CAD)和属性数据集。
  52553. */
  52554. this.datasetType = null;
  52555. if (options) {
  52556. Util_Util.extend(this, options);
  52557. }
  52558. this.CLASS_NAME = "SuperMap.CreateDatasetParameters";
  52559. }
  52560. /**
  52561. * @function CreateDatasetParameters.prototype.destroy
  52562. * @description 释放资源,将引用资源的属性置空。
  52563. */
  52564. CreateDatasetParameters_createClass(CreateDatasetParameters, [{
  52565. key: "destroy",
  52566. value: function destroy() {
  52567. var me = this;
  52568. me.datasourceName = null;
  52569. me.datasetName = null;
  52570. me.datasetType = null;
  52571. }
  52572. }]);
  52573. return CreateDatasetParameters;
  52574. }();
  52575. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightService.js
  52576. 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); }
  52577. function UpdateEdgeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52578. 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); } }
  52579. 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; }
  52580. 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); }
  52581. function UpdateEdgeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateEdgeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  52582. 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); }
  52583. 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); }
  52584. 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); }; }
  52585. 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); }
  52586. function UpdateEdgeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52587. 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; } }
  52588. function UpdateEdgeWeightService_getPrototypeOf(o) { UpdateEdgeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateEdgeWeightService_getPrototypeOf(o); }
  52589. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52590. * This program are made available under the terms of the Apache License, Version 2.0
  52591. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52592. /**
  52593. * @class UpdateEdgeWeightService
  52594. * @deprecatedclass SuperMap.UpdateEdgeWeightService
  52595. * @category iServer NetworkAnalyst EdgeWeight
  52596. * @classdesc 更新边的边的耗费权重服务
  52597. * @extends {NetworkAnalystServiceBase}
  52598. * @example
  52599. *(start code)
  52600. * var updateEdgeWeightService = new UpdateEdgeWeightService(url, {
  52601. * eventListeners: {
  52602. * "processCompleted": UpdateEdgeWeightCompleted,
  52603. * "processFailed": UpdateEdgeWeightError
  52604. * }
  52605. * });
  52606. * (end)
  52607. * @param {string} url - 服务地址。如:http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  52608. * @param {Object} options - 参数。
  52609. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  52610. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  52611. * @param {Object} [options.headers] - 请求头。
  52612. * @usage
  52613. */
  52614. var UpdateEdgeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  52615. UpdateEdgeWeightService_inherits(UpdateEdgeWeightService, _NetworkAnalystServic);
  52616. var _super = UpdateEdgeWeightService_createSuper(UpdateEdgeWeightService);
  52617. function UpdateEdgeWeightService(url, options) {
  52618. var _this;
  52619. UpdateEdgeWeightService_classCallCheck(this, UpdateEdgeWeightService);
  52620. _this = _super.call(this, url, options);
  52621. _this.CLASS_NAME = "SuperMap.UpdateEdgeWeightService";
  52622. return _this;
  52623. }
  52624. /**
  52625. * @override
  52626. */
  52627. UpdateEdgeWeightService_createClass(UpdateEdgeWeightService, [{
  52628. key: "destroy",
  52629. value: function destroy() {
  52630. UpdateEdgeWeightService_get(UpdateEdgeWeightService_getPrototypeOf(UpdateEdgeWeightService.prototype), "destroy", this).call(this);
  52631. }
  52632. /**
  52633. * @function UpdateEdgeWeightService.prototype.processAsync
  52634. * @description 开始异步执行边的边的耗费权重的更新
  52635. * @param {UpdateEdgeWeightParameters} params - 边的耗费权重更新服务参数类
  52636. * @example
  52637. * (code)
  52638. * var updateEdgeWeightParam=new SuperMapUpdateEdgeWeightParameters({
  52639. * edgeId:"20",
  52640. * fromNodeId:"26",
  52641. * toNodeId:"109",
  52642. * weightField:"time",
  52643. * edgeWeight:"25"
  52644. * });
  52645. * updateEdgeWeightService.processAsync(updateEdgeWeightParam);
  52646. * (end)
  52647. */
  52648. }, {
  52649. key: "processAsync",
  52650. value: function processAsync(params) {
  52651. if (!(params instanceof UpdateEdgeWeightParameters)) {
  52652. return;
  52653. }
  52654. var me = this;
  52655. var paramStr = me.parse(params);
  52656. me.url = Util_Util.urlPathAppend(me.url, paramStr);
  52657. var data = params.edgeWeight ? params.edgeWeight : null;
  52658. me.request({
  52659. method: "PUT",
  52660. scope: me,
  52661. data: data,
  52662. success: me.serviceProcessCompleted,
  52663. failure: me.serviceProcessFailed
  52664. });
  52665. }
  52666. /**
  52667. * @function UpdateEdgeWeightService.prototype.parse
  52668. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  52669. */
  52670. }, {
  52671. key: "parse",
  52672. value: function parse(params) {
  52673. if (!params) {
  52674. return;
  52675. }
  52676. var paramStr = "";
  52677. for (var attr in params) {
  52678. if (params[attr] === "" || params[attr] === "edgeWeight") {
  52679. continue;
  52680. }
  52681. switch (attr) {
  52682. case "edgeId":
  52683. paramStr += "/edgeweight/" + params[attr];
  52684. break;
  52685. case "fromNodeId":
  52686. paramStr += "/fromnode/" + params[attr];
  52687. break;
  52688. case "toNodeId":
  52689. paramStr += "/tonode/" + params[attr];
  52690. break;
  52691. case "weightField":
  52692. paramStr += "/weightfield/" + params[attr];
  52693. break;
  52694. default:
  52695. break;
  52696. }
  52697. }
  52698. return paramStr;
  52699. }
  52700. }]);
  52701. return UpdateEdgeWeightService;
  52702. }(NetworkAnalystServiceBase);
  52703. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightParameters.js
  52704. function UpdateTurnNodeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52705. 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); } }
  52706. 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; }
  52707. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52708. * This program are made available under the terms of the Apache License, Version 2.0
  52709. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52710. /**
  52711. * @class UpdateTurnNodeWeightParameters
  52712. * @deprecatedclass SuperMap.UpdateTurnNodeWeightParameters
  52713. * @category iServer NetworkAnalyst TurnNodeWeight
  52714. * @classdesc 转向耗费权重更新服务参数类。
  52715. * @param {Object} options - 参数。
  52716. * @param {string} options.nodeId - 转向结点的 ID。
  52717. * @param {string} options.fromEdgeId - 起始边的 ID。
  52718. * @param {string} options.toEdgeId - 终止边的 ID。
  52719. * @param {string} options.weightField - 转向结点的耗费字段。
  52720. * @param {string} options.turnNodeWeight - 耗费权重。
  52721. * @usage
  52722. */
  52723. var UpdateTurnNodeWeightParameters = /*#__PURE__*/function () {
  52724. function UpdateTurnNodeWeightParameters(options) {
  52725. UpdateTurnNodeWeightParameters_classCallCheck(this, UpdateTurnNodeWeightParameters);
  52726. if (!options) {
  52727. return;
  52728. }
  52729. /**
  52730. * @member {string} UpdateTurnNodeWeightParameters.prototype.nodeId
  52731. * @description 转向结点的 ID。
  52732. */
  52733. this.nodeId = "";
  52734. /**
  52735. * @member {string} UpdateTurnNodeWeightParameters.prototype.fromEdgeId
  52736. * @description 起始边的 ID。
  52737. */
  52738. this.fromEdgeId = "";
  52739. /**
  52740. * @member {string} UpdateTurnNodeWeightParameters.prototype.toEdgeId
  52741. * @description 终止边的 ID。
  52742. */
  52743. this.toEdgeId = "";
  52744. /**
  52745. * @member {string} UpdateTurnNodeWeightParameters.prototype.weightField
  52746. * @description 转向结点的耗费字段。
  52747. */
  52748. this.weightField = "";
  52749. /**
  52750. * @member {string} UpdateTurnNodeWeightParameters.prototype.turnNodeWeight
  52751. * @description 耗费权重。
  52752. */
  52753. this.turnNodeWeight = "";
  52754. Util_Util.extend(this, options);
  52755. this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightParameters";
  52756. }
  52757. /**
  52758. * @function UpdateTurnNodeWeightParameters.prototype.destroy
  52759. * @description 释放资源,将引用资源的属性置空。
  52760. */
  52761. UpdateTurnNodeWeightParameters_createClass(UpdateTurnNodeWeightParameters, [{
  52762. key: "destroy",
  52763. value: function destroy() {
  52764. this.nodeId = null;
  52765. this.fromEdgeId = null;
  52766. this.toEdgeId = null;
  52767. this.weightField = null;
  52768. this.turnNodeWeight = null;
  52769. }
  52770. }]);
  52771. return UpdateTurnNodeWeightParameters;
  52772. }();
  52773. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightService.js
  52774. 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); }
  52775. function UpdateTurnNodeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52776. 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); } }
  52777. 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; }
  52778. 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); }
  52779. function UpdateTurnNodeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateTurnNodeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  52780. 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); }
  52781. 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); }
  52782. 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); }; }
  52783. 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); }
  52784. function UpdateTurnNodeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52785. 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; } }
  52786. function UpdateTurnNodeWeightService_getPrototypeOf(o) { UpdateTurnNodeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateTurnNodeWeightService_getPrototypeOf(o); }
  52787. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52788. * This program are made available under the terms of the Apache License, Version 2.0
  52789. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52790. /**
  52791. * @class UpdateTurnNodeWeightService
  52792. * @deprecatedclass SuperMap.UpdateTurnNodeWeightService
  52793. * @category iServer NetworkAnalyst TurnNodeWeight
  52794. * @classdesc 转向耗费权重更新服务类
  52795. * @extends {NetworkAnalystServiceBase}
  52796. * @example
  52797. * var UpdateTurnNodeWeightService = new UpdateTurnNodeWeightService(url, {
  52798. * eventListeners: {
  52799. * "processCompleted": UpdateTurnNodeWeightCompleted,
  52800. * "processFailed": UpdateTurnNodeWeightError
  52801. * }
  52802. * });
  52803. * @param {string} url - 服务地址。如:
  52804. * http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  52805. * @param {Object} options - 参数。
  52806. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  52807. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  52808. * @param {Object} [options.headers] - 请求头。
  52809. * @usage
  52810. */
  52811. var UpdateTurnNodeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  52812. UpdateTurnNodeWeightService_inherits(UpdateTurnNodeWeightService, _NetworkAnalystServic);
  52813. var _super = UpdateTurnNodeWeightService_createSuper(UpdateTurnNodeWeightService);
  52814. function UpdateTurnNodeWeightService(url, options) {
  52815. var _this;
  52816. UpdateTurnNodeWeightService_classCallCheck(this, UpdateTurnNodeWeightService);
  52817. _this = _super.call(this, url, options);
  52818. _this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightService";
  52819. return _this;
  52820. }
  52821. /**
  52822. * @override
  52823. */
  52824. UpdateTurnNodeWeightService_createClass(UpdateTurnNodeWeightService, [{
  52825. key: "destroy",
  52826. value: function destroy() {
  52827. UpdateTurnNodeWeightService_get(UpdateTurnNodeWeightService_getPrototypeOf(UpdateTurnNodeWeightService.prototype), "destroy", this).call(this);
  52828. }
  52829. /**
  52830. * @function UpdateTurnNodeWeightService.prototype.processAsync
  52831. * @description 开始异步执行转向耗费权重的更新
  52832. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类
  52833. * @example
  52834. * (code)
  52835. * var updateTurnNodeWeightParam=new UpdateTurnNodeWeightParameters({
  52836. * nodeId:"106",
  52837. * fromEdgeId:"6508",
  52838. * toEdgeId:"6504",
  52839. * weightField:"TurnCost",
  52840. * turnNodeWeight:"50"
  52841. * });
  52842. * updateTurnNodeWeightService.processAsync(updateTurnNodeWeightParam);
  52843. * (end)
  52844. **/
  52845. }, {
  52846. key: "processAsync",
  52847. value: function processAsync(params) {
  52848. if (!(params instanceof UpdateTurnNodeWeightParameters)) {
  52849. return;
  52850. }
  52851. var me = this;
  52852. var paramStr = me.parse(params);
  52853. me.url = Util_Util.urlPathAppend(me.url, paramStr);
  52854. var data = params.turnNodeWeight ? params.turnNodeWeight : null;
  52855. me.request({
  52856. method: "PUT",
  52857. scope: me,
  52858. data: data,
  52859. success: me.serviceProcessCompleted,
  52860. failure: me.serviceProcessFailed
  52861. });
  52862. }
  52863. /**
  52864. * @function UpdateTurnNodeWeightService.prototype.parse
  52865. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  52866. */
  52867. }, {
  52868. key: "parse",
  52869. value: function parse(params) {
  52870. if (!params) {
  52871. return;
  52872. }
  52873. var paramStr = "";
  52874. for (var attr in params) {
  52875. if (params[attr] === "" || params[attr] === "turnNodeWeight") {
  52876. continue;
  52877. }
  52878. switch (attr) {
  52879. case "nodeId":
  52880. paramStr += "/turnnodeweight/" + params[attr];
  52881. break;
  52882. case "fromEdgeId":
  52883. paramStr += "/fromedge/" + params[attr];
  52884. break;
  52885. case "toEdgeId":
  52886. paramStr += "/toedge/" + params[attr];
  52887. break;
  52888. case "weightField":
  52889. paramStr += "/weightfield/" + params[attr];
  52890. break;
  52891. default:
  52892. break;
  52893. }
  52894. }
  52895. return paramStr;
  52896. }
  52897. }]);
  52898. return UpdateTurnNodeWeightService;
  52899. }(NetworkAnalystServiceBase);
  52900. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateDatasetParameters.js
  52901. function UpdateDatasetParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52902. 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); } }
  52903. 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; }
  52904. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52905. * This program are made available under the terms of the Apache License, Version 2.0
  52906. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52907. /**
  52908. * @class UpdateDatasetParameters
  52909. * @deprecatedclass SuperMap.UpdateDatasetParameters
  52910. * @category iServer Data Dataset
  52911. * @classdesc 数据集信息更改参数类。
  52912. * @param {Object} options - 参数。
  52913. * @param {string} options.datasourceName - 数据源名称。
  52914. * @param {string} options.datasetName - 数据集名称。
  52915. * @param {boolean} options.isFileCache - 是否使用文件形式的缓存。仅对数据库型数据源中的矢量数据集有效。
  52916. * @param {string} options.description - 数据集描述信息。
  52917. * @param {string} options.prjCoordSys - 投影坐标系。
  52918. * @param {Object} options.charset - 矢量数据集的字符集。当数据集类型为矢量数据集时,可以传递此参数。如果用户传递空值,则编码方式保持不变。
  52919. * @param {Array.<string>} options.palette - 影像数据的颜色调色板。当数据集类型为影像数据集时,可以传递此参数。
  52920. * @param {number} options.noValue - 栅格数据集中没有数据的像元的栅格值。当数据集类型为栅格数据集时,可以传递此参数。
  52921. * @usage
  52922. */
  52923. var UpdateDatasetParameters = /*#__PURE__*/function () {
  52924. function UpdateDatasetParameters(options) {
  52925. UpdateDatasetParameters_classCallCheck(this, UpdateDatasetParameters);
  52926. if (!options) {
  52927. return;
  52928. }
  52929. /**
  52930. * @member {string} UpdateDatasetParameters.prototype.datasourceName
  52931. * @description 数据源名称。
  52932. */
  52933. this.datasourceName = null;
  52934. /**
  52935. * @member {string} UpdateDatasetParameters.prototype.datasetName
  52936. * @description 数据集名称。
  52937. */
  52938. this.datasetName = null;
  52939. /**
  52940. * @member {boolean} UpdateDatasetParameters.prototype.isFileCache
  52941. * @description 是否使用文件形式的缓存。仅对数据库型数据源中的矢量数据集有效。
  52942. */
  52943. this.isFileCache = null;
  52944. /**
  52945. * @member {string} UpdateDatasetParameters.prototype.description
  52946. * @description 数据集描述信息。
  52947. */
  52948. this.description = null;
  52949. /**
  52950. * @member {string} UpdateDatasetParameters.prototype.prjCoordSys
  52951. * @description 投影坐标系。
  52952. */
  52953. this.prjCoordSys = null;
  52954. /**
  52955. * @member {Object} UpdateDatasetParameters.prototype.charset
  52956. * @description 矢量数据集的字符集。
  52957. */
  52958. this.charset = null;
  52959. /**
  52960. * @member {Array.<string>} UpdateDatasetParameters.prototype.palette
  52961. * @description 影像数据的颜色调色板。
  52962. */
  52963. this.palette = null;
  52964. /**
  52965. * @member {number} UpdateDatasetParameters.prototype.noValue
  52966. * @description 栅格数据集中没有数据的像元的栅格值。
  52967. */
  52968. this.noValue = null;
  52969. if (options) {
  52970. Util_Util.extend(this, options);
  52971. }
  52972. this.CLASS_NAME = "SuperMap.UpdateDatasetParameters";
  52973. }
  52974. /**
  52975. * @function UpdateDatasetParameters.prototype.destroy
  52976. * @description 释放资源,将引用资源的属性置空。
  52977. */
  52978. UpdateDatasetParameters_createClass(UpdateDatasetParameters, [{
  52979. key: "destroy",
  52980. value: function destroy() {
  52981. var me = this;
  52982. me.datasourceName = null;
  52983. me.datasetName = null;
  52984. me.isFileCache = null;
  52985. me.prjCoordSys = null;
  52986. me.charset = null;
  52987. me.palette = null;
  52988. me.noValue = null;
  52989. }
  52990. }]);
  52991. return UpdateDatasetParameters;
  52992. }();
  52993. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
  52994. function VectorClipJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52995. 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); } }
  52996. 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; }
  52997. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  52998. * This program are made available under the terms of the Apache License, Version 2.0
  52999. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53000. /**
  53001. * @class VectorClipJobsParameter
  53002. * @deprecatedclass SuperMap.VectorClipJobsParameter
  53003. * @category iServer ProcessingService VectorClip
  53004. * @classdesc 矢量裁剪分析任务参数类。
  53005. * @param {Object} options - 参数。
  53006. * @param {string} options.datasetName - 数据集名。
  53007. * @param {string} options.datasetOverlay - 裁剪对象数据集。
  53008. * @param {ClipAnalystMode} [options.mode=ClipAnalystMode.CLIP] - 裁剪分析模式。
  53009. * @param {string} [options.geometryClip] - 裁剪几何对象。
  53010. * @param {OutputSetting} [options.output] - 输出参数设置。
  53011. * @param {MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  53012. * @usage
  53013. */
  53014. var VectorClipJobsParameter = /*#__PURE__*/function () {
  53015. function VectorClipJobsParameter(options) {
  53016. VectorClipJobsParameter_classCallCheck(this, VectorClipJobsParameter);
  53017. options = options || {};
  53018. /**
  53019. * @member {string} VectorClipJobsParameter.prototype.datasetName
  53020. * @description 数据集名。
  53021. */
  53022. this.datasetName = "";
  53023. /**
  53024. * @member {string} VectorClipJobsParameter.prototype.datasetOverlay
  53025. * @description 裁剪对象数据集。
  53026. */
  53027. this.datasetVectorClip = "";
  53028. /**
  53029. * @member {string} VectorClipJobsParameter.prototype.geometryClip
  53030. * @description 裁剪几何对象。
  53031. */
  53032. this.geometryClip = "";
  53033. /**
  53034. * @member {ClipAnalystMode} [VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
  53035. * @description 裁剪分析模式 。
  53036. */
  53037. this.mode = ClipAnalystMode.CLIP;
  53038. /**
  53039. * @member {OutputSetting} VectorClipJobsParameter.prototype.output
  53040. * @description 输出参数设置类。
  53041. */
  53042. this.output = null;
  53043. /**
  53044. * @member {MappingParameters} [VectorClipJobsParameter.prototype.mappingParameters]
  53045. * @description 分析后结果可视化的参数类。
  53046. */
  53047. this.mappingParameters = null;
  53048. Util_Util.extend(this, options);
  53049. this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
  53050. }
  53051. /**
  53052. * @function VectorClipJobsParameter.prototype.destroy
  53053. * @description 释放资源,将引用资源的属性置空。
  53054. */
  53055. VectorClipJobsParameter_createClass(VectorClipJobsParameter, [{
  53056. key: "destroy",
  53057. value: function destroy() {
  53058. this.datasetName = null;
  53059. this.datasetVectorClip = null;
  53060. this.geometryClip = null;
  53061. this.mode = null;
  53062. if (this.output instanceof OutputSetting) {
  53063. this.output.destroy();
  53064. this.output = null;
  53065. }
  53066. if (this.mappingParameters instanceof MappingParameters) {
  53067. this.mappingParameters.destroy();
  53068. this.mappingParameters = null;
  53069. }
  53070. }
  53071. /**
  53072. * @function VectorClipJobsParameter.toObject
  53073. * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
  53074. * @param {Object} tempObj - 目标对象。
  53075. * @description 矢量裁剪分析任务对象。
  53076. */
  53077. }], [{
  53078. key: "toObject",
  53079. value: function toObject(vectorClipJobsParameter, tempObj) {
  53080. for (var name in vectorClipJobsParameter) {
  53081. if (name === "datasetName") {
  53082. tempObj['input'] = tempObj['input'] || {};
  53083. tempObj['input'][name] = vectorClipJobsParameter[name];
  53084. continue;
  53085. }
  53086. if (name === "output") {
  53087. tempObj['output'] = tempObj['output'] || {};
  53088. tempObj['output'] = vectorClipJobsParameter[name];
  53089. continue;
  53090. }
  53091. tempObj['analyst'] = tempObj['analyst'] || {};
  53092. tempObj['analyst'][name] = vectorClipJobsParameter[name];
  53093. if (name === 'mappingParameters') {
  53094. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  53095. tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
  53096. }
  53097. }
  53098. }
  53099. }]);
  53100. return VectorClipJobsParameter;
  53101. }();
  53102. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
  53103. 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); }
  53104. function VectorClipJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53105. 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); } }
  53106. 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; }
  53107. 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); }
  53108. function VectorClipJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = VectorClipJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  53109. 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); }
  53110. 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); }
  53111. 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); }; }
  53112. 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); }
  53113. function VectorClipJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53114. 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; } }
  53115. function VectorClipJobsService_getPrototypeOf(o) { VectorClipJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorClipJobsService_getPrototypeOf(o); }
  53116. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53117. * This program are made available under the terms of the Apache License, Version 2.0
  53118. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53119. /**
  53120. * @class VectorClipJobsService
  53121. * @deprecatedclass SuperMap.VectorClipJobsService
  53122. * @category iServer ProcessingService VectorClip
  53123. * @classdesc 矢量裁剪分析服务类
  53124. * @extends {ProcessingServiceBase}
  53125. * @param {string} url -服务地址。
  53126. * @param {Object} options - 可选参数。
  53127. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  53128. * @param {Object} [options.headers] - 请求头。
  53129. * @usage
  53130. */
  53131. var VectorClipJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  53132. VectorClipJobsService_inherits(VectorClipJobsService, _ProcessingServiceBas);
  53133. var _super = VectorClipJobsService_createSuper(VectorClipJobsService);
  53134. function VectorClipJobsService(url, options) {
  53135. var _this;
  53136. VectorClipJobsService_classCallCheck(this, VectorClipJobsService);
  53137. _this = _super.call(this, url, options);
  53138. _this.url = Util_Util.urlPathAppend(_this.url, 'spatialanalyst/vectorclip');
  53139. _this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
  53140. return _this;
  53141. }
  53142. /**
  53143. *@override
  53144. */
  53145. VectorClipJobsService_createClass(VectorClipJobsService, [{
  53146. key: "destroy",
  53147. value: function destroy() {
  53148. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "destroy", this).call(this);
  53149. }
  53150. /**
  53151. * @function VectorClipJobsService.protitype.getVectorClipJobs
  53152. * @description 获取矢量裁剪分析所有任务
  53153. */
  53154. }, {
  53155. key: "getVectorClipJobs",
  53156. value: function getVectorClipJobs() {
  53157. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, this.url);
  53158. }
  53159. /**
  53160. * @function KernelDensityJobsService.protitype.getVectorClipJob
  53161. * @description 获取指定id的矢量裁剪分析服务
  53162. * @param {string} id - 指定要获取数据的id
  53163. */
  53164. }, {
  53165. key: "getVectorClipJob",
  53166. value: function getVectorClipJob(id) {
  53167. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, Util_Util.urlPathAppend(this.url, id));
  53168. }
  53169. /**
  53170. * @function VectorClipJobsService.protitype.addVectorClipJob
  53171. * @description 新建矢量裁剪分析服务
  53172. * @param {VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  53173. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  53174. */
  53175. }, {
  53176. key: "addVectorClipJob",
  53177. value: function addVectorClipJob(params, seconds) {
  53178. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "addJob", this).call(this, this.url, params, VectorClipJobsParameter, seconds);
  53179. }
  53180. }]);
  53181. return VectorClipJobsService;
  53182. }(ProcessingServiceBase);
  53183. ;// CONCATENATED MODULE: ./src/common/iServer/RasterFunctionParameter.js
  53184. function RasterFunctionParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53185. 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); } }
  53186. 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; }
  53187. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53188. * This program are made available under the terms of the Apache License, Version 2.0
  53189. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53190. /**
  53191. * @class RasterFunctionParameter
  53192. * @deprecatedclass SuperMap.RasterFunctionParameter
  53193. * @category iServer Map Tile
  53194. * @classdesc iServer 地图服务栅格分析参数基类。
  53195. * @param {Object} options - 参数。
  53196. * @param {RasterFunctionType} options.type - 栅格分析方法。
  53197. * @usage
  53198. */
  53199. var RasterFunctionParameter = /*#__PURE__*/function () {
  53200. function RasterFunctionParameter(options) {
  53201. RasterFunctionParameter_classCallCheck(this, RasterFunctionParameter);
  53202. options = options || {};
  53203. /**
  53204. * @member {RasterFunctionType} [RasterFunctionParameter.prototype.type]
  53205. * @description 栅格分析方法。
  53206. */
  53207. this.type = null;
  53208. Util_Util.extend(this, options);
  53209. this.CLASS_NAME = 'SuperMap.RasterFunctionParameter';
  53210. }
  53211. /**
  53212. * @function RasterFunctionParameter.prototype.destroy
  53213. * @description 释放资源,将资源的属性置空。
  53214. */
  53215. RasterFunctionParameter_createClass(RasterFunctionParameter, [{
  53216. key: "destroy",
  53217. value: function destroy() {
  53218. this.type = null;
  53219. }
  53220. }]);
  53221. return RasterFunctionParameter;
  53222. }();
  53223. ;// CONCATENATED MODULE: ./src/common/iServer/NDVIParameter.js
  53224. 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); }
  53225. function NDVIParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53226. 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); } }
  53227. 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; }
  53228. 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); }
  53229. function NDVIParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NDVIParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  53230. 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); }
  53231. 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); }
  53232. 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); }; }
  53233. 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); }
  53234. function NDVIParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53235. 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; } }
  53236. function NDVIParameter_getPrototypeOf(o) { NDVIParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NDVIParameter_getPrototypeOf(o); }
  53237. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53238. * This program are made available under the terms of the Apache License, Version 2.0
  53239. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53240. /**
  53241. * @class NDVIParameter
  53242. * @deprecatedclass SuperMap.NDVIParameter
  53243. * @category iServer Map Tile
  53244. * @classdesc 归一化植被指数参数类。
  53245. * @param {Object} options - 参数。
  53246. * @param {number} [options.redIndex=0] - 红光谱波段索引。
  53247. * @param {number} [options.nirIndex=1] - 近红外光谱波段索引。
  53248. * @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。仅单波段数据时设定。
  53249. * @extends {RasterFunctionParameter}
  53250. * @usage
  53251. */
  53252. var NDVIParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  53253. NDVIParameter_inherits(NDVIParameter, _RasterFunctionParame);
  53254. var _super = NDVIParameter_createSuper(NDVIParameter);
  53255. function NDVIParameter(options) {
  53256. var _this;
  53257. NDVIParameter_classCallCheck(this, NDVIParameter);
  53258. _this = _super.call(this, options);
  53259. /**
  53260. * @member {number} [NDVIParameter.prototype.redIndex=0]
  53261. * @description 红光谱波段索引。
  53262. */
  53263. _this.redIndex = 0;
  53264. /**
  53265. * @member {number} [NDVIParameter.prototype.nirIndex=1]
  53266. * @description 近红外光谱波段索引。
  53267. */
  53268. _this.nirIndex = 1;
  53269. /**
  53270. * @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"]
  53271. * @description 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
  53272. */
  53273. _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';
  53274. /**
  53275. * @member {RasterFunctionType} [NDVIParameter.prototype.type]
  53276. * @description 栅格分析方法。
  53277. */
  53278. _this.type = RasterFunctionType.NDVI;
  53279. Util_Util.extend(NDVIParameter_assertThisInitialized(_this), options);
  53280. _this.CLASS_NAME = 'SuperMap.NDVIParameter';
  53281. return _this;
  53282. }
  53283. /**
  53284. * @function NDVIParameter.prototype.destroy
  53285. * @override
  53286. */
  53287. NDVIParameter_createClass(NDVIParameter, [{
  53288. key: "destroy",
  53289. value: function destroy() {
  53290. NDVIParameter_get(NDVIParameter_getPrototypeOf(NDVIParameter.prototype), "destroy", this).call(this);
  53291. this.redIndex = null;
  53292. this.nirIndex = null;
  53293. this.colorMap = null;
  53294. }
  53295. /**
  53296. * @function NDVIParameter.prototype.toJSON
  53297. * @description 将 NDVIParameter 对象转化为 JSON 字符串。
  53298. * @returns {string} 返回转换后的 JSON 字符串。
  53299. */
  53300. }, {
  53301. key: "toJSON",
  53302. value: function toJSON() {
  53303. return {
  53304. redIndex: this.redIndex,
  53305. nirIndex: this.nirIndex,
  53306. colorMap: this.colorMap,
  53307. type: this.type
  53308. };
  53309. }
  53310. }]);
  53311. return NDVIParameter;
  53312. }(RasterFunctionParameter);
  53313. ;// CONCATENATED MODULE: ./src/common/iServer/HillshadeParameter.js
  53314. 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); }
  53315. function HillshadeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53316. 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); } }
  53317. 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; }
  53318. 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); }
  53319. function HillshadeParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = HillshadeParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  53320. 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); }
  53321. 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); }
  53322. 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); }; }
  53323. 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); }
  53324. function HillshadeParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53325. 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; } }
  53326. function HillshadeParameter_getPrototypeOf(o) { HillshadeParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HillshadeParameter_getPrototypeOf(o); }
  53327. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53328. * This program are made available under the terms of the Apache License, Version 2.0
  53329. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53330. /**
  53331. * @class HillshadeParameter
  53332. * @deprecatedclass SuperMap.HillshadeParameter
  53333. * @category iServer Map Tile
  53334. * @classdesc 阴影面分析参数类。
  53335. * @param {Object} options - 可选参数。
  53336. * @param {number} [options.altitude=45] - 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  53337. * @param {number} [options.azimuth=315] - 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  53338. * @param {number} [options.zFactor=1] - 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  53339. * z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  53340. * 如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。这是默认设置。
  53341. * 如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。例如,如果 z 单位是英尺而 x,y 单位是米,则应使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
  53342. * 如果输入栅格位于球面坐标系中(如十进制度球面坐标系),则生成的山体阴影可能看起来很独特。这是因为水平地面单位与高程 z 单位之间的测量值存在差异。由于经度的长度随着纬度而变化,因此需要为该纬度指定一个适当的 z 因子。如果 x,y 单位是十进制度而 Z 单位是米,特定纬度的一些合适的 Z 因子为:
  53343. * Latitude Z-factor
  53344. * 0 0.00000898
  53345. * 10 0.00000912
  53346. * 20 0.00000956
  53347. * 30 0.00001036
  53348. * 40 0.00001171
  53349. * 50 0.00001395
  53350. * 60 0.00001792
  53351. * 70 0.00002619
  53352. * 80 0.00005156
  53353. * @extends {RasterFunctionParameter}
  53354. * @usage
  53355. */
  53356. var HillshadeParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  53357. HillshadeParameter_inherits(HillshadeParameter, _RasterFunctionParame);
  53358. var _super = HillshadeParameter_createSuper(HillshadeParameter);
  53359. function HillshadeParameter(options) {
  53360. var _this;
  53361. HillshadeParameter_classCallCheck(this, HillshadeParameter);
  53362. _this = _super.call(this, options);
  53363. /**
  53364. * @member {number} [HillshadeParameter.prototype.altitude = 45]
  53365. * @description 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  53366. */
  53367. _this.altitude = 45;
  53368. /**
  53369. * @member {number} [HillshadeParameter.prototype.azimuth = 315]
  53370. * @description 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  53371. */
  53372. _this.azimuth = 315;
  53373. /**
  53374. * @member {number} [HillshadeParameter.prototype.zFactor = 1]
  53375. * @description 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  53376. */
  53377. _this.zFactor = 1;
  53378. /**
  53379. * @member {RasterFunctionType} HillshadeParameter.prototype.type
  53380. * @description 栅格分析方法。
  53381. */
  53382. _this.type = RasterFunctionType.HILLSHADE;
  53383. Util_Util.extend(HillshadeParameter_assertThisInitialized(_this), options);
  53384. _this.CLASS_NAME = 'SuperMap.HillshadeParameter';
  53385. return _this;
  53386. }
  53387. /**
  53388. * @function HillshadeParameter.prototype.destroy
  53389. * @override
  53390. */
  53391. HillshadeParameter_createClass(HillshadeParameter, [{
  53392. key: "destroy",
  53393. value: function destroy() {
  53394. HillshadeParameter_get(HillshadeParameter_getPrototypeOf(HillshadeParameter.prototype), "destroy", this).call(this);
  53395. this.altitude = null;
  53396. this.azimuth = null;
  53397. this.zFactor = null;
  53398. }
  53399. /**
  53400. * @function HillshadeParameter.prototype.toJSON
  53401. * @description 将 HillshadeParameter 对象转化为 JSON 字符串。
  53402. * @returns {string} 返回转换后的 JSON 字符串。
  53403. */
  53404. }, {
  53405. key: "toJSON",
  53406. value: function toJSON() {
  53407. return {
  53408. altitude: this.altitude,
  53409. azimuth: this.azimuth,
  53410. zFactor: this.zFactor,
  53411. type: this.type
  53412. };
  53413. }
  53414. }]);
  53415. return HillshadeParameter;
  53416. }(RasterFunctionParameter);
  53417. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobCustomItems.js
  53418. function WebPrintingJobCustomItems_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53419. 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); } }
  53420. 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; }
  53421. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53422. * This program are made available under the terms of the Apache License, Version 2.0
  53423. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53424. /**
  53425. * @class WebPrintingJobCustomItems
  53426. * @deprecatedclass SuperMap.WebPrintingJobCustomItems
  53427. * @classdesc Web 打印图例元素参数类。
  53428. * @version 10.1.0
  53429. * @category iServer WebPrintingJob
  53430. * @param {Object} option - 参数。
  53431. * @param {string} option.name - 图例元素的名称。
  53432. * @param {string} option.picAsUrl - 图例元素 Base64 格式图片。
  53433. * @param {string} [option.picAsBase64] - 图例元素图片的获取地址。如果已填了 URL 参数,此参数可不传。
  53434. * @usage
  53435. */
  53436. var WebPrintingJobCustomItems = /*#__PURE__*/function () {
  53437. function WebPrintingJobCustomItems(option) {
  53438. WebPrintingJobCustomItems_classCallCheck(this, WebPrintingJobCustomItems);
  53439. /**
  53440. * @member {string} WebPrintingJobCustomItems.prototype.name
  53441. * @description 图例元素的名称。
  53442. */
  53443. this.name = null;
  53444. /**
  53445. * @member {string} [WebPrintingJobCustomItems.prototype.picAsUrl]
  53446. * @description 图例元素 Base64 格式图片。
  53447. */
  53448. this.picAsUrl = null;
  53449. /**
  53450. * @member {string} [WebPrintingJobCustomItems.prototype.picAsBase64]
  53451. * @description 图例元素图片的获取地址。
  53452. */
  53453. this.picAsBase64 = null;
  53454. this.CLASS_NAME = 'SuperMap.WebPrintingJobCustomItems';
  53455. Util_Util.extend(this, option);
  53456. }
  53457. /**
  53458. * @function WebPrintingJobCustomItems.prototype.destroy
  53459. * @description 释放资源,将引用资源的属性置空。
  53460. */
  53461. WebPrintingJobCustomItems_createClass(WebPrintingJobCustomItems, [{
  53462. key: "destroy",
  53463. value: function destroy() {
  53464. var me = this;
  53465. me.name = null;
  53466. me.picAsUrl = null;
  53467. me.picAsBase64 = null;
  53468. }
  53469. /**
  53470. * @function WebPrintingJobCustomItems.prototype.toJSON
  53471. * @description 将 WebPrintingJobCustomItems 对象转化为 JSON 字符串。
  53472. * @returns {string} 转换后的 JSON 字符串。
  53473. */
  53474. }, {
  53475. key: "toJSON",
  53476. value: function toJSON() {
  53477. var params = {
  53478. name: this.name
  53479. };
  53480. if (this.title) {
  53481. params.title = this.title;
  53482. }
  53483. if (this.picAsUrl) {
  53484. params.picAsUrl = this.picAsUrl;
  53485. } else if (this.picAsBase64) {
  53486. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  53487. }
  53488. return Util_Util.toJSON(params);
  53489. }
  53490. }]);
  53491. return WebPrintingJobCustomItems;
  53492. }();
  53493. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobImage.js
  53494. function WebPrintingJobImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53495. 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); } }
  53496. 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; }
  53497. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53498. * This program are made available under the terms of the Apache License, Version 2.0
  53499. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53500. /**
  53501. * @class WebPrintingJobImage
  53502. * @deprecatedclass SuperMap.WebPrintingJobImage
  53503. * @classdesc 表达小地图的静态图片参数类。
  53504. * @version 10.1.0
  53505. * @category iServer WebPrintingJob
  53506. * @param {Object} option - 参数。
  53507. * @param {string} option.picAsUrl - 小地图的图片 URL 地址。
  53508. * @param {string} [option.picAsBase64] - 小地图的base64位图片信息。如果已填了 URL 参数,此参数可不传。
  53509. * @usage
  53510. */
  53511. var WebPrintingJobImage = /*#__PURE__*/function () {
  53512. function WebPrintingJobImage(option) {
  53513. WebPrintingJobImage_classCallCheck(this, WebPrintingJobImage);
  53514. /**
  53515. * @member {string} [WebPrintingJobImage.prototype.picAsUrl]
  53516. * @description 小地图的图片 URL 地址。
  53517. */
  53518. this.picAsUrl = null;
  53519. /**
  53520. * @member {string} [WebPrintingJobImage.prototype.picAsBase64]
  53521. * @description 小地图的base64位图片信息。
  53522. */
  53523. this.picAsBase64 = null;
  53524. this.CLASS_NAME = 'SuperMap.WebPrintingJobImage';
  53525. Util_Util.extend(this, option);
  53526. }
  53527. /**
  53528. * @function WebPrintingJobImage.prototype.destroy
  53529. * @description 释放资源,将引用资源的属性置空。
  53530. */
  53531. WebPrintingJobImage_createClass(WebPrintingJobImage, [{
  53532. key: "destroy",
  53533. value: function destroy() {
  53534. this.picAsUrl = null;
  53535. this.picAsBase64 = null;
  53536. }
  53537. /**
  53538. * @function WebPrintingJobImage.prototype.toJSON
  53539. * @description 将 WebPrintingJobImage 对象转化为 JSON 字符串。
  53540. * @returns {string} 转换后的 JSON 字符串。
  53541. */
  53542. }, {
  53543. key: "toJSON",
  53544. value: function toJSON() {
  53545. var params = {};
  53546. if (this.picAsUrl) {
  53547. params.picAsUrl = this.picAsUrl;
  53548. }
  53549. if (this.picAsBase64) {
  53550. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  53551. }
  53552. return Util_Util.toJSON(params);
  53553. }
  53554. }]);
  53555. return WebPrintingJobImage;
  53556. }();
  53557. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayers.js
  53558. function WebPrintingJobLayers_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53559. 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); } }
  53560. 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; }
  53561. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53562. * This program are made available under the terms of the Apache License, Version 2.0
  53563. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53564. /**
  53565. * @class WebPrintingJobLayers
  53566. * @deprecatedclass SuperMap.WebPrintingJobLayers
  53567. * @classdesc 将图例添加到布局的业务图层参数类。
  53568. * @version 10.1.0
  53569. * @category iServer WebPrintingJob
  53570. * @param {Object} option - 参数。
  53571. * @param {string} option.name - 图层 name 的字符串。此 name 必须唯一,并且必须与定义业务图层的 LegendOptions_layers 元素中的图层 name 匹配。
  53572. * @usage
  53573. */
  53574. var WebPrintingJobLayers = /*#__PURE__*/function () {
  53575. function WebPrintingJobLayers(option) {
  53576. WebPrintingJobLayers_classCallCheck(this, WebPrintingJobLayers);
  53577. /**
  53578. * @member {string} WebPrintingJobLayers.prototype.name
  53579. * @description 图层 name。
  53580. */
  53581. this.name = null;
  53582. /**
  53583. * @member {string} WebPrintingJobLayers.prototype.layerType
  53584. * @description 图层 type。
  53585. */
  53586. this.layerType = null;
  53587. /**
  53588. * @member {string} WebPrintingJobLayers.prototype.url
  53589. * @description 图层 URL。
  53590. */
  53591. this.url = null;
  53592. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayers';
  53593. Util_Util.extend(this, option);
  53594. }
  53595. /**
  53596. * @function WebPrintingJobLayers.prototype.destroy
  53597. * @description 释放资源,将引用资源的属性置空。
  53598. */
  53599. WebPrintingJobLayers_createClass(WebPrintingJobLayers, [{
  53600. key: "destroy",
  53601. value: function destroy() {
  53602. this.name = null;
  53603. this.layerType = null;
  53604. this.url = null;
  53605. }
  53606. }]);
  53607. return WebPrintingJobLayers;
  53608. }();
  53609. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLegendOptions.js
  53610. function WebPrintingJobLegendOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53611. 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); } }
  53612. 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; }
  53613. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53614. * This program are made available under the terms of the Apache License, Version 2.0
  53615. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53616. /**
  53617. * @class WebPrintingJobLegendOptions
  53618. * @deprecatedclass SuperMap.WebPrintingJobLegendOptions
  53619. * @classdesc Web 打印图例参数类。
  53620. * @version 10.1.0
  53621. * @category iServer WebPrintingJob
  53622. * @param {Object} option - 参数。
  53623. * @param {string} [option.title] - 图例名称。
  53624. * @param {string} [option.picAsUrl] - 图例的图片 URL 地址。
  53625. * @param {string} [option.picAsBase64] - 图例的 base64 位图片信息。
  53626. * @param {WebPrintingJobLayers} [option.layers] - 图例的布局业务图层参数类。
  53627. * @param {WebPrintingJobCustomItems} [option.customItems] - 自定义图例元素参数类。
  53628. * @usage
  53629. */
  53630. var WebPrintingJobLegendOptions = /*#__PURE__*/function () {
  53631. function WebPrintingJobLegendOptions(option) {
  53632. WebPrintingJobLegendOptions_classCallCheck(this, WebPrintingJobLegendOptions);
  53633. /**
  53634. * @member {string} WebPrintingJobLegendOptions.prototype.title
  53635. * @description 图例名称。
  53636. */
  53637. this.title = null;
  53638. /**
  53639. * @member {string} [WebPrintingJobLegendOptions.prototype.picAsUrl]
  53640. * @description 图例的图片 URL 地址。
  53641. */
  53642. this.picAsUrl = null;
  53643. /**
  53644. * @member {string} [WebPrintingJobLegendOptions.prototype.picAsBase64]
  53645. * @description 图例的 base64 位图片信息。
  53646. */
  53647. this.picAsBase64 = null;
  53648. /**
  53649. * @member {WebPrintingJobLayers} [WebPrintingJobLegendOptions.prototype.layers]
  53650. * @description 图例的布局业务图层参数类。
  53651. */
  53652. this.layers = null;
  53653. /**
  53654. * @member {WebPrintingJobCustomItems} [WebPrintingJobLegendOptions.prototype.customItems]
  53655. * @description 自定义图例元素参数类。
  53656. */
  53657. this.customItems = null;
  53658. this.CLASS_NAME = 'SuperMap.WebPrintingJobLegendOptions';
  53659. Util_Util.extend(this, option);
  53660. }
  53661. /**
  53662. * @function WebPrintingJobLegendOptions.prototype.destroy
  53663. * @description 释放资源,将引用资源的属性置空。
  53664. */
  53665. WebPrintingJobLegendOptions_createClass(WebPrintingJobLegendOptions, [{
  53666. key: "destroy",
  53667. value: function destroy() {
  53668. this.title = null;
  53669. this.picAsUrl = null;
  53670. this.picAsBase64 = null;
  53671. if (this.layers instanceof WebPrintingJobLayers) {
  53672. this.layers.destroy();
  53673. this.layers = null;
  53674. }
  53675. if (this.customItems instanceof WebPrintingJobCustomItems) {
  53676. this.customItems.destroy();
  53677. this.customItems = null;
  53678. }
  53679. }
  53680. /**
  53681. * @function WebPrintingJobLegendOptions.prototype.toJSON
  53682. * @description 将 WebPrintingJobLegendOptions 对象转化为 JSON 字符串。
  53683. * @returns {string} 转换后的 JSON 字符串。
  53684. */
  53685. }, {
  53686. key: "toJSON",
  53687. value: function toJSON() {
  53688. var params = {
  53689. title: this.title || ""
  53690. };
  53691. if (this.picAsUrl) {
  53692. params.picAsUrl = this.picAsUrl;
  53693. } else if (this.picAsBase64) {
  53694. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  53695. } else if (this.customItems) {
  53696. params.customItems = this.customItems;
  53697. }
  53698. return Util_Util.toJSON(params);
  53699. }
  53700. }]);
  53701. return WebPrintingJobLegendOptions;
  53702. }();
  53703. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLittleMapOptions.js
  53704. function WebPrintingJobLittleMapOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53705. 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); } }
  53706. 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; }
  53707. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53708. * This program are made available under the terms of the Apache License, Version 2.0
  53709. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53710. /**
  53711. * @class WebPrintingJobLittleMapOptions
  53712. * @deprecatedclass SuperMap.WebPrintingJobLittleMapOptions
  53713. * @classdesc Web 打印小地图参数类。
  53714. * @version 10.1.0
  53715. * @category iServer WebPrintingJob
  53716. * @param {Object} option - 参数。
  53717. * @param {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} option.center - 小地图的中心点。
  53718. * @param {number} [option.scale] - 小地图的比例尺。
  53719. * @param {Array.<string>} [option.layerNames] - 指定 WebMap中图层名称的列表,用于渲染小地图。
  53720. * @param {WebPrintingJobImage} [option.image] - 表达小地图的静态图类。
  53721. * @param {WebPrintingJobLayers} [option.layers] - 指定 WebMap 中的 layers 图层类。
  53722. * @usage
  53723. */
  53724. var WebPrintingJobLittleMapOptions = /*#__PURE__*/function () {
  53725. function WebPrintingJobLittleMapOptions(option) {
  53726. WebPrintingJobLittleMapOptions_classCallCheck(this, WebPrintingJobLittleMapOptions);
  53727. /**
  53728. * @member {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} WebPrintingJobLittleMapOptions.prototype.center
  53729. * @description 小地图的中心点。
  53730. */
  53731. this.center = null;
  53732. /**
  53733. * @member {number} [WebPrintingJobLittleMapOptions.prototype.scale]
  53734. * @description 小地图的比例尺。
  53735. */
  53736. this.scale = null;
  53737. /**
  53738. * @member {Array.<string>} WebPrintingJobLittleMapOptions.prototype.layerNames
  53739. * @description 指定 WebMap中图层名称的列表,用于渲染小地图。
  53740. */
  53741. this.layerNames = null;
  53742. /**
  53743. * @member {WebPrintingJobImage} [WebPrintingJobLittleMapOptions.prototype.image]
  53744. * @description 表达小地图的静态图类。暂不支持。
  53745. */
  53746. this.image = null;
  53747. /**
  53748. * @member {WebPrintingJobLayers} [WebPrintingJobLittleMapOptions.prototype.layers]
  53749. * @description 指定 WebMap 中的 layers 图层类。
  53750. */
  53751. this.layers = null;
  53752. this.CLASS_NAME = 'SuperMap.WebPrintingJobLittleMapOptions';
  53753. Util_Util.extend(this, option);
  53754. }
  53755. /**
  53756. * @function WebPrintingJobLittleMapOptions.prototype.destroy
  53757. * @description 释放资源,将引用资源的属性置空。
  53758. */
  53759. WebPrintingJobLittleMapOptions_createClass(WebPrintingJobLittleMapOptions, [{
  53760. key: "destroy",
  53761. value: function destroy() {
  53762. this.center = null;
  53763. this.scale = null;
  53764. this.layerNames = null;
  53765. if (this.image instanceof WebPrintingJobImage) {
  53766. this.image.destroy();
  53767. this.image = null;
  53768. }
  53769. if (this.layers instanceof WebPrintingJobLayers) {
  53770. this.layers.destroy();
  53771. this.layers = null;
  53772. }
  53773. }
  53774. /**
  53775. * @function WebPrintingJobLittleMapOptions.prototype.toJSON
  53776. * @description 将 WebPrintingJobLittleMapOptions 对象转化为 JSON 字符串。
  53777. * @returns {string} 转换后的 JSON 字符串。
  53778. */
  53779. }, {
  53780. key: "toJSON",
  53781. value: function toJSON() {
  53782. var params = {
  53783. scale: this.scale,
  53784. center: this.center
  53785. };
  53786. if (this.layerNames) {
  53787. params.layerNames = this.layerNames;
  53788. } else if (this.layers) {
  53789. params.layers = this.layers;
  53790. }
  53791. if (this.image) {
  53792. params.image = this.image;
  53793. }
  53794. return Util_Util.toJSON(params);
  53795. }
  53796. }]);
  53797. return WebPrintingJobLittleMapOptions;
  53798. }();
  53799. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobNorthArrowOptions.js
  53800. function WebPrintingJobNorthArrowOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53801. 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); } }
  53802. 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; }
  53803. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53804. * This program are made available under the terms of the Apache License, Version 2.0
  53805. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53806. /**
  53807. * @class WebPrintingJobNorthArrowOptions
  53808. * @deprecatedclass SuperMap.WebPrintingJobNorthArrowOptions
  53809. * @classdesc Web 打印地图指北针参数类。
  53810. * @version 10.1.0
  53811. * @category iServer WebPrintingJob
  53812. * @param {Object} option - 参数。
  53813. * @param {string} option.picAsUrl - 指北针的图片 URL 地址。
  53814. * @param {string} [option.picAsBase64] - 指北针的base64位图片信息。
  53815. * @usage
  53816. */
  53817. var WebPrintingJobNorthArrowOptions = /*#__PURE__*/function () {
  53818. function WebPrintingJobNorthArrowOptions(option) {
  53819. WebPrintingJobNorthArrowOptions_classCallCheck(this, WebPrintingJobNorthArrowOptions);
  53820. /**
  53821. * @member {string} WebPrintingJobNorthArrowOptions.prototype.picAsUrl
  53822. * @description 指北针的图片 URL 地址。
  53823. */
  53824. this.picAsUrl = null;
  53825. /**
  53826. * @member {string} [WebPrintingJobNorthArrowOptions.prototype.picAsBase64]
  53827. * @description 指北针的base64位图片信息。
  53828. */
  53829. this.picAsBase64 = null;
  53830. this.CLASS_NAME = 'SuperMap.WebPrintingJobNorthArrowOptions';
  53831. Util_Util.extend(this, option);
  53832. }
  53833. /**
  53834. * @function WebPrintingJobNorthArrowOptions.prototype.destroy
  53835. * @description 释放资源,将引用资源的属性置空。
  53836. */
  53837. WebPrintingJobNorthArrowOptions_createClass(WebPrintingJobNorthArrowOptions, [{
  53838. key: "destroy",
  53839. value: function destroy() {
  53840. this.picAsUrl = null;
  53841. this.picAsBase64 = null;
  53842. }
  53843. /**
  53844. * @function WebPrintingJobNorthArrowOptions.prototype.toJSON
  53845. * @description 将 WebPrintingJobNorthArrowOptions 对象转化为 JSON 字符串。
  53846. * @returns {string} 转换后的 JSON 字符串。
  53847. */
  53848. }, {
  53849. key: "toJSON",
  53850. value: function toJSON() {
  53851. var params = {};
  53852. if (this.picAsUrl) {
  53853. params.picAsUrl = this.picAsUrl;
  53854. } else if (this.picAsBase64) {
  53855. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  53856. }
  53857. return Util_Util.toJSON(params);
  53858. }
  53859. }]);
  53860. return WebPrintingJobNorthArrowOptions;
  53861. }();
  53862. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobScaleBarOptions.js
  53863. function WebPrintingJobScaleBarOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53864. 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); } }
  53865. 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; }
  53866. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53867. * This program are made available under the terms of the Apache License, Version 2.0
  53868. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53869. /**
  53870. * @class WebPrintingJobScaleBarOptions
  53871. * @deprecatedclass SuperMap.WebPrintingJobScaleBarOptions
  53872. * @classdesc Web 打印比例尺参数类。
  53873. * @category iServer WebPrintingJob
  53874. * @version 10.1.0
  53875. * @param {Object} option - 参数。
  53876. * @param {string} [option.scaleText] - 比例尺文本信息。例如:1:1000000。
  53877. * @param {WebScaleOrientationType} [option.orientation] - 比例尺的方位样式。
  53878. * @param {WebScaleType} [option.type] - 比例尺的样式。
  53879. * @param {number} [option.intervals] - 比例尺条的段数。
  53880. * @param {WebScaleUnit} [option.unit] - 比例尺的单位制。
  53881. * @usage
  53882. */
  53883. var WebPrintingJobScaleBarOptions = /*#__PURE__*/function () {
  53884. function WebPrintingJobScaleBarOptions(option) {
  53885. WebPrintingJobScaleBarOptions_classCallCheck(this, WebPrintingJobScaleBarOptions);
  53886. /**
  53887. * @member {string} WebPrintingJobScaleBarOptions.prototype.scaleText
  53888. * @description 比例尺文本信息。
  53889. */
  53890. this.scaleText = null;
  53891. /**
  53892. * @member {WebScaleOrientationType} [WebPrintingJobScaleBarOptions.prototype.orientation]
  53893. * @description 比例尺的方位样式。
  53894. */
  53895. this.orientation = null;
  53896. /**
  53897. * @member {WebScaleType} [WebPrintingJobScaleBarOptions.prototype.type]
  53898. * @description 比例尺的样式。
  53899. */
  53900. this.type = null;
  53901. /**
  53902. * @member {Object} [WebPrintingJobScaleBarOptions.prototype.intervals]
  53903. * @description 比例尺条的段数。
  53904. */
  53905. this.intervals = null;
  53906. /**
  53907. * @member {WebScaleUnit} [WebPrintingJobScaleBarOptions.prototype.unit]
  53908. * @description 比例尺的单位制。
  53909. */
  53910. this.unit = null;
  53911. this.CLASS_NAME = 'SuperMap.WebPrintingJobScaleBarOptions';
  53912. Util_Util.extend(this, option);
  53913. }
  53914. /**
  53915. * @function WebPrintingJobScaleBarOptions.prototype.destroy
  53916. * @description 释放资源,将引用资源的属性置空。
  53917. */
  53918. WebPrintingJobScaleBarOptions_createClass(WebPrintingJobScaleBarOptions, [{
  53919. key: "destroy",
  53920. value: function destroy() {
  53921. this.scaleText = null;
  53922. this.orientation = null;
  53923. this.type = null;
  53924. this.intervals = null;
  53925. this.unit = null;
  53926. }
  53927. /**
  53928. * @function WebPrintingJobScaleBarOptions.prototype.toJSON
  53929. * @description 将 WebPrintingJobScaleBarOptions 对象转化为 JSON 字符串。
  53930. * @returns {string} 转换后的 JSON 字符串。
  53931. */
  53932. }, {
  53933. key: "toJSON",
  53934. value: function toJSON() {
  53935. var params = {
  53936. scaleText: this.scaleText || "",
  53937. type: this.type || "BAR",
  53938. intervals: this.intervals || "",
  53939. unit: this.unit || "METER"
  53940. };
  53941. if (this.orientation) {
  53942. params.orientation = this.orientation;
  53943. }
  53944. return Util_Util.toJSON(params);
  53945. }
  53946. }]);
  53947. return WebPrintingJobScaleBarOptions;
  53948. }();
  53949. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobContent.js
  53950. function WebPrintingJobContent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53951. 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); } }
  53952. 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; }
  53953. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  53954. * This program are made available under the terms of the Apache License, Version 2.0
  53955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53956. /**
  53957. * @class WebPrintingJobContent
  53958. * @deprecatedclass SuperMap.WebPrintingJobContent
  53959. * @classdesc Web 打印内容参数类。
  53960. * @version 10.1.0
  53961. * @category iServer WebPrintingJob
  53962. * @param {Object} option - 参数。
  53963. * @param {string} option.type - Web 打印内容支持的类型。目前支持的类型:WEBMAP。
  53964. * @param {string} [option.url] - 待打印的 SuperMap iPortal WebMap 的 URL 地址。例如:http://supermapiportal:8190/iportal/web/maps/{mapid}/map.rjson 。
  53965. * @param {string} [option.token] - 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  53966. * @param {WebMapSummaryObject} [option.value] - 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 JSON 表达。如果已填了 URL 参数,此参数可不传。
  53967. * @usage
  53968. */
  53969. var WebPrintingJobContent = /*#__PURE__*/function () {
  53970. function WebPrintingJobContent(option) {
  53971. WebPrintingJobContent_classCallCheck(this, WebPrintingJobContent);
  53972. /**
  53973. * @member {string} WebPrintingJobContent.prototype.type
  53974. * @description Web 打印内容支持的类型。
  53975. */
  53976. this.type = null;
  53977. /**
  53978. * @member {string} [WebPrintingJobContent.prototype.url]
  53979. * @description 待打印的 SuperMap iPortal WebMap 的 URL 地址。
  53980. */
  53981. this.url = null;
  53982. /**
  53983. * @member {string} [WebPrintingJobContent.prototype.token]
  53984. * @description 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  53985. */
  53986. this.token = null;
  53987. /**
  53988. * @member {WebMapSummaryObject} [WebPrintingJobContent.prototype.value]
  53989. * @description 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 JSON 表达。
  53990. */
  53991. this.value = null;
  53992. this.CLASS_NAME = 'SuperMap.WebPrintingJobContent';
  53993. Util_Util.extend(this, option);
  53994. }
  53995. /**
  53996. * @function WebPrintingJobContent.prototype.destroy
  53997. * @description 释放资源,将引用资源的属性置空。
  53998. */
  53999. WebPrintingJobContent_createClass(WebPrintingJobContent, [{
  54000. key: "destroy",
  54001. value: function destroy() {
  54002. this.type = false || "WEBMAP";
  54003. this.url = null;
  54004. this.token = null;
  54005. this.value = null;
  54006. }
  54007. /**
  54008. * @function WebPrintingJobContent.prototype.toJSON
  54009. * @description 将 WebPrintingJobContent 对象转化为 JSON 字符串。
  54010. * @returns {string} 转换后的 JSON 字符串。
  54011. */
  54012. }, {
  54013. key: "toJSON",
  54014. value: function toJSON() {
  54015. var params = {
  54016. type: this.type
  54017. };
  54018. if (this.token) {
  54019. params.token = this.token;
  54020. }
  54021. if (this.url) {
  54022. params.url = this.url;
  54023. } else if (this.value) {
  54024. params.value = this.value;
  54025. }
  54026. return Util_Util.toJSON(params);
  54027. }
  54028. }]);
  54029. return WebPrintingJobContent;
  54030. }();
  54031. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayoutOptions.js
  54032. function WebPrintingJobLayoutOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54033. 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); } }
  54034. 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; }
  54035. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54036. * This program are made available under the terms of the Apache License, Version 2.0
  54037. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54038. /**
  54039. * @class WebPrintingJobLayoutOptions
  54040. * @deprecatedclass SuperMap.WebPrintingJobLayoutOptions
  54041. * @classdesc Web 打印的布局参数类。
  54042. * @version 10.1.0
  54043. * @category iServer WebPrintingJob
  54044. * @param {Object} option - 参数。
  54045. * @param {string} option.templateName - 布局模板的名称。
  54046. * @param {string} option.title - 地图主标题名称。
  54047. * @param {string} option.subTitle - 地图副标题名称。
  54048. * @param {string} option.author - 作者名称。
  54049. * @param {string} option.copyright - 版权信息。
  54050. * @param {WebPrintingJobLittleMapOptions} option.littleMapOptions - 小地图参数类。
  54051. * @param {WebPrintingJobLegendOptions} option.legendOptions - 图例参数类。
  54052. * @param {WebPrintingJobScaleBarOptions} [option.scaleBarOptions] - 地图比例尺参数类。
  54053. * @param {WebPrintingJobNorthArrowOptions} [option.northArrowOptions] - 地图指北针参数类。
  54054. * @usage
  54055. */
  54056. var WebPrintingJobLayoutOptions = /*#__PURE__*/function () {
  54057. function WebPrintingJobLayoutOptions(option) {
  54058. WebPrintingJobLayoutOptions_classCallCheck(this, WebPrintingJobLayoutOptions);
  54059. /**
  54060. * @member {string} WebPrintingJobLayoutOptions.prototype.templateName
  54061. * @description 布局模板的名称。
  54062. */
  54063. this.templateName = null;
  54064. /**
  54065. * @member {string} WebPrintingJobLayoutOptions.prototype.title
  54066. * @description 地图主标题名称。
  54067. */
  54068. this.title = null;
  54069. /**
  54070. * @member {string} WebPrintingJobLayoutOptions.prototype.subTitle
  54071. * @description 地图副标题名称。
  54072. */
  54073. this.subTitle = null;
  54074. /**
  54075. * @member {string} WebPrintingJobLayoutOptions.prototype.author
  54076. * @description 地图作者名称。
  54077. */
  54078. this.author = null;
  54079. /**
  54080. * @member {string} WebPrintingJobLayoutOptions.prototype.copyright
  54081. * @description 地图版权信息。
  54082. */
  54083. this.copyright = null;
  54084. /**
  54085. * @member {WebPrintingJobScaleBarOptions} [WebPrintingJobLayoutOptions.prototype.scaleBarOptions]
  54086. * @description 地图比例尺参数类。
  54087. */
  54088. this.scaleBarOptions = null;
  54089. /**
  54090. * @member {WebPrintingJobNorthArrowOptions} [WebPrintingJobLayoutOptions.prototype.northArrowOptions]
  54091. * @description 地图指北针参数类。
  54092. */
  54093. this.northArrowOptions = null;
  54094. /**
  54095. * @member {WebPrintingJobLittleMapOptions} WebPrintingJobLayoutOptions.prototype.littleMapOptions
  54096. * @description 小地图参数类。
  54097. */
  54098. this.littleMapOptions = null;
  54099. /**
  54100. * @member {WebPrintingJobLegendOptions} WebPrintingJobLayoutOptions.prototype.legendOptions
  54101. * @description 图例参数类。
  54102. */
  54103. this.legendOptions = null;
  54104. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayoutOptions';
  54105. Util_Util.extend(this, option);
  54106. }
  54107. /**
  54108. * @function WebPrintingJobLayoutOptions.prototype.destroy
  54109. * @description 释放资源,将引用资源的属性置空。
  54110. */
  54111. WebPrintingJobLayoutOptions_createClass(WebPrintingJobLayoutOptions, [{
  54112. key: "destroy",
  54113. value: function destroy() {
  54114. this.templateName = null;
  54115. this.title = null;
  54116. this.subTitle = null;
  54117. this.author = null;
  54118. this.copyright = null;
  54119. if (this.scaleBarOptions instanceof WebPrintingJobScaleBarOptions) {
  54120. this.scaleBarOptions.destroy();
  54121. this.scaleBarOptions = null;
  54122. }
  54123. if (this.northArrowOptions instanceof WebPrintingJobNorthArrowOptions) {
  54124. this.northArrowOptions.destroy();
  54125. this.northArrowOptions = null;
  54126. }
  54127. if (this.littleMapOptions instanceof WebPrintingJobLittleMapOptions) {
  54128. this.littleMapOptions.destroy();
  54129. this.littleMapOptions = null;
  54130. }
  54131. if (this.legendOptions instanceof WebPrintingJobLegendOptions) {
  54132. this.legendOptions.destroy();
  54133. this.legendOptions = null;
  54134. }
  54135. }
  54136. /**
  54137. * @function WebPrintingJobLayoutOptions.prototype.toJSON
  54138. * @description 将 WebPrintingJobLayoutOptions 对象转化为 JSON 字符串。
  54139. * @returns {string} 转换后的 JSON 字符串。
  54140. */
  54141. }, {
  54142. key: "toJSON",
  54143. value: function toJSON() {
  54144. var params = {
  54145. templateName: this.templateName,
  54146. title: this.title,
  54147. subTitle: this.subTitle,
  54148. author: this.author,
  54149. copyright: this.copyright
  54150. };
  54151. if (this.scaleBarOptions) {
  54152. params.scaleBarOptions = this.scaleBarOptions;
  54153. }
  54154. if (this.northArrowOptions) {
  54155. params.northArrowOptions = this.northArrowOptions;
  54156. }
  54157. if (this.littleMapOptions) {
  54158. params.littleMapOptions = this.littleMapOptions;
  54159. }
  54160. if (this.legendOptions) {
  54161. params.legendOptions = this.legendOptions;
  54162. }
  54163. return Util_Util.toJSON(params);
  54164. }
  54165. }]);
  54166. return WebPrintingJobLayoutOptions;
  54167. }();
  54168. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobExportOptions.js
  54169. function WebPrintingJobExportOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54170. 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); } }
  54171. 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; }
  54172. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54173. * This program are made available under the terms of the Apache License, Version 2.0
  54174. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54175. /**
  54176. * @class WebPrintingJobExportOptions
  54177. * @deprecatedclass SuperMap.WebPrintingJobExportOptions
  54178. * @classdesc Web 打印的输出参数类。
  54179. * @version 10.1.0
  54180. * @category iServer WebPrintingJob
  54181. * @param {Object} option - 参数。
  54182. * @param {WebExportFormatType} option.format - Web 打印输出的格式,目前支持:PNG、PDF。
  54183. * @param {number} [option.dpi=96] - Web 打印输出的分辨率,单位为每英寸点数。默认值为 96 DPI。
  54184. * @param {number} [option.scale] - Web 打印输出的地图比例尺。
  54185. * @param {number} [option.rotation] - Web 打印输出的地图角度。
  54186. * @param {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [option.center] - Web 打印输出的地图中心点。
  54187. * @usage
  54188. */
  54189. var WebPrintingJobExportOptions = /*#__PURE__*/function () {
  54190. function WebPrintingJobExportOptions(option) {
  54191. WebPrintingJobExportOptions_classCallCheck(this, WebPrintingJobExportOptions);
  54192. /**
  54193. * @member {WebExportFormatType} WebPrintingJobExportOptions.prototype.format
  54194. * @description Web 打印输出的格式。
  54195. */
  54196. this.format = null;
  54197. /**
  54198. * @member {number} [WebPrintingJobExportOptions.prototype.dpi=96]
  54199. * @description Web 打印输出的分辨率,单位为每英寸点数。
  54200. */
  54201. this.dpi = 96;
  54202. /**
  54203. * @member {number} [WebPrintingJobExportOptions.prototype.scale]
  54204. * @description Web 打印输出的地图比例尺。
  54205. */
  54206. this.scale = null;
  54207. /**
  54208. * @member {number} [WebPrintingJobExportOptions.prototype.rotation]
  54209. * @description Web 打印输出的地图角度。
  54210. */
  54211. this.rotation = null;
  54212. /**
  54213. * @member {GeometryPoint|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [WebPrintingJobExportOptions.prototype.center]
  54214. * @description Web 打印输出的地图中心点。
  54215. */
  54216. this.center = null;
  54217. this.CLASS_NAME = 'SuperMap.WebPrintingJobExportOptions';
  54218. Util_Util.extend(this, option);
  54219. }
  54220. /**
  54221. * @function WebPrintingJobExportOptions.prototype.destroy
  54222. * @description 释放资源,将引用资源的属性置空。
  54223. */
  54224. WebPrintingJobExportOptions_createClass(WebPrintingJobExportOptions, [{
  54225. key: "destroy",
  54226. value: function destroy() {
  54227. this.format = null;
  54228. this.dpi = null;
  54229. this.scale = null;
  54230. this.rotation = null;
  54231. this.center = null;
  54232. this.outputSize = null;
  54233. }
  54234. /**
  54235. * @function WebPrintingJobExportOptions.prototype.toJSON
  54236. * @description 将 WebPrintingJobExportOptions 对象转化为 JSON 字符串。
  54237. * @returns {string} 转换后的 JSON 字符串。
  54238. */
  54239. }, {
  54240. key: "toJSON",
  54241. value: function toJSON() {
  54242. var params = {
  54243. format: this.format || "PDF",
  54244. dpi: this.dpi,
  54245. scale: this.scale,
  54246. center: this.center
  54247. };
  54248. if (this.rotation) {
  54249. params.rotation = this.rotation;
  54250. }
  54251. if (this.outputSize) {
  54252. params.outputSize = this.outputSize;
  54253. }
  54254. return Util_Util.toJSON(params);
  54255. }
  54256. }]);
  54257. return WebPrintingJobExportOptions;
  54258. }();
  54259. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobParameters.js
  54260. function WebPrintingJobParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54261. 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); } }
  54262. 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; }
  54263. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54264. * This program are made available under the terms of the Apache License, Version 2.0
  54265. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54266. /**
  54267. * @class WebPrintingJobParameters
  54268. * @deprecatedclass SuperMap.WebPrintingJobParameters
  54269. * @category iServer WebPrintingJob
  54270. * @version 10.1.0
  54271. * @classdesc Web 打印参数类。
  54272. * @param {Object} options - 参数。
  54273. * @param {WebPrintingJobContent} options.content - Web 打印的内容类。
  54274. * @param {WebPrintingJobLayoutOptions} options.layoutOptions - Web 打印的布局类,包含各种布局元素的设置。
  54275. * @param {WebPrintingJobExportOptions} options.exportOptions - Web 打印的输出类,包含 DPI、页面大小等。
  54276. * @usage
  54277. */
  54278. var WebPrintingJobParameters = /*#__PURE__*/function () {
  54279. function WebPrintingJobParameters(options) {
  54280. WebPrintingJobParameters_classCallCheck(this, WebPrintingJobParameters);
  54281. if (!options) {
  54282. return;
  54283. }
  54284. /**
  54285. * @member {WebPrintingJobContent} WebPrintingJobParameters.prototype.content
  54286. * @description Web 打印的内容类。
  54287. */
  54288. this.content = null;
  54289. /**
  54290. * @member {WebPrintingJobLayoutOptions} WebPrintingJobParameters.prototype.layoutOptions
  54291. * @description Web 打印的布局类,包含各种布局元素的设置。
  54292. */
  54293. this.layoutOptions = null;
  54294. /**
  54295. * @member {WebPrintingJobExportOptions} WebPrintingJobParameters.prototype.exportOptions
  54296. * @description Web 打印的输出类,包含 DPI、页面大小等。
  54297. */
  54298. this.exportOptions = null;
  54299. Util_Util.extend(this, options);
  54300. this.CLASS_NAME = 'SuperMap.WebPrintingJobParameters';
  54301. }
  54302. /**
  54303. * @function WebPrintingJobParameters.prototype.destroy
  54304. * @description 释放资源,将引用资源的属性置空。
  54305. */
  54306. WebPrintingJobParameters_createClass(WebPrintingJobParameters, [{
  54307. key: "destroy",
  54308. value: function destroy() {
  54309. if (this.content instanceof WebPrintingJobContent) {
  54310. this.content.destroy();
  54311. this.content = null;
  54312. }
  54313. if (this.layoutOptions instanceof WebPrintingJobLayoutOptions) {
  54314. this.layoutOptions.destroy();
  54315. this.layoutOptions = null;
  54316. }
  54317. if (this.exportOptions instanceof WebPrintingJobExportOptions) {
  54318. this.exportOptions.destroy();
  54319. this.exportOptions = null;
  54320. }
  54321. }
  54322. }]);
  54323. return WebPrintingJobParameters;
  54324. }();
  54325. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingService.js
  54326. 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); }
  54327. function WebPrintingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54328. 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); } }
  54329. 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; }
  54330. 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); }
  54331. function WebPrintingService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = WebPrintingService_getPrototypeOf(object); if (object === null) break; } return object; }
  54332. 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); }
  54333. 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); }
  54334. 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); }; }
  54335. 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); }
  54336. function WebPrintingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54337. 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; } }
  54338. function WebPrintingService_getPrototypeOf(o) { WebPrintingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingService_getPrototypeOf(o); }
  54339. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54340. * This program are made available under the terms of the Apache License, Version 2.0
  54341. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54342. /**
  54343. * @class WebPrintingService
  54344. * @deprecatedclass SuperMap.WebPrintingService
  54345. * @category iServer WebPrintingJob
  54346. * @version 10.1.0
  54347. * @classdesc 打印地图服务基类。
  54348. * @extends {CommonServiceBase}
  54349. * @param {string} url - 服务地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  54350. * @param {Object} options - 参数。
  54351. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  54352. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  54353. * @param {Object} [options.headers] - 请求头。
  54354. * @usage
  54355. */
  54356. var WebPrintingService = /*#__PURE__*/function (_CommonServiceBase) {
  54357. WebPrintingService_inherits(WebPrintingService, _CommonServiceBase);
  54358. var _super = WebPrintingService_createSuper(WebPrintingService);
  54359. function WebPrintingService(url, options) {
  54360. var _this;
  54361. WebPrintingService_classCallCheck(this, WebPrintingService);
  54362. _this = _super.call(this, url, options);
  54363. if (options) {
  54364. Util_Util.extend(WebPrintingService_assertThisInitialized(_this), options);
  54365. }
  54366. _this.eventCount = 0;
  54367. _this.CLASS_NAME = 'SuperMap.WebPrintingService';
  54368. if (!_this.url) {
  54369. return WebPrintingService_possibleConstructorReturn(_this);
  54370. }
  54371. return _this;
  54372. }
  54373. /**
  54374. * @function WebPrintingService.prototype.destroy
  54375. * @description 释放资源,将引用资源的属性置空。
  54376. */
  54377. WebPrintingService_createClass(WebPrintingService, [{
  54378. key: "destroy",
  54379. value: function destroy() {
  54380. WebPrintingService_get(WebPrintingService_getPrototypeOf(WebPrintingService.prototype), "destroy", this).call(this);
  54381. }
  54382. /**
  54383. * @function WebPrintingService.prototype.createWebPrintingJob
  54384. * @description 创建 Web 打印任务。
  54385. * @param {WebPrintingJobParameters} params - Web 打印的请求参数。
  54386. */
  54387. }, {
  54388. key: "createWebPrintingJob",
  54389. value: function createWebPrintingJob(params, callback) {
  54390. if (!params) {
  54391. return;
  54392. }
  54393. if (params.layoutOptions) {
  54394. if (params.layoutOptions.legendOptions) {
  54395. !params.layoutOptions.legendOptions.title && (params.layoutOptions.legendOptions.title = '');
  54396. params.layoutOptions.legendOptions.picAsBase64 = params.layoutOptions.legendOptions.picAsBase64 && params.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/, '');
  54397. if (params.layoutOptions.legendOptions.customItems && params.layoutOptions.legendOptions.customItems.hasOwnProperty('picAsBase64')) {
  54398. params.layoutOptions.legendOptions.customItems.picAsBase64 = params.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/, '');
  54399. }
  54400. }
  54401. }
  54402. this.processAsync('jobs', 'POST', callback, params);
  54403. }
  54404. /**
  54405. * @function WebPrintingService.prototype.getPrintingJob
  54406. * @description 获取 Web 打印输出文档任务。
  54407. * @param {string} jobId - Web 打印任务 ID
  54408. */
  54409. }, {
  54410. key: "getPrintingJob",
  54411. value: function getPrintingJob(jobId, callback) {
  54412. var me = this;
  54413. me.processAsync("jobs/".concat(jobId), 'GET', function (result) {
  54414. me.rollingProcess(result, me._processUrl("jobs/".concat(jobId)), callback);
  54415. });
  54416. }
  54417. /**
  54418. * @function WebPrintingService.prototype.getPrintingJobResult
  54419. * @description 获取 Web 打印任务的输出文档。
  54420. * @param {string} jobId - Web 打印输入文档任务 ID。
  54421. */
  54422. }, {
  54423. key: "getPrintingJobResult",
  54424. value: function getPrintingJobResult(jobId, callback) {
  54425. this.processAsync("jobs/".concat(jobId, "/result"), 'GET', callback);
  54426. }
  54427. /**
  54428. * @function WebPrintingService.prototype.getLayoutTemplates
  54429. * @description 查询 Web 打印服务所有可用的模板信息。
  54430. */
  54431. }, {
  54432. key: "getLayoutTemplates",
  54433. value: function getLayoutTemplates(callback) {
  54434. this.processAsync('layouts', 'GET', callback);
  54435. }
  54436. /**
  54437. * @function WebPrintingService.prototype.rollingProcess
  54438. * @description 轮询查询 Web 打印任务。
  54439. * @param {Object} result - 服务器返回的结果对象。
  54440. */
  54441. }, {
  54442. key: "rollingProcess",
  54443. value: function rollingProcess(result, url, callback) {
  54444. var me = this;
  54445. if (!result) {
  54446. return;
  54447. }
  54448. var id = setInterval(function () {
  54449. var eventId = ++me.eventCount;
  54450. var eventListeners = {
  54451. scope: this,
  54452. processCompleted: function processCompleted(result) {
  54453. if (eventId === result.result.eventId && callback) {
  54454. delete result.result.eventId;
  54455. callback(result);
  54456. me.events.un(eventListeners);
  54457. return false;
  54458. }
  54459. },
  54460. processFailed: function processFailed(result) {
  54461. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  54462. callback(result);
  54463. me.events.un(eventListeners);
  54464. return false;
  54465. }
  54466. }
  54467. };
  54468. me.events.on(eventListeners);
  54469. me.request({
  54470. url: url,
  54471. method: 'GET',
  54472. scope: me,
  54473. success: function success(result, options) {
  54474. result.eventId = eventId;
  54475. switch (result.status) {
  54476. case 'FINISHED':
  54477. clearInterval(id);
  54478. me.serviceProcessCompleted(result, options);
  54479. break;
  54480. case 'ERROR':
  54481. clearInterval(id);
  54482. me.serviceProcessFailed(result, options);
  54483. break;
  54484. case 'RUNNING':
  54485. me.events.triggerEvent('processRunning', result);
  54486. break;
  54487. }
  54488. },
  54489. failure: me.serviceProcessFailed
  54490. });
  54491. }, 1000);
  54492. }
  54493. }, {
  54494. key: "processAsync",
  54495. value: function processAsync(url, method, callback, params) {
  54496. var eventId = ++this.eventCount;
  54497. var eventListeners = {
  54498. scope: this,
  54499. processCompleted: function processCompleted(result) {
  54500. if (eventId === result.result.eventId && callback) {
  54501. delete result.result.eventId;
  54502. callback(result);
  54503. this.events && this.events.un(eventListeners);
  54504. return false;
  54505. }
  54506. },
  54507. processFailed: function processFailed(result) {
  54508. if (eventId === result.error.eventId || eventId === result.eventId) {
  54509. callback(result);
  54510. this.events && this.events.un(eventListeners);
  54511. return false;
  54512. }
  54513. }
  54514. };
  54515. this.events.on(eventListeners);
  54516. var me = this;
  54517. var requestConfig = {
  54518. url: me._processUrl(url),
  54519. method: method,
  54520. scope: me,
  54521. success: function success(result, options) {
  54522. result.eventId = eventId;
  54523. this.serviceProcessCompleted(result, options);
  54524. },
  54525. failure: function failure(result, options) {
  54526. if (result.error) {
  54527. result.error.eventId = eventId;
  54528. }
  54529. result.eventId = eventId;
  54530. this.serviceProcessFailed(result, options);
  54531. }
  54532. };
  54533. params && (requestConfig.data = Util_Util.toJSON(params));
  54534. me.request(requestConfig);
  54535. }
  54536. }, {
  54537. key: "_processUrl",
  54538. value: function _processUrl(appendContent) {
  54539. if (appendContent) {
  54540. return Util_Util.urlPathAppend(this.url, appendContent);
  54541. }
  54542. return this.url;
  54543. }
  54544. }]);
  54545. return WebPrintingService;
  54546. }(CommonServiceBase);
  54547. ;// CONCATENATED MODULE: ./src/common/iServer/ImageCollectionService.js
  54548. 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); }
  54549. function ImageCollectionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54550. 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); } }
  54551. 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; }
  54552. 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); }
  54553. function ImageCollectionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ImageCollectionService_getPrototypeOf(object); if (object === null) break; } return object; }
  54554. 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); }
  54555. 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); }
  54556. 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); }; }
  54557. 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); }
  54558. function ImageCollectionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54559. 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; } }
  54560. function ImageCollectionService_getPrototypeOf(o) { ImageCollectionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageCollectionService_getPrototypeOf(o); }
  54561. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54562. * This program are made available under the terms of the Apache License, Version 2.0
  54563. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54564. /**
  54565. * @class ImageCollectionService
  54566. * @deprecatedclass SuperMap.ImageCollectionService
  54567. * @classdesc 影像集合服务类。
  54568. * @version 10.2.0
  54569. * @category iServer Image
  54570. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  54571. * @param {Object} options - 参数。
  54572. * @param {string} options.collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  54573. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  54574. * @param {Object} [options.headers] - 请求头。
  54575. * @extends {CommonServiceBase}
  54576. * @usage
  54577. */
  54578. var ImageCollectionService = /*#__PURE__*/function (_CommonServiceBase) {
  54579. ImageCollectionService_inherits(ImageCollectionService, _CommonServiceBase);
  54580. var _super = ImageCollectionService_createSuper(ImageCollectionService);
  54581. function ImageCollectionService(url, options) {
  54582. var _this;
  54583. ImageCollectionService_classCallCheck(this, ImageCollectionService);
  54584. _this = _super.call(this, url, options);
  54585. _this.options = options || {};
  54586. if (options) {
  54587. Util_Util.extend(ImageCollectionService_assertThisInitialized(_this), options);
  54588. }
  54589. _this.eventCount = 0;
  54590. _this.CLASS_NAME = 'SuperMap.ImageCollectionService';
  54591. return _this;
  54592. }
  54593. /**
  54594. * @function ImageCollectionService.prototype.destroy
  54595. * @override
  54596. */
  54597. ImageCollectionService_createClass(ImageCollectionService, [{
  54598. key: "destroy",
  54599. value: function destroy() {
  54600. ImageCollectionService_get(ImageCollectionService_getPrototypeOf(ImageCollectionService.prototype), "destroy", this).call(this);
  54601. }
  54602. /**
  54603. * @function ImageCollectionService.prototype.getLegend
  54604. * @description 返回当前影像集合的图例信息。默认为服务发布所配置的风格,支持根据风格参数生成新的图例。
  54605. * @param {Object} queryParams query参数。
  54606. * @param {ImageRenderingRule} [queryParams.renderingRule] renderingRule 对象,用来指定影像的渲染风格,从而确定图例内容。影像的渲染风格包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。该参数未设置时,将使用发布服务时所配置的风格。
  54607. */
  54608. }, {
  54609. key: "getLegend",
  54610. value: function getLegend(queryParams, callback) {
  54611. var me = this;
  54612. var pathParams = {
  54613. collectionId: me.options.collectionId
  54614. };
  54615. var path = Util_Util.convertPath('/collections/{collectionId}/legend', pathParams);
  54616. var url = Util_Util.urlPathAppend(me.url, path);
  54617. this._processAsync({
  54618. url: url,
  54619. method: 'GET',
  54620. params: queryParams,
  54621. callback: callback
  54622. });
  54623. }
  54624. /**
  54625. * @function ImageCollectionService.prototype.getStatistics
  54626. * @description 返回当前影像集合的统计信息。包括文件数量,文件大小等信息。
  54627. */
  54628. }, {
  54629. key: "getStatistics",
  54630. value: function getStatistics(callback) {
  54631. var me = this;
  54632. var pathParams = {
  54633. collectionId: me.options.collectionId
  54634. };
  54635. var path = Util_Util.convertPath('/collections/{collectionId}/statistics', pathParams);
  54636. var url = Util_Util.urlPathAppend(me.url, path);
  54637. this._processAsync({
  54638. url: url,
  54639. method: 'GET',
  54640. callback: callback
  54641. });
  54642. }
  54643. /**
  54644. * @function ImageCollectionService.prototype.getTileInfo
  54645. * @description 返回影像集合所提供的服务瓦片的信息,包括:每层瓦片的分辨率,比例尺等信息,方便前端进行图层叠加。
  54646. */
  54647. }, {
  54648. key: "getTileInfo",
  54649. value: function getTileInfo(callback) {
  54650. var me = this;
  54651. var pathParams = {
  54652. collectionId: me.options.collectionId
  54653. };
  54654. var path = Util_Util.convertPath('/collections/{collectionId}/tileInfo', pathParams);
  54655. var url = Util_Util.urlPathAppend(me.url, path);
  54656. this._processAsync({
  54657. url: url,
  54658. method: 'GET',
  54659. callback: callback
  54660. });
  54661. }
  54662. /**
  54663. * @function ImageCollectionService.prototype.deleteItemByID
  54664. * @description 删除影像集合中指定 ID 的 Item,即从影像集合中删除指定的影像。
  54665. * @param {string} featureId Feature 的本地标识符。
  54666. */
  54667. }, {
  54668. key: "deleteItemByID",
  54669. value: function deleteItemByID(featureId, callback) {
  54670. var me = this;
  54671. var pathParams = {
  54672. collectionId: me.options.collectionId,
  54673. featureId: featureId
  54674. };
  54675. var path = Util_Util.convertPath('/collections/{collectionId}/items/{featureId}', pathParams);
  54676. var url = Util_Util.urlPathAppend(me.url, path);
  54677. this._processAsync({
  54678. url: url,
  54679. method: 'DELETE',
  54680. callback: callback
  54681. });
  54682. }
  54683. /**
  54684. * @function ImageCollectionService.prototype.getItemByID
  54685. * @description 返回指定ID(`collectionId`)的影像集合中的指定ID(`featureId`)的Item对象,即返回影像集合中指定的影像。
  54686. * @param {string} featureId Feature 的本地标识符。
  54687. */
  54688. }, {
  54689. key: "getItemByID",
  54690. value: function getItemByID(featureId, callback) {
  54691. var me = this;
  54692. var pathParams = {
  54693. collectionId: me.options.collectionId,
  54694. featureId: featureId
  54695. };
  54696. var path = Util_Util.convertPath('/collections/{collectionId}/items/{featureId}', pathParams);
  54697. var url = Util_Util.urlPathAppend(me.url, path);
  54698. this._processAsync({
  54699. url: url,
  54700. method: 'GET',
  54701. callback: callback
  54702. });
  54703. }
  54704. }, {
  54705. key: "_processAsync",
  54706. value: function _processAsync(_ref) {
  54707. var url = _ref.url,
  54708. method = _ref.method,
  54709. callback = _ref.callback,
  54710. params = _ref.params;
  54711. var eventId = ++this.eventCount;
  54712. var eventListeners = {
  54713. scope: this,
  54714. processCompleted: function processCompleted(result) {
  54715. if (eventId === result.result.eventId && callback) {
  54716. delete result.result.eventId;
  54717. callback(result);
  54718. this.events && this.events.un(eventListeners);
  54719. return false;
  54720. }
  54721. },
  54722. processFailed: function processFailed(result) {
  54723. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  54724. callback(result);
  54725. this.events && this.events.un(eventListeners);
  54726. return false;
  54727. }
  54728. }
  54729. };
  54730. this.events.on(eventListeners);
  54731. this.request({
  54732. method: method || 'GET',
  54733. url: url,
  54734. params: params,
  54735. scope: this,
  54736. success: function success(result, options) {
  54737. result.eventId = eventId;
  54738. this.serviceProcessCompleted(result, options);
  54739. },
  54740. failure: function failure(result, options) {
  54741. if (result.error) {
  54742. result.error.eventId = eventId;
  54743. }
  54744. result.eventId = eventId;
  54745. this.serviceProcessFailed(result, options);
  54746. }
  54747. });
  54748. }
  54749. }]);
  54750. return ImageCollectionService;
  54751. }(CommonServiceBase);
  54752. ;// CONCATENATED MODULE: ./src/common/iServer/ImageService.js
  54753. 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); }
  54754. 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; }
  54755. 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; }
  54756. 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; }
  54757. function ImageService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54758. 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); } }
  54759. 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; }
  54760. 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); }
  54761. function ImageService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ImageService_getPrototypeOf(object); if (object === null) break; } return object; }
  54762. 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); }
  54763. 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); }
  54764. 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); }; }
  54765. 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); }
  54766. function ImageService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54767. 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; } }
  54768. function ImageService_getPrototypeOf(o) { ImageService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ImageService_getPrototypeOf(o); }
  54769. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54770. * This program are made available under the terms of the Apache License, Version 2.0
  54771. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54772. /**
  54773. * @class ImageService
  54774. * @deprecatedclass SuperMap.ImageService
  54775. * @classdesc 影像服务类。
  54776. * @version 10.2.0
  54777. * @category iServer Image
  54778. * @param {string} url - 服务地址。例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  54779. * @param {Object} options - 可选参数。
  54780. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  54781. * @param {Object} [options.headers] - 请求头。
  54782. * @extends {CommonServiceBase}
  54783. * @usage
  54784. */
  54785. var ImageService = /*#__PURE__*/function (_CommonServiceBase) {
  54786. ImageService_inherits(ImageService, _CommonServiceBase);
  54787. var _super = ImageService_createSuper(ImageService);
  54788. function ImageService(url, options) {
  54789. var _this;
  54790. ImageService_classCallCheck(this, ImageService);
  54791. _this = _super.call(this, url, options);
  54792. _this.options = options || {};
  54793. if (options) {
  54794. Util_Util.extend(ImageService_assertThisInitialized(_this), options);
  54795. }
  54796. _this.eventCount = 0;
  54797. _this.CLASS_NAME = 'SuperMap.ImageService';
  54798. return _this;
  54799. }
  54800. /**
  54801. * @function ImageService.prototype.destroy
  54802. * @override
  54803. */
  54804. ImageService_createClass(ImageService, [{
  54805. key: "destroy",
  54806. value: function destroy() {
  54807. ImageService_get(ImageService_getPrototypeOf(ImageService.prototype), "destroy", this).call(this);
  54808. }
  54809. /**
  54810. * @function ImageService.prototype.getCollections
  54811. * @description 返回当前影像服务中的影像集合列表(Collections)。
  54812. */
  54813. }, {
  54814. key: "getCollections",
  54815. value: function getCollections(callback) {
  54816. var me = this;
  54817. var path = Util_Util.convertPath('/collections');
  54818. var url = Util_Util.urlPathAppend(me.url, path);
  54819. this._processAsync({
  54820. url: url,
  54821. mehtod: 'GET',
  54822. callback: callback
  54823. });
  54824. }
  54825. /**
  54826. * @function ImageService.prototype.getCollectionByID
  54827. * @description ID值等于`collectionId`参数值的影像集合(Collection)。ID值用于在服务中唯一标识该影像集合。
  54828. * @param {string} collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  54829. */
  54830. }, {
  54831. key: "getCollectionByID",
  54832. value: function getCollectionByID(collectionId, callback) {
  54833. var pathParams = {
  54834. collectionId: collectionId
  54835. };
  54836. var me = this;
  54837. var path = Util_Util.convertPath('/collections/{collectionId}', pathParams);
  54838. var url = Util_Util.urlPathAppend(me.url, path);
  54839. this._processAsync({
  54840. url: url,
  54841. mehtod: 'GET',
  54842. callback: callback
  54843. });
  54844. }
  54845. /**
  54846. * @function ImageSearchService.prototype.search
  54847. * @description 查询与过滤条件匹配的影像数据。
  54848. * @param {ImageSearchParameter} [imageSearchParameter] 查询参数。
  54849. */
  54850. }, {
  54851. key: "search",
  54852. value: function search(imageSearchParameter, callback) {
  54853. var postBody = _objectSpread({}, imageSearchParameter || {});
  54854. var me = this;
  54855. var path = Util_Util.convertPath('/search');
  54856. var url = Util_Util.urlPathAppend(me.url, path);
  54857. this._processAsync({
  54858. url: url,
  54859. method: 'POST',
  54860. data: postBody,
  54861. callback: callback
  54862. });
  54863. }
  54864. }, {
  54865. key: "_processAsync",
  54866. value: function _processAsync(_ref) {
  54867. var url = _ref.url,
  54868. method = _ref.method,
  54869. callback = _ref.callback,
  54870. data = _ref.data;
  54871. var eventId = ++this.eventCount;
  54872. var me = this;
  54873. var eventListeners = {
  54874. scope: this,
  54875. processCompleted: function processCompleted(result) {
  54876. if (eventId === result.result.eventId && callback) {
  54877. delete result.result.eventId;
  54878. callback(result);
  54879. this.events && this.events.un(eventListeners);
  54880. return false;
  54881. }
  54882. },
  54883. processFailed: function processFailed(result) {
  54884. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  54885. callback(result);
  54886. this.events && this.events.un(eventListeners);
  54887. return false;
  54888. }
  54889. }
  54890. };
  54891. this.events.on(eventListeners);
  54892. this.request({
  54893. method: method || 'GET',
  54894. url: url,
  54895. data: data,
  54896. scope: this,
  54897. success: function success(result, options) {
  54898. result.eventId = eventId;
  54899. me.serviceProcessCompleted(result, options);
  54900. },
  54901. failure: function failure(result, options) {
  54902. if (result.error) {
  54903. result.error.eventId = eventId;
  54904. }
  54905. result.eventId = eventId;
  54906. me.serviceProcessFailed(result, options);
  54907. }
  54908. });
  54909. }
  54910. }]);
  54911. return ImageService;
  54912. }(CommonServiceBase);
  54913. ;// CONCATENATED MODULE: ./src/common/iServer/FieldsFilter.js
  54914. function FieldsFilter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54915. 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); } }
  54916. 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; }
  54917. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54918. * This program are made available under the terms of the Apache License, Version 2.0
  54919. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54920. /**
  54921. * @class FieldsFilter
  54922. * @deprecatedclass SuperMap.FieldsFilter
  54923. * @category iServer Data Field
  54924. * @classdesc 指定返回的用于描述 Feature 的字段。
  54925. * @param {Object} options - 可选参数。
  54926. * @param {Array.<string>} [options.include] 对返回的字段内容进行过滤,需保留的字段列表。
  54927. * @param {Array.<string>} [options.exclude] 对返回的字段内容进行过滤,需排除的字段列表。
  54928. * @usage
  54929. */
  54930. var FieldsFilter = /*#__PURE__*/function () {
  54931. function FieldsFilter(options) {
  54932. FieldsFilter_classCallCheck(this, FieldsFilter);
  54933. /**
  54934. * @description 对返回的字段内容进行过滤,需保留的字段列表。
  54935. * @member {Array.<string>} FieldsFilter.prototype.include
  54936. */
  54937. this.include = undefined;
  54938. /**
  54939. * @description 对返回的字段内容进行过滤,需排除的字段列表。
  54940. * @member {Array.<string>} FieldsFilter.prototype.exclude
  54941. */
  54942. this.exclude = undefined;
  54943. this.CLASS_NAME = 'SuperMap.FieldsFilter';
  54944. Util_Util.extend(this, options);
  54945. }
  54946. /**
  54947. * @function FieldsFilter.prototype.destroy
  54948. * @description 释放资源,将引用资源的属性置空。
  54949. */
  54950. FieldsFilter_createClass(FieldsFilter, [{
  54951. key: "destroy",
  54952. value: function destroy() {
  54953. var me = this;
  54954. me.include = undefined;
  54955. me.exclude = undefined;
  54956. }
  54957. /**
  54958. * @function FieldsFilter.prototype.constructFromObject
  54959. * @description 目标对象新增该类的可选参数。
  54960. * @param {Object} data 要转换的数据。
  54961. * @param {FieldsFilter} obj 返回的模型。
  54962. * @return {FieldsFilter} 返回结果。
  54963. */
  54964. }], [{
  54965. key: "constructFromObject",
  54966. value: function constructFromObject(data, obj) {
  54967. if (data) {
  54968. obj = obj || new FieldsFilter();
  54969. if (data.hasOwnProperty('include')) {
  54970. obj.include = data.include;
  54971. }
  54972. if (data.hasOwnProperty('exclude')) {
  54973. obj.exclude = data.exclude;
  54974. }
  54975. }
  54976. return obj;
  54977. }
  54978. }]);
  54979. return FieldsFilter;
  54980. }();
  54981. ;// CONCATENATED MODULE: ./src/common/iServer/Sortby.js
  54982. function Sortby_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54983. 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); } }
  54984. 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; }
  54985. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  54986. * This program are made available under the terms of the Apache License, Version 2.0
  54987. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54988. /**
  54989. * @class Sortby
  54990. * @deprecatedclass SuperMap.Sortby
  54991. * @classdesc 通过指定字段进行排序的方法类。
  54992. * @category BaseTypes Util
  54993. * @param {Object} options - 参数。
  54994. * @param {string} options.field 属性名称。
  54995. * @param {Sortby.Direction} options.direction 排序规则,默认升序。
  54996. * @usage
  54997. */
  54998. var Sortby = /*#__PURE__*/function () {
  54999. function Sortby(options) {
  55000. Sortby_classCallCheck(this, Sortby);
  55001. /**
  55002. * @description 属性名称。
  55003. * @member {string} Sortby.prototype.field
  55004. */
  55005. this.field = undefined;
  55006. /**
  55007. * @description 排序规则。
  55008. * @member {Sortby.Direction} Sortby.prototype.direction
  55009. * @default Sortby.Direction.ASC
  55010. */
  55011. this.direction = Sortby.Direction.ASC;
  55012. this.CLASS_NAME = 'SuperMap.Sortby';
  55013. Util_Util.extend(this, options);
  55014. }
  55015. /**
  55016. * @function Sortby.prototype.destroy
  55017. * @description 释放资源,将引用资源的属性置空。
  55018. */
  55019. Sortby_createClass(Sortby, [{
  55020. key: "destroy",
  55021. value: function destroy() {
  55022. var me = this;
  55023. me.field = undefined;
  55024. me.direction = 'ASC';
  55025. }
  55026. /**
  55027. * @function Sortby.prototype.constructFromObject
  55028. * @description 目标对象新增该类的可选参数。
  55029. * @param {Object} data 要转换的数据。
  55030. * @param {Sortby} obj 返回的模型。
  55031. * @return {Sortby} 返回结果。
  55032. */
  55033. }], [{
  55034. key: "constructFromObject",
  55035. value: function constructFromObject(data, obj) {
  55036. if (data) {
  55037. obj = obj || new Sortby();
  55038. if (data.hasOwnProperty('field')) {
  55039. obj.field = data.field;
  55040. }
  55041. if (data.hasOwnProperty('direction')) {
  55042. obj.direction = data.direction;
  55043. }
  55044. }
  55045. return obj;
  55046. }
  55047. }]);
  55048. return Sortby;
  55049. }();
  55050. /**
  55051. * @enum Direction
  55052. * @description 排序的类型枚举。
  55053. * @memberOf Sortby
  55054. * @readonly
  55055. * @type {string}
  55056. */
  55057. Sortby.Direction = {
  55058. /** 升序。 */
  55059. ASC: 'ASC',
  55060. /** 降序。 */
  55061. DESC: 'DESC'
  55062. };
  55063. ;// CONCATENATED MODULE: ./src/common/iServer/ImageSearchParameter.js
  55064. function ImageSearchParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55065. 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); } }
  55066. 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; }
  55067. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55068. * This program are made available under the terms of the Apache License, Version 2.0
  55069. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55070. /**
  55071. * @class ImageSearchParameter
  55072. * @deprecatedclass SuperMap.ImageSearchParameter
  55073. * @classdesc 影像服务查询参数类。
  55074. * @category iServer Image
  55075. * @param {Object} options - 可选参数。
  55076. * @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)属性,由服务器决定是否使用单一的空间几何对象属性,还是使用所有相关的几何对象作为最终的查询空间范围。
  55077. * @param {Array.<string>} [options.collections] 影像集合的ID数组,将在该指定的Collection中搜索Items。
  55078. * @param {Array.<string>} [options.ids] 只返回指定 Item 的 ID 数组中的Item。返回的 Item 的 ID 值数组。设置了该参数,所有其他过滤器参数(除了next和limit)将被忽略。
  55079. * @param {number} [options.limit] 返回的最大结果数,即响应文档包含的 Item 的数目。
  55080. * @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 属性都包含在查询结果中。
  55081. * @param {Object} [options.query] 定义查询哪些属性,查询运算符将应用于这些属性。运算符包括:eq、neq、gt、lt、gte、lte、startsWith、endsWith、contains、in。其中in是Array.<string>类型,例如:{ "SmFileName": { "eq":"B49C001002.tif" }}
  55082. * @param {Array.<Sortby>} [options.sortby] 由包含属性名称和排序规则的对象构成的数组。
  55083. * @usage
  55084. */
  55085. var ImageSearchParameter = /*#__PURE__*/function () {
  55086. function ImageSearchParameter(options) {
  55087. ImageSearchParameter_classCallCheck(this, ImageSearchParameter);
  55088. /**
  55089. * @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)属性,由服务器决定是否使用单一的空间几何对象属性,还是使用所有相关的几何对象作为最终的查询空间范围。
  55090. * @member {Array.<number>} ImageSearchParameter.prototype.bbox
  55091. */
  55092. this.bbox = undefined;
  55093. /**
  55094. * @description 影像集合的ID数组,将在该指定的Collection中搜索Items。
  55095. * @member {Array.<string>} ImageSearchParameter.prototype.collections
  55096. */
  55097. this.collections = undefined;
  55098. /**
  55099. * @description 返回的 Item 的 ID 值数组。设置了该参数,所有其他过滤器参数(除了next和limit)将被忽略。
  55100. * @member {Array.<string>} ImageSearchParameter.prototype.ids
  55101. */
  55102. this.ids = undefined;
  55103. /**
  55104. * @description 单页返回的最大结果数。最小值为1,最大值为10000。
  55105. * @member {number} ImageSearchParameter.prototype.limit
  55106. */
  55107. this.limit = undefined;
  55108. /**
  55109. * @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 属性都包含在查询结果中。
  55110. * @member {FieldsFilter} ImageSearchParameter.prototype.fields
  55111. */
  55112. this.fields = undefined;
  55113. /**
  55114. * @description 定义查询哪些属性,查询运算符将应用于这些属性。
  55115. * @member {Object} ImageSearchParameter.prototype.query
  55116. */
  55117. this.query = undefined;
  55118. /**
  55119. * @description 由包含属性名称和排序规则的对象构成的数组。
  55120. * @member {Array.<Sortby>} ImageSearchParameter.prototype.sortby
  55121. */
  55122. this.sortby = undefined;
  55123. this.CLASS_NAME = 'SuperMap.ImageSearchParameter';
  55124. Util_Util.extend(this, options);
  55125. }
  55126. /**
  55127. * @function ImageSearchParameter.prototype.destroy
  55128. * @description 释放资源,将引用资源的属性置空。
  55129. */
  55130. ImageSearchParameter_createClass(ImageSearchParameter, [{
  55131. key: "destroy",
  55132. value: function destroy() {
  55133. var me = this;
  55134. me.bbox = undefined;
  55135. me.collections = undefined;
  55136. me.ids = undefined;
  55137. me.limit = undefined;
  55138. me.fields = undefined;
  55139. me.query = undefined;
  55140. me.sortby = undefined;
  55141. }
  55142. /**
  55143. * @function ImageSearchParameter.prototype.constructFromObject
  55144. * @description 目标对象新增该类的可选参数。
  55145. * @param {Object} data 要转换的数据。
  55146. * @param {ImageSearchParameter} obj 返回的模型。
  55147. * @return {ImageSearchParameter} 返回结果。
  55148. */
  55149. }], [{
  55150. key: "constructFromObject",
  55151. value: function constructFromObject(data, obj) {
  55152. if (data) {
  55153. obj = obj || new ImageSearchParameter();
  55154. if (data.hasOwnProperty('bbox')) {
  55155. obj.bbox = data.bbox;
  55156. }
  55157. if (data.hasOwnProperty('collections')) {
  55158. obj.collections = data.collections;
  55159. }
  55160. if (data.hasOwnProperty('ids')) {
  55161. obj.ids = data.ids;
  55162. }
  55163. if (data.hasOwnProperty('limit')) {
  55164. obj.limit = data.limit;
  55165. }
  55166. if (data.hasOwnProperty('fields')) {
  55167. obj.fields = FieldsFilter.constructFromObject && FieldsFilter.constructFromObject(data.fields, {}) || data.fields;
  55168. }
  55169. if (data.hasOwnProperty('query')) {
  55170. obj.query = data.query;
  55171. }
  55172. if (data.hasOwnProperty('sortby')) {
  55173. obj.sortby = data.sortby;
  55174. if (data.sortby) {
  55175. obj.sortby = data.sortby.map(function (item) {
  55176. return Sortby.constructFromObject && Sortby.constructFromObject(item, {}) || item;
  55177. });
  55178. }
  55179. }
  55180. }
  55181. return obj;
  55182. }
  55183. }]);
  55184. return ImageSearchParameter;
  55185. }();
  55186. ;// CONCATENATED MODULE: ./src/common/iServer/ImageStretchOption.js
  55187. function ImageStretchOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55188. 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); } }
  55189. 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; }
  55190. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55191. * This program are made available under the terms of the Apache License, Version 2.0
  55192. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55193. /**
  55194. * @class ImageStretchOption
  55195. * @deprecatedclass SuperMap.ImageStretchOption
  55196. * @classdesc 影像拉伸类。
  55197. * @category iServer Image
  55198. * @param {Object} options - 可选参数。
  55199. * @param {ImageStretchOption.StretchType} [options.stretchType] 影像拉伸类型。该属性的值有以下几种情况:NONE,无拉伸;GAUSSIAN,高斯拉伸;PERCENTCLIP,百分比截断拉伸;MINIMUMMAXIMUM,最值拉伸;STANDARDDEVIATION,标准差拉伸。
  55200. * @param {number} [options.stdevCoefficient] 标准差系数。
  55201. * @param {number} [options.gaussianCoefficient] 高斯系数。
  55202. * @param {boolean} [options.useMedianValue] 高斯拉伸时,是否使用中间值,若该属性值为true,表示使用中间值;false,表示使用平均值。
  55203. * @param {number} [options.minPercent] 使用百分比截断拉伸时,排除影像直方图最低值区域的像元,该参数值为这部分像元占总像元百分比。
  55204. * @param {number} [options.maxPercent] 使用百分比截断拉伸时,排除影像直方图最高值区域的像元,该参数值为这部分像元占总像元百分比。
  55205. * @usage
  55206. */
  55207. var ImageStretchOption = /*#__PURE__*/function () {
  55208. function ImageStretchOption(options) {
  55209. ImageStretchOption_classCallCheck(this, ImageStretchOption);
  55210. /**
  55211. * @description 影像拉伸类型。该属性的值有以下几种情况:NONE,无拉伸;GAUSSIAN,高斯拉伸;PERCENTCLIP,百分比截断拉伸;MINIMUMMAXIMUM,最值拉伸;STANDARDDEVIATION,标准差拉伸。
  55212. * @member {ImageStretchOption.StretchType} ImageStretchOption.prototype.stretchType
  55213. */
  55214. this.stretchType = undefined;
  55215. /**
  55216. * @description 标准差系数。
  55217. * @member {number} ImageStretchOption.prototype.stdevCoefficient
  55218. */
  55219. this.stdevCoefficient = undefined;
  55220. /**
  55221. * @description 高斯系数。
  55222. * @member {number} ImageStretchOption.prototype.gaussianCoefficient
  55223. */
  55224. this.gaussianCoefficient = undefined;
  55225. /**
  55226. * @description 高斯拉伸时,是否使用中间值,若该属性值为true,表示使用中间值;false,表示使用平均值。
  55227. * @member {boolean} ImageStretchOption.prototype.useMedianValue
  55228. */
  55229. this.useMedianValue = undefined;
  55230. /**
  55231. * @description 使用百分比截断拉伸时,排除影像直方图最低值区域的像元,该参数值为这部分像元占总像元百分比。
  55232. * @member {number} ImageStretchOption.prototype.minPercent
  55233. */
  55234. this.minPercent = undefined;
  55235. /**
  55236. * @description 使用百分比截断拉伸时,排除影像直方图最高值区域的像元,该参数值为这部分像元占总像元百分比。
  55237. * @member {number} ImageStretchOption.prototype.maxPercent
  55238. */
  55239. this.maxPercent = undefined;
  55240. this.CLASS_NAME = 'SuperMap.ImageStretchOption';
  55241. Util_Util.extend(this, options);
  55242. }
  55243. /**
  55244. * @function ImageStretchOption.prototype.destroy
  55245. * @description 释放资源,将引用资源的属性置空。
  55246. */
  55247. ImageStretchOption_createClass(ImageStretchOption, [{
  55248. key: "destroy",
  55249. value: function destroy() {
  55250. var me = this;
  55251. me.stretchType = undefined;
  55252. me.stdevCoefficient = undefined;
  55253. me.gaussianCoefficient = undefined;
  55254. me.useMedianValue = undefined;
  55255. me.minPercent = undefined;
  55256. me.maxPercent = undefined;
  55257. }
  55258. /**
  55259. * @function ImageStretchOption.prototype.constructFromObject
  55260. * @description 目标对象新增该类的可选参数。
  55261. * @param {Object} data 要转换的数据。
  55262. * @param {ImageStretchOption} obj 返回的模型。
  55263. * @return {ImageStretchOption} 返回结果。
  55264. */
  55265. }], [{
  55266. key: "constructFromObject",
  55267. value: function constructFromObject(data, obj) {
  55268. if (data) {
  55269. obj = obj || new ImageStretchOption();
  55270. if (data.hasOwnProperty('stretchType')) {
  55271. obj.stretchType = data.stretchType;
  55272. }
  55273. if (data.hasOwnProperty('stdevCoefficient')) {
  55274. obj.stdevCoefficient = data.stdevCoefficient;
  55275. }
  55276. if (data.hasOwnProperty('gaussianCoefficient')) {
  55277. obj.gaussianCoefficient = data.gaussianCoefficient;
  55278. }
  55279. if (data.hasOwnProperty('useMedianValue')) {
  55280. obj.useMedianValue = data.useMedianValue;
  55281. }
  55282. if (data.hasOwnProperty('minPercent')) {
  55283. obj.minPercent = data.minPercent;
  55284. }
  55285. if (data.hasOwnProperty('maxPercent')) {
  55286. obj.maxPercent = data.maxPercent;
  55287. }
  55288. }
  55289. return obj;
  55290. }
  55291. }]);
  55292. return ImageStretchOption;
  55293. }();
  55294. /**
  55295. * @enum StretchType
  55296. * @description 影像拉伸类型枚举。
  55297. * @memberOf ImageStretchOption
  55298. * @readonly
  55299. * @type {string}
  55300. */
  55301. ImageStretchOption.StretchType = {
  55302. /** 无拉伸。 */
  55303. NONE: 'NONE',
  55304. /** 高斯拉伸。 */
  55305. GAUSSIAN: 'GAUSSIAN',
  55306. /** 百分比截断拉伸。 */
  55307. PERCENTCLIP: 'PERCENTCLIP',
  55308. /** 最值拉伸。 */
  55309. MINIMUMMAXIMUM: 'MINIMUMMAXIMUM',
  55310. /** 标准差拉伸。 */
  55311. STANDARDDEVIATION: 'STANDARDDEVIATION'
  55312. };
  55313. ;// CONCATENATED MODULE: ./src/common/iServer/ImageRenderingRule.js
  55314. function ImageRenderingRule_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55315. 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); } }
  55316. 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; }
  55317. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55318. * This program are made available under the terms of the Apache License, Version 2.0
  55319. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55320. /**
  55321. * @class ImageRenderingRule
  55322. * @deprecatedclass SuperMap.ImageRenderingRule
  55323. * @classdesc 定义请求的影像如何进行渲染或者处理,如:影像的拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。
  55324. * @category iServer Image
  55325. * @param {Object} options - 可选参数。
  55326. * @param {ImageRenderingRule.DisplayMode} [options.displayMode] 影像显示模式,其中:Composite表示多波段组合显示;Stretched表示单波段拉伸显示。
  55327. * @param {string} [options.displayBands] 影像显示的波段或者波段组合。若影像的显示模式为STRETCHED,该属性指定一个波段的索引号(波段索引号从0开始计数);若影像的显示模式为COMPOSITE,该属性为组合的波段索引号,例如:属性值3,2,1表示采用4波段、3波段、2波段分别对应 R、G、B颜色通道进行组合显示。
  55328. * @param {ImageStretchOption} [options.stretchOption] 影像的拉伸参数。
  55329. * @param {ImageRenderingRule.InterpolationMode} [options.interpolationMode] 影像显示时使用的插值算法。
  55330. * @param {Array.<string>} [options.colorScheme] 影像拉伸显示的颜色方案。颜色方案为RGBA颜色数组。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。例如:"255,0,0","0,255,0","0,0,255" 表示由红色、绿色、蓝色三种颜色构成的色带。
  55331. * @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"。
  55332. * @param {number} [options.brightness] 影像显示的亮度。数值范围为-100到100,增加亮度为正,降低亮度为负。
  55333. * @param {number} [options.contrast] 影像显示的对比度。数值范围为-100到100,增加对比度为正,降低对比度为负。
  55334. * @param {string} [options.noData] 影像的无值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的无值。
  55335. * @param {string} [options.noDataColor] 影像的无值的显示颜色,支持RGB颜色,例如:255,0,0(红色),那么无值将以指定的红色显示。
  55336. * @param {boolean} [options.noDataTransparent] 无值是否透明显示,true表示透明显示无值;否则为false。
  55337. * @param {string} [options.backgroundValue] 影像的背景值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的背景值。
  55338. * @param {string} [options.backgroundColor] 指定背景值的颜色。支持指定RGB颜色,例如:255,0,0(红色),那么背景值将以指定的红色显示。
  55339. * @param {boolean} [options.backgroundTransparent] 背景值是否透明显示,true表示透明显示背景值;否则为false。
  55340. * @param {Array.<ImageGFHillShade|ImageGFSlope|ImageGFAspect|ImageGFOrtho>} [options.gridFunctions] 栅格函数链。
  55341. * @usage
  55342. */
  55343. var ImageRenderingRule = /*#__PURE__*/function () {
  55344. function ImageRenderingRule(options) {
  55345. ImageRenderingRule_classCallCheck(this, ImageRenderingRule);
  55346. /**
  55347. * @description 影像显示模式,其中:Composite表示多波段组合显示;Stretched表示单波段拉伸显示。
  55348. * @member {ImageRenderingRule.DisplayMode} ImageRenderingRule.prototype.displayMode
  55349. */
  55350. this.displayMode = undefined;
  55351. /**
  55352. * @description 影像显示的波段或者波段组合。该参数为一个数组,数组元素为波段索引号。若影像的显示模式为Stretched,该属性指定一个显示的波段;若影像的显示模式为Composite,该属性为组合的波段索引号,例如:属性值4,3,2表示采用4波段、3波段、2波段分别对应 R、G、B颜色通道进行组合显示。
  55353. * @member {string} ImageRenderingRule.prototype.displayBands
  55354. */
  55355. this.displayBands = undefined;
  55356. /**
  55357. * @description 影像的拉伸参数。
  55358. * @member {ImageStretchOption} ImageRenderingRule.prototype.stretchOption
  55359. */
  55360. this.stretchOption = undefined;
  55361. /**
  55362. * @description 影像显示时使用的插值算法。
  55363. * @member {ImageRenderingRule.InterpolationMode} ImageRenderingRule.prototype.interpolationMode
  55364. */
  55365. this.interpolationMode = undefined;
  55366. /**
  55367. * @description 影像拉伸显示的颜色方案。颜色方案为RGBA颜色数组。RGBA是代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间。Alpha值可以省略不写,表示完全不透明。Alpha通道表示不透明度参数,若该值为0表示完全透明。例如:"255,0,0","0,255,0","0,0,255" 表示由红色、绿色、蓝色三种颜色构成的色带。
  55368. * @member {Array.<string>} ImageRenderingRule.prototype.colorScheme
  55369. */
  55370. this.colorScheme = undefined;
  55371. /**
  55372. * @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"
  55373. * @member {Array.<string>} ImageRenderingRule.prototype.colorTable
  55374. */
  55375. this.colorTable = undefined;
  55376. /**
  55377. * @description 影像显示的亮度。数值范围为-100到100,增加亮度为正,降低亮度为负。
  55378. * @member {number} ImageRenderingRule.prototype.brightness
  55379. */
  55380. this.brightness = undefined;
  55381. /**
  55382. * @description 影像显示的对比度。数值范围为-100到100,增加对比度为正,降低对比度为负。
  55383. * @member {number} ImageRenderingRule.prototype.contrast
  55384. */
  55385. this.contrast = undefined;
  55386. /**
  55387. * @description 影像的无值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的无值。
  55388. * @member {string} ImageRenderingRule.prototype.noData
  55389. */
  55390. this.noData = undefined;
  55391. /**
  55392. * @description 影像的无值的显示颜色,支持RGB颜色,例如:255,0,0(红色),那么无值将以指定的红色显示。
  55393. * @member {string} ImageRenderingRule.prototype.noDataColor
  55394. */
  55395. this.noDataColor = undefined;
  55396. /**
  55397. * @description 无值是否透明显示,true表示透明显示无值;否则为false。
  55398. * @member {boolean} ImageRenderingRule.prototype.noDataTransparent
  55399. */
  55400. this.noDataTransparent = undefined;
  55401. /**
  55402. * @description 影像的背景值。影像为多波段时,通过逗号分隔 R,G,B 颜色通道对应波段的背景值。
  55403. * @member {string} ImageRenderingRule.prototype.backgroundValue
  55404. */
  55405. this.backgroundValue = undefined;
  55406. /**
  55407. * @description 指定背景值的颜色。支持指定RGB颜色,例如:255,0,0(红色),那么背景值将以指定的红色显示。
  55408. * @member {string} ImageRenderingRule.prototype.backgroundColor
  55409. */
  55410. this.backgroundColor = undefined;
  55411. /**
  55412. * @description 背景值是否透明显示,true表示透明显示背景值;否则为false。
  55413. * @member {boolean} ImageRenderingRule.prototype.backgroundTransparent
  55414. */
  55415. this.backgroundTransparent = undefined;
  55416. /**
  55417. * @description 栅格函数选项,通过应用栅格函数,可以对影像进行快速显示处理。
  55418. * @member {Array.<ImageGFHillShade|ImageGFSlope|ImageGFAspect|ImageGFOrtho>} ImageRenderingRule.prototype.gridFunctions
  55419. */
  55420. this.gridFunctions = undefined;
  55421. this.CLASS_NAME = 'SuperMap.ImageRenderingRule';
  55422. Util_Util.extend(this, options);
  55423. }
  55424. /**
  55425. * @function ImageRenderingRule.prototype.destroy
  55426. * @description 释放资源,将引用资源的属性置空。
  55427. */
  55428. ImageRenderingRule_createClass(ImageRenderingRule, [{
  55429. key: "destroy",
  55430. value: function destroy() {
  55431. var me = this;
  55432. me.displayMode = undefined;
  55433. me.displayBands = undefined;
  55434. me.stretchOption = undefined;
  55435. me.interpolationMode = undefined;
  55436. me.colorScheme = undefined;
  55437. me.colorTable = undefined;
  55438. me.brightness = undefined;
  55439. me.contrast = undefined;
  55440. me.noData = undefined;
  55441. me.noDataColor = undefined;
  55442. me.noDataTransparent = undefined;
  55443. me.backgroundValue = undefined;
  55444. me.backgroundColor = undefined;
  55445. me.backgroundTransparent = undefined;
  55446. me.gridFuncOptions = undefined;
  55447. }
  55448. /**
  55449. * @function ImageRenderingRule.prototype.constructFromObject
  55450. * @description 目标对象新增该类的可选参数。
  55451. * @param {Object} data 要转换的数据。
  55452. * @param {ImageRenderingRule} obj 返回的模型。
  55453. * @return {ImageRenderingRule} 返回结果。
  55454. */
  55455. }], [{
  55456. key: "constructFromObject",
  55457. value: function constructFromObject(data, obj) {
  55458. if (data) {
  55459. obj = obj || new ImageRenderingRule();
  55460. if (data.hasOwnProperty('displayMode')) {
  55461. obj.displayMode = data.displayMode;
  55462. }
  55463. if (data.hasOwnProperty('displayBands')) {
  55464. obj.displayBands = data.displayBands;
  55465. }
  55466. if (data.hasOwnProperty('stretchOption')) {
  55467. obj.stretchOption = ImageStretchOption.constructFromObject && ImageStretchOption.constructFromObject(data.stretchOption, {}) || data.stretchOption;
  55468. }
  55469. if (data.hasOwnProperty('interpolationMode')) {
  55470. obj.interpolationMode = data.interpolationMode;
  55471. }
  55472. if (data.hasOwnProperty('colorScheme')) {
  55473. obj.colorScheme = data.colorScheme;
  55474. }
  55475. if (data.hasOwnProperty('colorTable')) {
  55476. obj.colorTable = data.colorTable;
  55477. }
  55478. if (data.hasOwnProperty('brightness')) {
  55479. obj.brightness = data.brightness;
  55480. }
  55481. if (data.hasOwnProperty('contrast')) {
  55482. obj.contrast = data.contrast;
  55483. }
  55484. if (data.hasOwnProperty('noData')) {
  55485. obj.noData = data.noData;
  55486. }
  55487. if (data.hasOwnProperty('noDataColor')) {
  55488. obj.noDataColor = data.noDataColor;
  55489. }
  55490. if (data.hasOwnProperty('backgroundValue')) {
  55491. obj.backgroundValue = data.backgroundValue;
  55492. }
  55493. if (data.hasOwnProperty('noDataTransparent')) {
  55494. obj.noDataTransparent = data.noDataTransparent;
  55495. }
  55496. if (data.hasOwnProperty('backgroundColor')) {
  55497. obj.backgroundColor = data.backgroundColor;
  55498. }
  55499. if (data.hasOwnProperty('backgroundTransparent')) {
  55500. obj.backgroundTransparent = data.backgroundTransparent;
  55501. }
  55502. if (data.hasOwnProperty('gridFunctions')) {
  55503. obj.gridFunctions = data.gridFunctions;
  55504. }
  55505. }
  55506. return obj;
  55507. }
  55508. }]);
  55509. return ImageRenderingRule;
  55510. }();
  55511. /**
  55512. * @enum DisplayMode
  55513. * @description 影像显示模式。
  55514. * @memberOf ImageRenderingRule
  55515. * @readonly
  55516. * @type {string}
  55517. */
  55518. ImageRenderingRule.DisplayMode = {
  55519. COMPOSITE: 'COMPOSITE',
  55520. STRETCHED: 'Stretched'
  55521. };
  55522. /**
  55523. * @enum InterpolationMode
  55524. * @description 影像显示时使用的插值算法枚举。
  55525. * @memberOf ImageRenderingRule
  55526. * @readonly
  55527. * @type {string}
  55528. */
  55529. ImageRenderingRule.InterpolationMode = {
  55530. /** 最邻近插值模式。 */
  55531. NEARESTNEIGHBOR: 'NEARESTNEIGHBOR',
  55532. /** 高质量的双线性插值模式。 */
  55533. HIGHQUALITYBILINEAR: 'HIGHQUALITYBILINEAR',
  55534. /** 默认插值模式。 */
  55535. DEFAULT: 'DEFAULT'
  55536. };
  55537. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFHillShade.js
  55538. function ImageGFHillShade_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55539. 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); } }
  55540. 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; }
  55541. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55542. * This program are made available under the terms of the Apache License, Version 2.0
  55543. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55544. /**
  55545. * @class ImageGFHillShade
  55546. * @deprecatedclass SuperMap.ImageGFHillShade
  55547. * @classdesc 栅格函数对象:对DEM数据生成三维晕渲图。
  55548. * @category iServer Image
  55549. * @param {Object} options - 可选参数。
  55550. * @param {string} [options.girdFuncName='GFHillShade'] 栅格函数名称,参数值为:GFHillShade。
  55551. * @param {number} [options.Azimuth = 315] 光源方位角。用于确定光源的方向,是从光源所在位置的正北方向线起,依顺时针方向到光源与目标方向线的夹角,范围为 0-360 度,以正北方向为 0 度,依顺时针方向递增。默认值为:315。
  55552. * @param {number} [options.Altitude = 45] 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  55553. * @param {number} [options.ZFactor = 1] 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  55554. * @usage
  55555. */
  55556. var ImageGFHillShade = /*#__PURE__*/function () {
  55557. function ImageGFHillShade(options) {
  55558. ImageGFHillShade_classCallCheck(this, ImageGFHillShade);
  55559. /**
  55560. * @description 栅格函数名称,参数值为:GFHillShade。
  55561. * @member {string} ImageGFHillShade.prototype.girdFuncName
  55562. * @default 'GFHillShade'
  55563. */
  55564. this.girdFuncName = 'GFHillShade';
  55565. /**
  55566. * @description 光源方位角。用于确定光源的方向,是从光源所在位置的正北方向线起,依顺时针方向到光源与目标方向线的夹角,范围为 0-360 度,以正北方向为 0 度,依顺时针方向递增。默认值为:315。
  55567. * @member {number} ImageGFHillShade.prototype.Azimuth
  55568. */
  55569. this.Azimuth = 315;
  55570. /**
  55571. * @description 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  55572. * @member {number} ImageGFHillShade.prototype.Altitude
  55573. */
  55574. this.Altitude = 45;
  55575. /**
  55576. * @description 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  55577. * @member {number} ImageGFHillShade.prototype.ZFactor
  55578. */
  55579. this.ZFactor = 1;
  55580. this.CLASS_NAME = 'SuperMap.ImageGFHillShade';
  55581. Util_Util.extend(this, options);
  55582. }
  55583. /**
  55584. * @function ImageGFHillShade.prototype.destroy
  55585. * @description 释放资源,将引用资源的属性置空。
  55586. */
  55587. ImageGFHillShade_createClass(ImageGFHillShade, [{
  55588. key: "destroy",
  55589. value: function destroy() {
  55590. var me = this;
  55591. me.girdFuncName = 'GFHillShade';
  55592. me.Azimuth = 315;
  55593. me.Altitude = 45;
  55594. me.ZFactor = 1;
  55595. }
  55596. /**
  55597. * @function ImageGFHillShade.prototype.constructFromObject
  55598. * @description 目标对象新增该类的可选参数。
  55599. * @param {Object} data 要转换的数据。
  55600. * @param {ImageGFHillShade} obj 返回的模型。
  55601. * @return {ImageGFHillShade} 返回结果。
  55602. */
  55603. }], [{
  55604. key: "constructFromObject",
  55605. value: function constructFromObject(data, obj) {
  55606. if (data) {
  55607. obj = obj || new ImageGFHillShade();
  55608. if (data.hasOwnProperty('girdFuncName')) {
  55609. obj.girdFuncName = data.girdFuncName;
  55610. }
  55611. if (data.hasOwnProperty('Azimuth')) {
  55612. obj.Azimuth = data.Azimuth;
  55613. }
  55614. if (data.hasOwnProperty('Altitude')) {
  55615. obj.Altitude = data.Altitude;
  55616. }
  55617. if (data.hasOwnProperty('ZFactor')) {
  55618. obj.ZFactor = data.ZFactor;
  55619. }
  55620. }
  55621. return obj;
  55622. }
  55623. }]);
  55624. return ImageGFHillShade;
  55625. }();
  55626. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFAspect.js
  55627. function ImageGFAspect_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55628. 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); } }
  55629. 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; }
  55630. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55631. * This program are made available under the terms of the Apache License, Version 2.0
  55632. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55633. /**
  55634. * @class ImageGFAspect
  55635. * @deprecatedclass SuperMap.ImageGFAspect
  55636. * @classdesc 栅格函数对象:对DEM数据生成坡向渲图。
  55637. * @category iServer Image
  55638. * @param {Object} options -可选参数。
  55639. * @param {string} [options.girdFuncName='GFAspect'] 栅格函数名称,参数值为:GFAspect。
  55640. * @param {number} [options.Azimuth] 光源方位角,固定为360度。
  55641. * @usage
  55642. */
  55643. var ImageGFAspect = /*#__PURE__*/function () {
  55644. function ImageGFAspect(options) {
  55645. ImageGFAspect_classCallCheck(this, ImageGFAspect);
  55646. /**
  55647. * @description 栅格函数名称,参数值为:GFAspect。
  55648. * @member {string} ImageGFAspect.prototype.girdFuncName
  55649. * @default 'GFAspect'
  55650. */
  55651. this.girdFuncName = 'GFAspect';
  55652. /**
  55653. * @description 光源方位角,固定为360度。
  55654. * @member {number} ImageGFAspect.prototype.Azimuth
  55655. */
  55656. this.Azimuth = undefined;
  55657. this.CLASS_NAME = 'SuperMap.ImageGFAspect';
  55658. Util_Util.extend(this, options);
  55659. }
  55660. /**
  55661. * @function ImageGFAspect.prototype.destroy
  55662. * @description 释放资源,将引用资源的属性置空。
  55663. */
  55664. ImageGFAspect_createClass(ImageGFAspect, [{
  55665. key: "destroy",
  55666. value: function destroy() {
  55667. var me = this;
  55668. me.girdFuncName = 'GFAspect';
  55669. me.Azimuth = undefined;
  55670. }
  55671. /**
  55672. * @function ImageGFAspect.prototype.constructFromObject
  55673. * @description 目标对象新增该类的可选参数。
  55674. * @param {Object} data 要转换的数据。
  55675. * @param {ImageGFAspect} obj 返回的模型。
  55676. * @return {ImageGFAspect} 返回结果。
  55677. */
  55678. }], [{
  55679. key: "constructFromObject",
  55680. value: function constructFromObject(data, obj) {
  55681. if (data) {
  55682. obj = obj || new ImageGFAspect();
  55683. if (data.hasOwnProperty('girdFuncName')) {
  55684. obj.girdFuncName = data.girdFuncName;
  55685. }
  55686. if (data.hasOwnProperty('Azimuth')) {
  55687. obj.Azimuth = data.Azimuth;
  55688. }
  55689. }
  55690. return obj;
  55691. }
  55692. }]);
  55693. return ImageGFAspect;
  55694. }();
  55695. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFOrtho.js
  55696. function ImageGFOrtho_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55697. 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); } }
  55698. 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; }
  55699. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55700. * This program are made available under the terms of the Apache License, Version 2.0
  55701. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55702. /**
  55703. * @class ImageGFOrtho
  55704. * @deprecatedclass SuperMap.ImageGFOrtho
  55705. * @classdesc 栅格函数对象:对DEM数据生成三维晕渲图。该栅格函数不需要输入参数,采用系统默认设置。
  55706. * @category iServer Image
  55707. * @param {Object} options - 可选参数。
  55708. * @param {string} [options.girdFuncName='GFOrtho'] 栅格函数名称,参数值为:GFOrtho。
  55709. * @usage
  55710. */
  55711. var ImageGFOrtho = /*#__PURE__*/function () {
  55712. function ImageGFOrtho(options) {
  55713. ImageGFOrtho_classCallCheck(this, ImageGFOrtho);
  55714. /**
  55715. * @description 栅格函数名称,参数值为:GFOrtho。
  55716. * @member {string} ImageGFOrtho.prototype.girdFuncName
  55717. * @default 'GFOrtho'
  55718. */
  55719. this.girdFuncName = 'GFOrtho';
  55720. this.CLASS_NAME = 'SuperMap.ImageGFOrtho';
  55721. Util_Util.extend(this, options);
  55722. }
  55723. /**
  55724. * @function ImageGFOrtho.prototype.destroy
  55725. * @description 释放资源,将引用资源的属性置空。
  55726. */
  55727. ImageGFOrtho_createClass(ImageGFOrtho, [{
  55728. key: "destroy",
  55729. value: function destroy() {
  55730. var me = this;
  55731. me.girdFuncName = 'GFOrtho';
  55732. }
  55733. /**
  55734. * @function ImageGFOrtho.prototype.constructFromObject
  55735. * @description 目标对象新增该类的可选参数。
  55736. * @param {Object} data 要转换的数据。
  55737. * @param {ImageGFOrtho} obj 返回的模型。
  55738. * @return {ImageGFOrtho} 返回结果。
  55739. */
  55740. }], [{
  55741. key: "constructFromObject",
  55742. value: function constructFromObject(data, obj) {
  55743. if (data) {
  55744. obj = obj || new ImageGFOrtho();
  55745. if (data.hasOwnProperty('girdFuncName')) {
  55746. obj.girdFuncName = data.girdFuncName;
  55747. }
  55748. }
  55749. return obj;
  55750. }
  55751. }]);
  55752. return ImageGFOrtho;
  55753. }();
  55754. ;// CONCATENATED MODULE: ./src/common/iServer/ImageGFSlope.js
  55755. function ImageGFSlope_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55756. 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); } }
  55757. 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; }
  55758. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55759. * This program are made available under the terms of the Apache License, Version 2.0
  55760. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55761. /**
  55762. * @class ImageGFSlope
  55763. * @deprecatedclass SuperMap.ImageGFSlope
  55764. * @classdesc 栅格函数对象:对DEM数据生成坡度图。
  55765. * @category iServer Image
  55766. * @param {Object} options - 可选参数。
  55767. * @param {string} [options.girdFuncName='GFSlope'] 栅格函数名称,参数值为:GFSlope。
  55768. * @param {number} [options.Altitude = 45] 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  55769. * @param {number} [options.ZFactor = 1] 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  55770. * @usage
  55771. */
  55772. var ImageGFSlope = /*#__PURE__*/function () {
  55773. function ImageGFSlope(options) {
  55774. ImageGFSlope_classCallCheck(this, ImageGFSlope);
  55775. /**
  55776. * @description 栅格函数名称,参数值为:GFSlope。
  55777. * @member {string} ImageGFSlope.prototype.girdFuncName
  55778. * @default 'GFSlope'
  55779. */
  55780. this.girdFuncName = 'GFSlope';
  55781. /**
  55782. * @description 光源高度角。用于确定光源照射的倾斜角度,是光源与目标的方向线与水平面间的夹角,范围为 0-90 度。当光源高度角为 90 度时,光源正射地表。默认值为:45。
  55783. * @member {number} ImageGFSlope.prototype.Altitude
  55784. */
  55785. this.Altitude = 45;
  55786. /**
  55787. * @description 高程缩放系数。如果设置为 1.0,表示不缩放。默认值为:1。
  55788. * @member {number} ImageGFSlope.prototype.ZFactor
  55789. */
  55790. this.ZFactor = 1;
  55791. this.CLASS_NAME = 'SuperMap.ImageGFSlope';
  55792. Util_Util.extend(this, options);
  55793. }
  55794. /**
  55795. * @function ImageGFSlope.prototype.destroy
  55796. * @description 释放资源,将引用资源的属性置空。
  55797. */
  55798. ImageGFSlope_createClass(ImageGFSlope, [{
  55799. key: "destroy",
  55800. value: function destroy() {
  55801. var me = this;
  55802. me.girdFuncName = 'GFSlope';
  55803. me.Altitude = 45;
  55804. me.ZFactor = 1;
  55805. }
  55806. /**
  55807. * @function ImageGFSlope.prototype.constructFromObject
  55808. * @description 目标对象新增该类的可选参数。
  55809. * @param {Object} data 要转换的数据。
  55810. * @param {ImageGFSlope} obj 返回的模型。
  55811. * @return {ImageGFSlope} 返回结果。
  55812. */
  55813. }], [{
  55814. key: "constructFromObject",
  55815. value: function constructFromObject(data, obj) {
  55816. if (data) {
  55817. obj = obj || new ImageGFSlope();
  55818. if (data.hasOwnProperty('girdFuncName')) {
  55819. obj.girdFuncName = data.girdFuncName;
  55820. }
  55821. if (data.hasOwnProperty('Altitude')) {
  55822. obj.Altitude = data.Altitude;
  55823. }
  55824. if (data.hasOwnProperty('ZFactor')) {
  55825. obj.ZFactor = data.ZFactor;
  55826. }
  55827. }
  55828. return obj;
  55829. }
  55830. }]);
  55831. return ImageGFSlope;
  55832. }();
  55833. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphNodeParameter.js
  55834. function KnowledgeGraphNodeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55835. 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); } }
  55836. 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; }
  55837. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55838. * This program are made available under the terms of the Apache License, Version 2.0
  55839. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55840. /**
  55841. * @private
  55842. * @class KnowledgeGraphNodeParameter
  55843. * @deprecatedclass SuperMap.KnowledgeGraphNodeParameter
  55844. * @classdesc 知识图谱实体的参数设置。
  55845. * @category iServer KnowledgeGraph
  55846. * @version 11.1.0
  55847. * @param {Object} options - 参数。
  55848. * @param {string} options.id - 实体id。
  55849. * @param {Array.<string>} [options.labels] - 实体分类。
  55850. * @param {Object} [options.properties] - 属性。
  55851. * @usage
  55852. */
  55853. // {
  55854. // "id": 5348024557502471,
  55855. // "properties": {
  55856. // "server": "test1",
  55857. // "_labelfieldname": "FEATUREGUID",
  55858. // "_entityname": "院落",
  55859. // "_bindfindid": "院落@ST_YARDA@1",
  55860. // "FEATUREGUID": "{409E615B-A545-4E07-872D-B12EDA0B4A1A}",
  55861. // "_findid": 1,
  55862. // "ENTITYNAME": "公共管理与公共服务"
  55863. // },
  55864. // "labels": ["院落"]
  55865. // }
  55866. var KnowledgeGraphNodeParameter = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  55867. function KnowledgeGraphNodeParameter(options) {
  55868. KnowledgeGraphNodeParameter_classCallCheck(this, KnowledgeGraphNodeParameter);
  55869. /**
  55870. * @member {string} KnowledgeGraphNodeParameter.prototype.id
  55871. * @description 实体ID。
  55872. */
  55873. this.id = null;
  55874. /**
  55875. * @member {Array.<string>} KnowledgeGraphNodeParameter.prototype.labels
  55876. * @description 实体分类。
  55877. */
  55878. this.labels = null;
  55879. /**
  55880. * @member {Object} KnowledgeGraphNodeParameter.prototype.properties
  55881. * @description 实体属性。
  55882. */
  55883. this.properties = null;
  55884. this.CLASS_NAME = 'SuperMap.KnowledgeGraphNodeParameter';
  55885. Util.extend(this, options);
  55886. }
  55887. KnowledgeGraphNodeParameter_createClass(KnowledgeGraphNodeParameter, [{
  55888. key: "destroy",
  55889. value: function destroy() {
  55890. var me = this;
  55891. me.id = null;
  55892. me.labels = null;
  55893. me.properties = null;
  55894. }
  55895. }]);
  55896. return KnowledgeGraphNodeParameter;
  55897. }()));
  55898. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphEdgeParameter.js
  55899. function KnowledgeGraphEdgeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55900. 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); } }
  55901. 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; }
  55902. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55903. * This program are made available under the terms of the Apache License, Version 2.0
  55904. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55905. /**
  55906. * @private
  55907. * @class KnowledgeGraphEdgeParameter
  55908. * @deprecatedclass SuperMap.KnowledgeGraphEdgeParameter
  55909. * @classdesc 知识图谱关系的参数设置。
  55910. * @category iServer KnowledgeGraph
  55911. * @version 11.1.0
  55912. * @param {Object} options - 参数。
  55913. * @param {string} options.id - 边id。
  55914. * @param {string} options.start - 开始实体id。
  55915. * @param {string} options.end - 结束实体id。
  55916. * @param {string} [options.type] - 标签,关系。
  55917. * @param {Object} [options.properties] - 属性。
  55918. * @usage
  55919. */
  55920. var KnowledgeGraphEdgeParameter = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  55921. function KnowledgeGraphEdgeParameter(options) {
  55922. KnowledgeGraphEdgeParameter_classCallCheck(this, KnowledgeGraphEdgeParameter);
  55923. /**
  55924. * @member {string} KnowledgeGraphEdgeParameter.prototype.id
  55925. * @description 边id。
  55926. */
  55927. this.id = null;
  55928. /**
  55929. * @member {string} KnowledgeGraphEdgeParameter.prototype.start
  55930. * @description 开始实体id。
  55931. */
  55932. this.start = null;
  55933. /**
  55934. * @member {string} KnowledgeGraphEdgeParameter.prototype.end
  55935. * @description 结束实体id。
  55936. */
  55937. this.end = null;
  55938. /**
  55939. * @member {string} KnowledgeGraphEdgeParameter.prototype.type
  55940. * @description 标签,关系。
  55941. */
  55942. this.type = null;
  55943. /**
  55944. * @member {Object} KnowledgeGraphEdgeParameter.prototype.properties
  55945. * @description 实体属性。
  55946. */
  55947. this.properties = null;
  55948. this.CLASS_NAME = 'SuperMap.KnowledgeGraphEdgeParameter';
  55949. Util.extend(this, options);
  55950. }
  55951. KnowledgeGraphEdgeParameter_createClass(KnowledgeGraphEdgeParameter, [{
  55952. key: "destroy",
  55953. value: function destroy() {
  55954. var me = this;
  55955. me.id = null;
  55956. me.start = null;
  55957. me.end = null;
  55958. me.type = null;
  55959. me.properties = null;
  55960. }
  55961. }]);
  55962. return KnowledgeGraphEdgeParameter;
  55963. }()));
  55964. ;// CONCATENATED MODULE: ./src/common/iServer/KnowledgeGraphService.js
  55965. 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); }
  55966. 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; }
  55967. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  55968. 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."); }
  55969. 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); }
  55970. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  55971. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  55972. 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; }
  55973. 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); } }
  55974. 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); }); }; }
  55975. function KnowledgeGraphService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55976. 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); } }
  55977. 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; }
  55978. 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); }
  55979. function KnowledgeGraphService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KnowledgeGraphService_getPrototypeOf(object); if (object === null) break; } return object; }
  55980. 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); }
  55981. 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); }
  55982. 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); }; }
  55983. 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); }
  55984. function KnowledgeGraphService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55985. 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; } }
  55986. function KnowledgeGraphService_getPrototypeOf(o) { KnowledgeGraphService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KnowledgeGraphService_getPrototypeOf(o); }
  55987. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  55988. * This program are made available under the terms of the Apache License, Version 2.0
  55989. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55990. /**
  55991. * @class KnowledgeGraphService
  55992. * @category iServer KnowledgeGraph
  55993. * @classdesc 知识图谱服务类
  55994. * @version 11.1.0
  55995. * @extends {ProcessingServiceBase}
  55996. * @param {string} url - 服务地址。
  55997. * @param {Object} options - 可选参数。
  55998. * @param {string} [options.proxy] - 服务代理地址。
  55999. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  56000. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  56001. * @param {Object} [options.headers] - 请求头。
  56002. * @usage
  56003. */
  56004. var KnowledgeGraphService = /*#__PURE__*/function (_CommonServiceBase) {
  56005. KnowledgeGraphService_inherits(KnowledgeGraphService, _CommonServiceBase);
  56006. var _super = KnowledgeGraphService_createSuper(KnowledgeGraphService);
  56007. function KnowledgeGraphService(url, options) {
  56008. var _this;
  56009. KnowledgeGraphService_classCallCheck(this, KnowledgeGraphService);
  56010. _this = _super.call(this, url, options);
  56011. _this.options = options || {};
  56012. _this.eventCount = 0;
  56013. _this.CLASS_NAME = 'SuperMap.KnowledgeGraphService';
  56014. return _this;
  56015. }
  56016. /**
  56017. * @function KnowledgeGraphService.prototype.destroy
  56018. * @override
  56019. */
  56020. KnowledgeGraphService_createClass(KnowledgeGraphService, [{
  56021. key: "destroy",
  56022. value: function destroy() {
  56023. KnowledgeGraphService_get(KnowledgeGraphService_getPrototypeOf(KnowledgeGraphService.prototype), "destroy", this).call(this);
  56024. }
  56025. /**
  56026. * @function KnowledgeGraphService.prototype.query
  56027. * @description 通过查询语句查询知识图谱数据。
  56028. * @param {string} params - 查询条件。
  56029. * @param {RequestCallback} callback 回调函数。
  56030. */
  56031. }, {
  56032. key: "query",
  56033. value: function query(params, callback) {
  56034. var paramKey = 'cypherQuery';
  56035. var url = Util_Util.urlAppend(this.url + '/query.json', "".concat(paramKey, "=").concat(params));
  56036. this.processAsync({
  56037. url: url,
  56038. method: 'GET',
  56039. callback: callback
  56040. });
  56041. }
  56042. // /**
  56043. // * @function KnowledgeGraphService.prototype.queryById
  56044. // * @description 根据实体id查询关联节点。
  56045. // * @param {string} id - 实体id。
  56046. // * @param {RequestCallback} callback 回调函数。
  56047. // */
  56048. // queryById(id, callback) {
  56049. // const paramKey = 'cypherQuery';
  56050. // const url = Util.urlAppend(this.url + '/query.json', `${paramKey}=match p=(n)-[]-(m) where id(n)=${id} return p;`);
  56051. // this.processAsync({ url, method: 'GET', callback });
  56052. // }
  56053. // /**
  56054. // * @function KnowledgeGraphService.prototype.getMetaData
  56055. // * @description 获取元信息(展示所有实体类型和关系类型。)
  56056. // * @param {RequestCallback} callback 回调函数。
  56057. // */
  56058. // getMetaData(callback) {
  56059. // const url = this.url + 'management/metadata.json';
  56060. // this.processAsync({ url, method: 'GET', callback });
  56061. // }
  56062. /**
  56063. * @function KnowledgeGraphService.prototype.getGraphMaps
  56064. * @description 获取图谱列表
  56065. * @param {RequestCallback} callback 回调函数。
  56066. */
  56067. }, {
  56068. key: "getGraphMaps",
  56069. value: function getGraphMaps(callback) {
  56070. var url = this.url + '/graphmaps.json';
  56071. this.processAsync({
  56072. url: url,
  56073. method: 'GET',
  56074. callback: callback
  56075. });
  56076. }
  56077. /**
  56078. * @function KnowledgeGraphService.prototype.getGraphMap
  56079. * @description 获取图谱图序列化数据
  56080. * @param {string} graphMapName 图谱名称
  56081. * @param {RequestCallback} callback 回调函数
  56082. */
  56083. }, {
  56084. key: "getGraphMap",
  56085. value: function getGraphMap(graphMapName, callback) {
  56086. var url = this.url + "/graphmaps/".concat(graphMapName, ".json");
  56087. this.processAsync({
  56088. url: url,
  56089. method: 'GET',
  56090. callback: callback
  56091. });
  56092. }
  56093. /**
  56094. * @function KnowledgeGraphService.prototype.getGraphMapData
  56095. * @description 将iServer GraphMap服务的数据格式转换为KnowledgeGraph的数据格式。
  56096. * @param {string} graphMapName - 图谱名称
  56097. * @returns {Promise} Promise 对象。
  56098. */
  56099. }, {
  56100. key: "getGraphMapData",
  56101. value: function () {
  56102. var _getGraphMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(graphMapName) {
  56103. var data, graphMap, query, queries, expandQueries, _queries, j, cypherQuery, res;
  56104. return _regeneratorRuntime().wrap(function _callee$(_context) {
  56105. while (1) switch (_context.prev = _context.next) {
  56106. case 0:
  56107. data = [];
  56108. _context.next = 3;
  56109. return this._getGraphMapData(graphMapName);
  56110. case 3:
  56111. graphMap = _context.sent;
  56112. if (graphMap) {
  56113. _context.next = 6;
  56114. break;
  56115. }
  56116. return _context.abrupt("return");
  56117. case 6:
  56118. query = graphMap.dataContent.queries && graphMap.dataContent.queries.query || [];
  56119. queries = [];
  56120. if (typeof query === 'string') {
  56121. queries = [query];
  56122. } else {
  56123. queries = query;
  56124. }
  56125. expandQueries = this._getGraphMapExpandQuery(graphMap);
  56126. if (expandQueries.length) {
  56127. (_queries = queries).push.apply(_queries, _toConsumableArray(expandQueries));
  56128. }
  56129. j = 0;
  56130. case 12:
  56131. if (!(j < queries.length)) {
  56132. _context.next = 21;
  56133. break;
  56134. }
  56135. cypherQuery = queries[j];
  56136. _context.next = 16;
  56137. return this._queryDataBySql(cypherQuery);
  56138. case 16:
  56139. res = _context.sent;
  56140. data = data.concat([], res);
  56141. case 18:
  56142. j++;
  56143. _context.next = 12;
  56144. break;
  56145. case 21:
  56146. return _context.abrupt("return", {
  56147. data: data,
  56148. graphMap: graphMap
  56149. });
  56150. case 22:
  56151. case "end":
  56152. return _context.stop();
  56153. }
  56154. }, _callee, this);
  56155. }));
  56156. function getGraphMapData(_x) {
  56157. return _getGraphMapData2.apply(this, arguments);
  56158. }
  56159. return getGraphMapData;
  56160. }()
  56161. /**
  56162. * @private
  56163. * @function KnowledgeGraphService.prototype._getGraphMapExpandQuery
  56164. * @description 获取graphMap图谱展开节点的query条件
  56165. * @param {Object} graphMap -将iServer GraphMap图谱服务的数据
  56166. * @param {Array.<string>} 查询条件
  56167. */
  56168. }, {
  56169. key: "_getGraphMapExpandQuery",
  56170. value: function _getGraphMapExpandQuery(graphMap) {
  56171. var queries = [];
  56172. var expandIds = graphMap.dataContent.expand && JSON.parse(graphMap.dataContent.expand) || [];
  56173. expandIds.forEach(function (id) {
  56174. queries.push("match p=(n)-[]-(m) where id(n)=".concat(id, " return p;"));
  56175. });
  56176. return queries;
  56177. }
  56178. // /**
  56179. // * @private
  56180. // * @function KnowledgeGraphService.prototype.getEntities
  56181. // * @description 获取实体。
  56182. // * @param {Object} params - 查询条件。{type:'院落', count:1}
  56183. // * @param {number} [params.count] - 返回个数
  56184. // * @param {RequestCallback} callback 回调函数
  56185. // */
  56186. // getEntities(params, callback) {
  56187. // const url = Util.urlAppend(this.url + '/entities.json', params);
  56188. // this.processAsync({ url, params, method: 'GET', callback });
  56189. // }
  56190. // /**
  56191. // * @private
  56192. // * @function KnowledgeGraphService.prototype.getEdges
  56193. // * @description 获取实体。
  56194. // * @param {Object} params - 查询条件。{type:'院落', count:1}
  56195. // * @param {number} [params.count] - 返回个数
  56196. // * @param {RequestCallback} callback 回调函数
  56197. // */
  56198. // getEdges(params, callback) {
  56199. // const url = Util.urlAppend(this.url + '/edges.json', params);
  56200. // this.processAsync({ url, params, method: 'GET', callback });
  56201. // }
  56202. // /**
  56203. // * @private
  56204. // * @function KnowledgeGraphService.prototype.getEntities
  56205. // * @description 获取实体。
  56206. // * @param {number} id - 查询条件。{type:'院落', count:1}
  56207. // * @param {RequestCallback} callback 回调函数
  56208. // */
  56209. // deleteEntitiy(id, callback) {
  56210. // const url = Util.urlAppend(this.url + '/entities.json', `id=${id}`);
  56211. // this.processAsync({ url, method: 'DELETE', callback });
  56212. // }
  56213. // /**
  56214. // * @private
  56215. // * @function KnowledgeGraphService.prototype.addNode
  56216. // * @description 获取实体。
  56217. // * @param {Object} params - 查询条件
  56218. // * @param {number} [params.count] - 返回个数
  56219. // * @param {RequestCallback} callback 回调函数
  56220. // */
  56221. // addNode(params, callback) {
  56222. // if (!(params instanceof KnowledgeGraphNodeParameter)) {
  56223. // return;
  56224. // }
  56225. // const url = Util.urlAppend(this.url + '/entities.json', params);
  56226. // this.processAsync({ url, params, method: 'PUT', callback });
  56227. // }
  56228. // /**
  56229. // * @private
  56230. // * @function KnowledgeGraphService.prototype.addEdge
  56231. // * @description 获取实体。
  56232. // * @param {Object} params - 查询条件
  56233. // * @param {number} [params.count] - 返回个数
  56234. // * @param {RequestCallback} callback 回调函数
  56235. // */
  56236. // addEdge(params, callback) {
  56237. // if (!(params instanceof KnowledgeGraphEdgeParameter)) {
  56238. // return;
  56239. // }
  56240. // const url = Util.urlAppend(this.url + '/edges.json', params);
  56241. // this.processAsync({ url, params, method: 'PUT', callback });
  56242. // }
  56243. /**
  56244. * @function KnowledgeGraphService.prototype.processAsync
  56245. * @description 负责将客户端的动态分段服务参数传递到服务端。
  56246. * @param {string} url - 服务地址
  56247. * @param {Object} params - 参数
  56248. */
  56249. }, {
  56250. key: "processAsync",
  56251. value: function processAsync(_ref) {
  56252. var url = _ref.url,
  56253. params = _ref.params,
  56254. method = _ref.method,
  56255. callback = _ref.callback;
  56256. var eventId = ++this.eventCount;
  56257. var eventListeners = {
  56258. scope: this,
  56259. processCompleted: function processCompleted(result) {
  56260. if (eventId === result.result.eventId && callback) {
  56261. delete result.result.eventId;
  56262. callback(result);
  56263. this.events && this.events.un(eventListeners);
  56264. return false;
  56265. }
  56266. },
  56267. processFailed: function processFailed(result) {
  56268. if ((eventId === result.error.eventId || eventId === result.eventId) && callback) {
  56269. delete result.eventId;
  56270. callback(result);
  56271. this.events && this.events.un(eventListeners);
  56272. return false;
  56273. }
  56274. }
  56275. };
  56276. this.events.on(eventListeners);
  56277. var requestParams = {
  56278. method: method,
  56279. url: url,
  56280. scope: this,
  56281. success: function success(result, options) {
  56282. result.eventId = eventId;
  56283. this.serviceProcessCompleted(result, options);
  56284. },
  56285. failure: function failure(result, options) {
  56286. result.eventId = eventId;
  56287. this.serviceProcessFailed(result, options);
  56288. }
  56289. };
  56290. if (params) {
  56291. requestParams.params = params;
  56292. }
  56293. this.request(requestParams);
  56294. }
  56295. /**
  56296. * @private
  56297. * @function _getGraphMapData
  56298. * @description 获取图谱信息
  56299. * @param {string} graphMapName - 图谱名称
  56300. * @returns {Promise} Promise 对象
  56301. */
  56302. }, {
  56303. key: "_getGraphMapData",
  56304. value: function _getGraphMapData(graphMapName) {
  56305. var _this2 = this;
  56306. return new Promise(function (resolve, reject) {
  56307. _this2.getGraphMap(graphMapName, function (res) {
  56308. if (res.type === 'processFailed') {
  56309. reject(res.error);
  56310. } else {
  56311. if (res.result.data === '') {
  56312. reject('无数据');
  56313. } else {
  56314. resolve(res.result.graphMap);
  56315. }
  56316. }
  56317. });
  56318. });
  56319. }
  56320. /**
  56321. * @private
  56322. * @function _queryDataBySql
  56323. * @description 查询实体和关系数据。
  56324. * @param {string} cypherQuery - 查询语句
  56325. * @returns {Promise} Promise 对象。
  56326. */
  56327. }, {
  56328. key: "_queryDataBySql",
  56329. value: function _queryDataBySql(cypherQuery) {
  56330. var _this3 = this;
  56331. return new Promise(function (resolve, reject) {
  56332. _this3.query(cypherQuery, function (res) {
  56333. if (res.type === 'processFailed') {
  56334. reject(res.error);
  56335. } else {
  56336. resolve(res.result);
  56337. }
  56338. });
  56339. });
  56340. }
  56341. }]);
  56342. return KnowledgeGraphService;
  56343. }(CommonServiceBase);
  56344. ;// CONCATENATED MODULE: ./src/common/iServer/index.js
  56345. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56346. * This program are made available under the terms of the Apache License, Version 2.0
  56347. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56348. ;// CONCATENATED MODULE: ./src/common/online/OnlineResources.js
  56349. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56350. * This program are made available under the terms of the Apache License, Version 2.0
  56351. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56352. /**
  56353. * @enum ServiceStatus
  56354. * @category BaseTypes Constant
  56355. * @description 服务发布状态。
  56356. * @usage
  56357. * ```
  56358. * // 浏览器
  56359. * <script type="text/javascript" src="{cdn}"></script>
  56360. * <script>
  56361. * const result = {namespace}.ServiceStatus.DOES_NOT_INVOLVE;
  56362. *
  56363. * </script>
  56364. * // ES6 Import
  56365. * import { ServiceStatus } from '{npm}';
  56366. *
  56367. * const result = ServiceStatus.DOES_NOT_INVOLVE;
  56368. * ```
  56369. */
  56370. var ServiceStatus = {
  56371. /** 不涉及,不可发布。 */
  56372. DOES_NOT_INVOLVE: "DOES_NOT_INVOLVE",
  56373. /** 发布失败。 */
  56374. PUBLISH_FAILED: "PUBLISH_FAILED",
  56375. /** 已发布。 */
  56376. PUBLISHED: "PUBLISHED",
  56377. /** 正在发布。 */
  56378. PUBLISHING: "PUBLISHING",
  56379. /** 未发布。 */
  56380. UNPUBLISHED: "UNPUBLISHED",
  56381. /** 取消服务失败。 */
  56382. UNPUBLISHED_FAILED: "UNPUBLISHED_FAILED"
  56383. };
  56384. /**
  56385. * @enum DataItemOrderBy
  56386. * @category BaseTypes Constant
  56387. * @description 数据排序字段。
  56388. * @usage
  56389. * ```
  56390. * // 浏览器
  56391. * <script type="text/javascript" src="{cdn}"></script>
  56392. * <script>
  56393. * const result = {namespace}.DataItemOrderBy.FILENAME;
  56394. *
  56395. * </script>
  56396. * // ES6 Import
  56397. * import { DataItemOrderBy } from '{npm}';
  56398. *
  56399. * const result = DataItemOrderBy.FILENAME;
  56400. * ```
  56401. */
  56402. var DataItemOrderBy = {
  56403. /** 文件名。 */
  56404. FILENAME: "FILENAME",
  56405. /** ID。 */
  56406. ID: "ID",
  56407. /** 最后修改时间。 */
  56408. LASTMODIFIEDTIME: "LASTMODIFIEDTIME",
  56409. /** 作者昵称。 */
  56410. NICKNAME: "NICKNAME",
  56411. /** SERVICESTATUS。 */
  56412. SERVICESTATUS: "SERVICESTATUS",
  56413. /** 大小。 */
  56414. SIZE: "SIZE",
  56415. /** 状态。 */
  56416. STATUS: "STATUS",
  56417. /** 类型。 */
  56418. TYPE: "TYPE",
  56419. /** 更新时间。 */
  56420. UPDATETIME: "UPDATETIME",
  56421. /** 作者名。 */
  56422. USERNAME: "USERNAME"
  56423. };
  56424. /**
  56425. * @enum FilterField {number}
  56426. * @category BaseTypes Constant
  56427. * @description 关键字查询时的过滤字段。
  56428. * @usage
  56429. * ```
  56430. * // 浏览器
  56431. * <script type="text/javascript" src="{cdn}"></script>
  56432. * <script>
  56433. * const result = {namespace}.FilterField.LINKPAGE;
  56434. *
  56435. * </script>
  56436. * // ES6 Import
  56437. * import { FilterField } from '{npm}';
  56438. *
  56439. * const result = FilterField.LINKPAGE;
  56440. * ```
  56441. */
  56442. var FilterField = {
  56443. /** 服务地址。 */
  56444. LINKPAGE: "LINKPAGE",
  56445. /** 服务中包含的地图的名称。 */
  56446. MAPTITLE: "MAPTITLE",
  56447. /** 服务创建者昵称。 */
  56448. NICKNAME: "NICKNAME",
  56449. /** 服务名称。 */
  56450. RESTITLE: "RESTITLE",
  56451. /** 服务创建者用户名。 */
  56452. USERNAME: "USERNAME"
  56453. };
  56454. ;// CONCATENATED MODULE: ./src/common/online/OnlineServiceBase.js
  56455. function OnlineServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56456. 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); } }
  56457. 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; }
  56458. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56459. * This program are made available under the terms of the Apache License, Version 2.0
  56460. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56461. /**
  56462. * @class OnlineServiceBase
  56463. * @deprecatedclass SuperMap.OnlineServiceBase
  56464. * @classdesc Online 服务基类(使用 key 作为权限限制的类需要实现此类)。
  56465. * @category iPortal/Online Core
  56466. * @param {Object} options - 可选参数。
  56467. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  56468. * @param {Object} [options.headers] - 请求头。
  56469. * @usage
  56470. */
  56471. var OnlineServiceBase = /*#__PURE__*/function () {
  56472. function OnlineServiceBase(options) {
  56473. OnlineServiceBase_classCallCheck(this, OnlineServiceBase);
  56474. options = options || {};
  56475. Util_Util.extend(this, options);
  56476. this.CLASS_NAME = "SuperMap.OnlineServiceBase";
  56477. }
  56478. /**
  56479. * @function OnlineServiceBase.prototype.request
  56480. * @description 请求 online 服务
  56481. * @param {string} [method='GET'] - 请求方式, 'GET', 'PUT', 'POST', 'DELETE'。
  56482. * @param {string} url - 服务地址。
  56483. * @param {Object} param - URL 查询参数。
  56484. * @param {Object} [requestOptions] - http 请求参数, 比如请求头,超时时间等。
  56485. * @returns {Promise} 包含请求结果的 Promise 对象。
  56486. */
  56487. OnlineServiceBase_createClass(OnlineServiceBase, [{
  56488. key: "request",
  56489. value: function request(method, url, param) {
  56490. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  56491. url = SecurityManager.appendCredential(url);
  56492. requestOptions['crossOrigin'] = this.options.crossOrigin;
  56493. requestOptions['headers'] = this.options.headers;
  56494. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  56495. return response.json();
  56496. });
  56497. }
  56498. }]);
  56499. return OnlineServiceBase;
  56500. }();
  56501. ;// CONCATENATED MODULE: ./src/common/online/OnlineData.js
  56502. 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); }
  56503. function OnlineData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56504. 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); } }
  56505. 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; }
  56506. 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); }
  56507. 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); }
  56508. 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); }; }
  56509. 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); }
  56510. function OnlineData_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  56511. 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; } }
  56512. function OnlineData_getPrototypeOf(o) { OnlineData_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OnlineData_getPrototypeOf(o); }
  56513. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56514. * This program are made available under the terms of the Apache License, Version 2.0
  56515. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56516. /**
  56517. * @class OnlineData
  56518. * @deprecatedclass SuperMap.OnlineData
  56519. * @classdesc Online myData 服务。
  56520. * @category iPortal/Online Resources Data
  56521. * @param {string} serviceRootUrl - 服务地址。
  56522. * @param {Object} options - 可选参数。
  56523. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  56524. * @param {Object} [options.headers] - 请求头。
  56525. * @usage
  56526. * @extends OnlineServiceBase
  56527. */
  56528. var OnlineData = /*#__PURE__*/function (_OnlineServiceBase) {
  56529. OnlineData_inherits(OnlineData, _OnlineServiceBase);
  56530. var _super = OnlineData_createSuper(OnlineData);
  56531. //TODO 目前并没有对接服务支持的所有操作,日后需要补充完整
  56532. function OnlineData(serviceRootUrl, options) {
  56533. var _this;
  56534. OnlineData_classCallCheck(this, OnlineData);
  56535. _this = _super.call(this, serviceRootUrl);
  56536. options = options || {};
  56537. //MD5
  56538. _this.MD5 = null;
  56539. //文件类型。
  56540. _this.type = null;
  56541. //数据上传者名称。
  56542. _this.userName = null;
  56543. //文件名称。
  56544. _this.fileName = null;
  56545. //文件大小,单位为 B 。
  56546. _this.size = null;
  56547. //服务发布状态。
  56548. _this.serviceStatus = null;
  56549. //服务 id 。
  56550. _this.serviceId = null;
  56551. //数据项 id 。
  56552. _this.id = null;
  56553. //最后修改时间。
  56554. _this.lastModfiedTime = null;
  56555. //文件状态。
  56556. _this.status = null;
  56557. //数据文件存储 id 。
  56558. _this.storageId = null;
  56559. //数据的发布信息。
  56560. _this.publishInfo = null;
  56561. //数据的权限信息。
  56562. _this.authorizeSetting = null;
  56563. //用户的昵称。
  56564. _this.nickname = null;
  56565. //数据的标签。
  56566. _this.tags = [];
  56567. //数据的描述信息。
  56568. _this.description = null;
  56569. //数据发布的服务信息集合。
  56570. _this.dataItemServices = null;
  56571. //数据坐标类型。
  56572. _this.coordType = null;
  56573. //数据审核信息
  56574. _this.dataCheckResult = null;
  56575. //数据元数据信息
  56576. _this.dataMetaInfo = null;
  56577. //数据的缩略图路径。
  56578. _this.thumbnail = null;
  56579. Util_Util.extend(OnlineData_assertThisInitialized(_this), options);
  56580. if (_this.id) {
  56581. _this.serviceUrl = serviceRootUrl + "/" + _this.id;
  56582. }
  56583. _this.CLASS_NAME = "SuperMap.OnlineData";
  56584. return _this;
  56585. }
  56586. /**
  56587. * @function OnlineData.prototype.load
  56588. * @description 通过 URL 请求获取该服务完整信息。
  56589. * @returns {Promise} 不包含请求结果的 Promise 对象,请求返回结果自动填充到该类属性中。
  56590. */
  56591. OnlineData_createClass(OnlineData, [{
  56592. key: "load",
  56593. value: function load() {
  56594. if (!this.serviceUrl) {
  56595. return;
  56596. }
  56597. var me = this;
  56598. return me.request("GET", this.serviceUrl).then(function (result) {
  56599. Util_Util.extend(me, result);
  56600. });
  56601. }
  56602. /**
  56603. * @function OnlineData.prototype.getPublishedServices
  56604. * @description 获取数据发布的所有服务。
  56605. * @returns {Object} 数据发布的所有服务。
  56606. */
  56607. }, {
  56608. key: "getPublishedServices",
  56609. value: function getPublishedServices() {
  56610. return this.dataItemServices;
  56611. }
  56612. /**
  56613. * @function OnlineData.prototype.getAuthorizeSetting
  56614. * @description 获取数据的权限信息。
  56615. * @returns {Object} 权限信息。
  56616. */
  56617. }, {
  56618. key: "getAuthorizeSetting",
  56619. value: function getAuthorizeSetting() {
  56620. return this.authorizeSetting;
  56621. }
  56622. }]);
  56623. return OnlineData;
  56624. }(OnlineServiceBase);
  56625. ;// CONCATENATED MODULE: ./src/common/online/Online.js
  56626. function Online_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56627. 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); } }
  56628. 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; }
  56629. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56630. * This program are made available under the terms of the Apache License, Version 2.0
  56631. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56632. /**
  56633. * @class Online
  56634. * @deprecatedclass SuperMap.Online
  56635. * @classdesc 对接 SuperMap Online 所有基础服务。
  56636. * @category iPortal/Online Resources
  56637. * @modulecategory Services
  56638. * @example
  56639. * var online=new Online();
  56640. * var services = online.queryDatas(param);
  56641. * service.then(function(services){
  56642. * var service= services[0];
  56643. * service.updateDataInfo();
  56644. * })
  56645. * @usage
  56646. */
  56647. var Online = /*#__PURE__*/function () {
  56648. //TODO 目前并没有对接Online的所有操作,需要补充完整
  56649. //所有查询返回的是一个Promise,在外部使用的时候通过Promise的then方法获取异步结果
  56650. function Online() {
  56651. Online_classCallCheck(this, Online);
  56652. this.rootUrl = "https://www.supermapol.com";
  56653. this.webUrl = this.rootUrl + "/web";
  56654. var mContentUrl = this.webUrl + "/mycontent";
  56655. this.mDatasUrl = mContentUrl + "/datas";
  56656. this.CLASS_NAME = "SuperMap.Online";
  56657. }
  56658. /**
  56659. * @function Online.prototype.load
  56660. * @description 加载 online,验证 online 是否可用。
  56661. * @returns {Promise} 包含网络请求结果的 Promise 对象。
  56662. */
  56663. Online_createClass(Online, [{
  56664. key: "load",
  56665. value: function load() {
  56666. return FetchRequest.get(this.rootUrl).then(function (response) {
  56667. return response;
  56668. });
  56669. }
  56670. /**
  56671. * @function Online.prototype.login
  56672. * @description 登录Online
  56673. */
  56674. }, {
  56675. key: "login",
  56676. value: function login() {
  56677. SecurityManager.loginOnline(this.rootUrl, true);
  56678. }
  56679. /**
  56680. * @function Online.prototype.queryDatas
  56681. * @description 查询 Online “我的内容” 下 “我的数据” 服务(需要登录状态获取),并返回可操作的服务对象。
  56682. * @param {OnlineQueryDatasParameter} parameter - myDatas 服务资源查询参数。
  56683. * @returns {Promise} 包含所有数据服务信息的 Promise 对象。
  56684. */
  56685. }, {
  56686. key: "queryDatas",
  56687. value: function queryDatas(parameter) {
  56688. var me = this,
  56689. url = me.mDatasUrl;
  56690. if (parameter) {
  56691. parameter = parameter.toJSON();
  56692. }
  56693. return FetchRequest.get(url, parameter).then(function (json) {
  56694. if (!json || !json.content || json.content.length < 1) {
  56695. return;
  56696. }
  56697. var services = [],
  56698. contents = json.content,
  56699. len = contents.length;
  56700. for (var i = 0; i < len; i++) {
  56701. var content = contents[i];
  56702. var service = new OnlineData(me.mDatasUrl, content);
  56703. services.push(service);
  56704. }
  56705. return services;
  56706. });
  56707. }
  56708. }]);
  56709. return Online;
  56710. }();
  56711. ;// CONCATENATED MODULE: ./src/common/online/OnlineQueryDatasParameter.js
  56712. function OnlineQueryDatasParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56713. 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); } }
  56714. 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; }
  56715. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56716. * This program are made available under the terms of the Apache License, Version 2.0
  56717. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56718. /**
  56719. * @class OnlineQueryDatasParameter
  56720. * @deprecatedclass SuperMap.OnlineQueryDatasParameter
  56721. * @classdesc myDatas 服务资源查询参数。
  56722. * @category iPortal/Online Resources Data
  56723. * @param {Object} options - 参数。
  56724. * @usage
  56725. */
  56726. var OnlineQueryDatasParameter = /*#__PURE__*/function () {
  56727. function OnlineQueryDatasParameter(options) {
  56728. OnlineQueryDatasParameter_classCallCheck(this, OnlineQueryDatasParameter);
  56729. options = options || {};
  56730. /**
  56731. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.userNames
  56732. * @description 数据作者名。可以根据数据作者名查询,默认查询全部。
  56733. */
  56734. this.userNames = null;
  56735. /**
  56736. * @member {Array.<Object>} OnlineQueryDatasParameter.prototype.types
  56737. * @description 数据类型。
  56738. */
  56739. this.types = null;
  56740. /**
  56741. * @member {string} OnlineQueryDatasParameter.prototype.fileName
  56742. * @description 文件名称。
  56743. */
  56744. this.fileName = null;
  56745. /**
  56746. * @member {string} OnlineQueryDatasParameter.prototype.serviceStatuses
  56747. * @description 服务发布状态。
  56748. */
  56749. this.serviceStatuses = null;
  56750. /**
  56751. * @member {string} OnlineQueryDatasParameter.prototype.serviceId
  56752. * @description 服务 ID。
  56753. */
  56754. this.serviceId = null;
  56755. /**
  56756. * @member {Array.<number>} OnlineQueryDatasParameter.prototype.ids
  56757. * @description 由数据项 ID 组成的整型数组。
  56758. */
  56759. this.ids = null;
  56760. /**
  56761. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.keywords
  56762. * @description 关键字。
  56763. */
  56764. this.keywords = null;
  56765. /**
  56766. * @member {string} OnlineQueryDatasParameter.prototype.orderBy
  56767. * @description 排序字段。
  56768. */
  56769. this.orderBy = null;
  56770. /**
  56771. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.tags
  56772. * @description 数据的标签。
  56773. */
  56774. this.tags = null;
  56775. /**
  56776. * @member {Array.<string>} OnlineQueryDatasParameter.prototype.filterFields
  56777. * @description 用于关键字查询时的过滤字段。
  56778. */
  56779. this.filterFields = null;
  56780. Util_Util.extend(this, options);
  56781. this.CLASS_NAME = "SuperMap.OnlineQueryDatasParameter";
  56782. }
  56783. /**
  56784. * @function OnlineQueryDatasParameter.prototype.toJSON
  56785. * @description 返回对应的 JSON 对象。
  56786. * @returns {Object} 对应的 JSON 对象。
  56787. */
  56788. OnlineQueryDatasParameter_createClass(OnlineQueryDatasParameter, [{
  56789. key: "toJSON",
  56790. value: function toJSON() {
  56791. var me = this;
  56792. var jsonObj = {
  56793. "types": me.types,
  56794. "fileName": me.fileName,
  56795. "serviceStatuses": me.serviceStatuses,
  56796. "serviceId": me.serviceId,
  56797. "ids": me.ids,
  56798. "keywords": me.keywords,
  56799. "orderBy": me.orderBy,
  56800. "tags": me.tags,
  56801. "filterFields": me.filterFields
  56802. };
  56803. for (var key in jsonObj) {
  56804. if (jsonObj[key] == null) {
  56805. delete jsonObj[key];
  56806. }
  56807. }
  56808. return jsonObj;
  56809. }
  56810. }]);
  56811. return OnlineQueryDatasParameter;
  56812. }();
  56813. ;// CONCATENATED MODULE: ./src/common/online/index.js
  56814. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56815. * This program are made available under the terms of the Apache License, Version 2.0
  56816. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56817. ;// CONCATENATED MODULE: ./src/common/security/KeyServiceParameter.js
  56818. function KeyServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56819. 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); } }
  56820. 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; }
  56821. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56822. * This program are made available under the terms of the Apache License, Version 2.0
  56823. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56824. /**
  56825. * @class KeyServiceParameter
  56826. * @deprecatedclass SuperMap.KeyServiceParameter
  56827. * @classdesc key申请参数
  56828. * @category Security
  56829. * @param {Object} options - 参数。
  56830. * @param {string} options.name - 申请服务名称。
  56831. * @param {number} options.serviceIds - 服务 ID。
  56832. * @param {ClientType} [options.clientType=ClientType.SERVER] - 服务端类型。
  56833. * @param {number} options.limitation - 有效期
  56834. * @usage
  56835. */
  56836. var KeyServiceParameter = /*#__PURE__*/function () {
  56837. function KeyServiceParameter(options) {
  56838. KeyServiceParameter_classCallCheck(this, KeyServiceParameter);
  56839. this.name = null;
  56840. this.serviceIds = null;
  56841. this.clientType = ClientType.SERVER;
  56842. this.limitation = null;
  56843. Util_Util.extend(this, options);
  56844. this.CLASS_NAME = "SuperMap.KeyServiceParameter";
  56845. }
  56846. /**
  56847. * @function KeyServiceParameter.prototype.toJSON
  56848. * @description 转换成 JSON 对象
  56849. * @returns {Object} 参数的 JSON 对象
  56850. */
  56851. KeyServiceParameter_createClass(KeyServiceParameter, [{
  56852. key: "toJSON",
  56853. value: function toJSON() {
  56854. return {
  56855. name: this.name,
  56856. serviceIds: this.serviceIds,
  56857. clientType: this.clientType,
  56858. limitation: this.limitation
  56859. };
  56860. }
  56861. }]);
  56862. return KeyServiceParameter;
  56863. }();
  56864. ;// CONCATENATED MODULE: ./src/common/security/ServerInfo.js
  56865. 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); } }
  56866. 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; }
  56867. function ServerInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56868. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56869. * This program are made available under the terms of the Apache License, Version 2.0
  56870. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56871. /**
  56872. * @class ServerInfo
  56873. * @deprecatedclass SuperMap.ServerInfo
  56874. * @classdesc 服务器信息(安全相关),包含服务器类型,服务地址,token服务地址等。
  56875. * @category Security
  56876. * @param {string} type - 服务器类型。
  56877. * @param {Object} options - 参数。
  56878. * @param {string} options.server - 服务器地址,如:http://supermapiserver:8090/iserver。
  56879. * @param {string} [options.tokenServiceUrl] - 如:http://supermapiserver:8090/iserver/services/security/tokens.json。
  56880. * @param {string} [options.keyServiceUrl] - 如:http://supermapiserver:8092/web/mycontent/keys/register.json。
  56881. * @usage
  56882. */
  56883. var ServerInfo = /*#__PURE__*/ServerInfo_createClass(function ServerInfo(type, options) {
  56884. ServerInfo_classCallCheck(this, ServerInfo);
  56885. /**
  56886. * @member {ServerType} ServerInfo.prototype.type
  56887. * @description 服务器类型。
  56888. */
  56889. this.type = type;
  56890. /**
  56891. * @member {string} ServerInfo.prototype.server
  56892. * @description 服务器地址。
  56893. */
  56894. this.server = null;
  56895. /**
  56896. * @member {string} [ServerInfo.prototype.tokenServiceUrl]
  56897. * @description 如:http://supermapiserver:8090/iserver/services/security/tokens.json。
  56898. */
  56899. this.tokenServiceUrl = null;
  56900. /**
  56901. * @member {string} [ServerInfo.prototype.keyServiceUrl]
  56902. * @description 如:http://supermapiserver:8092/web/mycontent/keys/register.json。
  56903. */
  56904. this.keyServiceUrl = null;
  56905. Util_Util.extend(this, options);
  56906. this.CLASS_NAME = "SuperMap.ServerInfo";
  56907. this.type = this.type || ServerType.ISERVER;
  56908. if (!this.server) {
  56909. console.error('server url require is not undefined');
  56910. }
  56911. // var patten = /http:\/\/([^\/]+)/i;
  56912. //this.server = this.server.match(patten)[0];
  56913. var tokenServiceSuffix = "/services/security/tokens";
  56914. if (this.type === ServerType.ISERVER && this.server.indexOf("iserver") < 0) {
  56915. tokenServiceSuffix = "/iserver" + tokenServiceSuffix;
  56916. }
  56917. if (!this.tokenServiceUrl) {
  56918. this.tokenServiceUrl = Util_Util.urlPathAppend(this.server, tokenServiceSuffix);
  56919. }
  56920. if (!this.keyServiceUrl) {
  56921. if (this.type === ServerType.IPORTAL) {
  56922. this.keyServiceUrl = Util_Util.urlPathAppend(this.server, "/web/mycontent/keys/register");
  56923. } else if (this.type === ServerType.ONLINE) {
  56924. this.keyServiceUrl = Util_Util.urlPathAppend(this.server, "/web/mycontent/keys");
  56925. }
  56926. }
  56927. });
  56928. ;// CONCATENATED MODULE: ./src/common/security/TokenServiceParameter.js
  56929. function TokenServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56930. 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); } }
  56931. 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; }
  56932. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  56933. * This program are made available under the terms of the Apache License, Version 2.0
  56934. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56935. /**
  56936. * @class TokenServiceParameter
  56937. * @deprecatedclass SuperMap.TokenServiceParameter
  56938. * @classdesc token 申请参数。
  56939. * @category Security
  56940. * @param {Object} options - 参数。
  56941. * @param {string} options.username - 用户名。
  56942. * @param {string} options.password - 密码。
  56943. * @param {ClientType} [options.clientType='ClientType.NONE'] - token 申请的客户端标识类型。
  56944. * @param {string} [options.ip] - clientType=IP 时,此为必选参数。
  56945. * @param {string} [options.referer] -clientType=Referer 时,此为必选参数。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  56946. * @param {number} [options.expiration=60] - 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  56947. * @usage
  56948. *
  56949. */
  56950. var TokenServiceParameter = /*#__PURE__*/function () {
  56951. function TokenServiceParameter(options) {
  56952. TokenServiceParameter_classCallCheck(this, TokenServiceParameter);
  56953. /**
  56954. * @member {string} TokenServiceParameter.prototype.userName
  56955. * @description 用户名。
  56956. */
  56957. this.userName = null;
  56958. /**
  56959. * @member {string} TokenServiceParameter.prototype.password
  56960. * @description 密码。
  56961. */
  56962. this.password = null;
  56963. /**
  56964. * @member {ClientType} TokenServiceParameter.prototype.clientType
  56965. * @description token 申请的客户端标识类型。
  56966. */
  56967. this.clientType = ClientType.NONE;
  56968. /**
  56969. * @member {string} [TokenServiceParameter.prototype.ip]
  56970. * @description clientType=IP 时,此为必选参数。
  56971. */
  56972. this.ip = null;
  56973. /**
  56974. * @member {string} [TokenServiceParameter.prototype.referer]
  56975. * @description clientType=Referer 时,此为必选参数。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  56976. */
  56977. this.referer = null;
  56978. /**
  56979. * @member {number} TokenServiceParameter.prototype.expiration
  56980. * @description 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  56981. */
  56982. this.expiration = 60;
  56983. Util_Util.extend(this, options);
  56984. this.CLASS_NAME = "SuperMap.TokenServiceParameter";
  56985. }
  56986. /**
  56987. * @function TokenServiceParameter.prototype.toJSON
  56988. * @description 将所有信息转成 JSON 字符串。
  56989. * @returns {string} 参数的 JSON 字符串。
  56990. */
  56991. TokenServiceParameter_createClass(TokenServiceParameter, [{
  56992. key: "toJSON",
  56993. value: function toJSON() {
  56994. return {
  56995. userName: this.userName,
  56996. password: this.password,
  56997. clientType: this.clientType,
  56998. ip: this.ip,
  56999. referer: this.referer,
  57000. expiration: this.expiration
  57001. };
  57002. }
  57003. }]);
  57004. return TokenServiceParameter;
  57005. }();
  57006. ;// CONCATENATED MODULE: ./src/common/security/index.js
  57007. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57008. * This program are made available under the terms of the Apache License, Version 2.0
  57009. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57010. ;// CONCATENATED MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
  57011. var external_function_try_return_elasticsearch_catch_e_return_namespaceObject = function(){try{return elasticsearch}catch(e){return {}}}();
  57012. var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_namespaceObject);
  57013. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
  57014. function ElasticSearch_toConsumableArray(arr) { return ElasticSearch_arrayWithoutHoles(arr) || ElasticSearch_iterableToArray(arr) || ElasticSearch_unsupportedIterableToArray(arr) || ElasticSearch_nonIterableSpread(); }
  57015. 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."); }
  57016. 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); }
  57017. function ElasticSearch_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  57018. function ElasticSearch_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return ElasticSearch_arrayLikeToArray(arr); }
  57019. 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; }
  57020. function ElasticSearch_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57021. 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); } }
  57022. 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; }
  57023. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57024. * This program are made available under the terms of the Apache License, Version 2.0
  57025. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57026. /**
  57027. * @class ElasticSearch
  57028. * @deprecatedclass SuperMap.ElasticSearch
  57029. * @classdesc ElasticSearch服务类。
  57030. * @category ElasticSearch
  57031. * @modulecategory Services
  57032. * @param {string} url - ElasticSearch服务地址。
  57033. * @param {Object} options - 参数。
  57034. * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  57035. * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
  57036. * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
  57037. * @param {Object} [options.geoFence] - 地理围栏。
  57038. * @description
  57039. * <h3 style="font-size: 20px;margin-top: 20px;margin-bottom: 10px;">11.1.0</h3>
  57040. * 该功能依赖<a href="https://github.com/elastic/elasticsearch">@elastic/elasticsearch</a>, webpack5或其他不包含Node.js Polyfills的打包工具,需要加入相关配置,以webpack为例:<br/>
  57041. <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>
  57042. 然后配置webpack<pre><code>module.exports: {
  57043. resolve: {
  57044. alias: {
  57045. process: 'process/browser',
  57046. },
  57047. mainFields: ['browser', 'main'],
  57048. fallback: {
  57049. fs: false,
  57050. http: require.resolve('stream-http'),
  57051. https: require.resolve('https-browserify'),
  57052. os: require.resolve('os-browserify/browser'),
  57053. stream: require.resolve('stream-browserify'),
  57054. tty: require.resolve('tty-browserify'),
  57055. zlib: require.resolve('browserify-zlib')
  57056. }
  57057. }
  57058. plugins: [
  57059. new webpack.ProvidePlugin({
  57060. process: 'process/browser',
  57061. Buffer: ['buffer', 'Buffer']
  57062. }),
  57063. ]
  57064. }</code></pre>
  57065. * @usage
  57066. */
  57067. var ElasticSearch = /*#__PURE__*/function () {
  57068. function ElasticSearch(url, options) {
  57069. ElasticSearch_classCallCheck(this, ElasticSearch);
  57070. options = options || {};
  57071. /**
  57072. * @member {string} ElasticSearch.prototype.url
  57073. * @description ElasticSearch服务地址。
  57074. */
  57075. this.url = url;
  57076. /**
  57077. * @member {Object} ElasticSearch.prototype.client
  57078. * @description client ES客户端。
  57079. */
  57080. try {
  57081. // 老版本
  57082. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  57083. host: this.url
  57084. });
  57085. } catch (e) {
  57086. // 新版本
  57087. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  57088. node: {
  57089. url: new URL(this.url)
  57090. }
  57091. });
  57092. }
  57093. /**
  57094. * @deprecated
  57095. * @member {function} [ElasticSearch.prototype.change]
  57096. * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  57097. */
  57098. this.change = null;
  57099. /**
  57100. * @member {boolean} [ElasticSearch.prototype.openGeoFence=false]
  57101. * @description 是否开启地理围栏验证,默认为不开启。
  57102. */
  57103. this.openGeoFence = false;
  57104. /**
  57105. * @member {function} [ElasticSearch.prototype.outOfGeoFence]
  57106. * @description 数据超出地理围栏后执行的函数。
  57107. */
  57108. this.outOfGeoFence = null;
  57109. /**
  57110. * @member {Object} [ElasticSearch.prototype.geoFence]
  57111. * @description 地理围栏。
  57112. * @example {
  57113. * radius: 1000,//单位是m
  57114. * center: [104.40, 30.43],
  57115. * unit: 'meter|degree'
  57116. * }
  57117. */
  57118. this.geoFence = null;
  57119. /*
  57120. * Constant: EVENT_TYPES
  57121. * {Array.<String>}
  57122. * 此类支持的事件类型。
  57123. *
  57124. */
  57125. this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
  57126. /**
  57127. * @member {Events} ElasticSearch.prototype.events
  57128. * @description 事件。
  57129. */
  57130. this.events = new Events(this, null, this.EVENT_TYPES);
  57131. /**
  57132. * @member {Object} ElasticSearch.prototype.eventListeners
  57133. * @description 监听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
  57134. * 相当于调用 Events.on(eventListeners)。
  57135. */
  57136. this.eventListeners = null;
  57137. Util_Util.extend(this, options);
  57138. if (this.eventListeners instanceof Object) {
  57139. this.events.on(this.eventListeners);
  57140. }
  57141. }
  57142. /**
  57143. * @function ElasticSearch.prototype.setGeoFence
  57144. * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
  57145. * @param {Geometry} geoFence - 地理围栏。
  57146. */
  57147. ElasticSearch_createClass(ElasticSearch, [{
  57148. key: "setGeoFence",
  57149. value: function setGeoFence(geoFence) {
  57150. this.geoFence = geoFence;
  57151. }
  57152. /**
  57153. * @function ElasticSearch.prototype.bulk
  57154. * @description 批量操作API,允许执行多个索引/删除操作。
  57155. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
  57156. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
  57157. * @param {Object} params - 参数。
  57158. * @param {function} callback - 回调函数。
  57159. */
  57160. }, {
  57161. key: "bulk",
  57162. value: function bulk(params, callback) {
  57163. return this.client.bulk(params, this._handleCallback(callback));
  57164. }
  57165. /**
  57166. * @function ElasticSearch.prototype.clearScroll
  57167. * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
  57168. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
  57169. *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  57170. * @param {Object} params - 参数。
  57171. * @param {function} callback - 回调函数。
  57172. */
  57173. }, {
  57174. key: "clearScroll",
  57175. value: function clearScroll(params, callback) {
  57176. return this.client.clearScroll(params, this._handleCallback(callback));
  57177. }
  57178. /**
  57179. * @function ElasticSearch.prototype.count
  57180. * @description 获取集群、索引、类型或查询的文档个数。
  57181. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
  57182. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
  57183. * @param {Object} params - 参数。
  57184. * @param {function} callback - 回调函数。
  57185. */
  57186. }, {
  57187. key: "count",
  57188. value: function count(params, callback) {
  57189. return this.client.count(params, this._handleCallback(callback));
  57190. }
  57191. /**
  57192. * @function ElasticSearch.prototype.create
  57193. * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且ID已经存在的文档将发生错误。</br>
  57194. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
  57195. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
  57196. * @param {Object} params - 参数。
  57197. * @param {function} callback - 回调函数。
  57198. */
  57199. }, {
  57200. key: "create",
  57201. value: function create(params, callback) {
  57202. return this.client.create(params, this._handleCallback(callback));
  57203. }
  57204. /**
  57205. * @function ElasticSearch.prototype.delete
  57206. * @description 根据其ID从特定索引中删除键入的JSON文档。
  57207. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
  57208. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
  57209. * @param {Object} params - 参数。
  57210. * @param {function} callback - 回调函数。
  57211. */
  57212. }, {
  57213. key: "delete",
  57214. value: function _delete(params, callback) {
  57215. return this.client["delete"](params, this._handleCallback(callback));
  57216. }
  57217. /**
  57218. * @function ElasticSearch.prototype.deleteByQuery
  57219. * @description 根据其ID从特定索引中删除键入的JSON文档。
  57220. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
  57221. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
  57222. * @param {Object} params - 参数。
  57223. * @param {function} callback - 回调函数。
  57224. */
  57225. }, {
  57226. key: "deleteByQuery",
  57227. value: function deleteByQuery(params, callback) {
  57228. return this.client.deleteByQuery(params, this._handleCallback(callback));
  57229. }
  57230. /**
  57231. * @function ElasticSearch.prototype.deleteScript
  57232. * @description 根据其ID删除脚本。</br>
  57233. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
  57234. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  57235. * @param {Object} params - 参数。
  57236. * @param {function} callback - 回调函数。
  57237. */
  57238. }, {
  57239. key: "deleteScript",
  57240. value: function deleteScript(params, callback) {
  57241. return this.client.deleteScript(params, this._handleCallback(callback));
  57242. }
  57243. /**
  57244. * @function ElasticSearch.prototype.deleteTemplate
  57245. * @description 根据其ID删除模板。</br>
  57246. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
  57247. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  57248. * @param {Object} params - 参数。
  57249. * @param {function} callback - 回调函数。
  57250. */
  57251. }, {
  57252. key: "deleteTemplate",
  57253. value: function deleteTemplate(params, callback) {
  57254. return this.client.deleteTemplate(params, this._handleCallback(callback));
  57255. }
  57256. /**
  57257. * @function ElasticSearch.prototype.exists
  57258. * @description 检查给定文档是否存在。</br>
  57259. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
  57260. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  57261. * @param {Object} params - 参数。
  57262. * @param {function} callback - 回调函数。
  57263. */
  57264. }, {
  57265. key: "exists",
  57266. value: function exists(params, callback) {
  57267. return this.client.exists(params, this._handleCallback(callback));
  57268. }
  57269. /**
  57270. * @function ElasticSearch.prototype.existsSource
  57271. * @description 检查资源是否存在。</br>
  57272. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
  57273. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  57274. * @param {Object} params - 参数。
  57275. * @param {function} callback - 回调函数。
  57276. */
  57277. }, {
  57278. key: "existsSource",
  57279. value: function existsSource(params, callback) {
  57280. return this.client.existsSource(params, this._handleCallback(callback));
  57281. }
  57282. /**
  57283. * @function ElasticSearch.prototype.explain
  57284. * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
  57285. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
  57286. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
  57287. * @param {Object} params - 参数。
  57288. * @param {function} callback - 回调函数。
  57289. */
  57290. }, {
  57291. key: "explain",
  57292. value: function explain(params, callback) {
  57293. return this.client.explain(params, this._handleCallback(callback));
  57294. }
  57295. /**
  57296. * @function ElasticSearch.prototype.fieldCaps
  57297. * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
  57298. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
  57299. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
  57300. * @param {Object} params - 参数。
  57301. * @param {function} callback - 回调函数。
  57302. */
  57303. }, {
  57304. key: "fieldCaps",
  57305. value: function fieldCaps(params, callback) {
  57306. return this.client.fieldCaps(params, this._handleCallback(callback));
  57307. }
  57308. /**
  57309. * @function ElasticSearch.prototype.get
  57310. * @description 从索引获取一个基于其ID的类型的JSON文档。</br>
  57311. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
  57312. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  57313. * @param {Object} params - 参数。
  57314. * @param {function} callback - 回调函数。
  57315. */
  57316. }, {
  57317. key: "get",
  57318. value: function get(params, callback) {
  57319. return this.client.get(params, this._handleCallback(callback));
  57320. }
  57321. /**
  57322. * @function ElasticSearch.prototype.getScript
  57323. * @description 获取脚本。</br>
  57324. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
  57325. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  57326. * @param {Object} params - 参数。
  57327. * @param {function} callback - 回调函数。
  57328. */
  57329. }, {
  57330. key: "getScript",
  57331. value: function getScript(params, callback) {
  57332. return this.client.getScript(params, this._handleCallback(callback));
  57333. }
  57334. /**
  57335. * @function ElasticSearch.prototype.getSource
  57336. * @description 通过索引,类型和ID获取文档的源。</br>
  57337. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
  57338. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  57339. * @param {Object} params - 参数。
  57340. * @param {function} callback - 回调函数。
  57341. */
  57342. }, {
  57343. key: "getSource",
  57344. value: function getSource(params, callback) {
  57345. return this.client.getSource(params, this._handleCallback(callback));
  57346. }
  57347. /**
  57348. * @function ElasticSearch.prototype.getTemplate
  57349. * @description 获取模板。</br>
  57350. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
  57351. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  57352. * @param {Object} params - 参数。
  57353. * @param {function} callback - 回调函数。
  57354. */
  57355. }, {
  57356. key: "getTemplate",
  57357. value: function getTemplate(params, callback) {
  57358. return this.client.getTemplate(params, this._handleCallback(callback));
  57359. }
  57360. /**
  57361. * @function ElasticSearch.prototype.index
  57362. * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
  57363. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
  57364. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
  57365. * @param {Object} params - 参数。
  57366. * @param {function} callback - 回调函数。
  57367. */
  57368. }, {
  57369. key: "index",
  57370. value: function index(params, callback) {
  57371. return this.client.index(params, this._handleCallback(callback));
  57372. }
  57373. /**
  57374. * @function ElasticSearch.prototype.info
  57375. * @description 从当前集群获取基本信息。</br>
  57376. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
  57377. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  57378. * @param {Object} params - 参数。
  57379. * @param {function} callback - 回调函数。
  57380. */
  57381. }, {
  57382. key: "info",
  57383. value: function info(params, callback) {
  57384. return this.client.info(params, this._handleCallback(callback));
  57385. }
  57386. /**
  57387. * @function ElasticSearch.prototype.mget
  57388. * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
  57389. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
  57390. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
  57391. * @param {Object} params - 参数。
  57392. * @param {function} callback - 回调函数。
  57393. */
  57394. }, {
  57395. key: "mget",
  57396. value: function mget(params, callback) {
  57397. return this.client.mget(params, this._handleCallback(callback));
  57398. }
  57399. /**
  57400. * @function ElasticSearch.prototype.msearch
  57401. * @description 在同一请求中执行多个搜索请求。</br>
  57402. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
  57403. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
  57404. * @param {Object} params - 参数。
  57405. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  57406. * 回调参数:error,response,结果存储在response.responses中。
  57407. */
  57408. }, {
  57409. key: "msearch",
  57410. value: function msearch(params, callback) {
  57411. var me = this;
  57412. return me.client.msearch(params).then(function (resp) {
  57413. resp = resp.body || resp;
  57414. me._update(resp.responses, callback);
  57415. return resp;
  57416. }, function (err) {
  57417. callback(err);
  57418. me.events.triggerEvent('error', {
  57419. error: err
  57420. });
  57421. return err;
  57422. });
  57423. }
  57424. /**
  57425. * @function ElasticSearch.prototype.msearchTemplate
  57426. * @description 在同一请求中执行多个搜索模板请求。</br>
  57427. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
  57428. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  57429. * @param {Object} params - 参数。
  57430. * @param {function} callback - 回调函数。
  57431. */
  57432. }, {
  57433. key: "msearchTemplate",
  57434. value: function msearchTemplate(params, callback) {
  57435. return this.client.msearchTemplate(params, this._handleCallback(callback));
  57436. }
  57437. /**
  57438. * @function ElasticSearch.prototype.mtermvectors
  57439. * @description 多termvectors API允许一次获得多个termvectors。</br>
  57440. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
  57441. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
  57442. * @param {Object} params - 参数。
  57443. * @param {function} callback - 回调函数。
  57444. */
  57445. }, {
  57446. key: "mtermvectors",
  57447. value: function mtermvectors(params, callback) {
  57448. return this.client.mtermvectors(params, this._handleCallback(callback));
  57449. }
  57450. /**
  57451. * @function ElasticSearch.prototype.ping
  57452. * @description 测试连接。</br>
  57453. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
  57454. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  57455. * @param {Object} params - 参数。
  57456. * @param {function} callback - 回调函数。
  57457. */
  57458. }, {
  57459. key: "ping",
  57460. value: function ping(params, callback) {
  57461. return this.client.ping(params, this._handleCallback(callback));
  57462. }
  57463. /**
  57464. * @function ElasticSearch.prototype.putScript
  57465. * @description 添加脚本。</br>
  57466. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
  57467. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  57468. * @param {Object} params - 参数。
  57469. * @param {function} callback - 回调函数。
  57470. */
  57471. }, {
  57472. key: "putScript",
  57473. value: function putScript(params, callback) {
  57474. return this.client.putScript(params, this._handleCallback(callback));
  57475. }
  57476. /**
  57477. * @function ElasticSearch.prototype.putTemplate
  57478. * @description 添加模板。</br>
  57479. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
  57480. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  57481. * @param {Object} params - 参数。
  57482. * @param {function} callback - 回调函数。
  57483. */
  57484. }, {
  57485. key: "putTemplate",
  57486. value: function putTemplate(params, callback) {
  57487. return this.client.putTemplate(params, this._handleCallback(callback));
  57488. }
  57489. /**
  57490. * @function ElasticSearch.prototype.reindex
  57491. * @description 重新索引。</br>
  57492. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
  57493. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  57494. * @param {Object} params - 参数。
  57495. * @param {function} callback - 回调函数。
  57496. */
  57497. }, {
  57498. key: "reindex",
  57499. value: function reindex(params, callback) {
  57500. return this.client.reindex(params, this._handleCallback(callback));
  57501. }
  57502. /**
  57503. * @function ElasticSearch.prototype.reindexRessrottle
  57504. * @description 重新索引。</br>
  57505. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
  57506. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  57507. * @param {Object} params - 参数。
  57508. * @param {function} callback - 回调函数。
  57509. */
  57510. }, {
  57511. key: "reindexRessrottle",
  57512. value: function reindexRessrottle(params, callback) {
  57513. return this.client.reindexRessrottle(params, this._handleCallback(callback));
  57514. }
  57515. /**
  57516. * @function ElasticSearch.prototype.renderSearchTemplate
  57517. * @description 搜索模板。</br>
  57518. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
  57519. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  57520. * @param {Object} params - 参数。
  57521. * @param {function} callback - 回调函数。
  57522. */
  57523. }, {
  57524. key: "renderSearchTemplate",
  57525. value: function renderSearchTemplate(params, callback) {
  57526. return this.client.renderSearchTemplate(params, this._handleCallback(callback));
  57527. }
  57528. /**
  57529. * @function ElasticSearch.prototype.scroll
  57530. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
  57531. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
  57532. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  57533. * @param {Object} params - 参数。
  57534. * @param {function} callback - 回调函数。
  57535. */
  57536. }, {
  57537. key: "scroll",
  57538. value: function scroll(params, callback) {
  57539. return this.client.scroll(params, this._handleCallback(callback));
  57540. }
  57541. /**
  57542. * @function ElasticSearch.prototype.search
  57543. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
  57544. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
  57545. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
  57546. * @param {Object} params - 参数。
  57547. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  57548. * 回调参数:error,response,结果存储在response.responses中。
  57549. */
  57550. }, {
  57551. key: "search",
  57552. value: function search(params, callback) {
  57553. var me = this;
  57554. return me.client.search(params).then(function (resp) {
  57555. resp = resp.body || resp;
  57556. me._update(resp, callback);
  57557. return resp;
  57558. }, function (err) {
  57559. callback && callback(err);
  57560. me.events.triggerEvent('error', {
  57561. error: err
  57562. });
  57563. return err;
  57564. });
  57565. }
  57566. /**
  57567. * @function ElasticSearch.prototype.searchShards
  57568. * @description 返回要执行搜索请求的索引和分片。
  57569. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
  57570. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
  57571. * @param {Object} params - 参数。
  57572. * @param {function} callback - 回调函数。
  57573. */
  57574. }, {
  57575. key: "searchShards",
  57576. value: function searchShards(params, callback) {
  57577. return this.client.searchShards(params, this._handleCallback(callback));
  57578. }
  57579. /**
  57580. * @function ElasticSearch.prototype.searchTemplate
  57581. * @description 搜索模板。
  57582. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
  57583. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  57584. * @param {Object} params - 参数。
  57585. * @param {function} callback - 回调函数。
  57586. */
  57587. }, {
  57588. key: "searchTemplate",
  57589. value: function searchTemplate(params, callback) {
  57590. return this.client.searchTemplate(params, this._handleCallback(callback));
  57591. }
  57592. /**
  57593. * @function ElasticSearch.prototype.suggest
  57594. * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
  57595. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
  57596. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  57597. * @param {Object} params - 参数。
  57598. * @param {function} callback - 回调函数。
  57599. */
  57600. }, {
  57601. key: "suggest",
  57602. value: function suggest(params, callback) {
  57603. return this.client.suggest(params, this._handleCallback(callback));
  57604. }
  57605. /**
  57606. * @function ElasticSearch.prototype.termvectors
  57607. * @description 返回有关特定文档字段中的术语的信息和统计信息。
  57608. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
  57609. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
  57610. * @param {Object} params - 参数。
  57611. * @param {function} callback - 回调函数。
  57612. */
  57613. }, {
  57614. key: "termvectors",
  57615. value: function termvectors(params, callback) {
  57616. return this.client.termvectors(params, this._handleCallback(callback));
  57617. }
  57618. /**
  57619. * @function ElasticSearch.prototype.update
  57620. * @description 更新文档的部分。
  57621. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
  57622. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
  57623. * @param {Object} params - 参数。
  57624. * @param {function} callback - 回调函数。
  57625. */
  57626. }, {
  57627. key: "update",
  57628. value: function update(params, callback) {
  57629. return this.client.update(params, this._handleCallback(callback));
  57630. }
  57631. /**
  57632. * @function ElasticSearch.prototype.updateByQuery
  57633. * @description 通过查询API来更新文档。
  57634. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
  57635. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
  57636. * @param {Object} params - 参数。
  57637. * @param {function} callback - 回调函数。
  57638. */
  57639. }, {
  57640. key: "updateByQuery",
  57641. value: function updateByQuery(params, callback) {
  57642. return this.client.updateByQuery(params, this._handleCallback(callback));
  57643. }
  57644. /**
  57645. * @function ElasticSearch.prototype._handleCallback
  57646. * @description 处理ElasticSearch 16.x和5.x的callback兼容。 5.x的回调参数多包了一层body
  57647. * @param {function} callback - 回调函数。
  57648. * @private
  57649. */
  57650. }, {
  57651. key: "_handleCallback",
  57652. value: function _handleCallback(callback) {
  57653. return function () {
  57654. var args = Array.from(arguments);
  57655. var error = args.shift();
  57656. var resp = args.shift();
  57657. var body = resp && resp.body;
  57658. if (body) {
  57659. var _resp2 = resp,
  57660. statusCode = _resp2.statusCode,
  57661. headers = _resp2.headers;
  57662. args = [statusCode, headers];
  57663. resp = body;
  57664. }
  57665. callback.call.apply(callback, [this, error, resp].concat(ElasticSearch_toConsumableArray(args)));
  57666. };
  57667. }
  57668. }, {
  57669. key: "_update",
  57670. value: function _update(data, callback) {
  57671. var me = this;
  57672. if (!data) {
  57673. return;
  57674. }
  57675. me.data = data;
  57676. if (me.openGeoFence && me.geoFence) {
  57677. me._validateDatas(data);
  57678. }
  57679. me.events.triggerEvent('change', {
  57680. data: me.data
  57681. });
  57682. //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
  57683. if (me.change) {
  57684. me.change && me.change(data);
  57685. } else {
  57686. //加responses是为了保持跟原来es自身的数据结构一致
  57687. callback && callback(undefined, {
  57688. responses: data
  57689. });
  57690. }
  57691. }
  57692. }, {
  57693. key: "_validateDatas",
  57694. value: function _validateDatas(datas) {
  57695. if (!datas) {
  57696. return;
  57697. }
  57698. if (!(datas instanceof Array)) {
  57699. datas = [datas];
  57700. }
  57701. var i,
  57702. len = datas.length;
  57703. for (i = 0; i < len; i++) {
  57704. this._validateData(datas[i]);
  57705. }
  57706. }
  57707. }, {
  57708. key: "_validateData",
  57709. value: function _validateData(data) {
  57710. var me = this;
  57711. data.hits.hits.map(function (source) {
  57712. var content = source._source;
  57713. var meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
  57714. var geoFenceCX = me.geoFence.center[0] * meterUnit;
  57715. var geoFenceCY = me.geoFence.center[1] * meterUnit;
  57716. var contentX = content.x * meterUnit;
  57717. var contentY = content.y * meterUnit;
  57718. var distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
  57719. var radius = me.geoFence.radius;
  57720. if (distance > radius) {
  57721. me.outOfGeoFence && me.outOfGeoFence(data);
  57722. me.events.triggerEvent('outOfGeoFence', {
  57723. data: data
  57724. });
  57725. }
  57726. return source;
  57727. });
  57728. }
  57729. }, {
  57730. key: "_distance",
  57731. value: function _distance(x1, y1, x2, y2) {
  57732. return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  57733. }
  57734. }, {
  57735. key: "_getMeterPerMapUnit",
  57736. value: function _getMeterPerMapUnit(mapUnit) {
  57737. var earchRadiusInMeters = 6378137;
  57738. var meterPerMapUnit;
  57739. if (mapUnit === 'meter') {
  57740. meterPerMapUnit = 1;
  57741. } else if (mapUnit === 'degree') {
  57742. // 每度表示多少米。
  57743. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  57744. }
  57745. return meterPerMapUnit;
  57746. }
  57747. }]);
  57748. return ElasticSearch;
  57749. }();
  57750. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/index.js
  57751. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57752. * This program are made available under the terms of the Apache License, Version 2.0
  57753. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57754. ;// CONCATENATED MODULE: ./src/common/thirdparty/index.js
  57755. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57756. * This program are made available under the terms of the Apache License, Version 2.0
  57757. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57758. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Util.js
  57759. 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); }
  57760. function Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57761. 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); } }
  57762. 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; }
  57763. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  57764. * This program are made available under the terms of the Apache License, Version 2.0
  57765. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57766. /**
  57767. * @private
  57768. * @class LevelRenderer.Tool.Util
  57769. * @category Visualization Theme
  57770. * LevelRenderer 基础工具类
  57771. *
  57772. */
  57773. var levelRenderer_Util_Util = /*#__PURE__*/function () {
  57774. function Util() {
  57775. Util_classCallCheck(this, Util);
  57776. /**
  57777. * @member {Object} LevelRenderer.Tool.Util.prototype.BUILTIN_OBJECT
  57778. * @description 用于处理merge时无法遍历Date等对象的问题
  57779. */
  57780. this.BUILTIN_OBJECT = {
  57781. '[object Function]': 1,
  57782. '[object RegExp]': 1,
  57783. '[object Date]': 1,
  57784. '[object Error]': 1,
  57785. '[object CanvasGradient]': 1
  57786. };
  57787. /**
  57788. * @member {Object} LevelRenderer.Tool.Util.prototype._ctx
  57789. */
  57790. this._ctx = null;
  57791. /**
  57792. * Property: _canvas
  57793. * {Object}
  57794. */
  57795. this._canvas = null;
  57796. /**
  57797. * Property: _pixelCtx
  57798. * {Object}
  57799. */
  57800. this._pixelCtx = null;
  57801. /**
  57802. * Property: _width
  57803. * {Object}
  57804. */
  57805. this._width = null;
  57806. /**
  57807. * Property: _height
  57808. * {Object}
  57809. */
  57810. this._height = null;
  57811. /**
  57812. * Property: _offsetX
  57813. * {Object}
  57814. */
  57815. this._offsetX = 0;
  57816. /**
  57817. * Property: _offsetY
  57818. * {Object}
  57819. */
  57820. this._offsetY = 0;
  57821. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Util";
  57822. }
  57823. /**
  57824. * @function LevelRenderer.Tool.Util.prototype.clone
  57825. * @description 对一个object进行深度拷贝。
  57826. *
  57827. * @param {Object} source - 需要进行拷贝的对象。
  57828. * @return {Object} 拷贝后的新对象。
  57829. */
  57830. Util_createClass(Util, [{
  57831. key: "clone",
  57832. value: function clone(source) {
  57833. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  57834. if (Util_typeof(source) == 'object' && source !== null) {
  57835. var result = source;
  57836. if (source instanceof Array) {
  57837. result = [];
  57838. for (var i = 0, len = source.length; i < len; i++) {
  57839. result[i] = this.clone(source[i]);
  57840. }
  57841. } else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) {
  57842. result = {};
  57843. for (var key in source) {
  57844. if (source.hasOwnProperty(key)) {
  57845. result[key] = this.clone(source[key]);
  57846. }
  57847. }
  57848. }
  57849. return result;
  57850. }
  57851. return source;
  57852. }
  57853. /**
  57854. * @function LevelRenderer.Tool.Util.prototype.mergeItem
  57855. * @description 合并源对象的单个属性到目标对象。
  57856. *
  57857. * @param {Object} target - 目标对象。
  57858. * @param {Object} source - 源对象。
  57859. * @param {string} key - 键。
  57860. * @param {boolean} overwrite - 是否覆盖。
  57861. * @return {Object} 目标对象
  57862. */
  57863. }, {
  57864. key: "mergeItem",
  57865. value: function mergeItem(target, source, key, overwrite) {
  57866. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  57867. if (source.hasOwnProperty(key)) {
  57868. if (Util_typeof(target[key]) == 'object' && !BUILTIN_OBJECT[Object.prototype.toString.call(target[key])]) {
  57869. // 如果需要递归覆盖,就递归调用merge
  57870. this.merge(target[key], source[key], overwrite);
  57871. } else if (overwrite || !(key in target)) {
  57872. // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况
  57873. target[key] = source[key];
  57874. }
  57875. }
  57876. }
  57877. /**
  57878. * @function LevelRenderer.Tool.Util.prototype.merge
  57879. * @description 合并源对象的属性到目标对象。
  57880. *
  57881. * @param {Object} target - 目标对象。
  57882. * @param {Object} source - 源对象。
  57883. * @param {boolean} overwrite - 是否覆盖。
  57884. * @return {Object} 目标对象。
  57885. */
  57886. }, {
  57887. key: "merge",
  57888. value: function merge(target, source, overwrite) {
  57889. for (var i in source) {
  57890. this.mergeItem(target, source, i, overwrite);
  57891. }
  57892. return target;
  57893. }
  57894. /**
  57895. * @function LevelRenderer.Tool.Util.prototype.getContext
  57896. * @description 获取 Canvas 上下文。
  57897. * @return {Object} 上下文。
  57898. */
  57899. }, {
  57900. key: "getContext",
  57901. value: function getContext() {
  57902. if (!this._ctx) {
  57903. this._ctx = document.createElement('canvas').getContext('2d');
  57904. }
  57905. return this._ctx;
  57906. }
  57907. /**
  57908. * @function LevelRenderer.Tool.Util.prototype.getPixelContext
  57909. * @description 获取像素拾取专用的上下文。
  57910. * @return {Object} 像素拾取专用的上下文。
  57911. */
  57912. }, {
  57913. key: "getPixelContext",
  57914. value: function getPixelContext() {
  57915. if (!this._pixelCtx) {
  57916. this._canvas = document.createElement('canvas');
  57917. this._width = this._canvas.width;
  57918. this._height = this._canvas.height;
  57919. this._pixelCtx = this._canvas.getContext('2d');
  57920. }
  57921. return this._pixelCtx;
  57922. }
  57923. /**
  57924. * @function LevelRenderer.Tool.Util.prototype.adjustCanvasSize
  57925. * @description 如果坐标处在_canvas外部,改变_canvas的大小,修改canvas的大小 需要重新设置translate
  57926. *
  57927. * @param {number} x - 横坐标。
  57928. * @param {number} y - 纵坐标。
  57929. *
  57930. */
  57931. }, {
  57932. key: "adjustCanvasSize",
  57933. value: function adjustCanvasSize(x, y) {
  57934. var _canvas = this._canvas;
  57935. var _pixelCtx = this._pixelCtx;
  57936. var _width = this._width;
  57937. var _height = this._height;
  57938. var _offsetX = this._offsetX;
  57939. var _offsetY = this._offsetY;
  57940. // 每次加的长度
  57941. var _v = 100;
  57942. var _flag;
  57943. if (x + _offsetX > _width) {
  57944. _width = x + _offsetX + _v;
  57945. _canvas.width = _width;
  57946. _flag = true;
  57947. }
  57948. if (y + _offsetY > _height) {
  57949. _height = y + _offsetY + _v;
  57950. _canvas.height = _height;
  57951. _flag = true;
  57952. }
  57953. if (x < -_offsetX) {
  57954. _offsetX = Math.ceil(-x / _v) * _v;
  57955. _width += _offsetX;
  57956. _canvas.width = _width;
  57957. _flag = true;
  57958. }
  57959. if (y < -_offsetY) {
  57960. _offsetY = Math.ceil(-y / _v) * _v;
  57961. _height += _offsetY;
  57962. _canvas.height = _height;
  57963. _flag = true;
  57964. }
  57965. if (_flag) {
  57966. _pixelCtx.translate(_offsetX, _offsetY);
  57967. }
  57968. }
  57969. /**
  57970. * @function LevelRenderer.Tool.Util.prototype.getPixelOffset
  57971. * @description 获取像素canvas的偏移量。
  57972. * @return {Object} 偏移量。
  57973. */
  57974. }, {
  57975. key: "getPixelOffset",
  57976. value: function getPixelOffset() {
  57977. return {
  57978. x: this._offsetX,
  57979. y: this._offsetY
  57980. };
  57981. }
  57982. /**
  57983. * @function LevelRenderer.Tool.Util.prototype.indexOf
  57984. * @description 查询数组中元素的index
  57985. * @return {Object} 偏移量。
  57986. */
  57987. }, {
  57988. key: "indexOf",
  57989. value: function indexOf(array, value) {
  57990. if (array.indexOf) {
  57991. return array.indexOf(value);
  57992. }
  57993. for (var i = 0, len = array.length; i < len; i++) {
  57994. if (array[i] === value) {
  57995. return i;
  57996. }
  57997. }
  57998. return -1;
  57999. }
  58000. /**
  58001. * @function LevelRenderer.Tool.Util.prototype.inherits
  58002. * @description 构造类继承关系
  58003. *
  58004. * @param {function} clazz - 源类。
  58005. * @param {function} baseClazz - 基类。
  58006. * @return {Object} 偏移量。
  58007. */
  58008. }, {
  58009. key: "inherits",
  58010. value: function inherits(clazz, baseClazz) {
  58011. var clazzPrototype = clazz.prototype;
  58012. function F() {}
  58013. F.prototype = baseClazz.prototype;
  58014. clazz.prototype = new F();
  58015. for (var prop in clazzPrototype) {
  58016. clazz.prototype[prop] = clazzPrototype[prop];
  58017. }
  58018. clazz.constructor = clazz;
  58019. }
  58020. }]);
  58021. return Util;
  58022. }();
  58023. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Color.js
  58024. function Color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58025. 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); } }
  58026. 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; }
  58027. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  58028. * This program are made available under the terms of the Apache License, Version 2.0
  58029. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58030. /**
  58031. * @class LevelRenderer.Tool.Color
  58032. * @category Visualization Theme
  58033. * @classdesc LevelRenderer 工具-颜色辅助类
  58034. * @private
  58035. */
  58036. var Color = /*#__PURE__*/function () {
  58037. function Color() {
  58038. Color_classCallCheck(this, Color);
  58039. /**
  58040. * @member {LevelRenderer.Tool.Util} LevelRenderer.Tool.Color.prototype.util
  58041. * @description LevelRenderer 基础工具对象。
  58042. */
  58043. this.util = new levelRenderer_Util_Util();
  58044. /**
  58045. * @member {Object} LevelRenderer.Tool.Color.prototype._ctx
  58046. * @description _ctx。
  58047. */
  58048. this._ctx = null;
  58049. /**
  58050. * @member {Array.<string>} LevelRenderer.Tool.Color.prototype.palette
  58051. * @description 默认色板。色板是一个包含图表默认颜色系列的数组,当色板中所有颜色被使用过后,又将从新回到色板中的第一个颜色。
  58052. */
  58053. 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'];
  58054. /**
  58055. * @member {Array.<string>} LevelRenderer.Tool.Color.prototype._palette
  58056. * @description 复位色板,用于复位 palette
  58057. */
  58058. this._palette = this.palette;
  58059. /**
  58060. * @member {string} LevelRenderer.Tool.Color.prototype.highlightColor
  58061. * @description 高亮色
  58062. */
  58063. this.highlightColor = 'rgba(0,0,255,1)';
  58064. /**
  58065. * @member {string} LevelRenderer.Tool.Color.prototype._highlightColor
  58066. * @description 复位高亮色
  58067. */
  58068. this._highlightColor = this.highlightColor;
  58069. /**
  58070. * @member {string} LevelRenderer.Tool.Color.prototype.colorRegExp
  58071. * @description 颜色格式,正则表达式。
  58072. */
  58073. 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;
  58074. /**
  58075. * @member {string} LevelRenderer.Tool.Color.prototype._nameColors
  58076. * @description 颜色名。
  58077. */
  58078. this._nameColors = {
  58079. aliceblue: '#f0f8ff',
  58080. antiquewhite: '#faebd7',
  58081. aqua: '#0ff',
  58082. aquamarine: '#7fffd4',
  58083. azure: '#f0ffff',
  58084. beige: '#f5f5dc',
  58085. bisque: '#ffe4c4',
  58086. black: '#000',
  58087. blanchedalmond: '#ffebcd',
  58088. blue: '#00f',
  58089. blueviolet: '#8a2be2',
  58090. brown: '#a52a2a',
  58091. burlywood: '#deb887',
  58092. cadetblue: '#5f9ea0',
  58093. chartreuse: '#7fff00',
  58094. chocolate: '#d2691e',
  58095. coral: '#ff7f50',
  58096. cornflowerblue: '#6495ed',
  58097. cornsilk: '#fff8dc',
  58098. crimson: '#dc143c',
  58099. cyan: '#0ff',
  58100. darkblue: '#00008b',
  58101. darkcyan: '#008b8b',
  58102. darkgoldenrod: '#b8860b',
  58103. darkgray: '#a9a9a9',
  58104. darkgrey: '#a9a9a9',
  58105. darkgreen: '#006400',
  58106. darkkhaki: '#bdb76b',
  58107. darkmagenta: '#8b008b',
  58108. darkolivegreen: '#556b2f',
  58109. darkorange: '#ff8c00',
  58110. darkorchid: '#9932cc',
  58111. darkred: '#8b0000',
  58112. darksalmon: '#e9967a',
  58113. darkseagreen: '#8fbc8f',
  58114. darkslateblue: '#483d8b',
  58115. darkslategray: '#2f4f4f',
  58116. darkslategrey: '#2f4f4f',
  58117. darkturquoise: '#00ced1',
  58118. darkviolet: '#9400d3',
  58119. deeppink: '#ff1493',
  58120. deepskyblue: '#00bfff',
  58121. dimgray: '#696969',
  58122. dimgrey: '#696969',
  58123. dodgerblue: '#1e90ff',
  58124. firebrick: '#b22222',
  58125. floralwhite: '#fffaf0',
  58126. forestgreen: '#228b22',
  58127. fuchsia: '#f0f',
  58128. gainsboro: '#dcdcdc',
  58129. ghostwhite: '#f8f8ff',
  58130. gold: '#ffd700',
  58131. goldenrod: '#daa520',
  58132. gray: '#808080',
  58133. grey: '#808080',
  58134. green: '#008000',
  58135. greenyellow: '#adff2f',
  58136. honeydew: '#f0fff0',
  58137. hotpink: '#ff69b4',
  58138. indianred: '#cd5c5c',
  58139. indigo: '#4b0082',
  58140. ivory: '#fffff0',
  58141. khaki: '#f0e68c',
  58142. lavender: '#e6e6fa',
  58143. lavenderblush: '#fff0f5',
  58144. lawngreen: '#7cfc00',
  58145. lemonchiffon: '#fffacd',
  58146. lightblue: '#add8e6',
  58147. lightcoral: '#f08080',
  58148. lightcyan: '#e0ffff',
  58149. lightgoldenrodyellow: '#fafad2',
  58150. lightgray: '#d3d3d3',
  58151. lightgrey: '#d3d3d3',
  58152. lightgreen: '#90ee90',
  58153. lightpink: '#ffb6c1',
  58154. lightsalmon: '#ffa07a',
  58155. lightseagreen: '#20b2aa',
  58156. lightskyblue: '#87cefa',
  58157. lightslategray: '#789',
  58158. lightslategrey: '#789',
  58159. lightsteelblue: '#b0c4de',
  58160. lightyellow: '#ffffe0',
  58161. lime: '#0f0',
  58162. limegreen: '#32cd32',
  58163. linen: '#faf0e6',
  58164. magenta: '#f0f',
  58165. maroon: '#800000',
  58166. mediumaquamarine: '#66cdaa',
  58167. mediumblue: '#0000cd',
  58168. mediumorchid: '#ba55d3',
  58169. mediumpurple: '#9370d8',
  58170. mediumseagreen: '#3cb371',
  58171. mediumslateblue: '#7b68ee',
  58172. mediumspringgreen: '#00fa9a',
  58173. mediumturquoise: '#48d1cc',
  58174. mediumvioletred: '#c71585',
  58175. midnightblue: '#191970',
  58176. mintcream: '#f5fffa',
  58177. mistyrose: '#ffe4e1',
  58178. moccasin: '#ffe4b5',
  58179. navajowhite: '#ffdead',
  58180. navy: '#000080',
  58181. oldlace: '#fdf5e6',
  58182. olive: '#808000',
  58183. olivedrab: '#6b8e23',
  58184. orange: '#ffa500',
  58185. orangered: '#ff4500',
  58186. orchid: '#da70d6',
  58187. palegoldenrod: '#eee8aa',
  58188. palegreen: '#98fb98',
  58189. paleturquoise: '#afeeee',
  58190. palevioletred: '#d87093',
  58191. papayawhip: '#ffefd5',
  58192. peachpuff: '#ffdab9',
  58193. peru: '#cd853f',
  58194. pink: '#ffc0cb',
  58195. plum: '#dda0dd',
  58196. powderblue: '#b0e0e6',
  58197. purple: '#800080',
  58198. red: '#f00',
  58199. rosybrown: '#bc8f8f',
  58200. royalblue: '#4169e1',
  58201. saddlebrown: '#8b4513',
  58202. salmon: '#fa8072',
  58203. sandybrown: '#f4a460',
  58204. seagreen: '#2e8b57',
  58205. seashell: '#fff5ee',
  58206. sienna: '#a0522d',
  58207. silver: '#c0c0c0',
  58208. skyblue: '#87ceeb',
  58209. slateblue: '#6a5acd',
  58210. slategray: '#708090',
  58211. slategrey: '#708090',
  58212. snow: '#fffafa',
  58213. springgreen: '#00ff7f',
  58214. steelblue: '#4682b4',
  58215. tan: '#d2b48c',
  58216. teal: '#008080',
  58217. thistle: '#d8bfd8',
  58218. tomato: '#ff6347',
  58219. turquoise: '#40e0d0',
  58220. violet: '#ee82ee',
  58221. wheat: '#f5deb3',
  58222. white: '#fff',
  58223. whitesmoke: '#f5f5f5',
  58224. yellow: '#ff0',
  58225. yellowgreen: '#9acd32'
  58226. };
  58227. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Color";
  58228. }
  58229. /**
  58230. * @function LevelRenderer.Tool.Color.prototype.customPalette
  58231. * @description 自定义调色板。
  58232. * @param {Array.<string>} userPalete - 颜色板。
  58233. */
  58234. Color_createClass(Color, [{
  58235. key: "customPalette",
  58236. value: function customPalette(userPalete) {
  58237. this.palette = userPalete;
  58238. }
  58239. /**
  58240. * @function LevelRenderer.Tool.Color.prototype.resetPalette
  58241. * @description 复位默认色板。
  58242. */
  58243. }, {
  58244. key: "resetPalette",
  58245. value: function resetPalette() {
  58246. this.palette = this._palette;
  58247. }
  58248. /**
  58249. * @function LevelRenderer.Tool.Color.prototype.getColor
  58250. * @description 获取色板颜色。
  58251. * @param {number} idx - 色板位置。
  58252. * @param {Array.<string>} userPalete - 色板。
  58253. * @returns {string} 颜色值。
  58254. */
  58255. }, {
  58256. key: "getColor",
  58257. value: function getColor(idx, userPalete) {
  58258. idx = idx | 0;
  58259. userPalete = userPalete || this.palette;
  58260. return userPalete[idx % userPalete.length];
  58261. }
  58262. /**
  58263. * @function LevelRenderer.Tool.Color.prototype.customHighlight
  58264. * @description 自定义默认高亮颜色。
  58265. * @param {string} userHighlightColor - 自定义高亮色。
  58266. */
  58267. }, {
  58268. key: "customHighlight",
  58269. value: function customHighlight(userHighlightColor) {
  58270. this.highlightColor = userHighlightColor;
  58271. }
  58272. /**
  58273. * @function LevelRenderer.Tool.Color.prototype.resetHighlight
  58274. * @description 重置默认高亮颜色。将当前的高亮色作为默认高亮颜色
  58275. */
  58276. }, {
  58277. key: "resetHighlight",
  58278. value: function resetHighlight() {
  58279. this.highlightColor = this._highlightColor;
  58280. }
  58281. /**
  58282. * @function LevelRenderer.Tool.Color.prototype.getHighlightColor
  58283. * @description 获取默认高亮颜色
  58284. * @returns {string} 颜色值。
  58285. */
  58286. }, {
  58287. key: "getHighlightColor",
  58288. value: function getHighlightColor() {
  58289. return this.highlightColor;
  58290. }
  58291. /**
  58292. * @function LevelRenderer.Tool.Color.prototype.getRadialGradient
  58293. * @description 径向渐变。
  58294. * @param {number} x0 - 渐变起点横坐标。
  58295. * @param {number} y0 - 渐变起点纵坐标。
  58296. * @param {number} r0 - 半径
  58297. * @param {number} x1 - 渐变终点横坐标。
  58298. * @param {number} y1 - 渐变终点纵坐标。
  58299. * @param {number} r1 - 半径
  58300. * @param {Array} colorList - 颜色列表。
  58301. * @returns {CanvasGradient} Cavans 渐变颜色。
  58302. */
  58303. }, {
  58304. key: "getRadialGradient",
  58305. value: function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) {
  58306. var util = this.util;
  58307. if (!this._ctx) {
  58308. this._ctx = util.getContext();
  58309. }
  58310. var gradient = this._ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
  58311. for (var i = 0, l = colorList.length; i < l; i++) {
  58312. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  58313. }
  58314. gradient.__nonRecursion = true;
  58315. return gradient;
  58316. }
  58317. /**
  58318. * @function LevelRenderer.Tool.Color.prototype.getLinearGradient
  58319. * @description 线性渐变。
  58320. * @param {number} x0 - 渐变起点横坐标。
  58321. * @param {number} y0 - 渐变起点纵坐标。
  58322. * @param {number} x1 - 渐变终点横坐标。
  58323. * @param {number} y1 - 渐变终点纵坐标。
  58324. * @param {Array} colorList - 颜色列表。
  58325. * @returns {CanvasGradient} Cavans 渐变颜色。
  58326. */
  58327. }, {
  58328. key: "getLinearGradient",
  58329. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  58330. var util = this.util;
  58331. if (!this._ctx) {
  58332. this._ctx = util.getContext();
  58333. }
  58334. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  58335. for (var i = 0, l = colorList.length; i < l; i++) {
  58336. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  58337. }
  58338. gradient.__nonRecursion = true;
  58339. return gradient;
  58340. }
  58341. /**
  58342. * @function LevelRenderer.Tool.Color.prototype.getStepColors
  58343. * @description 获取两种颜色之间渐变颜色数组。
  58344. * @param {Object} start - 起始颜色对象。
  58345. * @param {Object} end - 结束颜色对象。
  58346. * @param {number} step - 渐变级数。
  58347. * @returns {Array} 颜色数组。
  58348. */
  58349. }, {
  58350. key: "getStepColors",
  58351. value: function getStepColors(start, end, step) {
  58352. start = this.toRGBA(start);
  58353. end = this.toRGBA(end);
  58354. start = this.getData(start);
  58355. end = this.getData(end);
  58356. var colors = [];
  58357. var stepR = (end[0] - start[0]) / step;
  58358. var stepG = (end[1] - start[1]) / step;
  58359. var stepB = (end[2] - start[2]) / step;
  58360. var stepA = (end[3] - start[3]) / step;
  58361. // 生成颜色集合
  58362. // fix by linfeng 颜色堆积
  58363. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  58364. 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');
  58365. r += stepR;
  58366. g += stepG;
  58367. b += stepB;
  58368. a += stepA;
  58369. }
  58370. r = end[0];
  58371. g = end[1];
  58372. b = end[2];
  58373. a = end[3];
  58374. colors[i] = this.toColor([r, g, b, a], 'rgba');
  58375. return colors;
  58376. }
  58377. /**
  58378. * @function LevelRenderer.Tool.Color.prototype.getGradientColors
  58379. * @description 获取指定级数的渐变颜色数组。
  58380. * @param {Array.<string>} colors - 颜色数组。
  58381. * @param {number} [step=20] - 渐变级数。
  58382. * @returns {Array.<string>} 颜色数组。
  58383. */
  58384. }, {
  58385. key: "getGradientColors",
  58386. value: function getGradientColors(colors, step) {
  58387. var ret = [];
  58388. var len = colors.length;
  58389. if (step === undefined) {
  58390. step = 20;
  58391. }
  58392. if (len === 1) {
  58393. ret = this.getStepColors(colors[0], colors[0], step);
  58394. } else if (len > 1) {
  58395. for (var i = 0, n = len - 1; i < n; i++) {
  58396. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  58397. if (i < n - 1) {
  58398. steps.pop();
  58399. }
  58400. ret = ret.concat(steps);
  58401. }
  58402. }
  58403. return ret;
  58404. }
  58405. /**
  58406. * @function LevelRenderer.Tool.Color.prototype.toColor
  58407. * @description 颜色值数组转为指定格式颜色。
  58408. * @param {Array} data - 颜色值数组。
  58409. * @param {string} format - 格式,默认'rgb'
  58410. * @returns {string} 颜色。
  58411. */
  58412. }, {
  58413. key: "toColor",
  58414. value: function toColor(data, format) {
  58415. format = format || 'rgb';
  58416. if (data && (data.length === 3 || data.length === 4)) {
  58417. data = this.map(data, function (c) {
  58418. return c > 1 ? Math.ceil(c) : c;
  58419. });
  58420. if (format.indexOf('hex') > -1) {
  58421. return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1);
  58422. } else if (format.indexOf('hs') > -1) {
  58423. var sx = this.map(data.slice(1, 3), function (c) {
  58424. return c + '%';
  58425. });
  58426. data[1] = sx[0];
  58427. data[2] = sx[1];
  58428. }
  58429. if (format.indexOf('a') > -1) {
  58430. if (data.length === 3) {
  58431. data.push(1);
  58432. }
  58433. data[3] = this.adjust(data[3], [0, 1]);
  58434. return format + '(' + data.slice(0, 4).join(',') + ')';
  58435. }
  58436. return format + '(' + data.slice(0, 3).join(',') + ')';
  58437. }
  58438. }
  58439. /**
  58440. * @function LevelRenderer.Tool.Color.prototype.toArray
  58441. * @description 颜色字符串转换为rgba数组。
  58442. * @param {string} color - 颜色。
  58443. * @returns {Array.<number>} 颜色值数组。
  58444. */
  58445. }, {
  58446. key: "toArray",
  58447. value: function toArray(color) {
  58448. color = this.trim(color);
  58449. if (color.indexOf('rgba') < 0) {
  58450. color = this.toRGBA(color);
  58451. }
  58452. var data = [];
  58453. var i = 0;
  58454. color.replace(/[\d.]+/g, function (n) {
  58455. if (i < 3) {
  58456. n = n | 0;
  58457. } else {
  58458. // Alpha
  58459. n = +n;
  58460. }
  58461. data[i++] = n;
  58462. });
  58463. return data;
  58464. }
  58465. /**
  58466. * @function LevelRenderer.Tool.Color.prototype.convert
  58467. * @description 颜色格式转化。
  58468. * @param {Array} data - 颜色值数组。
  58469. * @param {string} format - 格式,默认'rgb'
  58470. * @returns {string} 颜色。
  58471. */
  58472. }, {
  58473. key: "convert",
  58474. value: function convert(color, format) {
  58475. if (!this.isCalculableColor(color)) {
  58476. return color;
  58477. }
  58478. var data = this.getData(color);
  58479. var alpha = data[3];
  58480. if (typeof alpha === 'undefined') {
  58481. alpha = 1;
  58482. }
  58483. if (color.indexOf('hsb') > -1) {
  58484. data = this._HSV_2_RGB(data);
  58485. } else if (color.indexOf('hsl') > -1) {
  58486. data = this._HSL_2_RGB(data);
  58487. }
  58488. if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) {
  58489. data = this._RGB_2_HSB(data);
  58490. } else if (format.indexOf('hsl') > -1) {
  58491. data = this._RGB_2_HSL(data);
  58492. }
  58493. data[3] = alpha;
  58494. return this.toColor(data, format);
  58495. }
  58496. /**
  58497. * @function LevelRenderer.Tool.Color.prototype.toRGBA
  58498. * @description 转换为rgba格式的颜色。
  58499. * @param {string} color - 颜色。
  58500. * @returns {string} 颜色。
  58501. */
  58502. }, {
  58503. key: "toRGBA",
  58504. value: function toRGBA(color) {
  58505. return this.convert(color, 'rgba');
  58506. }
  58507. /**
  58508. * @function LevelRenderer.Tool.Color.prototype.toRGB
  58509. * @description 转换为rgb数字格式的颜色。
  58510. * @param {string} color - 颜色。
  58511. * @returns {string} 颜色。
  58512. */
  58513. }, {
  58514. key: "toRGB",
  58515. value: function toRGB(color) {
  58516. return this.convert(color, 'rgb');
  58517. }
  58518. /**
  58519. * @function LevelRenderer.Tool.Color.prototype.toHex
  58520. * @description 转换为16进制颜色。
  58521. * @param {string} color - 颜色。
  58522. * @returns {string} 16进制颜色,#rrggbb格式
  58523. */
  58524. }, {
  58525. key: "toHex",
  58526. value: function toHex(color) {
  58527. return this.convert(color, 'hex');
  58528. }
  58529. /**
  58530. * @function LevelRenderer.Tool.Color.prototype.toHSVA
  58531. * @description 转换为HSV颜色。
  58532. * @param {string} color - 颜色。
  58533. * @returns {string} HSVA颜色,hsva(h,s,v,a)
  58534. */
  58535. }, {
  58536. key: "toHSVA",
  58537. value: function toHSVA(color) {
  58538. return this.convert(color, 'hsva');
  58539. }
  58540. /**
  58541. * @function LevelRenderer.Tool.Color.prototype.toHSV
  58542. * @description 转换为HSV颜色。
  58543. * @param {string} color - 颜色。
  58544. * @returns {string} HSV颜色,hsv(h,s,v)
  58545. */
  58546. }, {
  58547. key: "toHSV",
  58548. value: function toHSV(color) {
  58549. return this.convert(color, 'hsv');
  58550. }
  58551. /**
  58552. * @function LevelRenderer.Tool.Color.prototype.toHSBA
  58553. * @description 转换为HSBA颜色。
  58554. * @param {string} color - 颜色。
  58555. * @returns {string} HSBA颜色,hsba(h,s,b,a)
  58556. */
  58557. }, {
  58558. key: "toHSBA",
  58559. value: function toHSBA(color) {
  58560. return this.convert(color, 'hsba');
  58561. }
  58562. /**
  58563. * @function LevelRenderer.Tool.Color.prototype.toHSB
  58564. * @description 转换为HSB颜色。
  58565. * @param {string} color - 颜色。
  58566. * @returns {string} HSB颜色,hsb(h,s,b)
  58567. */
  58568. }, {
  58569. key: "toHSB",
  58570. value: function toHSB(color) {
  58571. return this.convert(color, 'hsb');
  58572. }
  58573. /**
  58574. * @function LevelRenderer.Tool.Color.prototype.toHSLA
  58575. * @description 转换为HSLA颜色。
  58576. * @param {string} color - 颜色。
  58577. * @returns {string} HSLA颜色,hsla(h,s,l,a)
  58578. */
  58579. }, {
  58580. key: "toHSLA",
  58581. value: function toHSLA(color) {
  58582. return this.convert(color, 'hsla');
  58583. }
  58584. /**
  58585. * @function LevelRenderer.Tool.Color.prototype.toHSL
  58586. * @description 转换为HSL颜色。
  58587. * @param {string} color - 颜色。
  58588. * @returns {string} HSL颜色,hsl(h,s,l)
  58589. */
  58590. }, {
  58591. key: "toHSL",
  58592. value: function toHSL(color) {
  58593. return this.convert(color, 'hsl');
  58594. }
  58595. /**
  58596. * @function LevelRenderer.Tool.Color.prototype.toName
  58597. * @description 转换颜色名。
  58598. * @param {string} color - 颜色。
  58599. * @returns {string} 颜色名
  58600. */
  58601. }, {
  58602. key: "toName",
  58603. value: function toName(color) {
  58604. for (var key in this._nameColors) {
  58605. if (this.toHex(this._nameColors[key]) === this.toHex(color)) {
  58606. return key;
  58607. }
  58608. }
  58609. return null;
  58610. }
  58611. /**
  58612. * @function LevelRenderer.Tool.Color.prototype.trim
  58613. * @description 移除颜色中多余空格。
  58614. * @param {string} color - 颜色。
  58615. * @returns {string} 无空格颜色
  58616. */
  58617. }, {
  58618. key: "trim",
  58619. value: function trim(color) {
  58620. return String(color).replace(/\s+/g, '');
  58621. }
  58622. /**
  58623. * @function LevelRenderer.Tool.Color.prototype.normalize
  58624. * @description 颜色规范化。
  58625. * @param {string} color - 颜色。
  58626. * @returns {string} 规范化后的颜色
  58627. */
  58628. }, {
  58629. key: "normalize",
  58630. value: function normalize(color) {
  58631. // 颜色名
  58632. if (this._nameColors[color]) {
  58633. color = this._nameColors[color];
  58634. }
  58635. // 去掉空格
  58636. color = this.trim(color);
  58637. // hsv与hsb等价
  58638. color = color.replace(/hsv/i, 'hsb');
  58639. // rgb转为rrggbb
  58640. if (/^#[\da-f]{3}$/i.test(color)) {
  58641. color = parseInt(color.slice(1), 16);
  58642. var r = (color & 0xf00) << 8;
  58643. var g = (color & 0xf0) << 4;
  58644. var b = color & 0xf;
  58645. color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1);
  58646. }
  58647. // 或者使用以下正则替换,不过 chrome 下性能相对差点
  58648. // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3');
  58649. return color;
  58650. }
  58651. /**
  58652. * @function LevelRenderer.Tool.Color.prototype.lift
  58653. * @description 颜色加深或减淡,当level>0加深,当level<0减淡。
  58654. * @param {string} color - 颜色。
  58655. * @param {number} level - 升降程度,取值区间[-1,1]。
  58656. * @returns {string} 加深或减淡后颜色值
  58657. */
  58658. }, {
  58659. key: "lift",
  58660. value: function lift(color, level) {
  58661. if (!this.isCalculableColor(color)) {
  58662. return color;
  58663. }
  58664. var direct = level > 0 ? 1 : -1;
  58665. if (typeof level === 'undefined') {
  58666. level = 0;
  58667. }
  58668. level = Math.abs(level) > 1 ? 1 : Math.abs(level);
  58669. color = this.toRGB(color);
  58670. var data = this.getData(color);
  58671. for (var i = 0; i < 3; i++) {
  58672. if (direct === 1) {
  58673. data[i] = data[i] * (1 - level) | 0;
  58674. } else {
  58675. data[i] = (255 - data[i]) * level + data[i] | 0;
  58676. }
  58677. }
  58678. return 'rgb(' + data.join(',') + ')';
  58679. }
  58680. /**
  58681. * @function LevelRenderer.Tool.Color.prototype.reverse
  58682. * @description 颜色翻转。[255-r,255-g,255-b,1-a]
  58683. * @param {string} color - 颜色。
  58684. * @returns {string} 翻转颜色
  58685. */
  58686. }, {
  58687. key: "reverse",
  58688. value: function reverse(color) {
  58689. if (!this.isCalculableColor(color)) {
  58690. return color;
  58691. }
  58692. var data = this.getData(this.toRGBA(color));
  58693. data = this.map(data, function (c) {
  58694. return 255 - c;
  58695. });
  58696. return this.toColor(data, 'rgb');
  58697. }
  58698. /**
  58699. * @function LevelRenderer.Tool.Color.prototype.mix
  58700. * @description 简单两种颜色混合
  58701. * @param {string} color1 - 第一种颜色。
  58702. * @param {string} color2 - 第二种颜色。
  58703. * @param {number} weight - 混合权重[0-1]。
  58704. * @returns {string} 结果色。rgb(r,g,b)或rgba(r,g,b,a)
  58705. */
  58706. }, {
  58707. key: "mix",
  58708. value: function mix(color1, color2, weight) {
  58709. if (!this.isCalculableColor(color1) || !this.isCalculableColor(color2)) {
  58710. return color1;
  58711. }
  58712. if (typeof weight === 'undefined') {
  58713. weight = 0.5;
  58714. }
  58715. weight = 1 - this.adjust(weight, [0, 1]);
  58716. var w = weight * 2 - 1;
  58717. var data1 = this.getData(this.toRGBA(color1));
  58718. var data2 = this.getData(this.toRGBA(color2));
  58719. var d = data1[3] - data2[3];
  58720. var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2;
  58721. var weight2 = 1 - weight1;
  58722. var data = [];
  58723. for (var i = 0; i < 3; i++) {
  58724. data[i] = data1[i] * weight1 + data2[i] * weight2;
  58725. }
  58726. var alpha = data1[3] * weight + data2[3] * (1 - weight);
  58727. alpha = Math.max(0, Math.min(1, alpha));
  58728. if (data1[3] === 1 && data2[3] === 1) {
  58729. // 不考虑透明度
  58730. return this.toColor(data, 'rgb');
  58731. }
  58732. data[3] = alpha;
  58733. return this.toColor(data, 'rgba');
  58734. }
  58735. /**
  58736. * @function LevelRenderer.Tool.Color.prototype.random
  58737. * @description 随机颜色
  58738. * @returns {string} 颜色值,#rrggbb格式
  58739. */
  58740. }, {
  58741. key: "random",
  58742. value: function random() {
  58743. return '#' + Math.random().toString(16).slice(2, 8);
  58744. }
  58745. /**
  58746. * @function LevelRenderer.Tool.Color.prototype.getData
  58747. * @description 获取颜色值数组,返回值范围。
  58748. * RGB 范围[0-255]
  58749. * HSL/HSV/HSB 范围[0-1]
  58750. * A透明度范围[0-1]
  58751. * 支持格式:
  58752. * #rgb
  58753. * #rrggbb
  58754. * rgb(r,g,b)
  58755. * rgb(r%,g%,b%)
  58756. * rgba(r,g,b,a)
  58757. * hsb(h,s,b) // hsv与hsb等价
  58758. * hsb(h%,s%,b%)
  58759. * hsba(h,s,b,a)
  58760. * hsl(h,s,l)
  58761. * hsl(h%,s%,l%)
  58762. * hsla(h,s,l,a)
  58763. * @param {string} color - 颜色。
  58764. * @returns {Array.<number>} 颜色值数组或null
  58765. */
  58766. }, {
  58767. key: "getData",
  58768. value: function getData(color) {
  58769. color = this.normalize(color);
  58770. var r = color.match(this.colorRegExp);
  58771. if (r === null) {
  58772. throw new Error('The color format error'); // 颜色格式错误
  58773. }
  58774. var d;
  58775. var a;
  58776. var data = [];
  58777. var rgb;
  58778. if (r[2]) {
  58779. // #rrggbb
  58780. d = r[2].replace('#', '').split('');
  58781. rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]];
  58782. data = this.map(rgb, function (c) {
  58783. return Color.prototype.adjust.call(this, parseInt(c, 16), [0, 255]);
  58784. });
  58785. } else if (r[4]) {
  58786. // rgb rgba
  58787. var rgba = r[4].split(',');
  58788. a = rgba[3];
  58789. rgb = rgba.slice(0, 3);
  58790. data = this.map(rgb, function (c) {
  58791. c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c);
  58792. return Color.prototype.adjust.call(this, c, [0, 255]);
  58793. });
  58794. if (typeof a !== 'undefined') {
  58795. data.push(this.adjust(parseFloat(a), [0, 1]));
  58796. }
  58797. } else if (r[5] || r[6]) {
  58798. // hsb hsba hsl hsla
  58799. var hsxa = (r[5] || r[6]).split(',');
  58800. var h = parseInt(hsxa[0], 0) / 360;
  58801. var s = hsxa[1];
  58802. var x = hsxa[2];
  58803. a = hsxa[3];
  58804. data = this.map([s, x], function (c) {
  58805. return Color.prototype.adjust.call(this, parseFloat(c) / 100, [0, 1]);
  58806. });
  58807. data.unshift(h);
  58808. if (typeof a !== 'undefined') {
  58809. data.push(this.adjust(parseFloat(a), [0, 1]));
  58810. }
  58811. }
  58812. return data;
  58813. }
  58814. /**
  58815. * @function LevelRenderer.Tool.Color.prototype.alpha
  58816. * @description 设置颜色透明度
  58817. * @param {string} color - 颜色。
  58818. * @param {number} a - 透明度,区间[0,1]。
  58819. * @returns {string} rgba颜色值
  58820. */
  58821. }, {
  58822. key: "alpha",
  58823. value: function alpha(color, a) {
  58824. if (!this.isCalculableColor(color)) {
  58825. return color;
  58826. }
  58827. if (a === null) {
  58828. a = 1;
  58829. }
  58830. var data = this.getData(this.toRGBA(color));
  58831. data[3] = this.adjust(Number(a).toFixed(4), [0, 1]);
  58832. return this.toColor(data, 'rgba');
  58833. }
  58834. /**
  58835. * @function LevelRenderer.Tool.Color.prototype.map
  58836. * @description 数组映射
  58837. * @param {Array} array - 数组。
  58838. * @param {function} fun - 函数。
  58839. * @returns {string} 数组映射结果
  58840. */
  58841. }, {
  58842. key: "map",
  58843. value: function map(array, fun) {
  58844. if (typeof fun !== 'function') {
  58845. throw new TypeError();
  58846. }
  58847. var len = array ? array.length : 0;
  58848. for (var i = 0; i < len; i++) {
  58849. array[i] = fun(array[i]);
  58850. }
  58851. return array;
  58852. }
  58853. /**
  58854. * @function LevelRenderer.Tool.Color.prototype.adjust
  58855. * @description 调整值区间
  58856. * @param {Array.<number>} value - 数组。
  58857. * @param {Array.<number>} region - 区间。
  58858. * @returns {number} 调整后的值
  58859. */
  58860. }, {
  58861. key: "adjust",
  58862. value: function adjust(value, region) {
  58863. // < to <= & > to >=
  58864. // modify by linzhifeng 2014-05-25 because -0 == 0
  58865. if (value <= region[0]) {
  58866. value = region[0];
  58867. } else if (value >= region[1]) {
  58868. value = region[1];
  58869. }
  58870. return value;
  58871. }
  58872. /**
  58873. * @function LevelRenderer.Tool.Color.prototype.isCalculableColor
  58874. * @description 判断是否是可计算的颜色
  58875. * @param {string} color - 颜色。
  58876. * @returns {boolean} 是否是可计算的颜色
  58877. */
  58878. }, {
  58879. key: "isCalculableColor",
  58880. value: function isCalculableColor(color) {
  58881. return color instanceof Array || typeof color === 'string';
  58882. }
  58883. /**
  58884. * @function LevelRenderer.Tool.Color.prototype._HSV_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  58885. */
  58886. }, {
  58887. key: "_HSV_2_RGB",
  58888. value: function _HSV_2_RGB(data) {
  58889. var H = data[0];
  58890. var S = data[1];
  58891. var V = data[2];
  58892. // HSV from 0 to 1
  58893. var R;
  58894. var G;
  58895. var B;
  58896. if (S === 0) {
  58897. R = V * 255;
  58898. G = V * 255;
  58899. B = V * 255;
  58900. } else {
  58901. var h = H * 6;
  58902. if (h === 6) {
  58903. h = 0;
  58904. }
  58905. var i = h | 0;
  58906. var v1 = V * (1 - S);
  58907. var v2 = V * (1 - S * (h - i));
  58908. var v3 = V * (1 - S * (1 - (h - i)));
  58909. var r = 0;
  58910. var g = 0;
  58911. var b = 0;
  58912. if (i === 0) {
  58913. r = V;
  58914. g = v3;
  58915. b = v1;
  58916. } else if (i === 1) {
  58917. r = v2;
  58918. g = V;
  58919. b = v1;
  58920. } else if (i === 2) {
  58921. r = v1;
  58922. g = V;
  58923. b = v3;
  58924. } else if (i === 3) {
  58925. r = v1;
  58926. g = v2;
  58927. b = V;
  58928. } else if (i === 4) {
  58929. r = v3;
  58930. g = v1;
  58931. b = V;
  58932. } else {
  58933. r = V;
  58934. g = v1;
  58935. b = v2;
  58936. }
  58937. // RGB results from 0 to 255
  58938. R = r * 255;
  58939. G = g * 255;
  58940. B = b * 255;
  58941. }
  58942. return [R, G, B];
  58943. }
  58944. /**
  58945. * @function LevelRenderer.Tool.Color.prototype._HSL_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  58946. */
  58947. }, {
  58948. key: "_HSL_2_RGB",
  58949. value: function _HSL_2_RGB(data) {
  58950. var H = data[0];
  58951. var S = data[1];
  58952. var L = data[2];
  58953. // HSL from 0 to 1
  58954. var R;
  58955. var G;
  58956. var B;
  58957. if (S === 0) {
  58958. R = L * 255;
  58959. G = L * 255;
  58960. B = L * 255;
  58961. } else {
  58962. var v2;
  58963. if (L < 0.5) {
  58964. v2 = L * (1 + S);
  58965. } else {
  58966. v2 = L + S - S * L;
  58967. }
  58968. var v1 = 2 * L - v2;
  58969. R = 255 * this._HUE_2_RGB(v1, v2, H + 1 / 3);
  58970. G = 255 * this._HUE_2_RGB(v1, v2, H);
  58971. B = 255 * this._HUE_2_RGB(v1, v2, H - 1 / 3);
  58972. }
  58973. return [R, G, B];
  58974. }
  58975. /**
  58976. * @function LevelRenderer.Tool.Color.prototype._HUE_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  58977. */
  58978. }, {
  58979. key: "_HUE_2_RGB",
  58980. value: function _HUE_2_RGB(v1, v2, vH) {
  58981. if (vH < 0) {
  58982. vH += 1;
  58983. }
  58984. if (vH > 1) {
  58985. vH -= 1;
  58986. }
  58987. if (6 * vH < 1) {
  58988. return v1 + (v2 - v1) * 6 * vH;
  58989. }
  58990. if (2 * vH < 1) {
  58991. return v2;
  58992. }
  58993. if (3 * vH < 2) {
  58994. return v1 + (v2 - v1) * (2 / 3 - vH) * 6;
  58995. }
  58996. return v1;
  58997. }
  58998. /**
  58999. * @function LevelRenderer.Tool.Color.prototype._RGB_2_HSB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  59000. */
  59001. }, {
  59002. key: "_RGB_2_HSB",
  59003. value: function _RGB_2_HSB(data) {
  59004. // RGB from 0 to 255
  59005. var R = data[0] / 255;
  59006. var G = data[1] / 255;
  59007. var B = data[2] / 255;
  59008. var vMin = Math.min(R, G, B); // Min. value of RGB
  59009. var vMax = Math.max(R, G, B); // Max. value of RGB
  59010. var delta = vMax - vMin; // Delta RGB value
  59011. var V = vMax;
  59012. var H;
  59013. var S;
  59014. // HSV results from 0 to 1
  59015. if (delta === 0) {
  59016. H = 0;
  59017. S = 0;
  59018. } else {
  59019. S = delta / vMax;
  59020. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  59021. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  59022. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  59023. if (R === vMax) {
  59024. H = deltaB - deltaG;
  59025. } else if (G === vMax) {
  59026. H = 1 / 3 + deltaR - deltaB;
  59027. } else if (B === vMax) {
  59028. H = 2 / 3 + deltaG - deltaR;
  59029. }
  59030. if (H < 0) {
  59031. H += 1;
  59032. }
  59033. if (H > 1) {
  59034. H -= 1;
  59035. }
  59036. }
  59037. H = H * 360;
  59038. S = S * 100;
  59039. V = V * 100;
  59040. return [H, S, V];
  59041. }
  59042. /**
  59043. * @function LevelRenderer.Tool.Color.prototype._RGB_2_HSL。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  59044. */
  59045. }, {
  59046. key: "_RGB_2_HSL",
  59047. value: function _RGB_2_HSL(data) {
  59048. // RGB from 0 to 255
  59049. var R = data[0] / 255;
  59050. var G = data[1] / 255;
  59051. var B = data[2] / 255;
  59052. var vMin = Math.min(R, G, B); // Min. value of RGB
  59053. var vMax = Math.max(R, G, B); // Max. value of RGB
  59054. var delta = vMax - vMin; // Delta RGB value
  59055. var L = (vMax + vMin) / 2;
  59056. var H;
  59057. var S;
  59058. // HSL results from 0 to 1
  59059. if (delta === 0) {
  59060. H = 0;
  59061. S = 0;
  59062. } else {
  59063. if (L < 0.5) {
  59064. S = delta / (vMax + vMin);
  59065. } else {
  59066. S = delta / (2 - vMax - vMin);
  59067. }
  59068. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  59069. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  59070. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  59071. if (R === vMax) {
  59072. H = deltaB - deltaG;
  59073. } else if (G === vMax) {
  59074. H = 1 / 3 + deltaR - deltaB;
  59075. } else if (B === vMax) {
  59076. H = 2 / 3 + deltaG - deltaR;
  59077. }
  59078. if (H < 0) {
  59079. H += 1;
  59080. }
  59081. if (H > 1) {
  59082. H -= 1;
  59083. }
  59084. }
  59085. H = H * 360;
  59086. S = S * 100;
  59087. L = L * 100;
  59088. return [H, S, L];
  59089. }
  59090. }]);
  59091. return Color;
  59092. }();
  59093. ;// CONCATENATED MODULE: ./src/common/util/ColorsPickerUtil.js
  59094. function ColorsPickerUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59095. 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); } }
  59096. 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; }
  59097. var ColorRender = new Color();
  59098. // let "http://www.qzu.zj.cn": "#bd10e0"
  59099. // "www.qzct.net": "#7ed321" = new LevelRenderer.Tool.Color();
  59100. /**
  59101. * @name ColorsPickerUtil
  59102. * @namespace
  59103. * @category BaseTypes Util
  59104. * @classdesc 色带选择器工具类。用于1、创建canvas对象,2、从几种颜色中获取一定数量的渐变色。
  59105. * @usage
  59106. * ```
  59107. * // 浏览器
  59108. * <script type="text/javascript" src="{cdn}"></script>
  59109. * <script>
  59110. * const result = {namespace}.ColorsPickerUtil.createCanvas();
  59111. *
  59112. * // 弃用的写法
  59113. * const result = SuperMap.ColorsPickerUtil.createCanvas();
  59114. *
  59115. * </script>
  59116. *
  59117. * // ES6 Import
  59118. * import { ColorsPickerUtil } from '{npm}';
  59119. *
  59120. * const result = ColorsPickerUtil.createCanvas();
  59121. * ```
  59122. */
  59123. var ColorsPickerUtil = /*#__PURE__*/function () {
  59124. function ColorsPickerUtil() {
  59125. ColorsPickerUtil_classCallCheck(this, ColorsPickerUtil);
  59126. }
  59127. ColorsPickerUtil_createClass(ColorsPickerUtil, null, [{
  59128. key: "createCanvas",
  59129. value:
  59130. /**
  59131. * @function ColorsPickerUtil.createCanvas
  59132. * @description 创建DOM canvas。
  59133. * @param {number} height - canvas 高度。
  59134. * @param {number} width - canvas 宽度。
  59135. */
  59136. function createCanvas(height, width) {
  59137. var canvas = document.createElement("canvas");
  59138. canvas.height = height;
  59139. canvas.width = width;
  59140. return canvas.getContext("2d");
  59141. }
  59142. /**
  59143. * @function ColorsPickerUtil.getLinearGradient
  59144. * @description 线性渐变。
  59145. * @param {number} x0 - 渐变起点 x 坐标。
  59146. * @param {number} y0 - 渐变起点 y 坐标。
  59147. * @param {number} x1 - 渐变终点 x 坐标。
  59148. * @param {number} y1 - 渐变终点 y 坐标。
  59149. * @param {Array} colorList 颜色列表。
  59150. * @returns {CanvasGradient} Cavans 渐变颜色。
  59151. */
  59152. }, {
  59153. key: "getLinearGradient",
  59154. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  59155. if (!this._ctx) {
  59156. this._ctx = this.getContext();
  59157. }
  59158. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  59159. var leng = colorList.length;
  59160. var add = 1 / (leng - 1);
  59161. var offset = 0;
  59162. for (var i = 0; i < leng; i++) {
  59163. gradient.addColorStop(offset, colorList[i]);
  59164. offset += add;
  59165. }
  59166. gradient.__nonRecursion = true;
  59167. return gradient;
  59168. }
  59169. /**
  59170. * @function ColorsPickerUtil.getContext
  59171. * @description 获取 Cavans 上下文。
  59172. * @returns {Object} Cavans 上下文。
  59173. */
  59174. }, {
  59175. key: "getContext",
  59176. value: function getContext() {
  59177. if (!this._ctx) {
  59178. this._ctx = document.createElement('canvas').getContext('2d');
  59179. }
  59180. return this._ctx;
  59181. }
  59182. /**
  59183. * @function ColorsPickerUtil.getStepColors
  59184. * @description 获取两种颜色之间渐变颜色数组。
  59185. * @param {string} start - 起始颜色。
  59186. * @param {string} end - 结束颜色。
  59187. * @param {number} step - 渐变级数。
  59188. * @returns {Array} 颜色数组。
  59189. */
  59190. }, {
  59191. key: "getStepColors",
  59192. value: function getStepColors(start, end, step) {
  59193. start = ColorRender.toRGBA(start);
  59194. end = ColorRender.toRGBA(end);
  59195. start = ColorRender.getData(start);
  59196. end = ColorRender.getData(end);
  59197. var colors = [];
  59198. var stepR = (end[0] - start[0]) / step;
  59199. var stepG = (end[1] - start[1]) / step;
  59200. var stepB = (end[2] - start[2]) / step;
  59201. var stepA = (end[3] - start[3]) / step;
  59202. // 生成颜色集合
  59203. // fix by linfeng 颜色堆积
  59204. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  59205. 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');
  59206. r += stepR;
  59207. g += stepG;
  59208. b += stepB;
  59209. a += stepA;
  59210. }
  59211. r = end[0];
  59212. g = end[1];
  59213. b = end[2];
  59214. a = end[3];
  59215. colors[i] = ColorRender.toColor([r, g, b, a], 'hex');
  59216. return colors;
  59217. }
  59218. /**
  59219. * @function ColorsPickerUtil.getGradientColors
  59220. * @description 获取指定级数的渐变颜色数组。
  59221. * @param {Array.<string>} colors - 颜色组。
  59222. * @param {number} total - 颜色总数。
  59223. * @param {string} themeType - 专题类型。
  59224. * @returns {Array.<string>} 颜色数组。
  59225. */
  59226. }, {
  59227. key: "getGradientColors",
  59228. value: function getGradientColors(colors, total, themeType) {
  59229. var ret = [],
  59230. step;
  59231. var i,
  59232. n,
  59233. len = colors.length;
  59234. if (total === undefined) {
  59235. return;
  59236. }
  59237. if (len >= total) {
  59238. if (themeType === 'RANGE') {
  59239. for (i = 0; i < total; i++) {
  59240. ret.push(colors[i]);
  59241. }
  59242. } else {
  59243. //1/2前后取色
  59244. for (i = 0; i < total; i++) {
  59245. var ii = Math.floor(i / 2);
  59246. if (i % 2 === 0) {
  59247. ret.push(colors[ii]);
  59248. } else {
  59249. var _index = colors.length - 1 - ii;
  59250. ret.push(colors[_index]);
  59251. }
  59252. }
  59253. }
  59254. } else {
  59255. step = Math.ceil(total / (len - 1));
  59256. for (i = 0, n = len - 1; i < n; i++) {
  59257. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  59258. if (i < n - 1) {
  59259. steps.pop();
  59260. }
  59261. ret = ret.concat(steps);
  59262. }
  59263. //删除多余元素
  59264. var nouse = ret.length - total;
  59265. for (var j = 0, index = 0; j < nouse; j++) {
  59266. ret.splice(index + 2, 1);
  59267. }
  59268. }
  59269. return ret;
  59270. }
  59271. }]);
  59272. return ColorsPickerUtil;
  59273. }();
  59274. ;// CONCATENATED MODULE: ./src/common/util/ArrayStatistic.js
  59275. function ArrayStatistic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59276. 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); } }
  59277. 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; }
  59278. /**
  59279. * @name ArrayStatistic
  59280. * @namespace
  59281. * @category BaseTypes Util
  59282. * @classdesc 处理数组。
  59283. * @usage
  59284. * ```
  59285. * // 浏览器
  59286. * <script type="text/javascript" src="{cdn}"></script>
  59287. * <script>
  59288. * const result = {namespace}.ArrayStatistic.newInstance();
  59289. *
  59290. * // 弃用的写法
  59291. * const result = SuperMap.ArrayStatistic.newInstance();
  59292. *
  59293. * </script>
  59294. *
  59295. * // ES6 Import
  59296. * import { ArrayStatistic } from '{npm}';
  59297. *
  59298. * const result = ArrayStatistic.newInstance();
  59299. * ```
  59300. */
  59301. var ArrayStatistic = /*#__PURE__*/function () {
  59302. function ArrayStatistic() {
  59303. ArrayStatistic_classCallCheck(this, ArrayStatistic);
  59304. }
  59305. ArrayStatistic_createClass(ArrayStatistic, null, [{
  59306. key: "newInstance",
  59307. value:
  59308. // geostatsInstance: null,
  59309. /**
  59310. * @function ArrayStatistic.newInstance
  59311. * @description 初始化插件实例。
  59312. */
  59313. function newInstance() {
  59314. // if(!this.geostatsInstance) {
  59315. // // this.geostatsInstance = new geostats();
  59316. // // }
  59317. // window.dataList = [];
  59318. if (!this.geostatsInstance) {
  59319. this.geostatsInstance = new window.geostats();
  59320. }
  59321. return this.geostatsInstance;
  59322. }
  59323. /**
  59324. * @function ArrayStatistic.getInstance
  59325. * @description 设置需要被处理的数组。
  59326. * @param {Array} array - 数组。
  59327. */
  59328. }, {
  59329. key: "getInstance",
  59330. value: function getInstance(array) {
  59331. var instance = this.newInstance();
  59332. instance.setSerie(array);
  59333. return instance;
  59334. }
  59335. /**
  59336. * @function ArrayStatistic.getArrayStatistic
  59337. * @description 获取数组统计的值。
  59338. * @param {Array.<number>} array - 需要统计的数组。
  59339. * @param {string} type - 统计方法。
  59340. */
  59341. }, {
  59342. key: "getArrayStatistic",
  59343. value: function getArrayStatistic(array, type) {
  59344. if (!array.length) {
  59345. return 0;
  59346. }
  59347. if (type === "Sum" || type === "求和") {
  59348. return this.getSum(array);
  59349. } else if (type === "Maximum" || type === "最大值") {
  59350. return this.getMax(array);
  59351. } else if (type === "Minimum" || type === "最小值") {
  59352. return this.getMin(array);
  59353. } else if (type === "Average" || type === "平均值") {
  59354. return this.getMean(array);
  59355. } else if (type === "Median" || type === "中位数") {
  59356. return this.getMedian(array);
  59357. } else if (type === "times" || type === "计数") {
  59358. return this.getTimes(array);
  59359. }
  59360. }
  59361. /**
  59362. * @function ArrayStatistic.getArraySegments
  59363. * @description 获取数组分段后的数值。
  59364. * @param {Array.<number>} array - 需要分段的数组。
  59365. * @param {string} type - 分段方法。
  59366. * @param {number} segNum - 分段个数。
  59367. */
  59368. }, {
  59369. key: "getArraySegments",
  59370. value: function getArraySegments(array, type, segNum) {
  59371. if (type === "offset") {
  59372. return this.getEqInterval(array, segNum);
  59373. } else if (type === "jenks") {
  59374. return this.getJenks(array, segNum);
  59375. } else if (type === "square") {
  59376. // 数据都必须 >= 0
  59377. var minValue = this.getMin(array);
  59378. if (minValue >= 0) {
  59379. return this.getSqrtInterval(array, segNum);
  59380. } else {
  59381. //console.log('数据都必须 >= 0');
  59382. // Util.showMessage(Language.hasNegValue + Language.noSupportRange, 'ERROR');
  59383. return false;
  59384. }
  59385. } else if (type === "logarithm") {
  59386. // 数据都必须 > 0
  59387. var _minValue = this.getMin(array);
  59388. if (_minValue > 0) {
  59389. return this.getGeometricProgression(array, segNum);
  59390. } else {
  59391. //console.log('数据都必须 > 0');
  59392. // Util.showMessage(Language.hasZeroNegValue + Language.noSupportRange, 'ERROR');
  59393. return false;
  59394. }
  59395. }
  59396. }
  59397. /**
  59398. * @function ArrayStatistic.getSum
  59399. * @description 求和。
  59400. * @param {Array.<number>} array 需要求和的参数。
  59401. * @returns {number} 返回求和结果。
  59402. */
  59403. }, {
  59404. key: "getSum",
  59405. value: function getSum(array) {
  59406. return this.getInstance(array).sum();
  59407. }
  59408. /**
  59409. * @function ArrayStatistic.getMax
  59410. * @description 最大值。
  59411. * @param {Array.<number>} array 需要求最大值的参数。
  59412. * @returns {number} 返回最大值。
  59413. */
  59414. }, {
  59415. key: "getMax",
  59416. value: function getMax(array) {
  59417. return this.getInstance(array).max();
  59418. }
  59419. /**
  59420. * @function ArrayStatistic.getMin
  59421. * @description 最小值。
  59422. * @param {Array.<number>} array 需要求最小值的参数。
  59423. * @returns {number} 返回最小值。
  59424. */
  59425. }, {
  59426. key: "getMin",
  59427. value: function getMin(array) {
  59428. return this.getInstance(array).min();
  59429. }
  59430. /**
  59431. * @function ArrayStatistic.getMean
  59432. * @description 求平均数。
  59433. * @param {Array.<number>} array 需要求平均数的参数。
  59434. * @returns {number} 返回平均数。
  59435. */
  59436. }, {
  59437. key: "getMean",
  59438. value: function getMean(array) {
  59439. return this.getInstance(array).mean();
  59440. }
  59441. /**
  59442. * @function ArrayStatistic.getMedian
  59443. * @description 求中位数。
  59444. * @param {Array.<number>} array 需要求中位数的参数。
  59445. * @returns {number} 返回中位数。
  59446. */
  59447. }, {
  59448. key: "getMedian",
  59449. value: function getMedian(array) {
  59450. return this.getInstance(array).median();
  59451. }
  59452. /**
  59453. * @function ArrayStatistic.getTimes
  59454. * @description 计数。
  59455. * @param {Array.<number>} array 需要计数的参数。
  59456. * @returns {number} 返回计数结果。
  59457. */
  59458. }, {
  59459. key: "getTimes",
  59460. value: function getTimes(array) {
  59461. return array.length;
  59462. }
  59463. /**
  59464. * @function ArrayStatistic.getEqInterval
  59465. * @description 等距分段法。
  59466. * @param {Array} array 需要进行等距分段的数组。
  59467. * @param {number} segNum 分段个数。
  59468. */
  59469. }, {
  59470. key: "getEqInterval",
  59471. value: function getEqInterval(array, segNum) {
  59472. return this.getInstance(array).getClassEqInterval(segNum);
  59473. }
  59474. /**
  59475. * @function ArrayStatistic.getJenks
  59476. * @description 自然断裂法。
  59477. * @param {Array} array 需要进行自然断裂的参数。
  59478. * @param {number} segNum 分段个数。
  59479. */
  59480. }, {
  59481. key: "getJenks",
  59482. value: function getJenks(array, segNum) {
  59483. return this.getInstance(array).getClassJenks(segNum);
  59484. }
  59485. /**
  59486. * @function ArrayStatistic.getSqrtInterval
  59487. * @description 平方根分段法。
  59488. * @param {Array} array 需要进行平方根分段的参数。
  59489. * @param {number} segNum 分段个数。
  59490. */
  59491. }, {
  59492. key: "getSqrtInterval",
  59493. value: function getSqrtInterval(array, segNum) {
  59494. array = array.map(function (value) {
  59495. return Math.sqrt(value);
  59496. });
  59497. var breaks = this.getInstance(array).getClassEqInterval(segNum);
  59498. return breaks.map(function (value) {
  59499. return value * value;
  59500. });
  59501. }
  59502. /**
  59503. * @function ArrayStatistic.getGeometricProgression
  59504. * @description 对数分段法。
  59505. * @param {Array} array 需要进行对数分段的参数。
  59506. * @param {number} segNum 分段个数。
  59507. */
  59508. }, {
  59509. key: "getGeometricProgression",
  59510. value: function getGeometricProgression(array, segNum) {
  59511. return this.getInstance(array).getClassGeometricProgression(segNum);
  59512. }
  59513. }]);
  59514. return ArrayStatistic;
  59515. }();
  59516. ;// CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
  59517. /**
  59518. * @function getMeterPerMapUnit
  59519. * @description 单位换算,把米|度|千米|英寸|英尺换成米。
  59520. * @category BaseTypes Util
  59521. * @param {string} mapUnit 地图单位。
  59522. * @returns {number} 返回地图的距离单位。
  59523. * @usage
  59524. * ```
  59525. * // 浏览器
  59526. * <script type="text/javascript" src="{cdn}"></script>
  59527. * <script>
  59528. * const result = {namespace}.getMeterPerMapUnit(mapUnit);
  59529. *
  59530. * </script>
  59531. *
  59532. * // ES6 Import
  59533. * import { getMeterPerMapUnit } from '{npm}';
  59534. *
  59535. * const result = getMeterPerMapUnit(mapUnit);
  59536. * ```
  59537. */
  59538. var getMeterPerMapUnit = function getMeterPerMapUnit(mapUnit) {
  59539. var earchRadiusInMeters = 6378137;
  59540. var meterPerMapUnit;
  59541. if (mapUnit === Unit.METER) {
  59542. meterPerMapUnit = 1;
  59543. } else if (mapUnit === Unit.DEGREE) {
  59544. // 每度表示多少米。
  59545. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  59546. } else if (mapUnit === Unit.KILOMETER) {
  59547. meterPerMapUnit = 1.0e-3;
  59548. } else if (mapUnit === Unit.INCH) {
  59549. meterPerMapUnit = 1 / 2.5399999918e-2;
  59550. } else if (mapUnit === Unit.FOOT) {
  59551. meterPerMapUnit = 0.3048;
  59552. } else {
  59553. return meterPerMapUnit;
  59554. }
  59555. return meterPerMapUnit;
  59556. };
  59557. /**
  59558. * @function getWrapNum
  59559. * @description 获取该坐标系的经纬度范围的经度或纬度。
  59560. * @category BaseTypes Util
  59561. * @param {number} x 经度或纬度。
  59562. * @param {boolean} includeMax 是否获取经度或纬度的最大值。
  59563. * @param {boolean} includeMin 是否获取经度或纬度的最小值。
  59564. * @param {number} range 坐标系的经纬度范围。
  59565. * @returns {number} 返回经度或纬度的值。
  59566. * @usage
  59567. * ```
  59568. * // 浏览器
  59569. * <script type="text/javascript" src="{cdn}"></script>
  59570. * <script>
  59571. * const result = {namespace}.getWrapNum(x, includeMax, includeMin, range);
  59572. *
  59573. * </script>
  59574. *
  59575. * // ES6 Import
  59576. * import { getWrapNum } from '{npm}';
  59577. *
  59578. * const result = getWrapNum(x, includeMax, includeMin, range);
  59579. * ```
  59580. */
  59581. function getWrapNum(x) {
  59582. var includeMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  59583. var includeMin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  59584. var range = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [-180, 180];
  59585. var max = range[1],
  59586. min = range[0],
  59587. d = max - min;
  59588. if (x === max && includeMax) {
  59589. return x;
  59590. }
  59591. if (x === min && includeMin) {
  59592. return x;
  59593. }
  59594. var tmp = ((x - min) % d + d) % d;
  59595. if (tmp === 0 && includeMax) {
  59596. return max;
  59597. }
  59598. return ((x - min) % d + d) % d + min;
  59599. }
  59600. /**
  59601. * @function conversionDegree
  59602. * @description 转换经纬度。
  59603. * @category BaseTypes Util
  59604. * @param {number} degrees 经度或纬度。
  59605. * @returns {string} 返回度分秒。
  59606. * @usage
  59607. * ```
  59608. * // 浏览器
  59609. * <script type="text/javascript" src="{cdn}"></script>
  59610. * <script>
  59611. * const result = {namespace}.conversionDegree(degrees);
  59612. *
  59613. * </script>
  59614. *
  59615. * // ES6 Import
  59616. * import { conversionDegree } from '{npm}';
  59617. *
  59618. * const result = conversionDegree(degrees);
  59619. * ```
  59620. */
  59621. function conversionDegree(degrees) {
  59622. var degree = parseInt(degrees);
  59623. var fraction = parseInt((degrees - degree) * 60);
  59624. var second = parseInt(((degrees - degree) * 60 - fraction) * 60);
  59625. fraction = parseInt(fraction / 10) === 0 ? "0".concat(fraction) : fraction;
  59626. second = parseInt(second / 10) === 0 ? "0".concat(second) : second;
  59627. return "".concat(degree, "\xB0").concat(fraction, "'").concat(second);
  59628. }
  59629. /**
  59630. * @function scalesToResolutions
  59631. * @description 通过比例尺数组计算分辨率数组,没有传入比例尺数组时通过地图范围与地图最大级别进行计算。
  59632. * @version 11.0.1
  59633. * @param {Array} scales - 比例尺数组。
  59634. * @param {Object} bounds - 地图范围。
  59635. * @param {number} dpi - 屏幕分辨率。
  59636. * @param {string} mapUnit - 地图单位。
  59637. * @param {number} [level=22] - 地图最大级别。
  59638. * @returns {number} 分辨率。
  59639. * @usage
  59640. * ```
  59641. * // 浏览器
  59642. * <script type="text/javascript" src="{cdn}"></script>
  59643. * <script>
  59644. * const result = {namespace}.scalesToResolutions(scales, bounds, dpi, mapUnit);
  59645. *
  59646. * </script>
  59647. *
  59648. * // ES6 Import
  59649. * import { scalesToResolutions } from '{npm}';
  59650. *
  59651. * const result = scalesToResolutions(scales, bounds, dpi, mapUnit);
  59652. * ```
  59653. */
  59654. function scalesToResolutions(scales, bounds, dpi, mapUnit) {
  59655. var level = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 22;
  59656. var resolutions = [];
  59657. if (scales && scales.length > 0) {
  59658. for (var i = 0; i < scales.length; i++) {
  59659. resolutions.push(scaleToResolution(scales[i], dpi, mapUnit));
  59660. }
  59661. } else {
  59662. var maxReolution = Math.abs(bounds.left - bounds.right) / 256;
  59663. for (var _i2 = 0; _i2 < level; _i2++) {
  59664. resolutions.push(maxReolution / Math.pow(2, _i2));
  59665. }
  59666. }
  59667. return resolutions.sort(function (a, b) {
  59668. return b - a;
  59669. });
  59670. }
  59671. /**
  59672. * @function getZoomByResolution
  59673. * @description 通过分辨率获取地图级别。
  59674. * @version 11.0.1
  59675. * @param {number} resolution - 分辨率。
  59676. * @param {Array} resolutions - 分辨率数组。
  59677. * @returns {number} 地图级别。
  59678. * @usage
  59679. * ```
  59680. * // 浏览器
  59681. * <script type="text/javascript" src="{cdn}"></script>
  59682. * <script>
  59683. * const result = {namespace}.getZoomByResolution(resolution, resolutions);
  59684. *
  59685. * </script>
  59686. *
  59687. * // ES6 Import
  59688. * import { getZoomByResolution } from '{npm}';
  59689. *
  59690. * const result = getZoomByResolution(resolution, resolutions);
  59691. * ```
  59692. */
  59693. function getZoomByResolution(resolution, resolutions) {
  59694. var zoom = 0;
  59695. var minDistance;
  59696. for (var i = 0; i < resolutions.length; i++) {
  59697. if (i === 0) {
  59698. minDistance = Math.abs(resolution - resolutions[i]);
  59699. }
  59700. if (minDistance > Math.abs(resolution - resolutions[i])) {
  59701. minDistance = Math.abs(resolution - resolutions[i]);
  59702. zoom = i;
  59703. }
  59704. }
  59705. return zoom;
  59706. }
  59707. /**
  59708. * @function scaleToResolution
  59709. * @description 通过比例尺计算分辨率。
  59710. * @version 11.0.1
  59711. * @param {number} scale - 比例尺。
  59712. * @param {number} dpi - 屏幕分辨率。
  59713. * @param {string} mapUnit - 地图单位。
  59714. * @returns {number} 分辨率。
  59715. * @usage
  59716. * ```
  59717. * // 浏览器
  59718. * <script type="text/javascript" src="{cdn}"></script>
  59719. * <script>
  59720. * const result = {namespace}.scaleToResolution(scale, dpi, mapUnit);
  59721. *
  59722. * </script>
  59723. *
  59724. * // ES6 Import
  59725. * import { scaleToResolution } from '{npm}';
  59726. *
  59727. * const result = scaleToResolution(scale, dpi, mapUnit);
  59728. * ```
  59729. */
  59730. function scaleToResolution(scale, dpi, mapUnit) {
  59731. var inchPerMeter = 1 / 0.0254;
  59732. var meterPerMapUnitValue = getMeterPerMapUnit(mapUnit);
  59733. var resolution = 1 / (scale * dpi * inchPerMeter * meterPerMapUnitValue);
  59734. return resolution;
  59735. }
  59736. /**
  59737. * 范围是否相交
  59738. * @param {Array} extent1 范围1
  59739. * @param {Array} extent2 范围2
  59740. * @return {boolean} 范围是否相交。
  59741. */
  59742. function intersects(extent1, extent2) {
  59743. return extent1[0] <= extent2[2] && extent1[2] >= extent2[0] && extent1[1] <= extent2[3] && extent1[3] >= extent2[1];
  59744. }
  59745. /**
  59746. * 获取两个范围的交集
  59747. * @param {Array} extent1 Extent 1
  59748. * @param {Array} extent2 Extent 2
  59749. * @return {Array} 相交范围数组.
  59750. * @api
  59751. */
  59752. function getIntersection(extent1, extent2) {
  59753. var intersection = [];
  59754. if (intersects(extent1, extent2)) {
  59755. if (extent1[0] > extent2[0]) {
  59756. intersection[0] = extent1[0];
  59757. } else {
  59758. intersection[0] = extent2[0];
  59759. }
  59760. if (extent1[1] > extent2[1]) {
  59761. intersection[1] = extent1[1];
  59762. } else {
  59763. intersection[1] = extent2[1];
  59764. }
  59765. if (extent1[2] < extent2[2]) {
  59766. intersection[2] = extent1[2];
  59767. } else {
  59768. intersection[2] = extent2[2];
  59769. }
  59770. if (extent1[3] < extent2[3]) {
  59771. intersection[3] = extent1[3];
  59772. } else {
  59773. intersection[3] = extent2[3];
  59774. }
  59775. }
  59776. return intersection;
  59777. }
  59778. ;// CONCATENATED MODULE: ./src/common/util/index.js
  59779. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59780. * This program are made available under the terms of the Apache License, Version 2.0
  59781. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59782. function toSuperMapGeometry(geoJSON) {
  59783. if (geoJSON && geoJSON.type) {
  59784. var format = new GeoJSONFormat();
  59785. var result = format.read(geoJSON, "FeatureCollection");
  59786. return result[0].geometry;
  59787. }
  59788. }
  59789. function toSuperMapPolygon(lnglatBounds) {
  59790. var west = lnglatBounds.getWest();
  59791. var east = lnglatBounds.getEast();
  59792. var sourth = lnglatBounds.getSouth();
  59793. var north = lnglatBounds.getNorth();
  59794. return new Polygon([new LinearRing([new GeometryPoint(west, sourth), new GeometryPoint(east, sourth), new GeometryPoint(east, north), new GeometryPoint(west, north)])]);
  59795. }
  59796. /**
  59797. * @function Util.extend
  59798. * @description 对象拷贝赋值。
  59799. * @param {Object} dest - 目标对象。
  59800. * @param {Object} arguments - 待拷贝的对象。
  59801. * @returns {Object} 赋值后的目标对象。
  59802. */
  59803. function extend(dest) {
  59804. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  59805. var arg = Object.getOwnPropertyNames(arguments)[index];
  59806. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  59807. continue;
  59808. }
  59809. var obj = arguments[arg];
  59810. if (obj) {
  59811. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  59812. var key = Object.getOwnPropertyNames(obj)[j];
  59813. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  59814. continue;
  59815. }
  59816. dest[key] = obj[key];
  59817. }
  59818. }
  59819. }
  59820. return dest;
  59821. }
  59822. // EXTERNAL MODULE: ./node_modules/lodash.topairs/index.js
  59823. var lodash_topairs = __webpack_require__(7820);
  59824. var lodash_topairs_default = /*#__PURE__*/__webpack_require__.n(lodash_topairs);
  59825. ;// CONCATENATED MODULE: ./src/common/style/CartoCSS.js
  59826. 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); }
  59827. function CartoCSS_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59828. 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); } }
  59829. 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; }
  59830. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  59831. * This program are made available under the terms of the Apache License, Version 2.0
  59832. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59833. /**
  59834. * @class CartoCSS
  59835. * @deprecatedclass SuperMap.CartoCSS
  59836. * @classdesc CartoCSS 解析类,其主要功能为将 CartoCSS 字符串解析为 CartoCSS 的 shader 属性风格对象。
  59837. * @category BaseTypes Style
  59838. * @param {string} cartoStr - 样式表字符串。
  59839. * @example
  59840. * var cartocss = "@provinceLineColor:#ddd;
  59841. * #China_Provinces_L___China400{
  59842. * line-dasharray:10,10;
  59843. * line-color:@provinceLineColor;
  59844. * line-width:1;
  59845. * }";
  59846. * new CartoCSS(cartocss);
  59847. * @usage
  59848. */
  59849. /*eslint no-useless-escape: "off"*/
  59850. var CartoCSS = /*#__PURE__*/function () {
  59851. function CartoCSS(cartoStr) {
  59852. CartoCSS_classCallCheck(this, CartoCSS);
  59853. this.env = null;
  59854. /**
  59855. * @member CartoCSS.prototype.parser
  59856. * @description 解析器。
  59857. */
  59858. this.parser = null;
  59859. /**
  59860. * @member CartoCSS.prototype.ruleSet
  59861. * @description CartoCSS 规则对象。
  59862. */
  59863. this.ruleSet = null;
  59864. /**
  59865. * @member CartoCSS.prototype.cartoStr
  59866. * @description CartoCSS 样式表字符串。
  59867. */
  59868. this.cartoStr = "";
  59869. /**
  59870. * @member CartoCSS.prototype.shaders
  59871. * @description Carto 着色器集。
  59872. */
  59873. this.shaders = null;
  59874. if (typeof cartoStr === "string") {
  59875. this.cartoStr = cartoStr;
  59876. this.env = {
  59877. frames: [],
  59878. errors: [],
  59879. error: function error(obj) {
  59880. this.errors.push(obj);
  59881. }
  59882. };
  59883. this.parser = this.getParser(this.env);
  59884. this.parse(cartoStr);
  59885. this.shaders = this.toShaders();
  59886. }
  59887. }
  59888. /**
  59889. * @function CartoCSS.prototype.getParser
  59890. * @description 获取 CartoCSS 解析器。
  59891. */
  59892. CartoCSS_createClass(CartoCSS, [{
  59893. key: "getParser",
  59894. value: function getParser(env) {
  59895. var input,
  59896. // LeSS input string
  59897. i,
  59898. // current index in `input`
  59899. j,
  59900. // current chunk
  59901. temp,
  59902. // temporarily holds a chunk's state, for backtracking
  59903. memo,
  59904. // temporarily holds `i`, when backtracking
  59905. furthest,
  59906. // furthest index the parser has gone to
  59907. chunks,
  59908. // chunkified input
  59909. current,
  59910. // index of current chunk, in `input`
  59911. parser;
  59912. var that = this;
  59913. // This function is called after all files
  59914. // have been imported through `@import`.
  59915. var finish = function finish() {//NOSONAR
  59916. //所有文件导入完成之后调用
  59917. };
  59918. function save() {
  59919. temp = chunks[j];
  59920. memo = i;
  59921. current = i;
  59922. }
  59923. function restore() {
  59924. chunks[j] = temp;
  59925. i = memo;
  59926. current = i;
  59927. }
  59928. function sync() {
  59929. if (i > current) {
  59930. chunks[j] = chunks[j].slice(i - current);
  59931. current = i;
  59932. }
  59933. }
  59934. //
  59935. // Parse from a token, regexp or string, and move forward if match
  59936. //
  59937. function _match(tok) {
  59938. var match, length, c, endIndex;
  59939. // Non-terminal
  59940. if (tok instanceof Function) {
  59941. return tok.call(parser.parsers);
  59942. // Terminal
  59943. // Either match a single character in the input,
  59944. // or match a regexp in the current chunk (chunk[j]).
  59945. } else if (typeof tok === 'string') {
  59946. match = input.charAt(i) === tok ? tok : null;
  59947. length = 1;
  59948. sync();
  59949. } else {
  59950. sync();
  59951. match = tok.exec(chunks[j]);
  59952. if (match) {
  59953. length = match[0].length;
  59954. } else {
  59955. return null;
  59956. }
  59957. }
  59958. // The match is confirmed, add the match length to `i`,
  59959. // and consume any extra white-space characters (' ' || '\n')
  59960. // which come after that. The reason for this is that LeSS's
  59961. // grammar is mostly white-space insensitive.
  59962. if (match) {
  59963. var mem = i += length;
  59964. endIndex = i + chunks[j].length - length;
  59965. while (i < endIndex) {
  59966. c = input.charCodeAt(i);
  59967. if (!(c === 32 || c === 10 || c === 9)) {
  59968. break;
  59969. }
  59970. i++;
  59971. }
  59972. chunks[j] = chunks[j].slice(length + (i - mem));
  59973. current = i;
  59974. if (chunks[j].length === 0 && j < chunks.length - 1) {
  59975. j++;
  59976. }
  59977. if (typeof match === 'string') {
  59978. return match;
  59979. } else {
  59980. return match.length === 1 ? match[0] : match;
  59981. }
  59982. }
  59983. }
  59984. // Same as _match(), but don't change the state of the parser,
  59985. // just return the match.
  59986. function peek(tok) {
  59987. if (typeof tok === 'string') {
  59988. return input.charAt(i) === tok;
  59989. } else {
  59990. return !!tok.test(chunks[j]);
  59991. }
  59992. }
  59993. // Make an error object from a passed set of properties.
  59994. // Accepted properties:
  59995. // - `message`: Text of the error message.
  59996. // - `filename`: Filename where the error occurred.
  59997. // - `index`: Char. index where the error occurred.
  59998. function makeError(err) {
  59999. var einput;
  60000. var defautls = {
  60001. index: furthest,
  60002. filename: env.filename,
  60003. message: 'Parse error.',
  60004. line: 0,
  60005. column: -1
  60006. };
  60007. for (var prop in defautls) {
  60008. if (err[prop] === 0) {
  60009. err[prop] = defautls[prop];
  60010. }
  60011. }
  60012. if (err.filename && that.env.inputs && that.env.inputs[err.filename]) {
  60013. einput = that.env.inputs[err.filename];
  60014. } else {
  60015. einput = input;
  60016. }
  60017. err.line = (einput.slice(0, err.index).match(/\n/g) || '').length + 1;
  60018. for (var n = err.index; n >= 0 && einput.charAt(n) !== '\n'; n--) {
  60019. err.column++;
  60020. }
  60021. return new Error([err.filename, err.line, err.column, err.message].join(";"));
  60022. }
  60023. this.env = env = env || {};
  60024. this.env.filename = this.env.filename || null;
  60025. this.env.inputs = this.env.inputs || {};
  60026. // The Parser
  60027. parser = {
  60028. // Parse an input string into an abstract syntax tree.
  60029. // Throws an error on parse errors.
  60030. parse: function parse(str) {
  60031. var root,
  60032. error = null;
  60033. i = j = current = furthest = 0;
  60034. chunks = [];
  60035. input = str.replace(/\r\n/g, '\n');
  60036. if (env.filename) {
  60037. that.env.inputs[env.filename] = input;
  60038. }
  60039. // Split the input into chunks.
  60040. chunks = function (chunks) {
  60041. var j = 0,
  60042. skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
  60043. comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
  60044. string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
  60045. level = 0,
  60046. match,
  60047. chunk = chunks[0],
  60048. inParam;
  60049. for (var i = 0, c, cc; i < input.length;) {
  60050. skip.lastIndex = i;
  60051. if (match = skip.exec(input)) {
  60052. if (match.index === i) {
  60053. i += match[0].length;
  60054. chunk.push(match[0]);
  60055. }
  60056. }
  60057. c = input.charAt(i);
  60058. comment.lastIndex = string.lastIndex = i;
  60059. if (match = string.exec(input)) {
  60060. if (match.index === i) {
  60061. i += match[0].length;
  60062. chunk.push(match[0]);
  60063. continue;
  60064. }
  60065. }
  60066. if (!inParam && c === '/') {
  60067. cc = input.charAt(i + 1);
  60068. if (cc === '/' || cc === '*') {
  60069. if (match = comment.exec(input)) {
  60070. if (match.index === i) {
  60071. i += match[0].length;
  60072. chunk.push(match[0]);
  60073. continue;
  60074. }
  60075. }
  60076. }
  60077. }
  60078. switch (c) {
  60079. case '{':
  60080. //NOSONAR
  60081. if (!inParam) {
  60082. level++;
  60083. chunk.push(c);
  60084. break;
  60085. }
  60086. case '}':
  60087. //NOSONAR
  60088. if (!inParam) {
  60089. level--;
  60090. chunk.push(c);
  60091. chunks[++j] = chunk = [];
  60092. break;
  60093. }
  60094. case '(':
  60095. //NOSONAR
  60096. if (!inParam) {
  60097. inParam = true;
  60098. chunk.push(c);
  60099. break;
  60100. }
  60101. case ')':
  60102. //NOSONAR
  60103. if (inParam) {
  60104. inParam = false;
  60105. chunk.push(c);
  60106. break;
  60107. }
  60108. default:
  60109. chunk.push(c);
  60110. break;
  60111. }
  60112. i++;
  60113. }
  60114. if (level !== 0) {
  60115. error = {
  60116. index: i - 1,
  60117. type: 'Parse',
  60118. message: level > 0 ? "missing closing `}`" : "missing opening `{`"
  60119. };
  60120. }
  60121. return chunks.map(function (c) {
  60122. return c.join('');
  60123. });
  60124. }([[]]);
  60125. if (error) {
  60126. throw makeError(error);
  60127. }
  60128. // Sort rules by specificity: this function expects selectors to be
  60129. // split already.
  60130. //
  60131. // Written to be used as a .sort(Function);
  60132. // argument.
  60133. //
  60134. // [1, 0, 0, 467] > [0, 0, 1, 520]
  60135. var specificitySort = function specificitySort(a, b) {
  60136. var as = a.specificity;
  60137. var bs = b.specificity;
  60138. if (as[0] != bs[0]) {
  60139. return bs[0] - as[0];
  60140. }
  60141. if (as[1] != bs[1]) {
  60142. return bs[1] - as[1];
  60143. }
  60144. if (as[2] != bs[2]) {
  60145. return bs[2] - as[2];
  60146. }
  60147. return bs[3] - as[3];
  60148. };
  60149. // Start with the primary rule.
  60150. // The whole syntax tree is held under a Ruleset node,
  60151. // with the `root` property set to true, so no `{}` are
  60152. // output.
  60153. root = new CartoCSS.Tree.Ruleset([], _match(this.parsers.primary));
  60154. root.root = true;
  60155. // Get an array of Ruleset objects, flattened
  60156. // and sorted according to specificitySort
  60157. root.toList = function () {
  60158. return function (env) {
  60159. env.error = function (e) {
  60160. if (!env.errors) {
  60161. env.errors = new Error('');
  60162. }
  60163. if (env.errors.message) {
  60164. env.errors.message += '\n' + makeError(e).message;
  60165. } else {
  60166. env.errors.message = makeError(e).message;
  60167. }
  60168. };
  60169. env.frames = env.frames || [];
  60170. // call populates Invalid-caused errors
  60171. var definitions = this.flatten([], [], env);
  60172. definitions.sort(specificitySort);
  60173. return definitions;
  60174. };
  60175. }();
  60176. return root;
  60177. },
  60178. // Here in, the parsing rules/functions
  60179. //
  60180. // The basic structure of the syntax tree generated is as follows:
  60181. //
  60182. // Ruleset -> Rule -> Value -> Expression -> Entity
  60183. //
  60184. // In general, most rules will try to parse a token with the `_match()` function, and if the return
  60185. // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
  60186. // first, before parsing, that's when we use `peek()`.
  60187. parsers: {
  60188. // The `primary` rule is the *entry* and *exit* point of the parser.
  60189. // The rules here can appear at any level of the parse tree.
  60190. //
  60191. // The recursive nature of the grammar is an interplay between the `block`
  60192. // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
  60193. // as represented by this simplified grammar:
  60194. //
  60195. // primary → (ruleset | rule)+
  60196. // ruleset → selector+ block
  60197. // block → '{' primary '}'
  60198. //
  60199. // Only at one point is the primary rule not called from the
  60200. // block rule: at the root level.
  60201. primary: function primary() {
  60202. var node,
  60203. root = [];
  60204. while ((node = _match(this.rule) || _match(this.ruleset) || _match(this.comment)) || _match(/^[\s\n]+/) || (node = _match(this.invalid))) {
  60205. if (node) {
  60206. root.push(node);
  60207. }
  60208. }
  60209. return root;
  60210. },
  60211. invalid: function invalid() {
  60212. var chunk = _match(/^[^;\n]*[;\n]/);
  60213. // To fail gracefully, match everything until a semicolon or linebreak.
  60214. if (chunk) {
  60215. return new CartoCSS.Tree.Invalid(chunk, memo);
  60216. }
  60217. },
  60218. // We create a Comment node for CSS comments `/* */`,
  60219. // but keep the LeSS comments `//` silent, by just skipping
  60220. // over them.
  60221. comment: function comment() {
  60222. var comment;
  60223. if (input.charAt(i) !== '/') {
  60224. return;
  60225. }
  60226. if (input.charAt(i + 1) === '/') {
  60227. return new CartoCSS.Tree.Comment(_match(/^\/\/.*/), true);
  60228. } else if (comment = _match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
  60229. return new CartoCSS.Tree.Comment(comment);
  60230. }
  60231. },
  60232. // Entities are tokens which can be found inside an Expression
  60233. entities: {
  60234. // A string, which supports escaping " and ' "milky way" 'he\'s the one!'
  60235. quoted: function quoted() {
  60236. if (input.charAt(i) !== '"' && input.charAt(i) !== "'") {
  60237. return;
  60238. }
  60239. var str = _match(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);
  60240. if (str) {
  60241. return new CartoCSS.Tree.Quoted(str[1] || str[2]);
  60242. }
  60243. },
  60244. // A reference to a Mapnik field, like [NAME]
  60245. // Behind the scenes, this has the same representation, but Carto
  60246. // needs to be careful to warn when unsupported operations are used.
  60247. field: function field() {
  60248. var l = '[',
  60249. r = ']';
  60250. if (!_match(l)) {
  60251. return;
  60252. }
  60253. var field_name = _match(/(^[^\]]+)/);
  60254. if (!_match(r)) {
  60255. return;
  60256. }
  60257. if (field_name) {
  60258. return new CartoCSS.Tree.Field(field_name[1]);
  60259. }
  60260. },
  60261. // This is a comparison operator
  60262. comparison: function comparison() {
  60263. var str = _match(/^=~|=|!=|<=|>=|<|>/);
  60264. if (str) {
  60265. return str;
  60266. }
  60267. },
  60268. // A catch-all word, such as: hard-light
  60269. // These can start with either a letter or a dash (-),
  60270. // and then contain numbers, underscores, and letters.
  60271. keyword: function keyword() {
  60272. var k = _match(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);
  60273. if (k) {
  60274. return new CartoCSS.Tree.Keyword(k);
  60275. }
  60276. },
  60277. // A function call like rgb(255, 0, 255)
  60278. // The arguments are parsed with the `entities.arguments` parser.
  60279. call: function call() {
  60280. var name, args;
  60281. if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) {
  60282. return;
  60283. }
  60284. name = name[1];
  60285. if (name === 'url') {
  60286. // url() is handled by the url parser instead
  60287. return null;
  60288. } else {
  60289. i += name.length;
  60290. }
  60291. var l = '(',
  60292. r = ')';
  60293. _match(l); // Parse the '(' and consume whitespace.
  60294. args = _match(this.entities['arguments']);
  60295. if (!_match(r)) {
  60296. return;
  60297. }
  60298. if (name) {
  60299. return new CartoCSS.Tree.Call(name, args, i);
  60300. }
  60301. },
  60302. // Arguments are comma-separated expressions
  60303. 'arguments': function _arguments() {
  60304. var args = [],
  60305. arg;
  60306. while (arg = _match(this.expression)) {
  60307. args.push(arg);
  60308. var q = ',';
  60309. if (!_match(q)) {
  60310. break;
  60311. }
  60312. }
  60313. return args;
  60314. },
  60315. literal: function literal() {
  60316. return _match(this.entities.dimension) || _match(this.entities.keywordcolor) || _match(this.entities.hexcolor) || _match(this.entities.quoted);
  60317. },
  60318. // Parse url() tokens
  60319. //
  60320. // We use a specific rule for urls, because they don't really behave like
  60321. // standard function calls. The difference is that the argument doesn't have
  60322. // to be enclosed within a string, so it can't be parsed as an Expression.
  60323. url: function url() {
  60324. var value;
  60325. if (input.charAt(i) !== 'u' || !_match(/^url\(/)) {
  60326. return;
  60327. }
  60328. value = _match(this.entities.quoted) || _match(this.entities.variable) || _match(/^[\-\w%@_match\/.&=:;#+?~]+/) || '';
  60329. var r = ')';
  60330. if (!_match(r)) {
  60331. return new CartoCSS.Tree.Invalid(value, memo, 'Missing closing ) in URL.');
  60332. } else {
  60333. return new CartoCSS.Tree.URL(typeof value.value !== 'undefined' || value instanceof CartoCSS.Tree.Variable ? value : new CartoCSS.Tree.Quoted(value));
  60334. }
  60335. },
  60336. // A Variable entity, such as `@fink`, in
  60337. //
  60338. // width: @fink + 2px
  60339. //
  60340. // We use a different parser for variable definitions,
  60341. // see `parsers.variable`.
  60342. variable: function variable() {
  60343. var name,
  60344. index = i;
  60345. if (input.charAt(i) === '@' && (name = _match(/^@[\w-]+/))) {
  60346. return new CartoCSS.Tree.Variable(name, index, env.filename);
  60347. }
  60348. },
  60349. hexcolor: function hexcolor() {
  60350. var rgb;
  60351. if (input.charAt(i) === '#' && (rgb = _match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
  60352. return new CartoCSS.Tree.Color(rgb[1]);
  60353. }
  60354. },
  60355. keywordcolor: function keywordcolor() {
  60356. var rgb = chunks[j].match(/^[a-z]+/);
  60357. if (rgb && rgb[0] in CartoCSS.Tree.Reference.data.colors) {
  60358. return new CartoCSS.Tree.Color(CartoCSS.Tree.Reference.data.colors[_match(/^[a-z]+/)]);
  60359. }
  60360. },
  60361. // A Dimension, that is, a number and a unit. The only
  60362. // unit that has an effect is %
  60363. dimension: function dimension() {
  60364. var c = input.charCodeAt(i);
  60365. if (c > 57 || c < 45 || c === 47) {
  60366. return;
  60367. }
  60368. var value = _match(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);
  60369. if (value) {
  60370. return new CartoCSS.Tree.Dimension(value[1], value[2], memo);
  60371. }
  60372. }
  60373. },
  60374. // The variable part of a variable definition.
  60375. // Used in the `rule` parser. Like @fink:
  60376. variable: function variable() {
  60377. var name;
  60378. if (input.charAt(i) === '@' && (name = _match(/^(@[\w-]+)\s*:/))) {
  60379. return name[1];
  60380. }
  60381. },
  60382. // Entities are the smallest recognized token,
  60383. // and can be found inside a rule's value.
  60384. entity: function entity() {
  60385. var property1 = _match(this.entities.call) || _match(this.entities.literal);
  60386. var property2 = _match(this.entities.field) || _match(this.entities.variable);
  60387. var property3 = _match(this.entities.url) || _match(this.entities.keyword);
  60388. return property1 || property2 || property3;
  60389. },
  60390. // A Rule terminator. Note that we use `peek()` to check for '}',
  60391. // because the `block` rule will be expecting it, but we still need to make sure
  60392. // it's there, if ';' was ommitted.
  60393. end: function end() {
  60394. var q = ';';
  60395. return _match(q) || peek('}');
  60396. },
  60397. // Elements are the building blocks for Selectors. They consist of
  60398. // an element name, such as a tag a class, or `*`.
  60399. //增加对中文的支持,[\u4e00-\u9fa5]
  60400. element: function element() {
  60401. var e = _match(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);
  60402. if (e) {
  60403. return new CartoCSS.Tree.Element(e);
  60404. }
  60405. },
  60406. // Attachments allow adding multiple lines, polygons etc. to an
  60407. // object. There can only be one attachment per selector.
  60408. attachment: function attachment() {
  60409. var s = _match(/^::([\w\-]+(?:\/[\w\-]+)*)/);
  60410. if (s) {
  60411. return s[1];
  60412. }
  60413. },
  60414. // Selectors are made out of one or more Elements, see above.
  60415. selector: function selector() {
  60416. var a,
  60417. attachment,
  60418. e,
  60419. elements = [],
  60420. f,
  60421. filters = new CartoCSS.Tree.Filterset(),
  60422. z,
  60423. zooms = [],
  60424. segments = 0,
  60425. conditions = 0;
  60426. while ((e = _match(this.element)) || (z = _match(this.zoom)) || (f = _match(this.filter)) || (a = _match(this.attachment))) {
  60427. segments++;
  60428. if (e) {
  60429. elements.push(e);
  60430. } else if (z) {
  60431. zooms.push(z);
  60432. conditions++;
  60433. } else if (f) {
  60434. var err = filters.add(f);
  60435. if (err) {
  60436. throw makeError({
  60437. message: err,
  60438. index: i - 1
  60439. });
  60440. }
  60441. conditions++;
  60442. } else if (attachment) {
  60443. throw makeError({
  60444. message: 'Encountered second attachment name.',
  60445. index: i - 1
  60446. });
  60447. } else {
  60448. attachment = a;
  60449. }
  60450. var c = input.charAt(i);
  60451. if (c === '{' || c === '}' || c === ';' || c === ',') {
  60452. break;
  60453. }
  60454. }
  60455. if (segments) {
  60456. return new CartoCSS.Tree.Selector(filters, zooms, elements, attachment, conditions, memo);
  60457. }
  60458. },
  60459. filter: function filter() {
  60460. save();
  60461. var key,
  60462. op,
  60463. val,
  60464. l = '[',
  60465. r = ']';
  60466. if (!_match(l)) {
  60467. return;
  60468. }
  60469. if (key = _match(/^[a-zA-Z0-9\-_]+/) || _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.keyword) || _match(this.entities.field)) {
  60470. if (key instanceof CartoCSS.Tree.Quoted) {
  60471. key = new CartoCSS.Tree.Field(key.toString());
  60472. }
  60473. 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))) {
  60474. if (!_match(r)) {
  60475. throw makeError({
  60476. message: 'Missing closing ] of filter.',
  60477. index: memo - 1
  60478. });
  60479. }
  60480. if (!key.is) {
  60481. key = new CartoCSS.Tree.Field(key);
  60482. }
  60483. return new CartoCSS.Tree.Filter(key, op, val, memo, env.filename);
  60484. }
  60485. }
  60486. },
  60487. zoom: function zoom() {
  60488. save();
  60489. var op,
  60490. val,
  60491. r = ']';
  60492. if (_match(/^\[\s*zoom/g) && (op = _match(this.entities.comparison)) && (val = _match(this.entities.variable) || _match(this.entities.dimension)) && _match(r)) {
  60493. return new CartoCSS.Tree.Zoom(op, val, memo);
  60494. } else {
  60495. // backtrack
  60496. restore();
  60497. }
  60498. },
  60499. // The `block` rule is used by `ruleset`
  60500. // It's a wrapper around the `primary` rule, with added `{}`.
  60501. block: function block() {
  60502. var content,
  60503. l = '{',
  60504. r = '}';
  60505. if (_match(l) && (content = _match(this.primary)) && _match(r)) {
  60506. return content;
  60507. }
  60508. },
  60509. // div, .class, body > p {...}
  60510. ruleset: function ruleset() {
  60511. var selectors = [],
  60512. s,
  60513. rules,
  60514. q = ',';
  60515. save();
  60516. while (s = _match(this.selector)) {
  60517. selectors.push(s);
  60518. while (_match(this.comment)) {//NOSONAR
  60519. }
  60520. if (!_match(q)) {
  60521. break;
  60522. }
  60523. while (_match(this.comment)) {//NOSONAR
  60524. }
  60525. }
  60526. if (s) {
  60527. while (_match(this.comment)) {//NOSONAR
  60528. }
  60529. }
  60530. if (selectors.length > 0 && (rules = _match(this.block))) {
  60531. if (selectors.length === 1 && selectors[0].elements.length && selectors[0].elements[0].value === 'Map') {
  60532. var rs = new CartoCSS.Tree.Ruleset(selectors, rules);
  60533. rs.isMap = true;
  60534. return rs;
  60535. }
  60536. return new CartoCSS.Tree.Ruleset(selectors, rules);
  60537. } else {
  60538. // Backtrack
  60539. restore();
  60540. }
  60541. },
  60542. rule: function rule() {
  60543. var name,
  60544. value,
  60545. c = input.charAt(i);
  60546. save();
  60547. if (c === '.' || c === '#') {
  60548. return;
  60549. }
  60550. if (name = _match(this.variable) || _match(this.property)) {
  60551. value = _match(this.value);
  60552. if (value && _match(this.end)) {
  60553. return new CartoCSS.Tree.Rule(name, value, memo, env.filename);
  60554. } else {
  60555. furthest = i;
  60556. restore();
  60557. }
  60558. }
  60559. },
  60560. font: function font() {
  60561. var value = [],
  60562. expression = [],
  60563. e,
  60564. q = ',';
  60565. while (e = _match(this.entity)) {
  60566. expression.push(e);
  60567. }
  60568. value.push(new CartoCSS.Tree.Expression(expression));
  60569. if (_match(q)) {
  60570. while (e = _match(this.expression)) {
  60571. value.push(e);
  60572. if (!_match(q)) {
  60573. break;
  60574. }
  60575. }
  60576. }
  60577. return new CartoCSS.Tree.Value(value);
  60578. },
  60579. // A Value is a comma-delimited list of Expressions
  60580. // In a Rule, a Value represents everything after the `:`,
  60581. // and before the `;`.
  60582. value: function value() {
  60583. var e,
  60584. expressions = [],
  60585. q = ',';
  60586. while (e = _match(this.expression)) {
  60587. expressions.push(e);
  60588. if (!_match(q)) {
  60589. break;
  60590. }
  60591. }
  60592. if (expressions.length > 1) {
  60593. return new CartoCSS.Tree.Value(expressions.map(function (e) {
  60594. return e.value[0];
  60595. }));
  60596. } else if (expressions.length === 1) {
  60597. return new CartoCSS.Tree.Value(expressions);
  60598. }
  60599. },
  60600. // A sub-expression, contained by parenthensis
  60601. sub: function sub() {
  60602. var e,
  60603. l = '(',
  60604. r = ")";
  60605. if (_match(l) && (e = _match(this.expression)) && _match(r)) {
  60606. return e;
  60607. }
  60608. },
  60609. // This is a misnomer because it actually handles multiplication
  60610. // and division.
  60611. multiplication: function multiplication() {
  60612. var m,
  60613. a,
  60614. op,
  60615. operation,
  60616. q = '/';
  60617. if (m = _match(this.operand)) {
  60618. while ((op = _match(q) || _match('*') || _match('%')) && (a = _match(this.operand))) {
  60619. operation = new CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  60620. }
  60621. return operation || m;
  60622. }
  60623. },
  60624. addition: function addition() {
  60625. var m,
  60626. a,
  60627. op,
  60628. operation,
  60629. plus = '+';
  60630. if (m = _match(this.multiplication)) {
  60631. while ((op = _match(/^[-+]\s+/) || input.charAt(i - 1) != ' ' && (_match(plus) || _match('-'))) && (a = _match(this.multiplication))) {
  60632. operation = new CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  60633. }
  60634. return operation || m;
  60635. }
  60636. },
  60637. // An operand is anything that can be part of an operation,
  60638. // such as a Color, or a Variable
  60639. operand: function operand() {
  60640. return _match(this.sub) || _match(this.entity);
  60641. },
  60642. // Expressions either represent mathematical operations,
  60643. // or white-space delimited Entities. @var * 2
  60644. expression: function expression() {
  60645. var e,
  60646. entities = [];
  60647. while (e = _match(this.addition) || _match(this.entity)) {
  60648. entities.push(e);
  60649. }
  60650. if (entities.length > 0) {
  60651. return new CartoCSS.Tree.Expression(entities);
  60652. }
  60653. },
  60654. property: function property() {
  60655. var name = _match(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);
  60656. if (name) {
  60657. return name[1];
  60658. }
  60659. }
  60660. }
  60661. };
  60662. return parser;
  60663. }
  60664. /**
  60665. * @function CartoCSS.prototype.parse
  60666. * @description 利用CartoCSS解析器里面的parse方法,将CartoCSS样式表字符串转化为CartoCSS规则集。
  60667. * @returns {Object} CartoCSS规则集。
  60668. */
  60669. }, {
  60670. key: "parse",
  60671. value: function parse(str) {
  60672. var parser = this.parser;
  60673. var ruleSet = this.ruleSet = parser.parse(str);
  60674. return ruleSet;
  60675. }
  60676. /**
  60677. * @function CartoCSS.prototype.toShaders
  60678. * @description 将CartoCSS规则集转化为着色器。
  60679. * @returns {Array} CartoCSS着色器集。
  60680. */
  60681. }, {
  60682. key: "toShaders",
  60683. value: function toShaders() {
  60684. if (this.ruleSet) {
  60685. var ruleset = this.ruleSet;
  60686. if (ruleset) {
  60687. var defs = ruleset.toList(this.env);
  60688. defs.reverse();
  60689. var shaders = {};
  60690. var keys = [];
  60691. this._toShaders(shaders, keys, defs);
  60692. var ordered_shaders = [];
  60693. var done = {};
  60694. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  60695. var def = defs[i];
  60696. var k = def.attachment;
  60697. var shader = shaders[keys[i]];
  60698. var shaderArray = [];
  60699. if (!done[k]) {
  60700. var j = 0;
  60701. for (var prop in shader) {
  60702. if (prop !== 'zoom' && prop !== 'frames' && prop !== "attachment" && prop != "elements") {
  60703. //对layer-index作特殊处理以实现图层的控制
  60704. if (prop === "layer-index") {
  60705. /*var getLayerIndex = Function("attributes", "zoom", "var _value = null;" + shader[prop].join('\n') + "; return _value; ");*/
  60706. var getLayerIndex = function getLayerIndex(attributes, zoom) {
  60707. //NOSONAR
  60708. var _value = null;
  60709. shader[prop].join('\n');
  60710. return _value;
  60711. };
  60712. var layerIndex = getLayerIndex();
  60713. Object.defineProperty(shaderArray, "layerIndex", {
  60714. configurable: true,
  60715. enumerable: false,
  60716. value: layerIndex
  60717. });
  60718. } else {
  60719. shaderArray[j++] = function (ops, shaderArray) {
  60720. //NOSONAR
  60721. if (!Array.isArray(ops)) {
  60722. return ops;
  60723. }
  60724. var body = ops.join('\n');
  60725. var myKeyword = 'attributes["FEATUREID"]&&attributes["FEATUREID"]';
  60726. var index = body.indexOf(myKeyword);
  60727. if (index >= 0) {
  60728. //对featureID作一些特殊处理,以将featureID提取出来
  60729. if (!shaderArray.featureFilter) {
  60730. var featureFilterStart = index + myKeyword.length;
  60731. var featureFilterEnd = body.indexOf(")", featureFilterStart + 1);
  60732. var featureFilterStr = "featureId&&(featureId" + body.substring(featureFilterStart, featureFilterEnd) + ")";
  60733. /*var featureFilter = Function("featureId", "if(" + featureFilterStr + "){return true;}return false;");*/
  60734. var featureFilter = function featureFilter(featureId) {
  60735. if (featureFilterStr) {
  60736. return true;
  60737. }
  60738. return false;
  60739. };
  60740. Object.defineProperty(shaderArray, "featureFilter", {
  60741. configurable: true,
  60742. enumerable: false,
  60743. value: featureFilter
  60744. });
  60745. }
  60746. return {
  60747. "property": prop,
  60748. "getValue": Function("attributes", "zoom", "seftFilter", "var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){" + body + ";} return _value; ") //NOSONAR
  60749. };
  60750. } else {
  60751. return {
  60752. "property": prop,
  60753. "getValue": Function("attributes", "zoom", "var _value = null;" + body + "; return _value; ") //NOSONAR
  60754. };
  60755. }
  60756. }(shader[prop], shaderArray);
  60757. }
  60758. }
  60759. }
  60760. Object.defineProperty(shaderArray, "attachment", {
  60761. configurable: true,
  60762. enumerable: false,
  60763. value: k
  60764. });
  60765. Object.defineProperty(shaderArray, "elements", {
  60766. configurable: true,
  60767. enumerable: false,
  60768. value: def.elements
  60769. });
  60770. ordered_shaders.push(shaderArray);
  60771. done[keys[i]] = true;
  60772. }
  60773. Object.defineProperty(shaderArray, "zoom", {
  60774. configurable: true,
  60775. enumerable: false,
  60776. value: def.zoom
  60777. });
  60778. //shader.frames.push(def.frame_offset);
  60779. }
  60780. return ordered_shaders;
  60781. }
  60782. }
  60783. return null;
  60784. }
  60785. }, {
  60786. key: "_toShaders",
  60787. value: function _toShaders(shaders, keys, defs) {
  60788. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  60789. var def = defs[i];
  60790. var element_str = [];
  60791. for (var j = 0, len1 = def.elements.length; j < len1; j++) {
  60792. element_str.push(def.elements[j]);
  60793. }
  60794. var filters = def.filters.filters;
  60795. var filterStr = [];
  60796. for (var attr in filters) {
  60797. filterStr.push(filters[attr].id);
  60798. }
  60799. var key = element_str.join("/") + "::" + def.attachment + "_" + filterStr.join("_");
  60800. keys.push(key);
  60801. var shader = shaders[key] = shaders[key] || {};
  60802. //shader.frames = [];
  60803. shader.zoom = CartoCSS.Tree.Zoom.all;
  60804. var props = def.toJS(this.env);
  60805. for (var v in props) {
  60806. (shader[v] = shader[v] || []).push(props[v].join('\n'));
  60807. }
  60808. }
  60809. }
  60810. /**
  60811. * @function CartoCSS.prototype.getShaders
  60812. * @description 获取CartoCSS着色器。
  60813. * @returns {Array} 着色器集。
  60814. * @example
  60815. * //shaders的结构大概如下:
  60816. * var shaders=[
  60817. * {
  60818. * attachment:"one",
  60819. * elements:[],
  60820. * zoom:23,
  60821. * length:2,
  60822. * 0:{property:"line-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  60823. * 1:{preoperty:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  60824. * },
  60825. * {
  60826. * attachment:"two",
  60827. * elements:[],
  60828. * zoom:23,
  60829. * length:2,
  60830. * 0:{property:"polygon-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  60831. * 1:{property:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  60832. * }
  60833. * ];
  60834. */
  60835. }, {
  60836. key: "getShaders",
  60837. value: function getShaders() {
  60838. return this.shaders;
  60839. }
  60840. /**
  60841. * @function CartoCSS.prototype.destroy
  60842. * @description CartoCSS解析对象的析构函数,用于销毁CartoCSS解析对象。
  60843. */
  60844. }, {
  60845. key: "destroy",
  60846. value: function destroy() {
  60847. this.cartoStr = null;
  60848. this.env = null;
  60849. this.ruleSet = null;
  60850. this.parser = null;
  60851. this.shaders = null;
  60852. }
  60853. }]);
  60854. return CartoCSS;
  60855. }();
  60856. var _mapnik_reference_latest = {
  60857. "version": "2.1.1",
  60858. "style": {
  60859. "filter-mode": {
  60860. "type": ["all", "first"],
  60861. "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)",
  60862. "default-value": "all",
  60863. "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."
  60864. },
  60865. "image-filters": {
  60866. "css": "image-filters",
  60867. "default-value": "none",
  60868. "default-meaning": "no filters",
  60869. "type": "functions",
  60870. "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]],
  60871. "doc": "A list of image filters."
  60872. },
  60873. "comp-op": {
  60874. "css": "comp-op",
  60875. "default-value": "src-over",
  60876. "default-meaning": "add the current layer on top of other layers",
  60877. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  60878. "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"]
  60879. },
  60880. "opacity": {
  60881. "css": "opacity",
  60882. "type": "float",
  60883. "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)",
  60884. "default-value": 1,
  60885. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  60886. }
  60887. },
  60888. "layer": {
  60889. "name": {
  60890. "default-value": "",
  60891. "type": "string",
  60892. "required": true,
  60893. "default-meaning": "No layer name has been provided",
  60894. "doc": "The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"
  60895. },
  60896. "srs": {
  60897. "default-value": "",
  60898. "type": "string",
  60899. "default-meaning": "No srs value is provided and the value will be inherited from the Map's srs",
  60900. "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'"
  60901. },
  60902. "status": {
  60903. "default-value": true,
  60904. "type": "boolean",
  60905. "default-meaning": "This layer will be marked as active and available for processing",
  60906. "doc": "A property that can be set to false to disable this layer from being processed"
  60907. },
  60908. "minzoom": {
  60909. "default-value": "0",
  60910. "type": "float",
  60911. "default-meaning": "The layer will be visible at the minimum possible scale",
  60912. "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"
  60913. },
  60914. "maxzoom": {
  60915. "default-value": "1.79769e+308",
  60916. "type": "float",
  60917. "default-meaning": "The layer will be visible at the maximum possible scale",
  60918. "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"
  60919. },
  60920. "queryable": {
  60921. "default-value": false,
  60922. "type": "boolean",
  60923. "default-meaning": "The layer will not be available for the direct querying of data values",
  60924. "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"
  60925. },
  60926. "clear-label-cache": {
  60927. "default-value": false,
  60928. "type": "boolean",
  60929. "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",
  60930. "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"
  60931. },
  60932. "group-by": {
  60933. "default-value": "",
  60934. "type": "string",
  60935. "default-meaning": "No special layer grouping will be used during rendering",
  60936. "doc": "https://github.com/mapnik/mapnik/wiki/Grouped-rendering"
  60937. },
  60938. "buffer-size": {
  60939. "default-value": "0",
  60940. "type": "float",
  60941. "default-meaning": "No buffer will be used",
  60942. "doc": "Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"
  60943. },
  60944. "maximum-extent": {
  60945. "default-value": "none",
  60946. "type": "bbox",
  60947. "default-meaning": "No clipping extent will be used",
  60948. "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."
  60949. }
  60950. },
  60951. "symbolizers": {
  60952. "*": {
  60953. "image-filters": {
  60954. "css": "image-filters",
  60955. "default-value": "none",
  60956. "default-meaning": "no filters",
  60957. "type": "functions",
  60958. "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]],
  60959. "doc": "A list of image filters."
  60960. },
  60961. "comp-op": {
  60962. "css": "comp-op",
  60963. "default-value": "src-over",
  60964. "default-meaning": "add the current layer on top of other layers",
  60965. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  60966. "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"]
  60967. },
  60968. "opacity": {
  60969. "css": "opacity",
  60970. "type": "float",
  60971. "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)",
  60972. "default-value": 1,
  60973. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  60974. }
  60975. },
  60976. "map": {
  60977. "background-color": {
  60978. "css": "background-color",
  60979. "default-value": "none",
  60980. "default-meaning": "transparent",
  60981. "type": "color",
  60982. "doc": "Map Background color"
  60983. },
  60984. "background-image": {
  60985. "css": "background-image",
  60986. "type": "uri",
  60987. "default-value": "",
  60988. "default-meaning": "transparent",
  60989. "doc": "An image that is repeated below all features on a map as a background.",
  60990. "description": "Map Background image"
  60991. },
  60992. "srs": {
  60993. "css": "srs",
  60994. "type": "string",
  60995. "default-value": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
  60996. "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",
  60997. "doc": "Map spatial reference (proj4 string)"
  60998. },
  60999. "buffer-size": {
  61000. "css": "buffer-size",
  61001. "default-value": "0",
  61002. "type": "float",
  61003. "default-meaning": "No buffer will be used",
  61004. "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\"."
  61005. },
  61006. "maximum-extent": {
  61007. "css": "",
  61008. "default-value": "none",
  61009. "type": "bbox",
  61010. "default-meaning": "No clipping extent will be used",
  61011. "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."
  61012. },
  61013. "base": {
  61014. "css": "base",
  61015. "default-value": "",
  61016. "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.",
  61017. "type": "string",
  61018. "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."
  61019. },
  61020. "paths-from-xml": {
  61021. "css": "",
  61022. "default-value": true,
  61023. "default-meaning": "Paths read from XML will be interpreted from the location of the XML",
  61024. "type": "boolean",
  61025. "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()"
  61026. },
  61027. "minimum-version": {
  61028. "css": "",
  61029. "default-value": "none",
  61030. "default-meaning": "Mapnik version will not be detected and no error will be thrown about compatibility",
  61031. "type": "string",
  61032. "doc": "The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"
  61033. },
  61034. "font-directory": {
  61035. "css": "font-directory",
  61036. "type": "uri",
  61037. "default-value": "none",
  61038. "default-meaning": "No map-specific fonts will be registered",
  61039. "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)."
  61040. }
  61041. },
  61042. "polygon": {
  61043. "fill": {
  61044. "css": "polygon-fill",
  61045. "type": "color",
  61046. "default-value": "rgba(128,128,128,1)",
  61047. "default-meaning": "gray and fully opaque (alpha = 1), same as rgb(128,128,128)",
  61048. "doc": "Fill color to assign to a polygon"
  61049. },
  61050. "fill-opacity": {
  61051. "css": "polygon-opacity",
  61052. "type": "float",
  61053. "doc": "The opacity of the polygon",
  61054. "default-value": 1,
  61055. "default-meaning": "opaque"
  61056. },
  61057. "gamma": {
  61058. "css": "polygon-gamma",
  61059. "type": "float",
  61060. "default-value": 1,
  61061. "default-meaning": "fully antialiased",
  61062. "range": "0-1",
  61063. "doc": "Level of antialiasing of polygon edges"
  61064. },
  61065. "gamma-method": {
  61066. "css": "polygon-gamma-method",
  61067. "type": ["power", "linear", "none", "threshold", "multiply"],
  61068. "default-value": "power",
  61069. "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",
  61070. "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"
  61071. },
  61072. "clip": {
  61073. "css": "polygon-clip",
  61074. "type": "boolean",
  61075. "default-value": true,
  61076. "default-meaning": "geometry will be clipped to map bounds before rendering",
  61077. "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."
  61078. },
  61079. "smooth": {
  61080. "css": "polygon-smooth",
  61081. "type": "float",
  61082. "default-value": 0,
  61083. "default-meaning": "no smoothing",
  61084. "range": "0-1",
  61085. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  61086. },
  61087. "geometry-transform": {
  61088. "css": "polygon-geometry-transform",
  61089. "type": "functions",
  61090. "default-value": "none",
  61091. "default-meaning": "geometry will not be transformed",
  61092. "doc": "Allows transformation functions to be applied to the geometry.",
  61093. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  61094. },
  61095. "comp-op": {
  61096. "css": "polygon-comp-op",
  61097. "default-value": "src-over",
  61098. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61099. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61100. "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"]
  61101. }
  61102. },
  61103. "line": {
  61104. "stroke": {
  61105. "css": "line-color",
  61106. "default-value": "rgba(0,0,0,1)",
  61107. "type": "color",
  61108. "default-meaning": "black and fully opaque (alpha = 1), same as rgb(0,0,0)",
  61109. "doc": "The color of a drawn line"
  61110. },
  61111. "stroke-width": {
  61112. "css": "line-width",
  61113. "default-value": 1,
  61114. "type": "float",
  61115. "doc": "The width of a line in pixels"
  61116. },
  61117. "stroke-opacity": {
  61118. "css": "line-opacity",
  61119. "default-value": 1,
  61120. "type": "float",
  61121. "default-meaning": "opaque",
  61122. "doc": "The opacity of a line"
  61123. },
  61124. "stroke-linejoin": {
  61125. "css": "line-join",
  61126. "default-value": "miter",
  61127. "type": ["miter", "round", "bevel"],
  61128. "doc": "The behavior of lines when joining"
  61129. },
  61130. "stroke-linecap": {
  61131. "css": "line-cap",
  61132. "default-value": "butt",
  61133. "type": ["butt", "round", "square"],
  61134. "doc": "The display of line endings"
  61135. },
  61136. "stroke-gamma": {
  61137. "css": "line-gamma",
  61138. "type": "float",
  61139. "default-value": 1,
  61140. "default-meaning": "fully antialiased",
  61141. "range": "0-1",
  61142. "doc": "Level of antialiasing of stroke line"
  61143. },
  61144. "stroke-gamma-method": {
  61145. "css": "line-gamma-method",
  61146. "type": ["power", "linear", "none", "threshold", "multiply"],
  61147. "default-value": "power",
  61148. "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",
  61149. "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"
  61150. },
  61151. "stroke-dasharray": {
  61152. "css": "line-dasharray",
  61153. "type": "numbers",
  61154. "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.",
  61155. "default-value": "none",
  61156. "default-meaning": "solid line"
  61157. },
  61158. "stroke-dashoffset": {
  61159. "css": "line-dash-offset",
  61160. "type": "numbers",
  61161. "doc": "valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)",
  61162. "default-value": "none",
  61163. "default-meaning": "solid line"
  61164. },
  61165. "stroke-miterlimit": {
  61166. "css": "line-miterlimit",
  61167. "type": "float",
  61168. "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.",
  61169. "default-value": 4.0,
  61170. "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 )'"
  61171. },
  61172. "clip": {
  61173. "css": "line-clip",
  61174. "type": "boolean",
  61175. "default-value": true,
  61176. "default-meaning": "geometry will be clipped to map bounds before rendering",
  61177. "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."
  61178. },
  61179. "smooth": {
  61180. "css": "line-smooth",
  61181. "type": "float",
  61182. "default-value": 0,
  61183. "default-meaning": "no smoothing",
  61184. "range": "0-1",
  61185. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  61186. },
  61187. "offset": {
  61188. "css": "line-offset",
  61189. "type": "float",
  61190. "default-value": 0,
  61191. "default-meaning": "no offset",
  61192. "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)."
  61193. },
  61194. "rasterizer": {
  61195. "css": "line-rasterizer",
  61196. "type": ["full", "fast"],
  61197. "default-value": "full",
  61198. "doc": "Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."
  61199. },
  61200. "geometry-transform": {
  61201. "css": "line-geometry-transform",
  61202. "type": "functions",
  61203. "default-value": "none",
  61204. "default-meaning": "geometry will not be transformed",
  61205. "doc": "Allows transformation functions to be applied to the geometry.",
  61206. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  61207. },
  61208. "comp-op": {
  61209. "css": "line-comp-op",
  61210. "default-value": "src-over",
  61211. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61212. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61213. "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"]
  61214. }
  61215. },
  61216. "markers": {
  61217. "file": {
  61218. "css": "marker-file",
  61219. "doc": "An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.",
  61220. "default-value": "",
  61221. "default-meaning": "An ellipse or circle, if width equals height",
  61222. "type": "uri"
  61223. },
  61224. "opacity": {
  61225. "css": "marker-opacity",
  61226. "doc": "The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke",
  61227. "default-value": 1,
  61228. "default-meaning": "The stroke-opacity and fill-opacity will be used",
  61229. "type": "float"
  61230. },
  61231. "fill-opacity": {
  61232. "css": "marker-fill-opacity",
  61233. "doc": "The fill opacity of the marker",
  61234. "default-value": 1,
  61235. "default-meaning": "opaque",
  61236. "type": "float"
  61237. },
  61238. "stroke": {
  61239. "css": "marker-line-color",
  61240. "doc": "The color of the stroke around a marker shape.",
  61241. "default-value": "black",
  61242. "type": "color"
  61243. },
  61244. "stroke-width": {
  61245. "css": "marker-line-width",
  61246. "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.",
  61247. "type": "float"
  61248. },
  61249. "stroke-opacity": {
  61250. "css": "marker-line-opacity",
  61251. "default-value": 1,
  61252. "default-meaning": "opaque",
  61253. "doc": "The opacity of a line",
  61254. "type": "float"
  61255. },
  61256. "placement": {
  61257. "css": "marker-placement",
  61258. "type": ["point", "line", "interior"],
  61259. "default-value": "point",
  61260. "default-meaning": "Place markers at the center point (centroid) of the geometry",
  61261. "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"
  61262. },
  61263. "multi-policy": {
  61264. "css": "marker-multi-policy",
  61265. "type": ["each", "whole", "largest"],
  61266. "default-value": "each",
  61267. "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",
  61268. "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)."
  61269. },
  61270. "marker-type": {
  61271. "css": "marker-type",
  61272. "type": ["arrow", "ellipse"],
  61273. "default-value": "ellipse",
  61274. "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)"
  61275. },
  61276. "width": {
  61277. "css": "marker-width",
  61278. "default-value": 10,
  61279. "doc": "The width of the marker, if using one of the default types.",
  61280. "type": "expression"
  61281. },
  61282. "height": {
  61283. "css": "marker-height",
  61284. "default-value": 10,
  61285. "doc": "The height of the marker, if using one of the default types.",
  61286. "type": "expression"
  61287. },
  61288. "fill": {
  61289. "css": "marker-fill",
  61290. "default-value": "blue",
  61291. "doc": "The color of the area of the marker.",
  61292. "type": "color"
  61293. },
  61294. "allow-overlap": {
  61295. "css": "marker-allow-overlap",
  61296. "type": "boolean",
  61297. "default-value": false,
  61298. "doc": "Control whether overlapping markers are shown or hidden.",
  61299. "default-meaning": "Do not allow makers to overlap with each other - overlapping markers will not be shown."
  61300. },
  61301. "ignore-placement": {
  61302. "css": "marker-ignore-placement",
  61303. "type": "boolean",
  61304. "default-value": false,
  61305. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  61306. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  61307. },
  61308. "spacing": {
  61309. "css": "marker-spacing",
  61310. "doc": "Space between repeated labels",
  61311. "default-value": 100,
  61312. "type": "float"
  61313. },
  61314. "max-error": {
  61315. "css": "marker-max-error",
  61316. "type": "float",
  61317. "default-value": 0.2,
  61318. "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."
  61319. },
  61320. "transform": {
  61321. "css": "marker-transform",
  61322. "type": "functions",
  61323. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  61324. "default-value": "",
  61325. "default-meaning": "No transformation",
  61326. "doc": "SVG transformation definition"
  61327. },
  61328. "clip": {
  61329. "css": "marker-clip",
  61330. "type": "boolean",
  61331. "default-value": true,
  61332. "default-meaning": "geometry will be clipped to map bounds before rendering",
  61333. "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."
  61334. },
  61335. "smooth": {
  61336. "css": "marker-smooth",
  61337. "type": "float",
  61338. "default-value": 0,
  61339. "default-meaning": "no smoothing",
  61340. "range": "0-1",
  61341. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  61342. },
  61343. "geometry-transform": {
  61344. "css": "marker-geometry-transform",
  61345. "type": "functions",
  61346. "default-value": "none",
  61347. "default-meaning": "geometry will not be transformed",
  61348. "doc": "Allows transformation functions to be applied to the geometry.",
  61349. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  61350. },
  61351. "comp-op": {
  61352. "css": "marker-comp-op",
  61353. "default-value": "src-over",
  61354. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61355. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61356. "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"]
  61357. }
  61358. },
  61359. "shield": {
  61360. "name": {
  61361. "css": "shield-name",
  61362. "type": "expression",
  61363. "serialization": "content",
  61364. "doc": "Value to use for a shield\"s text label. Data columns are specified using brackets like [column_name]"
  61365. },
  61366. "file": {
  61367. "css": "shield-file",
  61368. "required": true,
  61369. "type": "uri",
  61370. "default-value": "none",
  61371. "doc": "Image file to render behind the shield text"
  61372. },
  61373. "face-name": {
  61374. "css": "shield-face-name",
  61375. "type": "string",
  61376. "validate": "font",
  61377. "doc": "Font name and style to use for the shield text",
  61378. "default-value": "",
  61379. "required": true
  61380. },
  61381. "unlock-image": {
  61382. "css": "shield-unlock-image",
  61383. "type": "boolean",
  61384. "doc": "This parameter should be set to true if you are trying to position text beside rather than on top of the shield image",
  61385. "default-value": false,
  61386. "default-meaning": "text alignment relative to the shield image uses the center of the image as the anchor for text positioning."
  61387. },
  61388. "size": {
  61389. "css": "shield-size",
  61390. "type": "float",
  61391. "doc": "The size of the shield text in pixels"
  61392. },
  61393. "fill": {
  61394. "css": "shield-fill",
  61395. "type": "color",
  61396. "doc": "The color of the shield text"
  61397. },
  61398. "placement": {
  61399. "css": "shield-placement",
  61400. "type": ["point", "line", "vertex", "interior"],
  61401. "default-value": "point",
  61402. "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."
  61403. },
  61404. "avoid-edges": {
  61405. "css": "shield-avoid-edges",
  61406. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  61407. "type": "boolean",
  61408. "default-value": false
  61409. },
  61410. "allow-overlap": {
  61411. "css": "shield-allow-overlap",
  61412. "type": "boolean",
  61413. "default-value": false,
  61414. "doc": "Control whether overlapping shields are shown or hidden.",
  61415. "default-meaning": "Do not allow shields to overlap with other map elements already placed."
  61416. },
  61417. "minimum-distance": {
  61418. "css": "shield-min-distance",
  61419. "type": "float",
  61420. "default-value": 0,
  61421. "doc": "Minimum distance to the next shield symbol, not necessarily the same shield."
  61422. },
  61423. "spacing": {
  61424. "css": "shield-spacing",
  61425. "type": "float",
  61426. "default-value": 0,
  61427. "doc": "The spacing between repeated occurrences of the same shield on a line"
  61428. },
  61429. "minimum-padding": {
  61430. "css": "shield-min-padding",
  61431. "default-value": 0,
  61432. "doc": "Determines the minimum amount of padding that a shield gets relative to other shields",
  61433. "type": "float"
  61434. },
  61435. "wrap-width": {
  61436. "css": "shield-wrap-width",
  61437. "type": "unsigned",
  61438. "default-value": 0,
  61439. "doc": "Length of a chunk of text in characters before wrapping text"
  61440. },
  61441. "wrap-before": {
  61442. "css": "shield-wrap-before",
  61443. "type": "boolean",
  61444. "default-value": false,
  61445. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  61446. },
  61447. "wrap-character": {
  61448. "css": "shield-wrap-character",
  61449. "type": "string",
  61450. "default-value": " ",
  61451. "doc": "Use this character instead of a space to wrap long names."
  61452. },
  61453. "halo-fill": {
  61454. "css": "shield-halo-fill",
  61455. "type": "color",
  61456. "default-value": "#FFFFFF",
  61457. "default-meaning": "white",
  61458. "doc": "Specifies the color of the halo around the text."
  61459. },
  61460. "halo-radius": {
  61461. "css": "shield-halo-radius",
  61462. "doc": "Specify the radius of the halo in pixels",
  61463. "default-value": 0,
  61464. "default-meaning": "no halo",
  61465. "type": "float"
  61466. },
  61467. "character-spacing": {
  61468. "css": "shield-character-spacing",
  61469. "type": "unsigned",
  61470. "default-value": 0,
  61471. "doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
  61472. },
  61473. "line-spacing": {
  61474. "css": "shield-line-spacing",
  61475. "doc": "Vertical spacing between lines of multiline labels (in pixels)",
  61476. "type": "unsigned"
  61477. },
  61478. "dx": {
  61479. "css": "shield-text-dx",
  61480. "type": "float",
  61481. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  61482. "default-value": 0
  61483. },
  61484. "dy": {
  61485. "css": "shield-text-dy",
  61486. "type": "float",
  61487. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  61488. "default-value": 0
  61489. },
  61490. "shield-dx": {
  61491. "css": "shield-dx",
  61492. "type": "float",
  61493. "doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  61494. "default-value": 0
  61495. },
  61496. "shield-dy": {
  61497. "css": "shield-dy",
  61498. "type": "float",
  61499. "doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  61500. "default-value": 0
  61501. },
  61502. "opacity": {
  61503. "css": "shield-opacity",
  61504. "type": "float",
  61505. "doc": "(Default 1.0) - opacity of the image used for the shield",
  61506. "default-value": 1
  61507. },
  61508. "text-opacity": {
  61509. "css": "shield-text-opacity",
  61510. "type": "float",
  61511. "doc": "(Default 1.0) - opacity of the text placed on top of the shield",
  61512. "default-value": 1
  61513. },
  61514. "horizontal-alignment": {
  61515. "css": "shield-horizontal-alignment",
  61516. "type": ["left", "middle", "right", "auto"],
  61517. "doc": "The shield's horizontal alignment from its centerpoint",
  61518. "default-value": "auto"
  61519. },
  61520. "vertical-alignment": {
  61521. "css": "shield-vertical-alignment",
  61522. "type": ["top", "middle", "bottom", "auto"],
  61523. "doc": "The shield's vertical alignment from its centerpoint",
  61524. "default-value": "middle"
  61525. },
  61526. "text-transform": {
  61527. "css": "shield-text-transform",
  61528. "type": ["none", "uppercase", "lowercase", "capitalize"],
  61529. "doc": "Transform the case of the characters",
  61530. "default-value": "none"
  61531. },
  61532. "justify-alignment": {
  61533. "css": "shield-justify-alignment",
  61534. "type": ["left", "center", "right", "auto"],
  61535. "doc": "Define how text in a shield's label is justified",
  61536. "default-value": "auto"
  61537. },
  61538. "clip": {
  61539. "css": "shield-clip",
  61540. "type": "boolean",
  61541. "default-value": true,
  61542. "default-meaning": "geometry will be clipped to map bounds before rendering",
  61543. "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."
  61544. },
  61545. "comp-op": {
  61546. "css": "shield-comp-op",
  61547. "default-value": "src-over",
  61548. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61549. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61550. "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"]
  61551. }
  61552. },
  61553. "line-pattern": {
  61554. "file": {
  61555. "css": "line-pattern-file",
  61556. "type": "uri",
  61557. "default-value": "none",
  61558. "required": true,
  61559. "doc": "An image file to be repeated and warped along a line"
  61560. },
  61561. "clip": {
  61562. "css": "line-pattern-clip",
  61563. "type": "boolean",
  61564. "default-value": true,
  61565. "default-meaning": "geometry will be clipped to map bounds before rendering",
  61566. "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."
  61567. },
  61568. "smooth": {
  61569. "css": "line-pattern-smooth",
  61570. "type": "float",
  61571. "default-value": 0,
  61572. "default-meaning": "no smoothing",
  61573. "range": "0-1",
  61574. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  61575. },
  61576. "geometry-transform": {
  61577. "css": "line-pattern-geometry-transform",
  61578. "type": "functions",
  61579. "default-value": "none",
  61580. "default-meaning": "geometry will not be transformed",
  61581. "doc": "Allows transformation functions to be applied to the geometry.",
  61582. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  61583. },
  61584. "comp-op": {
  61585. "css": "line-pattern-comp-op",
  61586. "default-value": "src-over",
  61587. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61588. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61589. "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"]
  61590. }
  61591. },
  61592. "polygon-pattern": {
  61593. "file": {
  61594. "css": "polygon-pattern-file",
  61595. "type": "uri",
  61596. "default-value": "none",
  61597. "required": true,
  61598. "doc": "Image to use as a repeated pattern fill within a polygon"
  61599. },
  61600. "alignment": {
  61601. "css": "polygon-pattern-alignment",
  61602. "type": ["local", "global"],
  61603. "default-value": "local",
  61604. "doc": "Specify whether to align pattern fills to the layer or to the map."
  61605. },
  61606. "gamma": {
  61607. "css": "polygon-pattern-gamma",
  61608. "type": "float",
  61609. "default-value": 1,
  61610. "default-meaning": "fully antialiased",
  61611. "range": "0-1",
  61612. "doc": "Level of antialiasing of polygon pattern edges"
  61613. },
  61614. "opacity": {
  61615. "css": "polygon-pattern-opacity",
  61616. "type": "float",
  61617. "doc": "(Default 1.0) - Apply an opacity level to the image used for the pattern",
  61618. "default-value": 1,
  61619. "default-meaning": "The image is rendered without modifications"
  61620. },
  61621. "clip": {
  61622. "css": "polygon-pattern-clip",
  61623. "type": "boolean",
  61624. "default-value": true,
  61625. "default-meaning": "geometry will be clipped to map bounds before rendering",
  61626. "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."
  61627. },
  61628. "smooth": {
  61629. "css": "polygon-pattern-smooth",
  61630. "type": "float",
  61631. "default-value": 0,
  61632. "default-meaning": "no smoothing",
  61633. "range": "0-1",
  61634. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  61635. },
  61636. "geometry-transform": {
  61637. "css": "polygon-pattern-geometry-transform",
  61638. "type": "functions",
  61639. "default-value": "none",
  61640. "default-meaning": "geometry will not be transformed",
  61641. "doc": "Allows transformation functions to be applied to the geometry.",
  61642. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  61643. },
  61644. "comp-op": {
  61645. "css": "polygon-pattern-comp-op",
  61646. "default-value": "src-over",
  61647. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61648. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61649. "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"]
  61650. }
  61651. },
  61652. "raster": {
  61653. "opacity": {
  61654. "css": "raster-opacity",
  61655. "default-value": 1,
  61656. "default-meaning": "opaque",
  61657. "type": "float",
  61658. "doc": "The opacity of the raster symbolizer on top of other symbolizers."
  61659. },
  61660. "filter-factor": {
  61661. "css": "raster-filter-factor",
  61662. "default-value": -1,
  61663. "default-meaning": "Allow the datasource to choose appropriate downscaling.",
  61664. "type": "float",
  61665. "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."
  61666. },
  61667. "scaling": {
  61668. "css": "raster-scaling",
  61669. "type": ["near", "fast", "bilinear", "bilinear8", "bicubic", "spline16", "spline36", "hanning", "hamming", "hermite", "kaiser", "quadric", "catrom", "gaussian", "bessel", "mitchell", "sinc", "lanczos", "blackman"],
  61670. "default-value": "near",
  61671. "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."
  61672. },
  61673. "mesh-size": {
  61674. "css": "raster-mesh-size",
  61675. "default-value": 16,
  61676. "default-meaning": "Reprojection mesh will be 1/16 of the resolution of the source image",
  61677. "type": "unsigned",
  61678. "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."
  61679. },
  61680. "comp-op": {
  61681. "css": "raster-comp-op",
  61682. "default-value": "src-over",
  61683. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61684. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61685. "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"]
  61686. }
  61687. },
  61688. "point": {
  61689. "file": {
  61690. "css": "point-file",
  61691. "type": "uri",
  61692. "required": false,
  61693. "default-value": "none",
  61694. "doc": "Image file to represent a point"
  61695. },
  61696. "allow-overlap": {
  61697. "css": "point-allow-overlap",
  61698. "type": "boolean",
  61699. "default-value": false,
  61700. "doc": "Control whether overlapping points are shown or hidden.",
  61701. "default-meaning": "Do not allow points to overlap with each other - overlapping markers will not be shown."
  61702. },
  61703. "ignore-placement": {
  61704. "css": "point-ignore-placement",
  61705. "type": "boolean",
  61706. "default-value": false,
  61707. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  61708. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  61709. },
  61710. "opacity": {
  61711. "css": "point-opacity",
  61712. "type": "float",
  61713. "default-value": 1.0,
  61714. "default-meaning": "Fully opaque",
  61715. "doc": "A value from 0 to 1 to control the opacity of the point"
  61716. },
  61717. "placement": {
  61718. "css": "point-placement",
  61719. "type": ["centroid", "interior"],
  61720. "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.",
  61721. "default-value": "centroid"
  61722. },
  61723. "transform": {
  61724. "css": "point-transform",
  61725. "type": "functions",
  61726. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  61727. "default-value": "",
  61728. "default-meaning": "No transformation",
  61729. "doc": "SVG transformation definition"
  61730. },
  61731. "comp-op": {
  61732. "css": "point-comp-op",
  61733. "default-value": "src-over",
  61734. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61735. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61736. "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"]
  61737. }
  61738. },
  61739. "text": {
  61740. "name": {
  61741. "css": "text-name",
  61742. "type": "expression",
  61743. "required": true,
  61744. "default-value": "",
  61745. "serialization": "content",
  61746. "doc": "Value to use for a text label. Data columns are specified using brackets like [column_name]"
  61747. },
  61748. "face-name": {
  61749. "css": "text-face-name",
  61750. "type": "string",
  61751. "validate": "font",
  61752. "doc": "Font name and style to render a label in",
  61753. "required": true
  61754. },
  61755. "size": {
  61756. "css": "text-size",
  61757. "type": "float",
  61758. "default-value": 10,
  61759. "doc": "Text size in pixels"
  61760. },
  61761. "text-ratio": {
  61762. "css": "text-ratio",
  61763. "doc": "Define the amount of text (of the total) present on successive lines when wrapping occurs",
  61764. "default-value": 0,
  61765. "type": "unsigned"
  61766. },
  61767. "wrap-width": {
  61768. "css": "text-wrap-width",
  61769. "doc": "Length of a chunk of text in characters before wrapping text",
  61770. "default-value": 0,
  61771. "type": "unsigned"
  61772. },
  61773. "wrap-before": {
  61774. "css": "text-wrap-before",
  61775. "type": "boolean",
  61776. "default-value": false,
  61777. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  61778. },
  61779. "wrap-character": {
  61780. "css": "text-wrap-character",
  61781. "type": "string",
  61782. "default-value": " ",
  61783. "doc": "Use this character instead of a space to wrap long text."
  61784. },
  61785. "spacing": {
  61786. "css": "text-spacing",
  61787. "type": "unsigned",
  61788. "doc": "Distance between repeated text labels on a line (aka. label-spacing)"
  61789. },
  61790. "character-spacing": {
  61791. "css": "text-character-spacing",
  61792. "type": "float",
  61793. "default-value": 0,
  61794. "doc": "Horizontal spacing adjustment between characters in pixels"
  61795. },
  61796. "line-spacing": {
  61797. "css": "text-line-spacing",
  61798. "default-value": 0,
  61799. "type": "unsigned",
  61800. "doc": "Vertical spacing adjustment between lines in pixels"
  61801. },
  61802. "label-position-tolerance": {
  61803. "css": "text-label-position-tolerance",
  61804. "default-value": 0,
  61805. "type": "unsigned",
  61806. "doc": "Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"
  61807. },
  61808. "max-char-angle-delta": {
  61809. "css": "text-max-char-angle-delta",
  61810. "type": "float",
  61811. "default-value": "22.5",
  61812. "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."
  61813. },
  61814. "fill": {
  61815. "css": "text-fill",
  61816. "doc": "Specifies the color for the text",
  61817. "default-value": "#000000",
  61818. "type": "color"
  61819. },
  61820. "opacity": {
  61821. "css": "text-opacity",
  61822. "doc": "A number from 0 to 1 specifying the opacity for the text",
  61823. "default-value": 1.0,
  61824. "default-meaning": "Fully opaque",
  61825. "type": "float"
  61826. },
  61827. "halo-fill": {
  61828. "css": "text-halo-fill",
  61829. "type": "color",
  61830. "default-value": "#FFFFFF",
  61831. "default-meaning": "white",
  61832. "doc": "Specifies the color of the halo around the text."
  61833. },
  61834. "halo-radius": {
  61835. "css": "text-halo-radius",
  61836. "doc": "Specify the radius of the halo in pixels",
  61837. "default-value": 0,
  61838. "default-meaning": "no halo",
  61839. "type": "float"
  61840. },
  61841. "dx": {
  61842. "css": "text-dx",
  61843. "type": "float",
  61844. "doc": "Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  61845. "default-value": 0
  61846. },
  61847. "dy": {
  61848. "css": "text-dy",
  61849. "type": "float",
  61850. "doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  61851. "default-value": 0
  61852. },
  61853. "vertical-alignment": {
  61854. "css": "text-vertical-alignment",
  61855. "type": ["top", "middle", "bottom", "auto"],
  61856. "doc": "Position of label relative to point position.",
  61857. "default-value": "auto",
  61858. "default-meaning": "Default affected by value of dy; \"bottom\" for dy>0, \"top\" for dy<0."
  61859. },
  61860. "avoid-edges": {
  61861. "css": "text-avoid-edges",
  61862. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  61863. "default-value": false,
  61864. "type": "boolean"
  61865. },
  61866. "minimum-distance": {
  61867. "css": "text-min-distance",
  61868. "doc": "Minimum permitted distance to the next text symbolizer.",
  61869. "type": "float"
  61870. },
  61871. "minimum-padding": {
  61872. "css": "text-min-padding",
  61873. "doc": "Determines the minimum amount of padding that a text symbolizer gets relative to other text",
  61874. "type": "float"
  61875. },
  61876. "minimum-path-length": {
  61877. "css": "text-min-path-length",
  61878. "type": "float",
  61879. "default-value": 0,
  61880. "default-meaning": "place labels on all paths",
  61881. "doc": "Place labels only on paths longer than this value."
  61882. },
  61883. "allow-overlap": {
  61884. "css": "text-allow-overlap",
  61885. "type": "boolean",
  61886. "default-value": false,
  61887. "doc": "Control whether overlapping text is shown or hidden.",
  61888. "default-meaning": "Do not allow text to overlap with other text - overlapping markers will not be shown."
  61889. },
  61890. "orientation": {
  61891. "css": "text-orientation",
  61892. "type": "expression",
  61893. "doc": "Rotate the text."
  61894. },
  61895. "placement": {
  61896. "css": "text-placement",
  61897. "type": ["point", "line", "vertex", "interior"],
  61898. "default-value": "point",
  61899. "doc": "Control the style of placement of a point versus the geometry it is attached to."
  61900. },
  61901. "placement-type": {
  61902. "css": "text-placement-type",
  61903. "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.",
  61904. "type": ["dummy", "simple"],
  61905. "default-value": "dummy"
  61906. },
  61907. "placements": {
  61908. "css": "text-placements",
  61909. "type": "string",
  61910. "default-value": "",
  61911. "doc": "If \"placement-type\" is set to \"simple\", use this \"POSITIONS,[SIZES]\" string. An example is `text-placements: \"E,NE,SE,W,NW,SW\";` "
  61912. },
  61913. "text-transform": {
  61914. "css": "text-transform",
  61915. "type": ["none", "uppercase", "lowercase", "capitalize"],
  61916. "doc": "Transform the case of the characters",
  61917. "default-value": "none"
  61918. },
  61919. "horizontal-alignment": {
  61920. "css": "text-horizontal-alignment",
  61921. "type": ["left", "middle", "right", "auto"],
  61922. "doc": "The text's horizontal alignment from its centerpoint",
  61923. "default-value": "auto"
  61924. },
  61925. "justify-alignment": {
  61926. "css": "text-align",
  61927. "type": ["left", "right", "center", "auto"],
  61928. "doc": "Define how text is justified",
  61929. "default-value": "auto",
  61930. "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"
  61931. },
  61932. "clip": {
  61933. "css": "text-clip",
  61934. "type": "boolean",
  61935. "default-value": true,
  61936. "default-meaning": "geometry will be clipped to map bounds before rendering",
  61937. "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."
  61938. },
  61939. "comp-op": {
  61940. "css": "text-comp-op",
  61941. "default-value": "src-over",
  61942. "default-meaning": "add the current symbolizer on top of other symbolizer",
  61943. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  61944. "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"]
  61945. }
  61946. },
  61947. "building": {
  61948. "fill": {
  61949. "css": "building-fill",
  61950. "default-value": "#FFFFFF",
  61951. "doc": "The color of the buildings walls.",
  61952. "type": "color"
  61953. },
  61954. "fill-opacity": {
  61955. "css": "building-fill-opacity",
  61956. "type": "float",
  61957. "doc": "The opacity of the building as a whole, including all walls.",
  61958. "default-value": 1
  61959. },
  61960. "height": {
  61961. "css": "building-height",
  61962. "doc": "The height of the building in pixels.",
  61963. "type": "expression",
  61964. "default-value": "0"
  61965. }
  61966. }
  61967. },
  61968. "colors": {
  61969. "aliceblue": [240, 248, 255],
  61970. "antiquewhite": [250, 235, 215],
  61971. "aqua": [0, 255, 255],
  61972. "aquamarine": [127, 255, 212],
  61973. "azure": [240, 255, 255],
  61974. "beige": [245, 245, 220],
  61975. "bisque": [255, 228, 196],
  61976. "black": [0, 0, 0],
  61977. "blanchedalmond": [255, 235, 205],
  61978. "blue": [0, 0, 255],
  61979. "blueviolet": [138, 43, 226],
  61980. "brown": [165, 42, 42],
  61981. "burlywood": [222, 184, 135],
  61982. "cadetblue": [95, 158, 160],
  61983. "chartreuse": [127, 255, 0],
  61984. "chocolate": [210, 105, 30],
  61985. "coral": [255, 127, 80],
  61986. "cornflowerblue": [100, 149, 237],
  61987. "cornsilk": [255, 248, 220],
  61988. "crimson": [220, 20, 60],
  61989. "cyan": [0, 255, 255],
  61990. "darkblue": [0, 0, 139],
  61991. "darkcyan": [0, 139, 139],
  61992. "darkgoldenrod": [184, 134, 11],
  61993. "darkgray": [169, 169, 169],
  61994. "darkgreen": [0, 100, 0],
  61995. "darkgrey": [169, 169, 169],
  61996. "darkkhaki": [189, 183, 107],
  61997. "darkmagenta": [139, 0, 139],
  61998. "darkolivegreen": [85, 107, 47],
  61999. "darkorange": [255, 140, 0],
  62000. "darkorchid": [153, 50, 204],
  62001. "darkred": [139, 0, 0],
  62002. "darksalmon": [233, 150, 122],
  62003. "darkseagreen": [143, 188, 143],
  62004. "darkslateblue": [72, 61, 139],
  62005. "darkslategrey": [47, 79, 79],
  62006. "darkturquoise": [0, 206, 209],
  62007. "darkviolet": [148, 0, 211],
  62008. "deeppink": [255, 20, 147],
  62009. "deepskyblue": [0, 191, 255],
  62010. "dimgray": [105, 105, 105],
  62011. "dimgrey": [105, 105, 105],
  62012. "dodgerblue": [30, 144, 255],
  62013. "firebrick": [178, 34, 34],
  62014. "floralwhite": [255, 250, 240],
  62015. "forestgreen": [34, 139, 34],
  62016. "fuchsia": [255, 0, 255],
  62017. "gainsboro": [220, 220, 220],
  62018. "ghostwhite": [248, 248, 255],
  62019. "gold": [255, 215, 0],
  62020. "goldenrod": [218, 165, 32],
  62021. "gray": [128, 128, 128],
  62022. "grey": [128, 128, 128],
  62023. "green": [0, 128, 0],
  62024. "greenyellow": [173, 255, 47],
  62025. "honeydew": [240, 255, 240],
  62026. "hotpink": [255, 105, 180],
  62027. "indianred": [205, 92, 92],
  62028. "indigo": [75, 0, 130],
  62029. "ivory": [255, 255, 240],
  62030. "khaki": [240, 230, 140],
  62031. "lavender": [230, 230, 250],
  62032. "lavenderblush": [255, 240, 245],
  62033. "lawngreen": [124, 252, 0],
  62034. "lemonchiffon": [255, 250, 205],
  62035. "lightblue": [173, 216, 230],
  62036. "lightcoral": [240, 128, 128],
  62037. "lightcyan": [224, 255, 255],
  62038. "lightgoldenrodyellow": [250, 250, 210],
  62039. "lightgray": [211, 211, 211],
  62040. "lightgreen": [144, 238, 144],
  62041. "lightgrey": [211, 211, 211],
  62042. "lightpink": [255, 182, 193],
  62043. "lightsalmon": [255, 160, 122],
  62044. "lightseagreen": [32, 178, 170],
  62045. "lightskyblue": [135, 206, 250],
  62046. "lightslategray": [119, 136, 153],
  62047. "lightslategrey": [119, 136, 153],
  62048. "lightsteelblue": [176, 196, 222],
  62049. "lightyellow": [255, 255, 224],
  62050. "lime": [0, 255, 0],
  62051. "limegreen": [50, 205, 50],
  62052. "linen": [250, 240, 230],
  62053. "magenta": [255, 0, 255],
  62054. "maroon": [128, 0, 0],
  62055. "mediumaquamarine": [102, 205, 170],
  62056. "mediumblue": [0, 0, 205],
  62057. "mediumorchid": [186, 85, 211],
  62058. "mediumpurple": [147, 112, 219],
  62059. "mediumseagreen": [60, 179, 113],
  62060. "mediumslateblue": [123, 104, 238],
  62061. "mediumspringgreen": [0, 250, 154],
  62062. "mediumturquoise": [72, 209, 204],
  62063. "mediumvioletred": [199, 21, 133],
  62064. "midnightblue": [25, 25, 112],
  62065. "mintcream": [245, 255, 250],
  62066. "mistyrose": [255, 228, 225],
  62067. "moccasin": [255, 228, 181],
  62068. "navajowhite": [255, 222, 173],
  62069. "navy": [0, 0, 128],
  62070. "oldlace": [253, 245, 230],
  62071. "olive": [128, 128, 0],
  62072. "olivedrab": [107, 142, 35],
  62073. "orange": [255, 165, 0],
  62074. "orangered": [255, 69, 0],
  62075. "orchid": [218, 112, 214],
  62076. "palegoldenrod": [238, 232, 170],
  62077. "palegreen": [152, 251, 152],
  62078. "paleturquoise": [175, 238, 238],
  62079. "palevioletred": [219, 112, 147],
  62080. "papayawhip": [255, 239, 213],
  62081. "peachpuff": [255, 218, 185],
  62082. "peru": [205, 133, 63],
  62083. "pink": [255, 192, 203],
  62084. "plum": [221, 160, 221],
  62085. "powderblue": [176, 224, 230],
  62086. "purple": [128, 0, 128],
  62087. "red": [255, 0, 0],
  62088. "rosybrown": [188, 143, 143],
  62089. "royalblue": [65, 105, 225],
  62090. "saddlebrown": [139, 69, 19],
  62091. "salmon": [250, 128, 114],
  62092. "sandybrown": [244, 164, 96],
  62093. "seagreen": [46, 139, 87],
  62094. "seashell": [255, 245, 238],
  62095. "sienna": [160, 82, 45],
  62096. "silver": [192, 192, 192],
  62097. "skyblue": [135, 206, 235],
  62098. "slateblue": [106, 90, 205],
  62099. "slategray": [112, 128, 144],
  62100. "slategrey": [112, 128, 144],
  62101. "snow": [255, 250, 250],
  62102. "springgreen": [0, 255, 127],
  62103. "steelblue": [70, 130, 180],
  62104. "tan": [210, 180, 140],
  62105. "teal": [0, 128, 128],
  62106. "thistle": [216, 191, 216],
  62107. "tomato": [255, 99, 71],
  62108. "turquoise": [64, 224, 208],
  62109. "violet": [238, 130, 238],
  62110. "wheat": [245, 222, 179],
  62111. "white": [255, 255, 255],
  62112. "whitesmoke": [245, 245, 245],
  62113. "yellow": [255, 255, 0],
  62114. "yellowgreen": [154, 205, 50],
  62115. "transparent": [0, 0, 0, 0]
  62116. },
  62117. "filter": {
  62118. "value": ["true", "false", "null", "point", "linestring", "polygon", "collection"]
  62119. }
  62120. };
  62121. CartoCSS['mapnik_reference'] = {
  62122. version: {
  62123. latest: _mapnik_reference_latest,
  62124. '2.1.1': _mapnik_reference_latest
  62125. }
  62126. };
  62127. CartoCSS.Tree = {};
  62128. CartoCSS.Tree.operate = function (op, a, b) {
  62129. switch (op) {
  62130. case '+':
  62131. return a + b;
  62132. case '-':
  62133. return a - b;
  62134. case '*':
  62135. return a * b;
  62136. case '%':
  62137. return a % b;
  62138. case '/':
  62139. return a / b;
  62140. }
  62141. };
  62142. CartoCSS.Tree.functions = {
  62143. rgb: function rgb(r, g, b) {
  62144. return this.rgba(r, g, b, 1.0);
  62145. },
  62146. rgba: function rgba(r, g, b, a) {
  62147. var me = this;
  62148. var rgb = [r, g, b].map(function (c) {
  62149. return me.number(c);
  62150. });
  62151. a = me.number(a);
  62152. if (rgb.some(isNaN) || isNaN(a)) {
  62153. return null;
  62154. }
  62155. return new CartoCSS.Tree.Color(rgb, a);
  62156. },
  62157. // Only require val
  62158. stop: function stop(val) {
  62159. var color, mode;
  62160. if (arguments.length > 1) {
  62161. color = arguments[1];
  62162. }
  62163. if (arguments.length > 2) {
  62164. mode = arguments[2];
  62165. }
  62166. return {
  62167. is: 'tag',
  62168. val: val,
  62169. color: color,
  62170. mode: mode,
  62171. toString: function toString(env) {
  62172. return '\n\t<stop value="' + val.ev(env) + '"' + (color ? ' color="' + color.ev(env) + '" ' : '') + (mode ? ' mode="' + mode.ev(env) + '" ' : '') + '/>';
  62173. }
  62174. };
  62175. },
  62176. hsl: function hsl(h, s, l) {
  62177. return this.hsla(h, s, l, 1.0);
  62178. },
  62179. hsla: function hsla(h, s, l, a) {
  62180. h = this.number(h) % 360 / 360;
  62181. s = this.number(s);
  62182. l = this.number(l);
  62183. a = this.number(a);
  62184. if ([h, s, l, a].some(isNaN)) {
  62185. return null;
  62186. }
  62187. var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,
  62188. m1 = l * 2 - m2;
  62189. return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, a);
  62190. function hue(h) {
  62191. h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
  62192. if (h * 6 < 1) {
  62193. return m1 + (m2 - m1) * h * 6;
  62194. } else if (h * 2 < 1) {
  62195. return m2;
  62196. } else if (h * 3 < 2) {
  62197. return m1 + (m2 - m1) * (2 / 3 - h) * 6;
  62198. } else {
  62199. return m1;
  62200. }
  62201. }
  62202. },
  62203. hue: function hue(color) {
  62204. if (!('toHSL' in color)) {
  62205. return null;
  62206. }
  62207. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().h));
  62208. },
  62209. saturation: function saturation(color) {
  62210. if (!('toHSL' in color)) {
  62211. return null;
  62212. }
  62213. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().s * 100), '%');
  62214. },
  62215. lightness: function lightness(color) {
  62216. if (!('toHSL' in color)) {
  62217. return null;
  62218. }
  62219. return new CartoCSS.Tree.Dimension(Math.round(color.toHSL().l * 100), '%');
  62220. },
  62221. alpha: function alpha(color) {
  62222. if (!('toHSL' in color)) {
  62223. return null;
  62224. }
  62225. return new CartoCSS.Tree.Dimension(color.toHSL().a);
  62226. },
  62227. saturate: function saturate(color, amount) {
  62228. if (!('toHSL' in color)) {
  62229. return null;
  62230. }
  62231. var hsl = color.toHSL();
  62232. hsl.s += amount.value / 100;
  62233. hsl.s = this.clamp(hsl.s);
  62234. return this.hsla_simple(hsl);
  62235. },
  62236. desaturate: function desaturate(color, amount) {
  62237. if (!('toHSL' in color)) {
  62238. return null;
  62239. }
  62240. var hsl = color.toHSL();
  62241. hsl.s -= amount.value / 100;
  62242. hsl.s = this.clamp(hsl.s);
  62243. return this.hsla_simple(hsl);
  62244. },
  62245. lighten: function lighten(color, amount) {
  62246. if (!('toHSL' in color)) {
  62247. return null;
  62248. }
  62249. var hsl = color.toHSL();
  62250. hsl.l += amount.value / 100;
  62251. hsl.l = this.clamp(hsl.l);
  62252. return this.hsla_simple(hsl);
  62253. },
  62254. darken: function darken(color, amount) {
  62255. if (!('toHSL' in color)) {
  62256. return null;
  62257. }
  62258. var hsl = color.toHSL();
  62259. hsl.l -= amount.value / 100;
  62260. hsl.l = this.clamp(hsl.l);
  62261. return this.hsla_simple(hsl);
  62262. },
  62263. fadein: function fadein(color, amount) {
  62264. if (!('toHSL' in color)) {
  62265. return null;
  62266. }
  62267. var hsl = color.toHSL();
  62268. hsl.a += amount.value / 100;
  62269. hsl.a = this.clamp(hsl.a);
  62270. return this.hsla_simple(hsl);
  62271. },
  62272. fadeout: function fadeout(color, amount) {
  62273. if (!('toHSL' in color)) {
  62274. return null;
  62275. }
  62276. var hsl = color.toHSL();
  62277. hsl.a -= amount.value / 100;
  62278. hsl.a = this.clamp(hsl.a);
  62279. return this.hsla_simple(hsl);
  62280. },
  62281. spin: function spin(color, amount) {
  62282. if (!('toHSL' in color)) {
  62283. return null;
  62284. }
  62285. var hsl = color.toHSL();
  62286. var hue = (hsl.h + amount.value) % 360;
  62287. hsl.h = hue < 0 ? 360 + hue : hue;
  62288. return this.hsla_simple(hsl);
  62289. },
  62290. replace: function replace(entity, a, b) {
  62291. if (entity.is === 'field') {
  62292. return entity.toString + '.replace(' + a.toString() + ', ' + b.toString() + ')';
  62293. } else {
  62294. return entity.replace(a, b);
  62295. }
  62296. },
  62297. //
  62298. // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
  62299. // http://sass-lang.com
  62300. //
  62301. mix: function mix(color1, color2, weight) {
  62302. var p = weight.value / 100.0;
  62303. var w = p * 2 - 1;
  62304. var a = color1.toHSL().a - color2.toHSL().a;
  62305. var w1 = ((w * a == -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  62306. var w2 = 1 - w1;
  62307. 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];
  62308. var alpha = color1.alpha * p + color2.alpha * (1 - p);
  62309. return new CartoCSS.Tree.Color(rgb, alpha);
  62310. },
  62311. greyscale: function greyscale(color) {
  62312. return this.desaturate(color, new CartoCSS.Tree.Dimension(100));
  62313. },
  62314. '%': function _(quoted /* arg, arg, ...*/) {
  62315. var args = Array.prototype.slice.call(arguments, 1),
  62316. str = quoted.value;
  62317. for (var i = 0; i < args.length; i++) {
  62318. str = str.replace(/%s/, args[i].value).replace(/%[da]/, args[i].toString());
  62319. }
  62320. str = str.replace(/%%/g, '%');
  62321. return new CartoCSS.Tree.Quoted(str);
  62322. },
  62323. hsla_simple: function hsla_simple(h) {
  62324. return this.hsla(h.h, h.s, h.l, h.a);
  62325. },
  62326. number: function number(n) {
  62327. if (n instanceof CartoCSS.Tree.Dimension) {
  62328. return parseFloat(n.unit === '%' ? n.value / 100 : n.value);
  62329. } else if (typeof n === 'number') {
  62330. return n;
  62331. } else {
  62332. return NaN;
  62333. }
  62334. },
  62335. clamp: function clamp(val) {
  62336. return Math.min(1, Math.max(0, val));
  62337. }
  62338. };
  62339. CartoCSS.Tree.Call = /*#__PURE__*/function () {
  62340. function Call(name, args, index) {
  62341. CartoCSS_classCallCheck(this, Call);
  62342. this.is = 'call';
  62343. this.name = name;
  62344. this.args = args;
  62345. this.index = index;
  62346. }
  62347. // When evuating a function call,
  62348. // we either find the function in `tree.functions` [1],
  62349. // in which case we call it, passing the evaluated arguments,
  62350. // or we simply print it out as it appeared originally [2].
  62351. // The *functions.js* file contains the built-in functions.
  62352. // The reason why we evaluate the arguments, is in the case where
  62353. // we try to pass a variable to a function, like: `saturate(@color)`.
  62354. // The function should receive the value, not the variable.
  62355. CartoCSS_createClass(Call, [{
  62356. key: 'ev',
  62357. value: function ev(env) {
  62358. var args = this.args.map(function (a) {
  62359. return a.ev(env);
  62360. });
  62361. for (var i = 0; i < args.length; i++) {
  62362. if (args[i].is === 'undefined') {
  62363. return {
  62364. is: 'undefined',
  62365. value: 'undefined'
  62366. };
  62367. }
  62368. }
  62369. if (this.name in CartoCSS.Tree.functions) {
  62370. if (CartoCSS.Tree.functions[this.name].length <= args.length) {
  62371. var val = CartoCSS.Tree.functions[this.name].apply(CartoCSS.Tree.functions, args);
  62372. if (val === null) {
  62373. env.error({
  62374. message: 'incorrect arguments given to ' + this.name + '()',
  62375. index: this.index,
  62376. type: 'runtime',
  62377. filename: this.filename
  62378. });
  62379. return {
  62380. is: 'undefined',
  62381. value: 'undefined'
  62382. };
  62383. }
  62384. return val;
  62385. } else {
  62386. env.error({
  62387. message: 'incorrect number of arguments for ' + this.name + '(). ' + CartoCSS.Tree.functions[this.name].length + ' expected.',
  62388. index: this.index,
  62389. type: 'runtime',
  62390. filename: this.filename
  62391. });
  62392. return {
  62393. is: 'undefined',
  62394. value: 'undefined'
  62395. };
  62396. }
  62397. } else {
  62398. var fn = CartoCSS.Tree.Reference.mapnikFunctions[this.name];
  62399. if (fn === undefined) {
  62400. var functions = lodash_topairs_default()(CartoCSS.Tree.Reference.mapnikFunctions);
  62401. // cheap closest, needs improvement.
  62402. var name = this.name;
  62403. var mean = functions.map(function (f) {
  62404. return [f[0], CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];
  62405. }).sort(function (a, b) {
  62406. return a[1] - b[1];
  62407. });
  62408. env.error({
  62409. message: 'unknown function ' + this.name + '(), did you mean ' + mean[0][0] + '(' + mean[0][2] + ')',
  62410. index: this.index,
  62411. type: 'runtime',
  62412. filename: this.filename
  62413. });
  62414. return {
  62415. is: 'undefined',
  62416. value: 'undefined'
  62417. };
  62418. }
  62419. if (fn !== args.length &&
  62420. // support variable-arg functions like `colorize-alpha`
  62421. fn !== -1) {
  62422. env.error({
  62423. message: 'function ' + this.name + '() takes ' + fn + ' arguments and was given ' + args.length,
  62424. index: this.index,
  62425. type: 'runtime',
  62426. filename: this.filename
  62427. });
  62428. return {
  62429. is: 'undefined',
  62430. value: 'undefined'
  62431. };
  62432. } else {
  62433. // Save the evaluated versions of arguments
  62434. this.args = args;
  62435. return this;
  62436. }
  62437. }
  62438. }
  62439. }, {
  62440. key: "toString",
  62441. value: function toString(env, format) {
  62442. if (this.args.length) {
  62443. return this.name + '(' + this.args.join(',') + ')';
  62444. } else {
  62445. return this.name;
  62446. }
  62447. }
  62448. }]);
  62449. return Call;
  62450. }();
  62451. CartoCSS.Tree.Color = /*#__PURE__*/function () {
  62452. function Color(rgb, a) {
  62453. CartoCSS_classCallCheck(this, Color);
  62454. this.is = 'color';
  62455. // The end goal here, is to parse the arguments
  62456. // into an integer triplet, such as `128, 255, 0`
  62457. //
  62458. // This facilitates operations and conversions.
  62459. if (Array.isArray(rgb)) {
  62460. this.rgb = rgb.slice(0, 3);
  62461. } else if (rgb.length == 6) {
  62462. this.rgb = rgb.match(/.{2}/g).map(function (c) {
  62463. return parseInt(c, 16);
  62464. });
  62465. } else {
  62466. this.rgb = rgb.split('').map(function (c) {
  62467. return parseInt(c + c, 16);
  62468. });
  62469. }
  62470. if (typeof a === 'number') {
  62471. this.alpha = a;
  62472. } else if (rgb.length === 4) {
  62473. this.alpha = rgb[3];
  62474. } else {
  62475. this.alpha = 1;
  62476. }
  62477. }
  62478. CartoCSS_createClass(Color, [{
  62479. key: 'ev',
  62480. value: function ev() {
  62481. return this;
  62482. }
  62483. // If we have some transparency, the only way to represent it
  62484. // is via `rgba`. Otherwise, we use the hex representation,
  62485. // which has better compatibility with older browsers.
  62486. // Values are capped between `0` and `255`, rounded and zero-padded.
  62487. }, {
  62488. key: "toString",
  62489. value: function toString() {
  62490. /* if (this.alpha < 1.0) {*/
  62491. return 'rgba(' + this.rgb.map(function (c) {
  62492. return Math.round(c);
  62493. }).concat(this.alpha).join(', ') + ')';
  62494. /*} else {
  62495. return '#' + this.rgb.map(function(i) {
  62496. i = Math.round(i);
  62497. i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
  62498. return i.length === 1 ? '0' + i : i;
  62499. }).join('');
  62500. }*/
  62501. }
  62502. // Operations have to be done per-channel, if not,
  62503. // channels will spill onto each other. Once we have
  62504. // our result, in the form of an integer triplet,
  62505. // we create a new Color node to hold the result.
  62506. }, {
  62507. key: "operate",
  62508. value: function operate(env, op, other) {
  62509. var result = [];
  62510. if (!(other instanceof CartoCSS.Tree.Color)) {
  62511. other = other.toColor();
  62512. }
  62513. for (var c = 0; c < 3; c++) {
  62514. result[c] = CartoCSS.Tree.operate(op, this.rgb[c], other.rgb[c]);
  62515. }
  62516. return new CartoCSS.Tree.Color(result);
  62517. }
  62518. }, {
  62519. key: "toHSL",
  62520. value: function toHSL() {
  62521. var r = this.rgb[0] / 255,
  62522. g = this.rgb[1] / 255,
  62523. b = this.rgb[2] / 255,
  62524. a = this.alpha;
  62525. var max = Math.max(r, g, b),
  62526. min = Math.min(r, g, b);
  62527. var h,
  62528. s,
  62529. l = (max + min) / 2,
  62530. d = max - min;
  62531. if (max === min) {
  62532. h = s = 0;
  62533. } else {
  62534. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  62535. switch (max) {
  62536. case r:
  62537. h = (g - b) / d + (g < b ? 6 : 0);
  62538. break;
  62539. case g:
  62540. h = (b - r) / d + 2;
  62541. break;
  62542. case b:
  62543. h = (r - g) / d + 4;
  62544. break;
  62545. default:
  62546. break;
  62547. }
  62548. h /= 6;
  62549. }
  62550. return {
  62551. h: h * 360,
  62552. s: s,
  62553. l: l,
  62554. a: a
  62555. };
  62556. }
  62557. }]);
  62558. return Color;
  62559. }();
  62560. CartoCSS.Tree.Comment = /*#__PURE__*/function () {
  62561. function Comment(value, silent) {
  62562. CartoCSS_classCallCheck(this, Comment);
  62563. this.value = value;
  62564. this.silent = !!silent;
  62565. }
  62566. CartoCSS_createClass(Comment, [{
  62567. key: "toString",
  62568. value: function toString(env) {
  62569. return '<!--' + this.value + '-->';
  62570. }
  62571. }, {
  62572. key: 'ev',
  62573. value: function ev() {
  62574. return this;
  62575. }
  62576. }]);
  62577. return Comment;
  62578. }();
  62579. CartoCSS.Tree.Definition = /*#__PURE__*/function () {
  62580. function Definition(selector, rules) {
  62581. CartoCSS_classCallCheck(this, Definition);
  62582. this.elements = selector.elements;
  62583. //assert.ok(selector.filters instanceof CartoCSS.Tree.Filterset);
  62584. this.rules = rules;
  62585. this.ruleIndex = {};
  62586. for (var i = 0; i < this.rules.length; i++) {
  62587. if ('zoom' in this.rules[i]) {
  62588. this.rules[i] = this.rules[i].clone();
  62589. }
  62590. this.rules[i].zoom = selector.zoom;
  62591. this.ruleIndex[this.rules[i].updateID()] = true;
  62592. }
  62593. this.filters = selector.filters;
  62594. this.zoom = selector.zoom;
  62595. this.attachment = selector.attachment || '__default__';
  62596. this.specificity = selector.specificity();
  62597. }
  62598. CartoCSS_createClass(Definition, [{
  62599. key: "toString",
  62600. value: function toString() {
  62601. var str = this.filters.toString();
  62602. for (var i = 0; i < this.rules.length; i++) {
  62603. str += '\n ' + this.rules[i];
  62604. }
  62605. return str;
  62606. }
  62607. }, {
  62608. key: "toJS",
  62609. value: function toJS(env) {
  62610. var shaderAttrs = {};
  62611. // merge conditions from filters with zoom condition of the
  62612. // definition
  62613. var zoom = this.zoom;
  62614. //var frame_offset = this.frame_offset;
  62615. var _if = this.filters.toJS(env);
  62616. var filters = [zoom];
  62617. if (_if) {
  62618. filters.push(_if);
  62619. }
  62620. //if(frame_offset) filters.push('ctx["frame-offset"] === ' + frame_offset);
  62621. _if = filters.join(" && ");
  62622. function eachRule(rule) {
  62623. if (rule instanceof CartoCSS.Tree.Rule) {
  62624. shaderAttrs[rule.name] = shaderAttrs[rule.name] || [];
  62625. if (_if) {
  62626. shaderAttrs[rule.name].push("if(" + _if + "){" + rule.value.toJS(env) + "}");
  62627. } else {
  62628. shaderAttrs[rule.name].push(rule.value.toJS(env));
  62629. }
  62630. } else {
  62631. if (rule instanceof CartoCSS.Tree.Ruleset) {
  62632. var sh = rule.toJS(env);
  62633. for (var v in sh) {
  62634. shaderAttrs[v] = shaderAttrs[v] || [];
  62635. for (var attr in sh[v]) {
  62636. shaderAttrs[v].push(sh[v][attr]);
  62637. }
  62638. }
  62639. }
  62640. }
  62641. }
  62642. for (var id in this.rules) {
  62643. eachRule(this.rules[id]);
  62644. }
  62645. return shaderAttrs;
  62646. }
  62647. }]);
  62648. return Definition;
  62649. }();
  62650. CartoCSS.Tree.Dimension = /*#__PURE__*/function () {
  62651. function Dimension(value, unit, index) {
  62652. CartoCSS_classCallCheck(this, Dimension);
  62653. this.is = 'float';
  62654. this.physical_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc'];
  62655. this.screen_units = ['px', '%'];
  62656. this.all_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'];
  62657. this.densities = {
  62658. m: 0.0254,
  62659. mm: 25.4,
  62660. cm: 2.54,
  62661. pt: 72,
  62662. pc: 6
  62663. };
  62664. this.value = parseFloat(value);
  62665. this.unit = unit || null;
  62666. this.index = index;
  62667. }
  62668. CartoCSS_createClass(Dimension, [{
  62669. key: "ev",
  62670. value: function ev(env) {
  62671. if (this.unit && this.all_units.indexOf(this.unit) < 0) {
  62672. env.error({
  62673. message: "Invalid unit: '" + this.unit + "'",
  62674. index: this.index
  62675. });
  62676. return {
  62677. is: 'undefined',
  62678. value: 'undefined'
  62679. };
  62680. }
  62681. // normalize units which are not px or %
  62682. if (this.unit && this.physical_units.indexOf(this.unit) >= 0) {
  62683. if (!env.ppi) {
  62684. env.error({
  62685. message: "ppi is not set, so metric units can't be used",
  62686. index: this.index
  62687. });
  62688. return {
  62689. is: 'undefined',
  62690. value: 'undefined'
  62691. };
  62692. }
  62693. // convert all units to inch
  62694. // convert inch to px using ppi
  62695. this.value = this.value / this.densities[this.unit] * env.ppi;
  62696. this.unit = 'px';
  62697. }
  62698. return this;
  62699. }
  62700. }, {
  62701. key: "toColor",
  62702. value: function toColor() {
  62703. return new CartoCSS.Tree.Color([this.value, this.value, this.value]);
  62704. }
  62705. }, {
  62706. key: "round",
  62707. value: function round() {
  62708. this.value = Math.round(this.value);
  62709. return this;
  62710. }
  62711. }, {
  62712. key: "toString",
  62713. value: function toString() {
  62714. return this.value.toString();
  62715. }
  62716. }, {
  62717. key: "operate",
  62718. value: function operate(env, op, other) {
  62719. if (this.unit === '%' && other.unit !== '%') {
  62720. env.error({
  62721. message: 'If two operands differ, the first must not be %',
  62722. index: this.index
  62723. });
  62724. return {
  62725. is: 'undefined',
  62726. value: 'undefined'
  62727. };
  62728. }
  62729. if (this.unit !== '%' && other.unit === '%') {
  62730. if (op === '*' || op === '/' || op === '%') {
  62731. env.error({
  62732. message: 'Percent values can only be added or subtracted from other values',
  62733. index: this.index
  62734. });
  62735. return {
  62736. is: 'undefined',
  62737. value: 'undefined'
  62738. };
  62739. }
  62740. return new CartoCSS.Tree.Dimension(CartoCSS.Tree.operate(op, this.value, this.value * other.value * 0.01), this.unit);
  62741. }
  62742. //here the operands are either the same (% or undefined or px), or one is undefined and the other is px
  62743. return new CartoCSS.Tree.Dimension(CartoCSS.Tree.operate(op, this.value, other.value), this.unit || other.unit);
  62744. }
  62745. }]);
  62746. return Dimension;
  62747. }();
  62748. CartoCSS.Tree.Element = /*#__PURE__*/function () {
  62749. function Element(value) {
  62750. CartoCSS_classCallCheck(this, Element);
  62751. this.value = value.trim();
  62752. if (this.value[0] === '#') {
  62753. this.type = 'id';
  62754. this.clean = this.value.replace(/^#/, '');
  62755. }
  62756. if (this.value[0] === '.') {
  62757. this.type = 'class';
  62758. this.clean = this.value.replace(/^\./, '');
  62759. }
  62760. if (this.value.indexOf('*') !== -1) {
  62761. this.type = 'wildcard';
  62762. }
  62763. }
  62764. CartoCSS_createClass(Element, [{
  62765. key: "specificity",
  62766. value: function specificity() {
  62767. return [this.type === 'id' ? 1 : 0,
  62768. // a
  62769. this.type === 'class' ? 1 : 0 // b
  62770. ];
  62771. }
  62772. }, {
  62773. key: "toString",
  62774. value: function toString() {
  62775. return this.value;
  62776. }
  62777. }]);
  62778. return Element;
  62779. }();
  62780. CartoCSS.Tree.Expression = /*#__PURE__*/function () {
  62781. function Expression(value) {
  62782. CartoCSS_classCallCheck(this, Expression);
  62783. this.is = 'expression';
  62784. this.value = value;
  62785. }
  62786. CartoCSS_createClass(Expression, [{
  62787. key: "ev",
  62788. value: function ev(env) {
  62789. if (this.value.length > 1) {
  62790. return new CartoCSS.Tree.Expression(this.value.map(function (e) {
  62791. return e.ev(env);
  62792. }));
  62793. } else {
  62794. return this.value[0].ev(env);
  62795. }
  62796. }
  62797. }, {
  62798. key: "toString",
  62799. value: function toString(env) {
  62800. return this.value.map(function (e) {
  62801. return e.toString(env);
  62802. }).join(' ');
  62803. }
  62804. }]);
  62805. return Expression;
  62806. }();
  62807. CartoCSS.Tree.Field = /*#__PURE__*/function () {
  62808. function Field(content) {
  62809. CartoCSS_classCallCheck(this, Field);
  62810. this.is = 'field';
  62811. this.value = content || '';
  62812. }
  62813. CartoCSS_createClass(Field, [{
  62814. key: "toString",
  62815. value: function toString() {
  62816. return '["' + this.value.toUpperCase() + '"]';
  62817. }
  62818. }, {
  62819. key: 'ev',
  62820. value: function ev() {
  62821. return this;
  62822. }
  62823. }]);
  62824. return Field;
  62825. }();
  62826. CartoCSS.Tree.Filter = /*#__PURE__*/function () {
  62827. function Filter(key, op, val, index, filename) {
  62828. CartoCSS_classCallCheck(this, Filter);
  62829. this.ops = {
  62830. '<': [' &lt; ', 'numeric'],
  62831. '>': [' &gt; ', 'numeric'],
  62832. '=': [' = ', 'both'],
  62833. '!=': [' != ', 'both'],
  62834. '<=': [' &lt;= ', 'numeric'],
  62835. '>=': [' &gt;= ', 'numeric'],
  62836. '=~': ['.match(', 'string', ')']
  62837. };
  62838. this.key = key;
  62839. this.op = op;
  62840. this.val = val;
  62841. this.index = index;
  62842. this.filename = filename;
  62843. this.id = this.key + this.op + this.val;
  62844. }
  62845. CartoCSS_createClass(Filter, [{
  62846. key: "ev",
  62847. value: function ev(env) {
  62848. this.key = this.key.ev(env);
  62849. this.val = this.val.ev(env);
  62850. return this;
  62851. }
  62852. }, {
  62853. key: "toString",
  62854. value: function toString() {
  62855. return '[' + this.id + ']';
  62856. }
  62857. }]);
  62858. return Filter;
  62859. }();
  62860. CartoCSS.Tree.Filterset = /*#__PURE__*/function () {
  62861. function Filterset() {
  62862. CartoCSS_classCallCheck(this, Filterset);
  62863. this.filters = {};
  62864. }
  62865. CartoCSS_createClass(Filterset, [{
  62866. key: "toJS",
  62867. value: function toJS(env) {
  62868. function eachFilter(filter) {
  62869. var op = filter.op;
  62870. if (op === "=") {
  62871. op = "==";
  62872. }
  62873. var val = filter.val;
  62874. if (filter._val !== undefined) {
  62875. val = filter._val.toString(true);
  62876. }
  62877. //对scale进行特殊处理,将值转换成数值
  62878. if (filter.key && filter.key.value === 'scale') {
  62879. val = +val;
  62880. } else if (typeof val === 'string' || CartoCSS_typeof(val) === 'object') {
  62881. val = "'" + val + "'";
  62882. }
  62883. var attrs = "attributes";
  62884. return attrs + "&&" + attrs + filter.key + "&&" + attrs + filter.key + " " + op + val;
  62885. }
  62886. var results = [];
  62887. for (var id in this.filters) {
  62888. results.push(eachFilter(this.filters[id]));
  62889. }
  62890. return results.join(' && ');
  62891. }
  62892. }, {
  62893. key: "toString",
  62894. value: function toString() {
  62895. var arr = [];
  62896. for (var id in this.filters) {
  62897. arr.push(this.filters[id].id);
  62898. }
  62899. return arr.sort().join('\t');
  62900. }
  62901. }, {
  62902. key: "ev",
  62903. value: function ev(env) {
  62904. for (var i in this.filters) {
  62905. this.filters[i].ev(env);
  62906. }
  62907. return this;
  62908. }
  62909. }, {
  62910. key: "clone",
  62911. value: function clone() {
  62912. var clone = new CartoCSS.Tree.Filterset();
  62913. for (var id in this.filters) {
  62914. clone.filters[id] = this.filters[id];
  62915. }
  62916. return clone;
  62917. }
  62918. }, {
  62919. key: "cloneWith",
  62920. value: function cloneWith(other) {
  62921. var additions = [];
  62922. for (var id in other.filters) {
  62923. var status = this.addable(other.filters[id]);
  62924. // status is true, false or null. if it's null we don't fail this
  62925. // clone nor do we add the filter.
  62926. if (status === false) {
  62927. return false;
  62928. }
  62929. if (status === true) {
  62930. // Adding the filter will override another value.
  62931. additions.push(other.filters[id]);
  62932. }
  62933. }
  62934. // Adding the other filters doesn't make this filterset invalid, but it
  62935. // doesn't add anything to it either.
  62936. if (!additions.length) {
  62937. return null;
  62938. }
  62939. // We can successfully add all filters. Now clone the filterset and add the
  62940. // new rules.
  62941. var clone = new CartoCSS.Tree.Filterset();
  62942. // We can add the rules that are already present without going through the
  62943. // add function as a Filterset is always in it's simplest canonical form.
  62944. for (id in this.filters) {
  62945. clone.filters[id] = this.filters[id];
  62946. }
  62947. // Only add new filters that actually change the filter.
  62948. while (id = additions.shift()) {
  62949. clone.add(id);
  62950. }
  62951. return clone;
  62952. }
  62953. }, {
  62954. key: "addable",
  62955. value: function addable(filter) {
  62956. var key = filter.key.toString(),
  62957. value = filter.val.toString();
  62958. if (value.match(/^[0-9]+(\.[0-9]*)?_match/)) {
  62959. value = parseFloat(value);
  62960. }
  62961. switch (filter.op) {
  62962. case '=':
  62963. // if there is already foo= and we're adding foo=
  62964. if (this.filters[key + '='] !== undefined) {
  62965. if (this.filters[key + '='].val.toString() != value) {
  62966. return false;
  62967. } else {
  62968. return null;
  62969. }
  62970. }
  62971. if (this.filters[key + '!=' + value] !== undefined) {
  62972. return false;
  62973. }
  62974. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  62975. return false;
  62976. }
  62977. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  62978. return false;
  62979. }
  62980. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  62981. return false;
  62982. }
  62983. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  62984. return false;
  62985. }
  62986. return true;
  62987. case '=~':
  62988. return true;
  62989. case '!=':
  62990. if (this.filters[key + '='] !== undefined) {
  62991. return this.filters[key + '='].val === value ? false : null;
  62992. }
  62993. if (this.filters[key + '!=' + value] !== undefined) {
  62994. return null;
  62995. }
  62996. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  62997. return null;
  62998. }
  62999. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  63000. return null;
  63001. }
  63002. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  63003. return null;
  63004. }
  63005. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  63006. return null;
  63007. }
  63008. return true;
  63009. case '>':
  63010. if (key + '=' in this.filters) {
  63011. if (this.filters[key + '='].val <= value) {
  63012. return false;
  63013. } else {
  63014. return null;
  63015. }
  63016. }
  63017. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  63018. return false;
  63019. }
  63020. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  63021. return false;
  63022. }
  63023. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  63024. return null;
  63025. }
  63026. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  63027. return null;
  63028. }
  63029. return true;
  63030. case '>=':
  63031. if (this.filters[key + '='] !== undefined) {
  63032. return this.filters[key + '='].val < value ? false : null;
  63033. }
  63034. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  63035. return false;
  63036. }
  63037. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  63038. return false;
  63039. }
  63040. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  63041. return null;
  63042. }
  63043. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  63044. return null;
  63045. }
  63046. return true;
  63047. case '<':
  63048. if (this.filters[key + '='] !== undefined) {
  63049. return this.filters[key + '='].val >= value ? false : null;
  63050. }
  63051. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  63052. return false;
  63053. }
  63054. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  63055. return false;
  63056. }
  63057. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  63058. return null;
  63059. }
  63060. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  63061. return null;
  63062. }
  63063. return true;
  63064. case '<=':
  63065. if (this.filters[key + '='] !== undefined) {
  63066. return this.filters[key + '='].val > value ? false : null;
  63067. }
  63068. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  63069. return false;
  63070. }
  63071. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  63072. return false;
  63073. }
  63074. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  63075. return null;
  63076. }
  63077. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  63078. return null;
  63079. }
  63080. return true;
  63081. default:
  63082. break;
  63083. }
  63084. }
  63085. }, {
  63086. key: "conflict",
  63087. value: function conflict(filter) {
  63088. var key = filter.key.toString(),
  63089. value = filter.val.toString();
  63090. if (!isNaN(parseFloat(value))) {
  63091. value = parseFloat(value);
  63092. }
  63093. // if (a=b) && (a=c)
  63094. // if (a=b) && (a!=b)
  63095. // or (a!=b) && (a=b)
  63096. 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()) {
  63097. return filter.toString() + ' added to ' + this.toString() + ' produces an invalid filter';
  63098. }
  63099. return false;
  63100. }
  63101. }, {
  63102. key: "add",
  63103. value: function add(filter, env) {
  63104. var key = filter.key.toString(),
  63105. op = filter.op,
  63106. conflict = this.conflict(filter),
  63107. numval;
  63108. if (conflict) {
  63109. return conflict;
  63110. }
  63111. if (op === '=') {
  63112. for (var i in this.filters) {
  63113. if (this.filters[i].key === key) {
  63114. delete this.filters[i];
  63115. }
  63116. }
  63117. this.filters[key + '='] = filter;
  63118. } else if (op === '!=') {
  63119. this.filters[key + '!=' + filter.val] = filter;
  63120. } else if (op === '=~') {
  63121. this.filters[key + '=~' + filter.val] = filter;
  63122. } else if (op === '>') {
  63123. // If there are other filters that are also >
  63124. // but are less than this one, they don't matter, so
  63125. // remove them.
  63126. for (var j in this.filters) {
  63127. if (this.filters[j].key === key && this.filters[j].val <= filter.val) {
  63128. delete this.filters[j];
  63129. }
  63130. }
  63131. this.filters[key + '>'] = filter;
  63132. } else if (op === '>=') {
  63133. for (var k in this.filters) {
  63134. numval = +this.filters[k].val.toString();
  63135. if (this.filters[k].key === key && numval < filter.val) {
  63136. delete this.filters[k];
  63137. }
  63138. }
  63139. if (this.filters[key + '!=' + filter.val] !== undefined) {
  63140. delete this.filters[key + '!=' + filter.val];
  63141. filter.op = '>';
  63142. this.filters[key + '>'] = filter;
  63143. } else {
  63144. this.filters[key + '>='] = filter;
  63145. }
  63146. } else if (op === '<') {
  63147. for (var l in this.filters) {
  63148. numval = +this.filters[l].val.toString();
  63149. if (this.filters[l].key === key && numval >= filter.val) {
  63150. delete this.filters[l];
  63151. }
  63152. }
  63153. this.filters[key + '<'] = filter;
  63154. } else if (op === '<=') {
  63155. for (var m in this.filters) {
  63156. numval = +this.filters[m].val.toString();
  63157. if (this.filters[m].key === key && numval > filter.val) {
  63158. delete this.filters[m];
  63159. }
  63160. }
  63161. if (this.filters[key + '!=' + filter.val] !== undefined) {
  63162. delete this.filters[key + '!=' + filter.val];
  63163. filter.op = '<';
  63164. this.filters[key + '<'] = filter;
  63165. } else {
  63166. this.filters[key + '<='] = filter;
  63167. }
  63168. }
  63169. }
  63170. }]);
  63171. return Filterset;
  63172. }();
  63173. CartoCSS.Tree.Fontset = /*#__PURE__*/CartoCSS_createClass(function Fontset(env, fonts) {
  63174. CartoCSS_classCallCheck(this, Fontset);
  63175. this.fonts = fonts;
  63176. this.name = 'fontset-' + env.effects.length;
  63177. });
  63178. CartoCSS.Tree.Invalid = /*#__PURE__*/function () {
  63179. function Invalid(chunk, index, message) {
  63180. CartoCSS_classCallCheck(this, Invalid);
  63181. this.is = 'invalid';
  63182. this.chunk = chunk;
  63183. this.index = index;
  63184. this.type = 'syntax';
  63185. this.message = message || "Invalid code: " + this.chunk;
  63186. }
  63187. CartoCSS_createClass(Invalid, [{
  63188. key: "ev",
  63189. value: function ev(env) {
  63190. env.error({
  63191. chunk: this.chunk,
  63192. index: this.index,
  63193. type: 'syntax',
  63194. message: this.message || "Invalid code: " + this.chunk
  63195. });
  63196. return {
  63197. is: 'undefined'
  63198. };
  63199. }
  63200. }]);
  63201. return Invalid;
  63202. }();
  63203. CartoCSS.Tree.Keyword = /*#__PURE__*/function () {
  63204. function Keyword(value) {
  63205. CartoCSS_classCallCheck(this, Keyword);
  63206. this.value = value;
  63207. var special = {
  63208. 'transparent': 'color',
  63209. 'true': 'boolean',
  63210. 'false': 'boolean'
  63211. };
  63212. this.is = special[value] ? special[value] : 'keyword';
  63213. }
  63214. CartoCSS_createClass(Keyword, [{
  63215. key: "ev",
  63216. value: function ev() {
  63217. return this;
  63218. }
  63219. }, {
  63220. key: "toString",
  63221. value: function toString() {
  63222. return this.value;
  63223. }
  63224. }]);
  63225. return Keyword;
  63226. }();
  63227. /*Layer:class Invalid ),*/
  63228. CartoCSS.Tree.Literal = /*#__PURE__*/function () {
  63229. function Literal(content) {
  63230. CartoCSS_classCallCheck(this, Literal);
  63231. this.value = content || '';
  63232. this.is = 'field';
  63233. }
  63234. CartoCSS_createClass(Literal, [{
  63235. key: "toString",
  63236. value: function toString() {
  63237. return this.value;
  63238. }
  63239. }, {
  63240. key: 'ev',
  63241. value: function ev() {
  63242. return this;
  63243. }
  63244. }]);
  63245. return Literal;
  63246. }();
  63247. CartoCSS.Tree.Operation = /*#__PURE__*/function () {
  63248. function Operation(op, operands, index) {
  63249. CartoCSS_classCallCheck(this, Operation);
  63250. this.is = 'operation';
  63251. this.op = op.trim();
  63252. this.operands = operands;
  63253. this.index = index;
  63254. }
  63255. CartoCSS_createClass(Operation, [{
  63256. key: "ev",
  63257. value: function ev(env) {
  63258. var a = this.operands[0].ev(env),
  63259. b = this.operands[1].ev(env),
  63260. temp;
  63261. if (a.is === 'undefined' || b.is === 'undefined') {
  63262. return {
  63263. is: 'undefined',
  63264. value: 'undefined'
  63265. };
  63266. }
  63267. if (a instanceof CartoCSS.Tree.Dimension && b instanceof CartoCSS.Tree.Color) {
  63268. if (this.op === '*' || this.op === '+') {
  63269. temp = b;
  63270. b = a;
  63271. a = temp;
  63272. } else {
  63273. env.error({
  63274. name: "OperationError",
  63275. message: "Can't substract or divide a color from a number",
  63276. index: this.index
  63277. });
  63278. }
  63279. }
  63280. // Only concatenate plain strings, because this is easily
  63281. // pre-processed
  63282. if (a instanceof CartoCSS.Tree.Quoted && b instanceof CartoCSS.Tree.Quoted && this.op !== '+') {
  63283. env.error({
  63284. message: "Can't subtract, divide, or multiply strings.",
  63285. index: this.index,
  63286. type: 'runtime',
  63287. filename: this.filename
  63288. });
  63289. return {
  63290. is: 'undefined',
  63291. value: 'undefined'
  63292. };
  63293. }
  63294. // Fields, literals, dimensions, and quoted strings can be combined.
  63295. if (a instanceof CartoCSS.Tree.Field || b instanceof CartoCSS.Tree.Field || a instanceof CartoCSS.Tree.Literal || b instanceof CartoCSS.Tree.Literal) {
  63296. if (a.is === 'color' || b.is === 'color') {
  63297. env.error({
  63298. message: "Can't subtract, divide, or multiply colors in expressions.",
  63299. index: this.index,
  63300. type: 'runtime',
  63301. filename: this.filename
  63302. });
  63303. return {
  63304. is: 'undefined',
  63305. value: 'undefined'
  63306. };
  63307. } else {
  63308. return new CartoCSS.Tree.Literal(a.ev(env).toString(true) + this.op + b.ev(env).toString(true));
  63309. }
  63310. }
  63311. if (a.operate === undefined) {
  63312. env.error({
  63313. message: 'Cannot do math with type ' + a.is + '.',
  63314. index: this.index,
  63315. type: 'runtime',
  63316. filename: this.filename
  63317. });
  63318. return {
  63319. is: 'undefined',
  63320. value: 'undefined'
  63321. };
  63322. }
  63323. return a.operate(env, this.op, b);
  63324. }
  63325. }]);
  63326. return Operation;
  63327. }();
  63328. CartoCSS.Tree.Quoted = /*#__PURE__*/function () {
  63329. function Quoted(content) {
  63330. CartoCSS_classCallCheck(this, Quoted);
  63331. this.is = 'string';
  63332. this.value = content || '';
  63333. }
  63334. CartoCSS_createClass(Quoted, [{
  63335. key: "toString",
  63336. value: function toString(quotes) {
  63337. var escapedValue = this.value.replace(/&/g, '&amp;');
  63338. var xmlvalue = escapedValue.replace(/\'/g, '\\\'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/\>/g, '&gt;');
  63339. return quotes === true ? "'" + xmlvalue + "'" : escapedValue;
  63340. }
  63341. }, {
  63342. key: "ev",
  63343. value: function ev() {
  63344. return this;
  63345. }
  63346. }, {
  63347. key: "operate",
  63348. value: function operate(env, op, other) {
  63349. return new CartoCSS.Tree.Quoted(CartoCSS.Tree.operate(op, this.toString(), other.toString(this.contains_field)));
  63350. }
  63351. }]);
  63352. return Quoted;
  63353. }();
  63354. CartoCSS.Tree.Reference = {
  63355. _validateValue: {
  63356. 'font': function font(env, value) {
  63357. if (env.validation_data && env.validation_data.fonts) {
  63358. return env.validation_data.fonts.indexOf(value) != -1;
  63359. } else {
  63360. return true;
  63361. }
  63362. }
  63363. },
  63364. setData: function setData(data) {
  63365. this.data = data;
  63366. this.selector_cache = generateSelectorCache(data);
  63367. this.mapnikFunctions = generateMapnikFunctions(data);
  63368. this.required_cache = generateRequiredProperties(data);
  63369. function generateSelectorCache(data) {
  63370. var index = {};
  63371. for (var i in data.symbolizers) {
  63372. for (var j in data.symbolizers[i]) {
  63373. if (data.symbolizers[i][j].hasOwnProperty('css')) {
  63374. index[data.symbolizers[i][j].css] = [data.symbolizers[i][j], i, j];
  63375. }
  63376. }
  63377. }
  63378. return index;
  63379. }
  63380. function generateMapnikFunctions(data) {
  63381. var functions = {};
  63382. for (var i in data.symbolizers) {
  63383. for (var j in data.symbolizers[i]) {
  63384. if (data.symbolizers[i][j].type === 'functions') {
  63385. for (var k = 0; k < data.symbolizers[i][j].functions.length; k++) {
  63386. var fn = data.symbolizers[i][j].functions[k];
  63387. functions[fn[0]] = fn[1];
  63388. }
  63389. }
  63390. }
  63391. }
  63392. return functions;
  63393. }
  63394. function generateRequiredProperties(data) {
  63395. var cache = {};
  63396. for (var symbolizer_name in data.symbolizers) {
  63397. cache[symbolizer_name] = [];
  63398. for (var j in data.symbolizers[symbolizer_name]) {
  63399. if (data.symbolizers[symbolizer_name][j].required) {
  63400. cache[symbolizer_name].push(data.symbolizers[symbolizer_name][j].css);
  63401. }
  63402. }
  63403. }
  63404. return cache;
  63405. }
  63406. },
  63407. setVersion: function setVersion(version) {
  63408. if (CartoCSS.mapnik_reference.version.hasOwnProperty(version)) {
  63409. this.setData(CartoCSS.mapnik_reference.version[version]);
  63410. return true;
  63411. }
  63412. return false;
  63413. },
  63414. selectorData: function selectorData(selector, i) {
  63415. if (this.selector_cache && this.selector_cache[selector]) {
  63416. return this.selector_cache[selector][i];
  63417. }
  63418. },
  63419. validSelector: function validSelector(selector) {
  63420. return !!this.selector_cache[selector];
  63421. },
  63422. selectorName: function selectorName(selector) {
  63423. return this.selectorData(selector, 2);
  63424. },
  63425. selector: function selector(_selector) {
  63426. return this.selectorData(_selector, 0);
  63427. },
  63428. symbolizer: function symbolizer(selector) {
  63429. return this.selectorData(selector, 1);
  63430. },
  63431. requiredProperties: function requiredProperties(symbolizer_name, rules) {
  63432. var req = this.required_cache[symbolizer_name];
  63433. for (var i in req) {
  63434. if (!(req[i] in rules)) {
  63435. return 'Property ' + req[i] + ' required for defining ' + symbolizer_name + ' styles.';
  63436. }
  63437. }
  63438. },
  63439. isFont: function isFont(selector) {
  63440. return this.selector(selector).validate === 'font';
  63441. },
  63442. editDistance: function editDistance(a, b) {
  63443. if (a.length === 0) {
  63444. return b.length;
  63445. }
  63446. if (b.length === 0) {
  63447. return a.length;
  63448. }
  63449. var matrix = [];
  63450. for (var i = 0; i <= b.length; i++) {
  63451. matrix[i] = [i];
  63452. }
  63453. for (var j = 0; j <= a.length; j++) {
  63454. matrix[0][j] = j;
  63455. }
  63456. for (i = 1; i <= b.length; i++) {
  63457. for (j = 1; j <= a.length; j++) {
  63458. if (b.charAt(i - 1) === a.charAt(j - 1)) {
  63459. matrix[i][j] = matrix[i - 1][j - 1];
  63460. } else {
  63461. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1,
  63462. // substitution
  63463. Math.min(matrix[i][j - 1] + 1,
  63464. // insertion
  63465. matrix[i - 1][j] + 1)); // deletion
  63466. }
  63467. }
  63468. }
  63469. return matrix[b.length][a.length];
  63470. },
  63471. validValue: function validValue(env, selector, value) {
  63472. function validateFunctions(value, selector) {
  63473. if (value.value[0].is === 'string') {
  63474. return true;
  63475. }
  63476. for (var i in value.value) {
  63477. for (var j in value.value[i].value) {
  63478. if (value.value[i].value[j].is !== 'call') {
  63479. return false;
  63480. }
  63481. var f = find(this.selector(selector).functions, function (x) {
  63482. //NOSONAR
  63483. return x[0] === value.value[i].value[j].name;
  63484. });
  63485. if (!(f && f[1] === -1)) {
  63486. // This filter is unknown or given an incorrect number of arguments
  63487. if (!f || f[1] !== value.value[i].value[j].args.length) {
  63488. return false;
  63489. }
  63490. }
  63491. }
  63492. }
  63493. return true;
  63494. }
  63495. function validateKeyword(value, selector) {
  63496. if (CartoCSS_typeof(this.selector(selector).type) === 'object') {
  63497. return this.selector(selector).type.indexOf(value.value[0].value) !== -1;
  63498. } else {
  63499. // allow unquoted keywords as strings
  63500. return this.selector(selector).type === 'string';
  63501. }
  63502. }
  63503. var i;
  63504. if (!this.selector(selector)) {
  63505. return false;
  63506. } else if (value.value[0].is === 'keyword') {
  63507. return validateKeyword(value, selector);
  63508. } else if (value.value[0].is === 'undefined') {
  63509. // caught earlier in the chain - ignore here so that
  63510. // error is not overridden
  63511. return true;
  63512. } else if (this.selector(selector).type === 'numbers') {
  63513. for (i in value.value) {
  63514. if (value.value[i].is !== 'float') {
  63515. return false;
  63516. }
  63517. }
  63518. return true;
  63519. } else if (this.selector(selector).type === 'tags') {
  63520. if (!value.value) {
  63521. return false;
  63522. }
  63523. if (!value.value[0].value) {
  63524. return value.value[0].is === 'tag';
  63525. }
  63526. for (i = 0; i < value.value[0].value.length; i++) {
  63527. if (value.value[0].value[i].is !== 'tag') {
  63528. return false;
  63529. }
  63530. }
  63531. return true;
  63532. } else if (this.selector(selector).type == 'functions') {
  63533. // For backwards compatibility, you can specify a string for `functions`-compatible
  63534. // values, though they will not be validated.
  63535. return validateFunctions(value, selector);
  63536. } else if (this.selector(selector).type === 'expression') {
  63537. return true;
  63538. } else if (this.selector(selector).type === 'unsigned') {
  63539. if (value.value[0].is === 'float') {
  63540. value.value[0].round();
  63541. return true;
  63542. } else {
  63543. return false;
  63544. }
  63545. } else {
  63546. if (this.selector(selector).validate) {
  63547. var valid = false;
  63548. for (i = 0; i < value.value.length; i++) {
  63549. if (this.selector(selector).type === value.value[i].is && this._validateValue[this.selector(selector).validate](env, value.value[i].value)) {
  63550. return true;
  63551. }
  63552. }
  63553. return valid;
  63554. } else {
  63555. return this.selector(selector).type === value.value[0].is;
  63556. }
  63557. }
  63558. }
  63559. };
  63560. CartoCSS.Tree.Reference.setVersion("latest");
  63561. CartoCSS.Tree.Rule = /*#__PURE__*/function () {
  63562. function Rule(name, value, index, filename) {
  63563. CartoCSS_classCallCheck(this, Rule);
  63564. this.is = 'rule';
  63565. var parts = name.split('/');
  63566. this.name = parts.pop();
  63567. this.instance = parts.length ? parts[0] : '__default__';
  63568. this.value = value instanceof CartoCSS.Tree.Value ? value : new CartoCSS.Tree.Value([value]);
  63569. this.index = index;
  63570. this.symbolizer = CartoCSS.Tree.Reference.symbolizer(this.name);
  63571. this.filename = filename;
  63572. this.variable = name.charAt(0) === '@';
  63573. }
  63574. CartoCSS_createClass(Rule, [{
  63575. key: "clone",
  63576. value: function clone() {
  63577. var clone = Object.create(CartoCSS.Tree.Rule.prototype);
  63578. clone.name = this.name;
  63579. clone.value = this.value;
  63580. clone.index = this.index;
  63581. clone.instance = this.instance;
  63582. clone.symbolizer = this.symbolizer;
  63583. clone.filename = this.filename;
  63584. clone.variable = this.variable;
  63585. return clone;
  63586. }
  63587. }, {
  63588. key: "updateID",
  63589. value: function updateID() {
  63590. return this.id = this.zoom + '#' + this.instance + '#' + this.name;
  63591. }
  63592. }, {
  63593. key: "toString",
  63594. value: function toString() {
  63595. return '[' + CartoCSS.Tree.Zoom.toString(this.zoom) + '] ' + this.name + ': ' + this.value;
  63596. }
  63597. }, {
  63598. key: "ev",
  63599. value: function ev(context) {
  63600. return new CartoCSS.Tree.Rule(this.name, this.value.ev(context), this.index, this.filename);
  63601. }
  63602. }]);
  63603. return Rule;
  63604. }();
  63605. CartoCSS.Tree.Ruleset = /*#__PURE__*/function () {
  63606. function Ruleset(selectors, rules) {
  63607. CartoCSS_classCallCheck(this, Ruleset);
  63608. this.is = 'ruleset';
  63609. this.selectors = selectors;
  63610. this.rules = rules;
  63611. // static cache of find() function
  63612. this._lookups = {};
  63613. }
  63614. CartoCSS_createClass(Ruleset, [{
  63615. key: "ev",
  63616. value: function ev(env) {
  63617. var i,
  63618. rule,
  63619. ruleset = new CartoCSS.Tree.Ruleset(this.selectors, this.rules.slice(0));
  63620. ruleset.root = this.root;
  63621. // push the current ruleset to the frames stack
  63622. env.frames.unshift(ruleset);
  63623. // Evaluate everything else
  63624. for (i = 0, rule; i < ruleset.rules.length; i++) {
  63625. rule = ruleset.rules[i];
  63626. ruleset.rules[i] = rule.ev ? rule.ev(env) : rule;
  63627. }
  63628. // Pop the stack
  63629. env.frames.shift();
  63630. return ruleset;
  63631. }
  63632. }, {
  63633. key: "match",
  63634. value: function match(args) {
  63635. return !args || args.length === 0;
  63636. }
  63637. }, {
  63638. key: "variables",
  63639. value: function variables() {
  63640. if (this._variables) {
  63641. return this._variables;
  63642. } else {
  63643. return this._variables = this.rules.reduce(function (hash, r) {
  63644. if (r instanceof CartoCSS.Tree.Rule && r.variable === true) {
  63645. hash[r.name] = r;
  63646. }
  63647. return hash;
  63648. }, {});
  63649. }
  63650. }
  63651. }, {
  63652. key: "variable",
  63653. value: function variable(name) {
  63654. return this.variables()[name];
  63655. }
  63656. }, {
  63657. key: "rulesets",
  63658. value: function rulesets() {
  63659. if (this._rulesets) {
  63660. return this._rulesets;
  63661. } else {
  63662. return this._rulesets = this.rules.filter(function (r) {
  63663. return r instanceof CartoCSS.Tree.Ruleset;
  63664. });
  63665. }
  63666. }
  63667. }, {
  63668. key: "find",
  63669. value: function find(selector, self) {
  63670. self = self || this;
  63671. var rules = [],
  63672. match,
  63673. key = selector.toString();
  63674. if (key in this._lookups) {
  63675. return this._lookups[key];
  63676. }
  63677. this.rulesets().forEach(function (rule) {
  63678. if (rule !== self) {
  63679. for (var j = 0; j < rule.selectors.length; j++) {
  63680. match = selector.match(rule.selectors[j]);
  63681. if (match) {
  63682. if (selector.elements.length > 1) {
  63683. Array.prototype.push.apply(rules, rule.find(new CartoCSS.Tree.Selector(null, null, selector.elements.slice(1)), self));
  63684. } else {
  63685. rules.push(rule);
  63686. }
  63687. break;
  63688. }
  63689. }
  63690. }
  63691. });
  63692. return this._lookups[key] = rules;
  63693. }
  63694. // Zooms can use variables. This replaces CartoCSS.Tree.Zoom objects on selectors
  63695. // with simple bit-arrays that we can compare easily.
  63696. }, {
  63697. key: "evZooms",
  63698. value: function evZooms(env) {
  63699. for (var i = 0; i < this.selectors.length; i++) {
  63700. var zval = CartoCSS.Tree.Zoom.all;
  63701. for (var z = 0; z < this.selectors[i].zoom.length; z++) {
  63702. zval = this.selectors[i].zoom[z].ev(env).zoom;
  63703. }
  63704. this.selectors[i].zoom = zval;
  63705. }
  63706. }
  63707. }, {
  63708. key: "flatten",
  63709. value: function flatten(result, parents, env) {
  63710. var selectors = [],
  63711. i,
  63712. j;
  63713. if (this.selectors.length === 0) {
  63714. env.frames = env.frames.concat(this.rules);
  63715. }
  63716. // evaluate zoom variables on this object.
  63717. this.evZooms(env);
  63718. for (i = 0; i < this.selectors.length; i++) {
  63719. var child = this.selectors[i];
  63720. if (!child.filters) {
  63721. // This is an invalid filterset.
  63722. continue;
  63723. }
  63724. if (parents.length) {
  63725. for (j = 0; j < parents.length; j++) {
  63726. var parent = parents[j];
  63727. var mergedFilters = parent.filters.cloneWith(child.filters);
  63728. if (mergedFilters === null) {
  63729. // Filters could be added, but they didn't change the
  63730. // filters. This means that we only have to clone when
  63731. // the zoom levels or the attachment is different too.
  63732. if (parent.zoom === child.zoom && parent.attachment === child.attachment && parent.elements.join() === child.elements.join()) {
  63733. selectors.push(parent);
  63734. continue;
  63735. } else {
  63736. mergedFilters = parent.filters;
  63737. }
  63738. } else if (!mergedFilters) {
  63739. // The merged filters are invalid, that means we don't
  63740. // have to clone.
  63741. continue;
  63742. }
  63743. var clone = Object.create(CartoCSS.Tree.Selector.prototype);
  63744. clone.filters = mergedFilters;
  63745. clone.zoom = child.zoom;
  63746. clone.elements = parent.elements.concat(child.elements);
  63747. if (parent.attachment && child.attachment) {
  63748. clone.attachment = parent.attachment + '/' + child.attachment;
  63749. } else {
  63750. clone.attachment = child.attachment || parent.attachment;
  63751. }
  63752. clone.conditions = parent.conditions + child.conditions;
  63753. clone.index = child.index;
  63754. selectors.push(clone);
  63755. }
  63756. } else {
  63757. selectors.push(child);
  63758. }
  63759. }
  63760. var rules = [];
  63761. for (i = 0; i < this.rules.length; i++) {
  63762. var rule = this.rules[i];
  63763. // Recursively flatten any nested rulesets
  63764. if (rule instanceof CartoCSS.Tree.Ruleset) {
  63765. rule.flatten(result, selectors, env);
  63766. } else if (rule instanceof CartoCSS.Tree.Rule) {
  63767. rules.push(rule);
  63768. } else if (rule instanceof CartoCSS.Tree.Invalid) {
  63769. env.error(rule);
  63770. }
  63771. }
  63772. var index = rules.length ? rules[0].index : false;
  63773. for (i = 0; i < selectors.length; i++) {
  63774. // For specificity sort, use the position of the first rule to allow
  63775. // defining attachments that are under current element as a descendant
  63776. // selector.
  63777. if (index !== false) {
  63778. selectors[i].index = index;
  63779. }
  63780. result.push(new CartoCSS.Tree.Definition(selectors[i], rules.slice()));
  63781. }
  63782. return result;
  63783. }
  63784. }]);
  63785. return Ruleset;
  63786. }();
  63787. CartoCSS.Tree.Selector = /*#__PURE__*/function () {
  63788. function Selector(filters, zoom, elements, attachment, conditions, index) {
  63789. CartoCSS_classCallCheck(this, Selector);
  63790. this.elements = elements || [];
  63791. this.attachment = attachment;
  63792. this.filters = filters || {};
  63793. this.zoom = typeof zoom !== 'undefined' ? zoom : CartoCSS.Tree.Zoom.all;
  63794. this.conditions = conditions;
  63795. this.index = index;
  63796. }
  63797. CartoCSS_createClass(Selector, [{
  63798. key: "specificity",
  63799. value: function specificity() {
  63800. return this.elements.reduce(function (memo, e) {
  63801. var spec = e.specificity();
  63802. memo[0] += spec[0];
  63803. memo[1] += spec[1];
  63804. return memo;
  63805. }, [0, 0, this.conditions, this.index]);
  63806. }
  63807. }]);
  63808. return Selector;
  63809. }();
  63810. /*style:class Invalid ),*/
  63811. CartoCSS.Tree.URL = /*#__PURE__*/function () {
  63812. function URL(val, paths) {
  63813. CartoCSS_classCallCheck(this, URL);
  63814. this.is = 'uri';
  63815. this.value = val;
  63816. this.paths = paths;
  63817. }
  63818. CartoCSS_createClass(URL, [{
  63819. key: "toString",
  63820. value: function toString() {
  63821. return this.value.toString();
  63822. }
  63823. }, {
  63824. key: "ev",
  63825. value: function ev(ctx) {
  63826. return new CartoCSS.Tree.URL(this.value.ev(ctx), this.paths);
  63827. }
  63828. }]);
  63829. return URL;
  63830. }();
  63831. CartoCSS.Tree.Value = /*#__PURE__*/function () {
  63832. function Value(value) {
  63833. CartoCSS_classCallCheck(this, Value);
  63834. this.is = 'value';
  63835. this.value = value;
  63836. }
  63837. CartoCSS_createClass(Value, [{
  63838. key: "ev",
  63839. value: function ev(env) {
  63840. if (this.value.length === 1) {
  63841. return this.value[0].ev(env);
  63842. } else {
  63843. return new CartoCSS.Tree.Value(this.value.map(function (v) {
  63844. return v.ev(env);
  63845. }));
  63846. }
  63847. }
  63848. }, {
  63849. key: "toJS",
  63850. value: function toJS(env) {
  63851. //var v = this.value[0].value[0];
  63852. var val = this.ev(env);
  63853. var v = val.toString();
  63854. if (val.is === "color" || val.is === 'uri' || val.is === 'string' || val.is === 'keyword') {
  63855. v = "'" + v + "'";
  63856. } else if (val.is === 'field') {
  63857. // replace [varuable] by ctx['variable']
  63858. v = v.replace(/\[(.*)\]/g, "attributes['\_match1']");
  63859. } else if (val.value && CartoCSS_typeof(val.value) === "object") {
  63860. v = "[" + v + "]";
  63861. }
  63862. return "_value = " + v + ";";
  63863. }
  63864. }, {
  63865. key: "toString",
  63866. value: function toString(env, selector, sep, format) {
  63867. return this.value.map(function (e) {
  63868. return e.toString(env, format);
  63869. }).join(sep || ', ');
  63870. }
  63871. }, {
  63872. key: "clone",
  63873. value: function clone() {
  63874. var obj = Object.create(CartoCSS.Tree.Value.prototype);
  63875. if (Array.isArray(obj)) {
  63876. obj.value = this.value.slice();
  63877. } else {
  63878. obj.value = this.value;
  63879. }
  63880. obj.is = this.is;
  63881. return obj;
  63882. }
  63883. }]);
  63884. return Value;
  63885. }();
  63886. CartoCSS.Tree.Variable = /*#__PURE__*/function () {
  63887. function Variable(name, index, filename) {
  63888. CartoCSS_classCallCheck(this, Variable);
  63889. this.is = 'variable';
  63890. this.name = name;
  63891. this.index = index;
  63892. this.filename = filename;
  63893. }
  63894. CartoCSS_createClass(Variable, [{
  63895. key: "toString",
  63896. value: function toString() {
  63897. return this.name;
  63898. }
  63899. }, {
  63900. key: "ev",
  63901. value: function ev(env) {
  63902. if (this._css) {
  63903. return this._css;
  63904. }
  63905. var thisframe = env.frames.filter(function (f) {
  63906. return f.name === this.name;
  63907. }.bind(this));
  63908. if (thisframe.length) {
  63909. return thisframe[0].value.ev(env);
  63910. } else {
  63911. env.error({
  63912. message: 'variable ' + this.name + ' is undefined',
  63913. index: this.index,
  63914. type: 'runtime',
  63915. filename: this.filename
  63916. });
  63917. return {
  63918. is: 'undefined',
  63919. value: 'undefined'
  63920. };
  63921. }
  63922. }
  63923. }]);
  63924. return Variable;
  63925. }();
  63926. CartoCSS.Tree.Zoom = /*#__PURE__*/function () {
  63927. function Zoom(op, value, index) {
  63928. CartoCSS_classCallCheck(this, Zoom);
  63929. this.op = op;
  63930. this.value = value;
  63931. this.index = index;
  63932. }
  63933. CartoCSS_createClass(Zoom, [{
  63934. key: "setZoom",
  63935. value: function setZoom(zoom) {
  63936. this.zoom = zoom;
  63937. return this;
  63938. }
  63939. }, {
  63940. key: "ev",
  63941. value: function ev(env) {
  63942. var value = parseInt(this.value.ev(env).toString(), 10);
  63943. if (value > CartoCSS.Tree.Zoom.maxZoom || value < 0) {
  63944. env.error({
  63945. message: 'Only zoom levels between 0 and ' + CartoCSS.Tree.Zoom.maxZoom + ' supported.',
  63946. index: this.index
  63947. });
  63948. }
  63949. switch (this.op) {
  63950. case '=':
  63951. this.zoom = "zoom && zoom === " + value;
  63952. return this;
  63953. case '>':
  63954. this.zoom = "zoom && zoom > " + value;
  63955. break;
  63956. case '>=':
  63957. this.zoom = "zoom && zoom >= " + value;
  63958. break;
  63959. case '<':
  63960. this.zoom = "zoom && zoom < " + value;
  63961. break;
  63962. case '<=':
  63963. this.zoom = "zoom && zoom <= " + value;
  63964. break;
  63965. default:
  63966. break;
  63967. }
  63968. /*
  63969. for (var i = 0; i <= CartoCSS.Tree.Zoom.maxZoom; i++) {
  63970. if (i >= start && i <= end) {
  63971. zoom |= (1 << i);
  63972. }
  63973. }
  63974. this.zoom = zoom;
  63975. this.zoom=value+this.op+"zoom";*/
  63976. return this;
  63977. }
  63978. }, {
  63979. key: "toString",
  63980. value: function toString() {
  63981. var str = '';
  63982. for (var i = 0; i <= CartoCSS.Tree.Zoom.maxZoom; i++) {
  63983. str += this.zoom & 1 << i ? 'X' : '.';
  63984. }
  63985. return str;
  63986. }
  63987. }]);
  63988. return Zoom;
  63989. }();
  63990. // Covers all zoomlevels from 0 to 22
  63991. CartoCSS.Tree.Zoom.all = 23;
  63992. CartoCSS.Tree.Zoom.maxZoom = 22;
  63993. CartoCSS.Tree.Zoom.ranges = {
  63994. 0: 1000000000,
  63995. 1: 500000000,
  63996. 2: 200000000,
  63997. 3: 100000000,
  63998. 4: 50000000,
  63999. 5: 25000000,
  64000. 6: 12500000,
  64001. 7: 6500000,
  64002. 8: 3000000,
  64003. 9: 1500000,
  64004. 10: 750000,
  64005. 11: 400000,
  64006. 12: 200000,
  64007. 13: 100000,
  64008. 14: 50000,
  64009. 15: 25000,
  64010. 16: 12500,
  64011. 17: 5000,
  64012. 18: 2500,
  64013. 19: 1500,
  64014. 20: 750,
  64015. 21: 500,
  64016. 22: 250,
  64017. 23: 100
  64018. };
  64019. ;// CONCATENATED MODULE: ./src/common/style/ThemeStyle.js
  64020. 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); } }
  64021. 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; }
  64022. function ThemeStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64023. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64024. * This program are made available under the terms of the Apache License, Version 2.0
  64025. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64026. /**
  64027. * @class ThemeStyle
  64028. * @deprecatedclass SuperMap.ThemeStyle
  64029. * @classdesc 客户端专题图风格类。
  64030. * @modulecategory Overlay
  64031. * @category Visualization Theme
  64032. * @param {Object} options - 可选参数。
  64033. * @param {boolean} [options.fill=true] - 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  64034. * @param {string} [options.fillColor='#000000'] - 十六进制填充颜色。
  64035. * @param {number} [options.fillOpacity=1] - 填充不透明度。取值范围[0, 1]。
  64036. * @param {boolean} [options.stroke=false] - 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  64037. * @param {string} [options.strokeColor='#000000'] - 十六进制描边颜色。
  64038. * @param {number} [options.strokeOpacity=1] - 描边的不透明度。取值范围[0, 1]。
  64039. * @param {number} [options.strokeWidth=1] - 线宽度/描边宽度。
  64040. * @param {string} [options.strokeLinecap='butt'] - 线帽样式。strokeLinecap 有三种类型 “butt", "round", "square"。
  64041. * @param {string} [options.strokeLineJoin='iter'] - 线段连接样式。strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  64042. * @param {string} [options.strokeDashstyle='solid'] - 虚线类型。strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"。solid 表示实线。
  64043. * @param {number} [options.pointRadius=6] - 点半径,单位为像素。
  64044. * @param {number} [options.shadowBlur=0] - 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  64045. * @param {string} [options.shadowColor='#000000'] - 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  64046. * @param {number} [options.shadowOffsetX=0] - 阴影 X 方向偏移值。
  64047. * @param {number} [options.shadowOffsetY=0] - 阴影 Y 方向偏移值。
  64048. * @param {string} options.label - 专题要素附加文本标签内容。
  64049. * @param {string} [options.fontColor] - 附加文本字体颜色。
  64050. * @param {number} [options.fontSize=12] - 附加文本字体大小,单位是像素。
  64051. * @param {string} [options.fontStyle='normal'] - 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  64052. * @param {string} [options.fontVariant='normal'] - 附加文本字体变体。可设值:"normal", "small-caps"。
  64053. * @param {string} [options.fontWeight='normal'] - 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  64054. * @param {string} [options.fontFamily='arial,sans-serif'] - 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,
  64055. * 浏览器会使用它可识别的第一个可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称
  64056. * ("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  64057. * @param {string} [options.labelPosition='top'] - 附加文本位置,可以是 'inside', 'left', 'right', 'top', 'bottom'。
  64058. * @param {string} [options.labelAlign='center'] - 附加文本水平对齐。可以是 'left', 'right', 'center'。
  64059. * @param {string} [options.labelBaseline='middle'] - 附加文本垂直对齐。可以是 'top', 'bottom', 'middle' 。
  64060. * @param {number} [options.labelXOffset=0] - 附加文本在x轴方向的偏移量。
  64061. * @param {number} [options.labelYOffset=0] - 附加文本在y轴方向的偏移量。
  64062. * @usage
  64063. */
  64064. var ThemeStyle = /*#__PURE__*/ThemeStyle_createClass(function ThemeStyle(options) {
  64065. ThemeStyle_classCallCheck(this, ThemeStyle);
  64066. options = options || {};
  64067. /**
  64068. * @member {boolean} [ThemeStyle.prototype.fill=true]
  64069. * @description 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  64070. */
  64071. this.fill = true;
  64072. /**
  64073. * @member {string} [ThemeStyle.prototype.fillColor="#000000"]
  64074. * @description 十六进制填充颜色。
  64075. */
  64076. this.fillColor = "#000000";
  64077. /**
  64078. * @member {number} [ThemeStyle.prototype.fillOpacity=1]
  64079. * @description 填充不透明度。取值范围[0, 1]。
  64080. */
  64081. this.fillOpacity = 1;
  64082. /**
  64083. * @member {boolean} [ThemeStyle.prototype.stroke=false]
  64084. * @description 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  64085. */
  64086. this.stroke = false;
  64087. /**
  64088. * @member {string} [ThemeStyle.prototype.strokeColor="#000000"]
  64089. * @description 十六进制描边颜色。
  64090. */
  64091. this.strokeColor = "#000000";
  64092. /**
  64093. * @member {number} [ThemeStyle.prototype.strokeOpacity=1]
  64094. * @description 描边的不透明度。取值范围[0, 1]。
  64095. */
  64096. this.strokeOpacity = 1;
  64097. /**
  64098. * @member {number} [ThemeStyle.prototype.strokeWidth=1]
  64099. * @description 线宽度/描边宽度。
  64100. */
  64101. this.strokeWidth = 1;
  64102. /**
  64103. * @member {string} [ThemeStyle.prototype.strokeLinecap="butt"]
  64104. * @description 线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。
  64105. */
  64106. this.strokeLinecap = "butt";
  64107. /**
  64108. * @member {string} [ThemeStyle.prototype.strokeLineJoin="miter"]
  64109. * @description 线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  64110. */
  64111. this.strokeLineJoin = "miter";
  64112. /**
  64113. * @member {string} [ThemeStyle.prototype.strokeDashstyle="solid"]
  64114. * @description 虚线类型;strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted";
  64115. * solid 表示实线。
  64116. */
  64117. this.strokeDashstyle = "solid";
  64118. /**
  64119. * @member {number} [ThemeStyle.prototype.pointRadius=6]
  64120. * @description 点半径。单位为像素。
  64121. */
  64122. this.pointRadius = 6;
  64123. /**
  64124. * @member {number} [ThemeStyle.prototype.shadowBlur=0]
  64125. * @description 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  64126. */
  64127. this.shadowBlur = 0;
  64128. /**
  64129. * @member {string} [ThemeStyle.prototype.shadowColor='#000000']
  64130. * @description 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  64131. */
  64132. this.shadowColor = "#000000";
  64133. /**
  64134. * @member {number} [ThemeStyle.prototype.shadowOffsetX=0]
  64135. * @description 阴影 X 方向偏移值。
  64136. */
  64137. this.shadowOffsetX = 0;
  64138. /**
  64139. * @member {number} ThemeStyle.prototype.shadowOffsetY
  64140. * @description Y 方向偏移值。
  64141. */
  64142. this.shadowOffsetY = 0;
  64143. /**
  64144. * @member {string} [ThemeStyle.prototype.label]
  64145. * @description 专题要素附加文本标签内容。
  64146. */
  64147. this.label = "";
  64148. /**
  64149. * @member {boolean} [ThemeStyle.prototype.labelRect=false]
  64150. * @description 是否显示文本标签矩形背景。
  64151. */
  64152. this.labelRect = false;
  64153. /**
  64154. * @member {string} [ThemeStyle.prototype.fontColor]
  64155. * @description 附加文本字体颜色。
  64156. */
  64157. this.fontColor = "";
  64158. /**
  64159. * @member {number} [ThemeStyle.prototype.fontSize=12]
  64160. * @description 附加文本字体大小,单位是像素。
  64161. */
  64162. this.fontSize = 12;
  64163. /**
  64164. * @member {string} [ThemeStyle.prototype.fontStyle="normal"]
  64165. * @description 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  64166. */
  64167. this.fontStyle = "normal";
  64168. /**
  64169. * @member {string} [ThemeStyle.prototype.fontVariant="normal"]
  64170. * @description 附加文本字体变体。可设值:"normal", "small-caps"。
  64171. */
  64172. this.fontVariant = "normal";
  64173. /**
  64174. * @member {string} [ThemeStyle.prototype.fontWeight="normal"]
  64175. * @description 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  64176. */
  64177. this.fontWeight = "normal";
  64178. /**
  64179. * @member {string} [ThemeStyle.prototype.fontFamily="arial,sans-serif"]
  64180. * @description 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个
  64181. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  64182. */
  64183. this.fontFamily = "arial,sans-serif";
  64184. /**
  64185. * @member {string} [ThemeStyle.prototype.labelPosition='top']
  64186. * @description 附加文本位置,可以是 'inside', 'left', 'right', 'top', 'bottom'。
  64187. */
  64188. this.labelPosition = "top";
  64189. /**
  64190. * @member {string} [ThemeStyle.prototype.labelAlign='center']
  64191. * @description 附加文本水平对齐。可以是 'left', 'right', 'center'。
  64192. */
  64193. this.labelAlign = "center";
  64194. /**
  64195. * @member {string} [ThemeStyle.prototype.labelBaseline='middle']
  64196. * @description 附加文本垂直对齐。可以是 'top', 'bottom', 'middle'。
  64197. */
  64198. this.labelBaseline = "middle";
  64199. /**
  64200. * @member {number} [ThemeStyle.prototype.labelXOffset=0]
  64201. * @description 附加文本在 X 轴方向的偏移量。
  64202. */
  64203. this.labelXOffset = 0;
  64204. /**
  64205. * @member {number} [ThemeStyle.prototype.labelYOffset=0]
  64206. * @description 附加文本在 Y 轴方向的偏移量。
  64207. */
  64208. this.labelYOffset = 0;
  64209. Util_Util.extend(this, options);
  64210. });
  64211. ;// CONCATENATED MODULE: ./src/common/style/index.js
  64212. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64213. * This program are made available under the terms of the Apache License, Version 2.0
  64214. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64215. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeParameters.js
  64216. function ShapeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64217. 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); } }
  64218. 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; }
  64219. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64220. * This program are made available under the terms of the Apache License, Version 2.0
  64221. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64222. /**
  64223. * @class ShapeParameters
  64224. * @aliasclass Feature.ShapeParameters
  64225. * @deprecatedclass SuperMap.Feature.ShapeParameters
  64226. * @category Visualization Theme
  64227. * @classdesc 图形参数基类
  64228. * @usage
  64229. */
  64230. var ShapeParameters = /*#__PURE__*/function () {
  64231. function ShapeParameters() {
  64232. ShapeParameters_classCallCheck(this, ShapeParameters);
  64233. /**
  64234. * @member {Array.<number>} [ShapeParameters.prototype.refOriginalPosition=[0,0]]
  64235. * @description 图形参考原点位置,图形的参考中心位置。
  64236. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  64237. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  64238. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  64239. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  64240. * 图形(Shape)的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  64241. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  64242. * refOriginalPosition 的值为 [0, 0] 时,图形的位置信息才是 canvas 绝对位置。
  64243. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  64244. */
  64245. this.refOriginalPosition = [0, 0];
  64246. /**
  64247. * @member {string} ShapeParameters.prototype.refDataID
  64248. * @description 图形所关联数据的 ID(<{@link FeatureVector}> 的 ID)。
  64249. */
  64250. this.refDataID = null;
  64251. /**
  64252. * @member {boolean} ShapeParameters.prototype.isHoverByRefDataID
  64253. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  64254. */
  64255. this.isHoverByRefDataID = false;
  64256. /**
  64257. * @member {string} ShapeParameters.prototype.refDataHoverGroup
  64258. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  64259. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  64260. */
  64261. this.refDataHoverGroup = null;
  64262. /**
  64263. * @member {Object} ShapeParameters.prototype.dataInfo
  64264. * @description 图形携带的附加数据。
  64265. */
  64266. this.dataInfo = null;
  64267. /**
  64268. * @member {boolean} ShapeParameters.prototype.clickable
  64269. * @description 是否可点击。
  64270. */
  64271. this.clickable = true;
  64272. /**
  64273. * @member {boolean} ShapeParameters.prototype.hoverable
  64274. * @description 是否可点击。
  64275. */
  64276. this.hoverable = true;
  64277. /**
  64278. * @member {Object} ShapeParameters.prototype.style
  64279. * @description 图形样式对象,可设样式属性在子类中确定。
  64280. */
  64281. this.style = null;
  64282. /**
  64283. * @member {Object} ShapeParameters.prototype.highlightStyle
  64284. * @description 高亮样式对象,可设样式属性与 style 的可设样式属性相同。
  64285. */
  64286. this.highlightStyle = {};
  64287. this.CLASS_NAME = "SuperMap.Feature.ShapeParameters";
  64288. }
  64289. /**
  64290. * @function ShapeParameters.prototype.destroy
  64291. * @description 销毁对象。
  64292. */
  64293. ShapeParameters_createClass(ShapeParameters, [{
  64294. key: "destroy",
  64295. value: function destroy() {
  64296. this.refOriginalPosition = null;
  64297. this.refDataID = null;
  64298. this.isHoverByRefDataID = null;
  64299. this.refDataHoverGroup = null;
  64300. this.dataInfo = null;
  64301. this.clickable = null;
  64302. this.hoverable = null;
  64303. this.style = null;
  64304. this.highlightStyle = null;
  64305. }
  64306. }]);
  64307. return ShapeParameters;
  64308. }();
  64309. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Point.js
  64310. 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); }
  64311. function feature_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64312. 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); } }
  64313. 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; }
  64314. function feature_Point_get() { if (typeof Reflect !== "undefined" && Reflect.get) { feature_Point_get = Reflect.get.bind(); } else { feature_Point_get = function _get(target, property, receiver) { var base = feature_Point_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return feature_Point_get.apply(this, arguments); }
  64315. function feature_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  64316. function feature_Point_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) feature_Point_setPrototypeOf(subClass, superClass); }
  64317. function feature_Point_setPrototypeOf(o, p) { feature_Point_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Point_setPrototypeOf(o, p); }
  64318. function feature_Point_createSuper(Derived) { var hasNativeReflectConstruct = feature_Point_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = feature_Point_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = feature_Point_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return feature_Point_possibleConstructorReturn(this, result); }; }
  64319. function feature_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 feature_Point_assertThisInitialized(self); }
  64320. function feature_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64321. function feature_Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  64322. function feature_Point_getPrototypeOf(o) { feature_Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Point_getPrototypeOf(o); }
  64323. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64324. * This program are made available under the terms of the Apache License, Version 2.0
  64325. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64326. /**
  64327. * @class ShapeParametersPoint
  64328. * @aliasclass Feature.ShapeParameters.Point
  64329. * @deprecatedclass SuperMap.Feature.ShapeParameters.Point
  64330. * @category Visualization Theme
  64331. * @classdesc 点参数对象。
  64332. * @extends {ShapeParameters}
  64333. * @param {number} x - 点 x 坐标。
  64334. * @param {number} y - 点 y 坐标。
  64335. * @usage
  64336. */
  64337. var Point_Point = /*#__PURE__*/function (_ShapeParameters) {
  64338. feature_Point_inherits(Point, _ShapeParameters);
  64339. var _super = feature_Point_createSuper(Point);
  64340. function Point(x, y) {
  64341. var _this;
  64342. feature_Point_classCallCheck(this, Point);
  64343. _this = _super.call(this, x, y);
  64344. /**
  64345. * @member {number} ShapeParametersPoint.prototype.x
  64346. * @description 点 x 坐标。
  64347. */
  64348. _this.x = !isNaN(x) ? x : 0;
  64349. /**
  64350. * @member {number} ShapeParametersPoint.prototype.y
  64351. * @description 点 y 坐标。
  64352. */
  64353. _this.y = !isNaN(y) ? y : 0;
  64354. /**
  64355. * @member {number} ShapeParametersPoint.prototype.r
  64356. * @description 点的半径。
  64357. */
  64358. _this.r = 6;
  64359. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Point";
  64360. return _this;
  64361. }
  64362. /**
  64363. * @function ShapeParametersPoint.prototype.destroy
  64364. * @description 销毁对象。
  64365. */
  64366. feature_Point_createClass(Point, [{
  64367. key: "destroy",
  64368. value: function destroy() {
  64369. this.x = null;
  64370. this.y = null;
  64371. this.r = null;
  64372. feature_Point_get(feature_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  64373. }
  64374. }]);
  64375. return Point;
  64376. }(ShapeParameters);
  64377. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Line.js
  64378. 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); }
  64379. function Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64380. 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); } }
  64381. 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; }
  64382. 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); }
  64383. function Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Line_getPrototypeOf(object); if (object === null) break; } return object; }
  64384. 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); }
  64385. 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); }
  64386. 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); }; }
  64387. 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); }
  64388. function Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64389. 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; } }
  64390. function Line_getPrototypeOf(o) { Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Line_getPrototypeOf(o); }
  64391. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64392. * This program are made available under the terms of the Apache License, Version 2.0
  64393. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64394. /**
  64395. * @class ShapeParametersLine
  64396. * @aliasclass Feature.ShapeParameters.Line
  64397. * @deprecatedclass SuperMap.Feature.ShapeParameters.Line
  64398. * @category Visualization Theme
  64399. * @classdesc 线参数对象。
  64400. * @extends {ShapeParameters}
  64401. * @param {Array} pointList - 线要素节点数组,二维数组。
  64402. * @usage
  64403. */
  64404. var Line_Line = /*#__PURE__*/function (_ShapeParameters) {
  64405. Line_inherits(Line, _ShapeParameters);
  64406. var _super = Line_createSuper(Line);
  64407. function Line(pointList) {
  64408. var _this;
  64409. Line_classCallCheck(this, Line);
  64410. _this = _super.call(this, pointList);
  64411. /**
  64412. * @member {Array} ShapeParametersLine.prototype.pointList
  64413. * @description 线要素节点数组,二维数组。
  64414. * 数组形如:
  64415. * (start code)
  64416. * [
  64417. * [10, 20], //节点
  64418. * [30, 40],
  64419. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  64420. * ]
  64421. * (end)
  64422. */
  64423. _this.pointList = pointList;
  64424. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Line";
  64425. return _this;
  64426. }
  64427. /**
  64428. * @function ShapeParametersLine.prototype.destroy
  64429. * @description 销毁对象。
  64430. */
  64431. Line_createClass(Line, [{
  64432. key: "destroy",
  64433. value: function destroy() {
  64434. this.pointList = null;
  64435. Line_get(Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  64436. }
  64437. }]);
  64438. return Line;
  64439. }(ShapeParameters);
  64440. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Polygon.js
  64441. 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); }
  64442. function feature_Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64443. 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); } }
  64444. 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; }
  64445. 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); }
  64446. function Polygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Polygon_getPrototypeOf(object); if (object === null) break; } return object; }
  64447. 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); }
  64448. 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); }
  64449. 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); }; }
  64450. 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); }
  64451. function feature_Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64452. 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; } }
  64453. 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); }
  64454. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64455. * This program are made available under the terms of the Apache License, Version 2.0
  64456. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64457. /**
  64458. * @class ShapeParametersPolygon
  64459. * @aliasclass Feature.ShapeParameters.Polygon
  64460. * @deprecatedclass SuperMap.Feature.ShapeParameters.Polygon
  64461. * @category Visualization Theme
  64462. * @classdesc 面参数对象。
  64463. * @extends {ShapeParameters}
  64464. * @param {Array} pointList - 横坐标。
  64465. * @usage
  64466. */
  64467. var feature_Polygon_Polygon = /*#__PURE__*/function (_ShapeParameters) {
  64468. feature_Polygon_inherits(Polygon, _ShapeParameters);
  64469. var _super = feature_Polygon_createSuper(Polygon);
  64470. function Polygon(pointList) {
  64471. var _this;
  64472. feature_Polygon_classCallCheck(this, Polygon);
  64473. _this = _super.call(this, pointList);
  64474. /**
  64475. * @member {Array} ShapeParametersPolygon.prototype.pointList
  64476. * @description 面要素节点数组,二维数组。
  64477. * 数组形如:
  64478. * (start code)
  64479. * [
  64480. * [10, 20], //节点
  64481. * [30, 40],
  64482. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  64483. * ]
  64484. * (end)
  64485. */
  64486. _this.pointList = pointList;
  64487. /**
  64488. * @member {Array} ShapeParametersPolygon.prototype.holePolygonPointLists
  64489. * @description 岛洞面多边形顶点数组(三维数组)
  64490. */
  64491. _this.holePolygonPointLists = null;
  64492. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Polygon";
  64493. return _this;
  64494. }
  64495. /**
  64496. * @function ShapeParametersPolygon.prototype.destroy
  64497. * @description 销毁对象。
  64498. */
  64499. feature_Polygon_createClass(Polygon, [{
  64500. key: "destroy",
  64501. value: function destroy() {
  64502. this.pointList = null;
  64503. this.holePolygonPointLists = null;
  64504. Polygon_get(feature_Polygon_getPrototypeOf(Polygon.prototype), "destroy", this).call(this);
  64505. }
  64506. }]);
  64507. return Polygon;
  64508. }(ShapeParameters);
  64509. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Rectangle.js
  64510. 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); }
  64511. function feature_Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64512. 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); } }
  64513. 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; }
  64514. 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); }
  64515. function Rectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Rectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  64516. 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); }
  64517. 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); }
  64518. 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); }; }
  64519. 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); }
  64520. function feature_Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64521. 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; } }
  64522. 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); }
  64523. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64524. * This program are made available under the terms of the Apache License, Version 2.0
  64525. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64526. /**
  64527. * @class ShapeParametersRectangle
  64528. * @aliasclass Feature.ShapeParameters.Rectangle
  64529. * @deprecatedclass SuperMap.Feature.ShapeParameters.Rectangle
  64530. * @category Visualization Theme
  64531. * @classdesc 矩形参数对象。
  64532. * @extends {ShapeParameters}
  64533. * @param {number} x - 矩形 x 坐标。
  64534. * @param {number} y - 矩形 y 坐标。
  64535. * @param {number} width - 矩形 width 宽度。
  64536. * @param {number} height - 矩形 height 高度。
  64537. * @usage
  64538. */
  64539. var Rectangle_Rectangle = /*#__PURE__*/function (_ShapeParameters) {
  64540. feature_Rectangle_inherits(Rectangle, _ShapeParameters);
  64541. var _super = feature_Rectangle_createSuper(Rectangle);
  64542. function Rectangle(x, y, width, height) {
  64543. var _this;
  64544. feature_Rectangle_classCallCheck(this, Rectangle);
  64545. _this = _super.call(this, x, y, width, height);
  64546. /**
  64547. * @member {number} ShapeParametersRectangle.prototype.x
  64548. * @description 左上角 x 坐标。
  64549. */
  64550. _this.x = !isNaN(x) ? x : 0;
  64551. /**
  64552. * @member {number} ShapeParametersRectangle.prototype.y
  64553. * @description 左上角 y 坐标。
  64554. */
  64555. _this.y = !isNaN(x) ? y : 0;
  64556. /**
  64557. * @member {number} ShapeParametersRectangle.prototype.width
  64558. * @description 宽度。
  64559. */
  64560. _this.width = !isNaN(width) ? width : 0;
  64561. /**
  64562. * @member {number} ShapeParametersRectangle.prototype.height
  64563. * @description 高度。
  64564. */
  64565. _this.height = !isNaN(height) ? height : 0;
  64566. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Rectangle";
  64567. return _this;
  64568. }
  64569. /**
  64570. * @function ShapeParametersRectangle.prototype.destroy
  64571. * @description 销毁对象。
  64572. */
  64573. feature_Rectangle_createClass(Rectangle, [{
  64574. key: "destroy",
  64575. value: function destroy() {
  64576. this.x = null;
  64577. this.y = null;
  64578. this.width = null;
  64579. this.height = null;
  64580. Rectangle_get(feature_Rectangle_getPrototypeOf(Rectangle.prototype), "destroy", this).call(this);
  64581. }
  64582. }]);
  64583. return Rectangle;
  64584. }(ShapeParameters);
  64585. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Sector.js
  64586. 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); }
  64587. function Sector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64588. 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); } }
  64589. 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; }
  64590. 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); }
  64591. function Sector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Sector_getPrototypeOf(object); if (object === null) break; } return object; }
  64592. 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); }
  64593. 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); }
  64594. 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); }; }
  64595. 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); }
  64596. function Sector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64597. 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; } }
  64598. function Sector_getPrototypeOf(o) { Sector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Sector_getPrototypeOf(o); }
  64599. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64600. * This program are made available under the terms of the Apache License, Version 2.0
  64601. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64602. /**
  64603. * @class ShapeParametersSector
  64604. * @aliasclass Feature.ShapeParameters.Sector
  64605. * @deprecatedclass SuperMap.Feature.ShapeParameters.Sector
  64606. * @category Visualization Theme
  64607. * @classdesc 扇形参数对象。
  64608. * @extends {ShapeParameters}
  64609. * @param {number} x - 圆心 x 坐标。
  64610. * @param {number} y - 圆心 y 坐标。
  64611. * @param {number} r - 外圆半径。
  64612. * @param {number} startAngle - 起始角度。取值范围[0, 360)。
  64613. * @param {number} endAngle - 结束角度。取值范围(0, 360]。
  64614. * @param {number} [r0=0] - 内圆半径,指定后将出现内弧,同时扇边长度为'r - r0'。取值范围[0, r)。
  64615. * @usage
  64616. */
  64617. var Sector = /*#__PURE__*/function (_ShapeParameters) {
  64618. Sector_inherits(Sector, _ShapeParameters);
  64619. var _super = Sector_createSuper(Sector);
  64620. function Sector(x, y, r, startAngle, endAngle, r0, clockWise) {
  64621. var _this;
  64622. Sector_classCallCheck(this, Sector);
  64623. _this = _super.call(this, x, y, r, startAngle, endAngle, r0, clockWise);
  64624. /**
  64625. * @member {number} ShapeParametersSector.prototype.x
  64626. * @description 圆心 x 坐标。
  64627. */
  64628. _this.x = !isNaN(x) ? x : 0;
  64629. /**
  64630. * @member {number} ShapeParametersSector.prototype.Y
  64631. * @description 圆心 Y 坐标。
  64632. */
  64633. _this.y = !isNaN(y) ? y : 0;
  64634. /**
  64635. * @member {number} ShapeParametersSector.prototype.r
  64636. * @description 外圆半径。
  64637. */
  64638. _this.r = !isNaN(r) ? r : 0;
  64639. /**
  64640. * @member {number} ShapeParametersSector.prototype.startAngle
  64641. * @description 起始角度。取值范围[0, 360),默认值:null。
  64642. */
  64643. _this.startAngle = !isNaN(startAngle) ? startAngle : 0;
  64644. /**
  64645. * @member {number} ShapeParametersSector.prototype.endAngle
  64646. * @description 结束角度。取值范围(0, 360],默认值:null。
  64647. */
  64648. _this.endAngle = !isNaN(endAngle) ? endAngle : 0;
  64649. /**
  64650. * @member {number} [ShapeParametersSector.prototype.r0=0]
  64651. * @description 内圆半径,指定后将出现内弧,同时扇边长度为 r 减 r0。取值范围[0, r)。
  64652. */
  64653. _this.r0 = !isNaN(r0) ? r0 : 0;
  64654. /**
  64655. * @member {number} [ShapeParametersSector.prototype.clockWise=false]
  64656. * @description 是否是顺时针。默认值:false。
  64657. */
  64658. _this.clockWise = clockWise;
  64659. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Sector";
  64660. return _this;
  64661. }
  64662. /**
  64663. * @function ShapeParametersSector.prototype.destroy
  64664. * @description 销毁对象。
  64665. */
  64666. Sector_createClass(Sector, [{
  64667. key: "destroy",
  64668. value: function destroy() {
  64669. this.x = null;
  64670. this.y = null;
  64671. this.r = null;
  64672. this.startAngle = null;
  64673. this.endAngle = null;
  64674. this.r0 = null;
  64675. this.clockWise = null;
  64676. Sector_get(Sector_getPrototypeOf(Sector.prototype), "destroy", this).call(this);
  64677. }
  64678. }]);
  64679. return Sector;
  64680. }(ShapeParameters);
  64681. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Label.js
  64682. 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); }
  64683. function Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64684. 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); } }
  64685. 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; }
  64686. 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); }
  64687. function Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Label_getPrototypeOf(object); if (object === null) break; } return object; }
  64688. 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); }
  64689. 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); }
  64690. 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); }; }
  64691. 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); }
  64692. function Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64693. 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; } }
  64694. function Label_getPrototypeOf(o) { Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Label_getPrototypeOf(o); }
  64695. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64696. * This program are made available under the terms of the Apache License, Version 2.0
  64697. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64698. /**
  64699. * @class ShapeParametersLabel
  64700. * @aliasclass Feature.ShapeParameters.Label
  64701. * @deprecatedclass SuperMap.Feature.ShapeParameters.Label
  64702. * @category Visualization Theme
  64703. * @classdesc 标签参数对象。
  64704. * @extends {ShapeParameters}
  64705. * @param {number} x - 横坐标。
  64706. * @param {number} y - 纵坐标。
  64707. * @param {string} text - 图形中的附加文本。
  64708. * @usage
  64709. * ```
  64710. * // 浏览器
  64711. * <script type="text/javascript" src="{cdn}"></script>
  64712. * <script>
  64713. * new {namespace}.Feature.ShapeParameters.Label(x, y, text);
  64714. *
  64715. * // 弃用的写法
  64716. * new SuperMap.Feature.ShapeParameters.Label(x, y, text);
  64717. *
  64718. * </script>
  64719. * // ES6 Import
  64720. * import { ShapeParametersLabel } from '{npm}';
  64721. * new ShapeParametersLabel(x, y, text);
  64722. *
  64723. * // 弃用的写法
  64724. * import { Label } from '{npm}';
  64725. * new Label(x, y, text);
  64726. *
  64727. * ```
  64728. */
  64729. var Label = /*#__PURE__*/function (_ShapeParameters) {
  64730. Label_inherits(Label, _ShapeParameters);
  64731. var _super = Label_createSuper(Label);
  64732. function Label(x, y, text) {
  64733. var _this;
  64734. Label_classCallCheck(this, Label);
  64735. _this = _super.call(this, x, y, text);
  64736. /**
  64737. * @member {number} ShapeParametersLabel.prototype.x
  64738. * @description 标签 x 坐标。
  64739. */
  64740. _this.x = x;
  64741. /**
  64742. * @member {number} ShapeParametersLabel.prototype.y
  64743. * @description 标签 y 坐标。
  64744. */
  64745. _this.y = y;
  64746. /**
  64747. * @member {number} ShapeParametersLabel.prototype.text
  64748. * @description 标签的文本内容。
  64749. */
  64750. _this.text = text;
  64751. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Label";
  64752. return _this;
  64753. }
  64754. /**
  64755. * @function ShapeParametersLabel.prototype.destroy
  64756. * @description 销毁对象。
  64757. */
  64758. Label_createClass(Label, [{
  64759. key: "destroy",
  64760. value: function destroy() {
  64761. this.x = null;
  64762. this.y = null;
  64763. this.text = null;
  64764. Label_get(Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
  64765. }
  64766. }]);
  64767. return Label;
  64768. }(ShapeParameters);
  64769. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Image.js
  64770. 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); }
  64771. function feature_Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64772. 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); } }
  64773. 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; }
  64774. 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); }
  64775. function feature_Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Image_getPrototypeOf(object); if (object === null) break; } return object; }
  64776. 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); }
  64777. 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); }
  64778. 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); }; }
  64779. 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); }
  64780. function feature_Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64781. 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; } }
  64782. 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); }
  64783. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64784. * This program are made available under the terms of the Apache License, Version 2.0
  64785. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64786. /**
  64787. * @class ShapeParametersImage
  64788. * @aliasclass Feature.ShapeParameters.Image
  64789. * @deprecatedclass SuperMap.Feature.ShapeParameters.Image
  64790. * @category Visualization Theme
  64791. * @classdesc 图片参数对象。
  64792. * @extends {ShapeParameters}
  64793. * @param {number} x - 左上角横坐标。
  64794. * @param {number} y - 左上角纵坐标。
  64795. * @param {(string|Object)} image - 图片地址或Cavans对象。
  64796. * @param {number} width - 绘制到画布上的宽度,默认为图片高度。
  64797. * @param {number} height - 绘制到画布上的高度,默认为图片高度。
  64798. * @param {number} sx - 从图片中裁剪的左上角横坐标。
  64799. * @param {number} sy - 从图片中裁剪的左上角纵坐标。
  64800. * @param {number} sWidth - 从图片中裁剪的宽度,默认为图片高度。
  64801. * @param {number} sHeight - 绘制到画布上的高度,默认为图片高度。
  64802. * @usage
  64803. */
  64804. var Image_Image = /*#__PURE__*/function (_ShapeParameters) {
  64805. feature_Image_inherits(Image, _ShapeParameters);
  64806. var _super = feature_Image_createSuper(Image);
  64807. function Image(x, y, image, width, height, sx, sy, sWidth, sHeight) {
  64808. var _this;
  64809. feature_Image_classCallCheck(this, Image);
  64810. _this = _super.call(this, x, y, image, width, height, sx, sy, sWidth, sHeight);
  64811. /**
  64812. * @member {number} ShapeParametersImage.prototype.x
  64813. * @description 左上角横坐标,必设参数。
  64814. */
  64815. _this.x = x;
  64816. /**
  64817. * @member {number} ShapeParametersImage.prototype.y
  64818. * @description 左上角纵坐标,必设参数。
  64819. */
  64820. _this.y = y;
  64821. /**
  64822. * @member {(string|Object)} ShapeParametersImage.prototype.image
  64823. * @description 图片地址。
  64824. */
  64825. _this.image = image;
  64826. /**
  64827. * @member {number} ShapeParametersImage.prototype.width
  64828. * @description 绘制到画布上的宽度,默认为图片高度。
  64829. */
  64830. _this.width = width;
  64831. /**
  64832. * @member {number} ShapeParametersImage.prototype.height
  64833. * @description 绘制到画布上的高度,默认为图片高度。
  64834. */
  64835. _this.height = height;
  64836. /**
  64837. * @member {number} ShapeParametersImage.prototype.sx
  64838. * @description 从图片中裁剪的左上角横坐标。
  64839. */
  64840. _this.sx = sx;
  64841. /**
  64842. * @member {number} ShapeParametersImage.prototype.sy
  64843. * @description 从图片中裁剪的左上角纵坐标。
  64844. */
  64845. _this.sy = sy;
  64846. /**
  64847. * @member {number} ShapeParametersImage.prototype.sWidth
  64848. * @description 从图片中裁剪的宽度,默认为图片高度。
  64849. */
  64850. _this.sWidth = sWidth;
  64851. /**
  64852. * @member {number} ShapeParametersImage.prototype.sHeight
  64853. * @description 绘制到画布上的高度,默认为图片高度。
  64854. */
  64855. _this.sHeight = sHeight;
  64856. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Image";
  64857. return _this;
  64858. }
  64859. /**
  64860. * @function ShapeParametersImage.prototype.destroy
  64861. * @description 销毁对象。
  64862. */
  64863. feature_Image_createClass(Image, [{
  64864. key: "destroy",
  64865. value: function destroy() {
  64866. this.x = null;
  64867. this.y = null;
  64868. this.image = null;
  64869. this.width = null;
  64870. this.height = null;
  64871. this.sx = null;
  64872. this.sy = null;
  64873. this.sWidth = null;
  64874. this.sHeight = null;
  64875. feature_Image_get(feature_Image_getPrototypeOf(Image.prototype), "destroy", this).call(this);
  64876. }
  64877. }]);
  64878. return Image;
  64879. }(ShapeParameters);
  64880. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Circle.js
  64881. 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); }
  64882. function Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64883. 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); } }
  64884. 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; }
  64885. 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); }
  64886. function Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  64887. 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); }
  64888. 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); }
  64889. 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); }; }
  64890. 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); }
  64891. function Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  64892. 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; } }
  64893. function Circle_getPrototypeOf(o) { Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Circle_getPrototypeOf(o); }
  64894. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64895. * This program are made available under the terms of the Apache License, Version 2.0
  64896. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64897. /**
  64898. * @class ShapeParametersCircle
  64899. * @aliasclass Feature.ShapeParameters.Circle
  64900. * @deprecatedclass SuperMap.Feature.ShapeParameters.Circle
  64901. * @classdesc 圆形参数对象。
  64902. * @category Visualization Theme
  64903. * @extends {ShapeParameters}
  64904. * @param {number} x - 圆心 x 坐标。
  64905. * @param {number} y - 圆心 y 坐标。
  64906. * @param {number} r - 圆半径。
  64907. * @usage
  64908. */
  64909. var Circle_Circle = /*#__PURE__*/function (_ShapeParameters) {
  64910. Circle_inherits(Circle, _ShapeParameters);
  64911. var _super = Circle_createSuper(Circle);
  64912. function Circle(x, y, r) {
  64913. var _this;
  64914. Circle_classCallCheck(this, Circle);
  64915. _this = _super.call(this, x, y, r);
  64916. /**
  64917. * @member {number} ShapeParametersCircle.prototype.x
  64918. * @description 圆心 x 坐标。
  64919. */
  64920. _this.x = !isNaN(x) ? x : 0;
  64921. /**
  64922. * @member {number} ShapeParametersCircle.prototype.y
  64923. * @description 圆心 y 坐标。
  64924. */
  64925. _this.y = !isNaN(y) ? y : 0;
  64926. /**
  64927. * @member {number} ShapeParametersCircle.prototype.r
  64928. * @description 圆半径。
  64929. */
  64930. _this.r = !isNaN(r) ? r : 0;
  64931. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Circle";
  64932. return _this;
  64933. }
  64934. /**
  64935. * @function ShapeParametersCircle.prototype.destroy
  64936. * @description 销毁对象。
  64937. */
  64938. Circle_createClass(Circle, [{
  64939. key: "destroy",
  64940. value: function destroy() {
  64941. this.x = null;
  64942. this.y = null;
  64943. this.r = null;
  64944. Circle_get(Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  64945. }
  64946. }]);
  64947. return Circle;
  64948. }(ShapeParameters);
  64949. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Eventful.js
  64950. function Eventful_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64951. 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); } }
  64952. 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; }
  64953. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  64954. * This program are made available under the terms of the Apache License, Version 2.0
  64955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64956. /**
  64957. * @class LevelRenderer.Eventful
  64958. * @category Visualization Theme
  64959. * @classdesc 事件分发器超类,所有支持事件处理的类均是此类的子类。
  64960. * 此类不可实例化。
  64961. * 支持的事件:
  64962. * Symbolizer properties:
  64963. * onclick - {function} 默认值:null。
  64964. * onmouseover - {function} 默认值:null。
  64965. * onmouseout - {function} 默认值:null。
  64966. * onmousemove - {function} 默认值:null。
  64967. * onmousewheel - {function} 默认值:null。
  64968. * onmousedown - {function} 默认值:null。
  64969. * onmouseup - {function} 默认值:null。
  64970. * ondragstart - {function} 默认值:null。
  64971. * ondragend - {function} 默认值:null。
  64972. * ondragenter - {function} 默认值:null。
  64973. * ondragleave - {function} 默认值:null。
  64974. * ondragover - {function} 默认值:null。
  64975. * ondrop - {function} 默认值:null。
  64976. * @private
  64977. */
  64978. var Eventful = /*#__PURE__*/function () {
  64979. function Eventful() {
  64980. Eventful_classCallCheck(this, Eventful);
  64981. /**
  64982. * @member {Object} LevelRenderer.Eventful.prototype._handlers
  64983. * @description 事件处理对象(事件分发器)。
  64984. */
  64985. this._handlers = {};
  64986. this.CLASS_NAME = "SuperMap.LevelRenderer.Eventful";
  64987. }
  64988. /**
  64989. * @function {Object} LevelRenderer.Eventful.prototype.destroy
  64990. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  64991. */
  64992. Eventful_createClass(Eventful, [{
  64993. key: "destroy",
  64994. value: function destroy() {
  64995. this._handlers = null;
  64996. }
  64997. /**
  64998. * @function LevelRenderer.Eventful.prototype.one
  64999. * @description 单次触发绑定,dispatch后销毁。
  65000. * @param {string} event - 事件名。
  65001. * @param {boolean} handler - 响应函数。
  65002. * @param {Object} context - context。
  65003. * @returns {LevelRenderer.Eventful} this
  65004. */
  65005. }, {
  65006. key: "one",
  65007. value: function one(event, handler, context) {
  65008. var _h = this._handlers;
  65009. if (!handler || !event) {
  65010. return this;
  65011. }
  65012. if (!_h[event]) {
  65013. _h[event] = [];
  65014. }
  65015. _h[event].push({
  65016. h: handler,
  65017. one: true,
  65018. ctx: context || this
  65019. });
  65020. return this;
  65021. }
  65022. /**
  65023. * @function LevelRenderer.Eventful.prototype.bind
  65024. * @description 绑定事件。
  65025. * @param {string} event - 事件名。
  65026. * @param {boolean} handler - 响应函数。
  65027. * @param {Object} context - context。
  65028. * @returns {LevelRenderer.Eventful} this
  65029. */
  65030. }, {
  65031. key: "bind",
  65032. value: function bind(event, handler, context) {
  65033. var _h = this._handlers;
  65034. if (!handler || !event) {
  65035. return this;
  65036. }
  65037. if (!_h[event]) {
  65038. _h[event] = [];
  65039. }
  65040. _h[event].push({
  65041. h: handler,
  65042. one: false,
  65043. ctx: context || this
  65044. });
  65045. return this;
  65046. }
  65047. /**
  65048. * @function LevelRenderer.Eventful.prototype.unbind
  65049. * @description 解绑事件。
  65050. * @param {string} event - 事件名。
  65051. * @param {boolean} handler - 响应函数。
  65052. * @returns {LevelRenderer.Eventful} this
  65053. */
  65054. }, {
  65055. key: "unbind",
  65056. value: function unbind(event, handler) {
  65057. var _h = this._handlers;
  65058. if (!event) {
  65059. this._handlers = {};
  65060. return this;
  65061. }
  65062. if (handler) {
  65063. if (_h[event]) {
  65064. var newList = [];
  65065. for (var i = 0, l = _h[event].length; i < l; i++) {
  65066. if (_h[event][i]['h'] != handler) {
  65067. newList.push(_h[event][i]);
  65068. }
  65069. }
  65070. _h[event] = newList;
  65071. }
  65072. if (_h[event] && _h[event].length === 0) {
  65073. delete _h[event];
  65074. }
  65075. } else {
  65076. delete _h[event];
  65077. }
  65078. return this;
  65079. }
  65080. /**
  65081. * @function LevelRenderer.Eventful.prototype.dispatch
  65082. * @description 事件分发。
  65083. * @param {string} type - 事件类型。
  65084. * @returns {LevelRenderer.Eventful} this
  65085. */
  65086. }, {
  65087. key: "dispatch",
  65088. value: function dispatch(type) {
  65089. if (this._handlers[type]) {
  65090. var args = arguments;
  65091. var argLen = args.length;
  65092. if (argLen > 3) {
  65093. args = Array.prototype.slice.call(args, 1);
  65094. }
  65095. var _h = this._handlers[type];
  65096. var len = _h.length;
  65097. for (var i = 0; i < len;) {
  65098. // Optimize advise from backbone
  65099. switch (argLen) {
  65100. case 1:
  65101. _h[i]['h'].call(_h[i]['ctx']);
  65102. break;
  65103. case 2:
  65104. _h[i]['h'].call(_h[i]['ctx'], args[1]);
  65105. break;
  65106. case 3:
  65107. _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]);
  65108. break;
  65109. default:
  65110. // have more than 2 given arguments
  65111. _h[i]['h'].apply(_h[i]['ctx'], args);
  65112. break;
  65113. }
  65114. if (_h[i]['one']) {
  65115. _h.splice(i, 1);
  65116. len--;
  65117. } else {
  65118. i++;
  65119. }
  65120. }
  65121. }
  65122. return this;
  65123. }
  65124. /**
  65125. * @function LevelRenderer.Eventful.prototype.dispatchWithContext
  65126. * @description 带有context的事件分发,最后一个参数是事件回调的 context。
  65127. * @param {string} type - 事件类型。
  65128. * @returns {LevelRenderer.Eventful} this
  65129. */
  65130. }, {
  65131. key: "dispatchWithContext",
  65132. value: function dispatchWithContext(type) {
  65133. if (this._handlers[type]) {
  65134. var args = arguments;
  65135. var argLen = args.length;
  65136. if (argLen > 4) {
  65137. args = Array.prototype.slice.call(args, 1, args.length - 1);
  65138. }
  65139. var ctx = args[args.length - 1];
  65140. var _h = this._handlers[type];
  65141. var len = _h.length;
  65142. for (var i = 0; i < len;) {
  65143. // Optimize advise from backbone
  65144. switch (argLen) {
  65145. case 1:
  65146. _h[i]['h'].call(ctx);
  65147. break;
  65148. case 2:
  65149. _h[i]['h'].call(ctx, args[1]);
  65150. break;
  65151. case 3:
  65152. _h[i]['h'].call(ctx, args[1], args[2]);
  65153. break;
  65154. default:
  65155. // have more than 2 given arguments
  65156. _h[i]['h'].apply(ctx, args);
  65157. break;
  65158. }
  65159. if (_h[i]['one']) {
  65160. _h.splice(i, 1);
  65161. len--;
  65162. } else {
  65163. i++;
  65164. }
  65165. }
  65166. }
  65167. return this;
  65168. }
  65169. }]);
  65170. return Eventful;
  65171. }();
  65172. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Vector.js
  65173. function levelRenderer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65174. 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); } }
  65175. 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; }
  65176. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65177. * This program are made available under the terms of the Apache License, Version 2.0
  65178. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65179. /**
  65180. * @private
  65181. * @class LevelRenderer.Tool.Vector
  65182. * @category Visualization Theme
  65183. * @classdesc LevelRenderer 二维向量类
  65184. *
  65185. */
  65186. var levelRenderer_Vector_Vector = /*#__PURE__*/function () {
  65187. function Vector() {
  65188. levelRenderer_Vector_classCallCheck(this, Vector);
  65189. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  65190. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Vector";
  65191. }
  65192. /**
  65193. * @function LevelRenderer.Tool.Vector.prototype.create
  65194. * @description 创建一个向量。
  65195. *
  65196. * @param {number} x - x坐标
  65197. * @param {number} y - Y坐标
  65198. * @return {Vector2} 向量。
  65199. */
  65200. levelRenderer_Vector_createClass(Vector, [{
  65201. key: "create",
  65202. value: function create(x, y) {
  65203. var ArrayCtor = this.ArrayCtor;
  65204. var out = new ArrayCtor(2);
  65205. out[0] = x || 0;
  65206. out[1] = y || 0;
  65207. return out;
  65208. }
  65209. /**
  65210. * @function LevelRenderer.Tool.Vector.prototype.copy
  65211. * @description 复制一个向量。
  65212. *
  65213. * @param {Vector2} out - 基础向量。
  65214. * @param {Vector2} v - 向量。
  65215. * @return {Vector2} 克隆向量。
  65216. */
  65217. }, {
  65218. key: "copy",
  65219. value: function copy(out, v) {
  65220. out[0] = v[0];
  65221. out[1] = v[1];
  65222. return out;
  65223. }
  65224. /**
  65225. * @function LevelRenderer.Tool.Vector.prototype.set
  65226. * @description 设置向量的两个项。
  65227. *
  65228. * @param {Vector2} out - 基础向量。
  65229. * @param {number} a - 项 a。
  65230. * @param {number} b - 项 b。
  65231. * @return {Vector2} 结果。
  65232. */
  65233. }, {
  65234. key: "set",
  65235. value: function set(out, a, b) {
  65236. out[0] = a;
  65237. out[1] = b;
  65238. return out;
  65239. }
  65240. /**
  65241. * @function LevelRenderer.Tool.Vector.prototype.add
  65242. * @description 向量相加。
  65243. *
  65244. * @param {Vector2} out - 基础向量。
  65245. * @param {Vector2} v1 - 向量 v1。
  65246. * @param {Vector2} v2 - 向量 v2。
  65247. * @return {Vector2} 结果。
  65248. */
  65249. }, {
  65250. key: "add",
  65251. value: function add(out, v1, v2) {
  65252. out[0] = v1[0] + v2[0];
  65253. out[1] = v1[1] + v2[1];
  65254. return out;
  65255. }
  65256. /**
  65257. * @function LevelRenderer.Tool.Vector.prototype.scaleAndAdd
  65258. * @description 向量缩放后相加。
  65259. * @param {Vector2} out - 基础向量。
  65260. * @param {Vector2} v1 - 向量 v1。
  65261. * @param {Vector2} v2 - 向量 v2(缩放向量)。
  65262. * @param {number} a - 缩放参数。
  65263. * @return {Vector2} 结果。
  65264. */
  65265. }, {
  65266. key: "scaleAndAdd",
  65267. value: function scaleAndAdd(out, v1, v2, a) {
  65268. out[0] = v1[0] + v2[0] * a;
  65269. out[1] = v1[1] + v2[1] * a;
  65270. return out;
  65271. }
  65272. /**
  65273. * @function LevelRenderer.Tool.Vector.prototype.sub
  65274. * @description 向量相减。
  65275. * @param {Vector2} out - 基础向量。
  65276. * @param {Vector2} v1 - 向量 v1。
  65277. * @param {Vector2} v2 - 向量 v2。
  65278. * @return {Vector2} 结果。
  65279. */
  65280. }, {
  65281. key: "sub",
  65282. value: function sub(out, v1, v2) {
  65283. out[0] = v1[0] - v2[0];
  65284. out[1] = v1[1] - v2[1];
  65285. return out;
  65286. }
  65287. /**
  65288. * @function LevelRenderer.Tool.Vector.prototype.len
  65289. * @description 向量长度。
  65290. * @param {Vector2} v - 向量。
  65291. * @return {number} 向量长度。
  65292. */
  65293. }, {
  65294. key: "len",
  65295. value: function len(v) {
  65296. return Math.sqrt(this.lenSquare(v));
  65297. }
  65298. /**
  65299. * @function LevelRenderer.Tool.Vector.prototype.lenSquare
  65300. * @description 向量长度平方。
  65301. * @param {Vector2} v - 向量。
  65302. * @return {number} 向量长度平方。
  65303. */
  65304. }, {
  65305. key: "lenSquare",
  65306. value: function lenSquare(v) {
  65307. return v[0] * v[0] + v[1] * v[1];
  65308. }
  65309. /**
  65310. * @function LevelRenderer.Tool.Vector.prototype.mul
  65311. * @description 向量乘法。
  65312. * @param {Vector2} out - 基础向量。
  65313. * @param {Vector2} v1 - 向量 v1。
  65314. * @param {Vector2} v2 - 向量 v2。
  65315. * @return {Vector2} 结果。
  65316. */
  65317. }, {
  65318. key: "mul",
  65319. value: function mul(out, v1, v2) {
  65320. out[0] = v1[0] * v2[0];
  65321. out[1] = v1[1] * v2[1];
  65322. return out;
  65323. }
  65324. /**
  65325. * @function LevelRenderer.Tool.Vector.prototype.div
  65326. * @description 向量除法。
  65327. *
  65328. * @param {Vector2} out - 基础向量。
  65329. * @param {Vector2} v1 - 向量 v1。
  65330. * @param {Vector2} v2 - 向量 v2。
  65331. * @return {Vector2} 结果。
  65332. */
  65333. }, {
  65334. key: "div",
  65335. value: function div(out, v1, v2) {
  65336. out[0] = v1[0] / v2[0];
  65337. out[1] = v1[1] / v2[1];
  65338. return out;
  65339. }
  65340. /**
  65341. * @function LevelRenderer.Tool.Vector.prototype.dot
  65342. * @description 向量点乘。
  65343. *
  65344. * @param {Vector2} v1 - 向量 v1。
  65345. * @param {Vector2} v2 - 向量 v2。
  65346. * @return {number} 向量点乘。
  65347. */
  65348. }, {
  65349. key: "dot",
  65350. value: function dot(v1, v2) {
  65351. return v1[0] * v2[0] + v1[1] * v2[1];
  65352. }
  65353. /**
  65354. * @function LevelRenderer.Tool.Vector.prototype.scale
  65355. * @description 向量缩放。
  65356. *
  65357. * @param {Vector2} out - 基础向量。
  65358. * @param {Vector2} v - 向量v。
  65359. * @param {number} s -缩放参数。
  65360. * @return {Vector2} 结果。
  65361. */
  65362. }, {
  65363. key: "scale",
  65364. value: function scale(out, v, s) {
  65365. out[0] = v[0] * s;
  65366. out[1] = v[1] * s;
  65367. return out;
  65368. }
  65369. /**
  65370. * @function LevelRenderer.Tool.Vector.prototype.normalize
  65371. * @description 向量归一化。
  65372. *
  65373. * @param {Vector2} out - 基础向量。
  65374. * @param {Vector2} v - 向量 v。
  65375. * @return {Vector2} 结果。
  65376. */
  65377. }, {
  65378. key: "normalize",
  65379. value: function normalize(out, v) {
  65380. var d = this.len(v);
  65381. if (d === 0) {
  65382. out[0] = 0;
  65383. out[1] = 0;
  65384. } else {
  65385. out[0] = v[0] / d;
  65386. out[1] = v[1] / d;
  65387. }
  65388. return out;
  65389. }
  65390. /**
  65391. * @function LevelRenderer.Tool.Vector.prototype.distance
  65392. * @description 计算向量间距离。
  65393. *
  65394. * @param {Vector2} v1 - 向量 v1。
  65395. * @param {Vector2} v2 - 向量 v2。
  65396. * @return {number} 向量间距离。
  65397. */
  65398. }, {
  65399. key: "distance",
  65400. value: function distance(v1, v2) {
  65401. return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
  65402. }
  65403. /**
  65404. * @function LevelRenderer.Tool.Vector.prototype.distanceSquare
  65405. * @description 向量距离平方。
  65406. *
  65407. * @param {Vector2} v1 - 向量 v1。
  65408. * @param {Vector2} v2 - 向量 v2。
  65409. * @return {number} 向量距离平方。
  65410. */
  65411. }, {
  65412. key: "distanceSquare",
  65413. value: function distanceSquare(v1, v2) {
  65414. return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
  65415. }
  65416. /**
  65417. * @function LevelRenderer.Tool.Vector.prototype.negate
  65418. * @description 求负向量。
  65419. *
  65420. * @param {Vector2} out - 基础向量。
  65421. * @param {Vector2} v - 向量 v。
  65422. * @return {Vector2} 负向量。
  65423. */
  65424. }, {
  65425. key: "negate",
  65426. value: function negate(out, v) {
  65427. out[0] = -v[0];
  65428. out[1] = -v[1];
  65429. return out;
  65430. }
  65431. /**
  65432. * @function LevelRenderer.Tool.Vector.prototype.lerp
  65433. * @description 两点之间线性插值。
  65434. *
  65435. * @param {Vector2} out - 基础向量。
  65436. * @param {Vector2} v1 - 向量 v1。
  65437. * @param {Vector2} v2 - 向量 v2。
  65438. * @param {number} t
  65439. * @return {Vector2} 结果。
  65440. */
  65441. }, {
  65442. key: "lerp",
  65443. value: function lerp(out, v1, v2, t) {
  65444. out[0] = v1[0] + t * (v2[0] - v1[0]);
  65445. out[1] = v1[1] + t * (v2[1] - v1[1]);
  65446. return out;
  65447. }
  65448. /**
  65449. * @function LevelRenderer.Tool.Vector.prototype.applyTransform
  65450. * @description 矩阵左乘向量。
  65451. *
  65452. * @param {Vector2} out - 基础向量。
  65453. * @param {Vector2} v1 - 向量 v1。
  65454. * @param {Vector2} v2 - 向量 v2。
  65455. * @return {Vector2} 结果。
  65456. */
  65457. }, {
  65458. key: "applyTransform",
  65459. value: function applyTransform(out, v, m) {
  65460. var x = v[0];
  65461. var y = v[1];
  65462. out[0] = m[0] * x + m[2] * y + m[4];
  65463. out[1] = m[1] * x + m[3] * y + m[5];
  65464. return out;
  65465. }
  65466. /**
  65467. * @function LevelRenderer.Tool.Vector.prototype.min
  65468. * @description 求两个向量最小值。
  65469. * @param {Vector2} out - 基础向量。
  65470. * @param {Vector2} v1 - 向量 v1。
  65471. * @param {Vector2} v2 - 向量 v2。
  65472. * @return {Vector2} 结果。
  65473. */
  65474. }, {
  65475. key: "min",
  65476. value: function min(out, v1, v2) {
  65477. out[0] = Math.min(v1[0], v2[0]);
  65478. out[1] = Math.min(v1[1], v2[1]);
  65479. return out;
  65480. }
  65481. /**
  65482. * @function LevelRenderer.Tool.Vector.prototype.max
  65483. * @description 求两个向量最大值。
  65484. *
  65485. * @param {Vector2} out - 基础向量。
  65486. * @param {Vector2} v1 - 向量 v1。
  65487. * @param {Vector2} v2 - 向量 v2。
  65488. * @return {Vector2} 结果。
  65489. */
  65490. }, {
  65491. key: "max",
  65492. value: function max(out, v1, v2) {
  65493. out[0] = Math.max(v1[0], v2[0]);
  65494. out[1] = Math.max(v1[1], v2[1]);
  65495. return out;
  65496. }
  65497. /**
  65498. * @function LevelRenderer.Tool.Vector.prototype.length
  65499. * @description 向量长度。
  65500. *
  65501. * @param {Vector2} v - 向量。
  65502. * @return {number} 向量长度。
  65503. */
  65504. }, {
  65505. key: "length",
  65506. value: function length(v) {
  65507. return this.len(v);
  65508. }
  65509. /**
  65510. * @function LevelRenderer.Tool.Vector.prototype.lengthSquare
  65511. * @description 向量长度平方。
  65512. *
  65513. * @param {Vector2} v - 向量。
  65514. * @return {number} 向量长度平方。
  65515. */
  65516. }, {
  65517. key: "lengthSquare",
  65518. value: function lengthSquare(v) {
  65519. return this.lenSquare(v);
  65520. }
  65521. /**
  65522. * @function LevelRenderer.Tool.Vector.prototype.dist
  65523. * @description 计算向量间距离。
  65524. *
  65525. * @param {Vector2} v1 - 向量 v1。
  65526. * @param {Vector2} v2 - 向量 v2。
  65527. * @return {number} 向量间距离。
  65528. */
  65529. }, {
  65530. key: "dist",
  65531. value: function dist(v1, v2) {
  65532. return this.distance(v1, v2);
  65533. }
  65534. /**
  65535. * @function LevelRenderer.Tool.Vector.prototype.distSquare
  65536. * @description 向量距离平方。
  65537. *
  65538. * @param {Vector2} v1 - 向量 v1。
  65539. * @param {Vector2} v2 - 向量 v2。
  65540. * @return {number} 向量距离平方
  65541. */
  65542. }, {
  65543. key: "distSquare",
  65544. value: function distSquare(v1, v2) {
  65545. return this.distanceSquare(v1, v2);
  65546. }
  65547. }]);
  65548. return Vector;
  65549. }();
  65550. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Curve.js
  65551. function levelRenderer_Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65552. 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); } }
  65553. 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; }
  65554. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  65555. * This program are made available under the terms of the Apache License, Version 2.0
  65556. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65557. /**
  65558. * @class LevelRenderer.Tool.Curve
  65559. * @category Visualization Theme
  65560. * @classdesc LevelRenderer 工具-曲线
  65561. * @private
  65562. */
  65563. var Curve_Curve = /*#__PURE__*/function () {
  65564. function Curve() {
  65565. levelRenderer_Curve_classCallCheck(this, Curve);
  65566. /**
  65567. * @member {LevelRenderer.Tool.Vector} LevelRenderer.Tool.Curve.prototype.vector
  65568. * @description 矢量工具。
  65569. */
  65570. this.vector = new levelRenderer_Vector_Vector();
  65571. /**
  65572. * @member {number} LevelRenderer.Tool.Curve.prototype.EPSILON
  65573. * @description e。
  65574. */
  65575. this.EPSILON = 1e-4;
  65576. /**
  65577. * @member {number} LevelRenderer.Tool.Curve.prototype.THREE_SQRT
  65578. * @description 3 的平方根。
  65579. */
  65580. this.THREE_SQRT = Math.sqrt(3);
  65581. /**
  65582. * @member {number} LevelRenderer.Tool.Curve.prototype.ONE_THIRD
  65583. * @description 1/3。
  65584. */
  65585. this.ONE_THIRD = 1 / 3;
  65586. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Curve";
  65587. }
  65588. /*
  65589. * Method: evalCubicCoeff
  65590. *
  65591. * Parameters:
  65592. * a - {number} 值。
  65593. * b - {number} 值。
  65594. * c - {number} 值。
  65595. * d - {number} 值。
  65596. * t - {number} 值。
  65597. *
  65598. * Returns:
  65599. * {number}
  65600. */
  65601. /*
  65602. evalCubicCoeff: function(a, b, c, d, t){
  65603. return ((a * t + b) * t + c) * t + d;
  65604. },
  65605. */
  65606. /**
  65607. * @function LevelRenderer.Tool.Curve.prototype.isAroundZero
  65608. * @description 判断一个值是否趋于0,判断参考值:1e-4。
  65609. * @param {number} val - 值。
  65610. * @returns {boolean} 值是否趋于0。
  65611. */
  65612. levelRenderer_Curve_createClass(Curve, [{
  65613. key: "isAroundZero",
  65614. value: function isAroundZero(val) {
  65615. return val > -this.EPSILON && val < this.EPSILON;
  65616. }
  65617. /**
  65618. * @function LevelRenderer.Tool.Curve.prototype.isNotAroundZero
  65619. * @description 判断一个值是否不趋于0,判断参考值:1e-4。
  65620. * @param {number} val - 值。
  65621. * @returns {boolean} 值是否不趋于0。
  65622. */
  65623. }, {
  65624. key: "isNotAroundZero",
  65625. value: function isNotAroundZero(val) {
  65626. return val > this.EPSILON || val < -this.EPSILON;
  65627. }
  65628. /**
  65629. * @function LevelRenderer.Tool.Curve.prototype.cubicAt
  65630. * @description 计算三次贝塞尔值
  65631. * @param {number} p0 - 点p0。
  65632. * @param {number} p1 - 点p1。
  65633. * @param {number} p2 - 点p2。
  65634. * @param {number} p3 - 点p3。
  65635. * @param {number} t - t值。
  65636. * @returns {number} 三次贝塞尔值。
  65637. */
  65638. }, {
  65639. key: "cubicAt",
  65640. value: function cubicAt(p0, p1, p2, p3, t) {
  65641. var onet = 1 - t;
  65642. return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);
  65643. }
  65644. /**
  65645. * @function LevelRenderer.Tool.Curve.prototype.cubicDerivativeAt
  65646. * @description 计算三次贝塞尔导数值
  65647. * @param {number} p0 - 点p0。
  65648. * @param {number} p1 - 点p1。
  65649. * @param {number} p2 - 点p2。
  65650. * @param {number} p3 - 点p3。
  65651. * @param {number} t - t值。
  65652. * @returns {number} 三次贝塞尔导数值。
  65653. */
  65654. }, {
  65655. key: "cubicDerivativeAt",
  65656. value: function cubicDerivativeAt(p0, p1, p2, p3, t) {
  65657. var onet = 1 - t;
  65658. return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);
  65659. }
  65660. /**
  65661. * @function LevelRenderer.Tool.Curve.prototype.cubicRootAt
  65662. * @description 计算三次贝塞尔方程根,使用盛金公式
  65663. * @param {number} p0 - 点p0。
  65664. * @param {number} p1 - 点p1。
  65665. * @param {number} p2 - 点p2。
  65666. * @param {number} p3 - 点p3。
  65667. * @param {number} val - 值。
  65668. * @param {Array.<number>} roots - 有效根数目。
  65669. * @returns {number} 有效根。
  65670. */
  65671. }, {
  65672. key: "cubicRootAt",
  65673. value: function cubicRootAt(p0, p1, p2, p3, val, roots) {
  65674. // Evaluate roots of cubic functions
  65675. var a = p3 + 3 * (p1 - p2) - p0;
  65676. var b = 3 * (p2 - p1 * 2 + p0);
  65677. var c = 3 * (p1 - p0);
  65678. var d = p0 - val;
  65679. var A = b * b - 3 * a * c;
  65680. var B = b * c - 9 * a * d;
  65681. var C = c * c - 3 * b * d;
  65682. var n = 0;
  65683. if (this.isAroundZero(A) && this.isAroundZero(B)) {
  65684. if (this.isAroundZero(b)) {
  65685. roots[0] = 0;
  65686. } else {
  65687. var t1 = -c / b; //t1, t2, t3, b is not zero
  65688. if (t1 >= 0 && t1 <= 1) {
  65689. roots[n++] = t1;
  65690. }
  65691. }
  65692. } else {
  65693. var disc = B * B - 4 * A * C;
  65694. if (this.isAroundZero(disc)) {
  65695. var K = B / A;
  65696. var _t2 = -b / a + K; // t1, a is not zero
  65697. var t2 = -K / 2; // t2, t3
  65698. if (_t2 >= 0 && _t2 <= 1) {
  65699. roots[n++] = _t2;
  65700. }
  65701. if (t2 >= 0 && t2 <= 1) {
  65702. roots[n++] = t2;
  65703. }
  65704. } else if (disc > 0) {
  65705. var discSqrt = Math.sqrt(disc);
  65706. var Y1 = A * b + 1.5 * a * (-B + discSqrt);
  65707. var Y2 = A * b + 1.5 * a * (-B - discSqrt);
  65708. if (Y1 < 0) {
  65709. Y1 = -Math.pow(-Y1, this.ONE_THIRD);
  65710. } else {
  65711. Y1 = Math.pow(Y1, this.ONE_THIRD);
  65712. }
  65713. if (Y2 < 0) {
  65714. Y2 = -Math.pow(-Y2, this.ONE_THIRD);
  65715. } else {
  65716. Y2 = Math.pow(Y2, this.ONE_THIRD);
  65717. }
  65718. var _t3 = (-b - (Y1 + Y2)) / (3 * a);
  65719. if (_t3 >= 0 && _t3 <= 1) {
  65720. roots[n++] = _t3;
  65721. }
  65722. } else {
  65723. var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A));
  65724. var theta = Math.acos(T) / 3;
  65725. var ASqrt = Math.sqrt(A);
  65726. var tmp = Math.cos(theta);
  65727. var _t4 = (-b - 2 * ASqrt * tmp) / (3 * a);
  65728. var _t5 = (-b + ASqrt * (tmp + this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  65729. var t3 = (-b + ASqrt * (tmp - this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  65730. if (_t4 >= 0 && _t4 <= 1) {
  65731. roots[n++] = _t4;
  65732. }
  65733. if (_t5 >= 0 && _t5 <= 1) {
  65734. roots[n++] = _t5;
  65735. }
  65736. if (t3 >= 0 && t3 <= 1) {
  65737. roots[n++] = t3;
  65738. }
  65739. }
  65740. }
  65741. return n;
  65742. }
  65743. /**
  65744. * @function LevelRenderer.Tool.Curve.prototype.cubicRootAt
  65745. * @description 计算三次贝塞尔方程极限值的位置
  65746. * @param {number} p0 - 点p0。
  65747. * @param {number} p1 - 点p1。
  65748. * @param {number} p2 - 点p2。
  65749. * @param {number} p3 - 点p3。
  65750. * @param {Array.<number>} extrema - 值。
  65751. * @returns {number} 有效数目。
  65752. */
  65753. }, {
  65754. key: "cubicExtrema",
  65755. value: function cubicExtrema(p0, p1, p2, p3, extrema) {
  65756. var b = 6 * p2 - 12 * p1 + 6 * p0;
  65757. var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
  65758. var c = 3 * p1 - 3 * p0;
  65759. var n = 0;
  65760. if (this.isAroundZero(a)) {
  65761. if (this.isNotAroundZero(b)) {
  65762. var t1 = -c / b;
  65763. if (t1 >= 0 && t1 <= 1) {
  65764. extrema[n++] = t1;
  65765. }
  65766. }
  65767. } else {
  65768. var disc = b * b - 4 * a * c;
  65769. if (this.isAroundZero(disc)) {
  65770. extrema[0] = -b / (2 * a);
  65771. } else if (disc > 0) {
  65772. var discSqrt = Math.sqrt(disc);
  65773. var _t6 = (-b + discSqrt) / (2 * a);
  65774. var t2 = (-b - discSqrt) / (2 * a);
  65775. if (_t6 >= 0 && _t6 <= 1) {
  65776. extrema[n++] = _t6;
  65777. }
  65778. if (t2 >= 0 && t2 <= 1) {
  65779. extrema[n++] = t2;
  65780. }
  65781. }
  65782. }
  65783. return n;
  65784. }
  65785. /**
  65786. * @function LevelRenderer.Tool.Curve.prototype.cubicSubdivide
  65787. * @description 细分三次贝塞尔曲线
  65788. * @param {number} p0 - 点p0。
  65789. * @param {number} p1 - 点p1。
  65790. * @param {number} p2 - 点p2。
  65791. * @param {number} p3 - 点p3。
  65792. * @param {number} t - t值。
  65793. * @param {Array.<number>} out - 投射点。
  65794. * @returns {number} 投射点。
  65795. */
  65796. }, {
  65797. key: "cubicSubdivide",
  65798. value: function cubicSubdivide(p0, p1, p2, p3, t, out) {
  65799. var p01 = (p1 - p0) * t + p0;
  65800. var p12 = (p2 - p1) * t + p1;
  65801. var p23 = (p3 - p2) * t + p2;
  65802. var p012 = (p12 - p01) * t + p01;
  65803. var p123 = (p23 - p12) * t + p12;
  65804. var p0123 = (p123 - p012) * t + p012;
  65805. // Seg0
  65806. out[0] = p0;
  65807. out[1] = p01;
  65808. out[2] = p012;
  65809. out[3] = p0123;
  65810. // Seg1
  65811. out[4] = p0123;
  65812. out[5] = p123;
  65813. out[6] = p23;
  65814. out[7] = p3;
  65815. }
  65816. /**
  65817. * @function LevelRenderer.Tool.Curve.prototype.cubicProjectPoint
  65818. * @description 投射点到三次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  65819. * @param {number} x0 - 点p0横坐标。
  65820. * @param {number} y0 - 点p0纵坐标。
  65821. * @param {number} x1 - 点p1横坐标。
  65822. * @param {number} y1 - 点p1纵坐标。
  65823. * @param {number} x2 - 点p2横坐标。
  65824. * @param {number} y2 - 点p2纵坐标。
  65825. * @param {number} x3 - 点p3横坐标。
  65826. * @param {number} y3 - 点p3纵坐标。
  65827. * @param {number} x - 点p横坐标。
  65828. * @param {number} y - 点p纵坐标。
  65829. * @param {Array.<number>} out - 投射点。
  65830. * @returns {number} 投射点。
  65831. */
  65832. }, {
  65833. key: "cubicProjectPoint",
  65834. value: function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
  65835. // 临时变量
  65836. var _v0 = this.vector.create();
  65837. var _v1 = this.vector.create();
  65838. var _v2 = this.vector.create();
  65839. // var _v3 = vector.create();
  65840. // http://pomax.github.io/bezierinfo/#projections
  65841. var t;
  65842. var interval = 0.005;
  65843. var d = Infinity;
  65844. _v0[0] = x;
  65845. _v0[1] = y;
  65846. // 先粗略估计一下可能的最小距离的 t 值
  65847. // PENDING
  65848. for (var _t = 0; _t < 1; _t += 0.05) {
  65849. _v1[0] = this.cubicAt(x0, x1, x2, x3, _t);
  65850. _v1[1] = this.cubicAt(y0, y1, y2, y3, _t);
  65851. var d1 = this.vector.distSquare(_v0, _v1);
  65852. if (d1 < d) {
  65853. t = _t;
  65854. d = d1;
  65855. }
  65856. }
  65857. d = Infinity;
  65858. // At most 32 iteration
  65859. for (var i = 0; i < 32; i++) {
  65860. if (interval < this.EPSILON) {
  65861. break;
  65862. }
  65863. var prev = t - interval;
  65864. var next = t + interval;
  65865. // t - interval
  65866. _v1[0] = this.cubicAt(x0, x1, x2, x3, prev);
  65867. _v1[1] = this.cubicAt(y0, y1, y2, y3, prev);
  65868. var _d = this.vector.distSquare(_v1, _v0);
  65869. if (prev >= 0 && _d < d) {
  65870. t = prev;
  65871. d = _d;
  65872. } else {
  65873. // t + interval
  65874. _v2[0] = this.cubicAt(x0, x1, x2, x3, next);
  65875. _v2[1] = this.cubicAt(y0, y1, y2, y3, next);
  65876. var d2 = this.vector.distSquare(_v2, _v0);
  65877. if (next <= 1 && d2 < d) {
  65878. t = next;
  65879. d = d2;
  65880. } else {
  65881. interval *= 0.5;
  65882. }
  65883. }
  65884. }
  65885. // t
  65886. if (out) {
  65887. out[0] = this.cubicAt(x0, x1, x2, x3, t);
  65888. out[1] = this.cubicAt(y0, y1, y2, y3, t);
  65889. }
  65890. // console.log(interval, i);
  65891. return Math.sqrt(d);
  65892. }
  65893. /**
  65894. * @function LevelRenderer.Tool.Curve.prototype.quadraticAt
  65895. * @description 计算二次方贝塞尔值。
  65896. * @param {number} p0 - 点p0。
  65897. * @param {number} p1 - 点p1。
  65898. * @param {number} p2 - 点p2。
  65899. * @param {number} t - t值。
  65900. * @returns {number} 二次方贝塞尔值。
  65901. */
  65902. }, {
  65903. key: "quadraticAt",
  65904. value: function quadraticAt(p0, p1, p2, t) {
  65905. var onet = 1 - t;
  65906. return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
  65907. }
  65908. /**
  65909. * @function LevelRenderer.Tool.Curve.prototype.quadraticAt
  65910. * @description 计算二次方贝塞尔导数值。
  65911. * @param {number} p0 - 点p0。
  65912. * @param {number} p1 - 点p1。
  65913. * @param {number} p2 - 点p2。
  65914. * @param {number} t - t值。
  65915. * @returns {number} 二次方贝塞尔导数值。
  65916. */
  65917. }, {
  65918. key: "quadraticDerivativeAt",
  65919. value: function quadraticDerivativeAt(p0, p1, p2, t) {
  65920. return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
  65921. }
  65922. /**
  65923. * @function LevelRenderer.Tool.Curve.prototype.quadraticRootAt
  65924. * @description 计算二次方贝塞尔方程根
  65925. * @param {number} p0 - 点p0。
  65926. * @param {number} p1 - 点p1。
  65927. * @param {number} p2 - 点p2。
  65928. * @param {number} val - 值。
  65929. * @param {Array.<number>} roots - 有效根数目。
  65930. * @returns {number} 有效根数目。
  65931. */
  65932. }, {
  65933. key: "quadraticRootAt",
  65934. value: function quadraticRootAt(p0, p1, p2, val, roots) {
  65935. var a = p0 - 2 * p1 + p2;
  65936. var b = 2 * (p1 - p0);
  65937. var c = p0 - val;
  65938. var n = 0;
  65939. if (this.isAroundZero(a)) {
  65940. if (this.isNotAroundZero(b)) {
  65941. var t1 = -c / b;
  65942. if (t1 >= 0 && t1 <= 1) {
  65943. roots[n++] = t1;
  65944. }
  65945. }
  65946. } else {
  65947. var disc = b * b - 4 * a * c;
  65948. if (this.isAroundZero(disc)) {
  65949. var _t7 = -b / (2 * a);
  65950. if (_t7 >= 0 && _t7 <= 1) {
  65951. roots[n++] = _t7;
  65952. }
  65953. } else if (disc > 0) {
  65954. var discSqrt = Math.sqrt(disc);
  65955. var _t8 = (-b + discSqrt) / (2 * a);
  65956. var t2 = (-b - discSqrt) / (2 * a);
  65957. if (_t8 >= 0 && _t8 <= 1) {
  65958. roots[n++] = _t8;
  65959. }
  65960. if (t2 >= 0 && t2 <= 1) {
  65961. roots[n++] = t2;
  65962. }
  65963. }
  65964. }
  65965. return n;
  65966. }
  65967. /**
  65968. * @function LevelRenderer.Tool.Curve.prototype.quadraticExtremum
  65969. * @description 计算二次贝塞尔方程极限值
  65970. * @param {number} p0 - 点p0。
  65971. * @param {number} p1 - 点p1。
  65972. * @param {number} p2 - 点p2。
  65973. * @returns {number} 二次贝塞尔方程极限值。
  65974. */
  65975. }, {
  65976. key: "quadraticExtremum",
  65977. value: function quadraticExtremum(p0, p1, p2) {
  65978. var divider = p0 + p2 - 2 * p1;
  65979. if (divider === 0) {
  65980. // p1 is center of p0 and p2
  65981. return 0.5;
  65982. } else {
  65983. return (p0 - p1) / divider;
  65984. }
  65985. }
  65986. /**
  65987. * @function LevelRenderer.Tool.Curve.prototype.quadraticProjectPoint
  65988. * @description 投射点到二次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  65989. * @param {number} x0 - 点p0横坐标。
  65990. * @param {number} y0 - 点p0纵坐标。
  65991. * @param {number} x1 - 点p1横坐标。
  65992. * @param {number} y1 - 点p1纵坐标。
  65993. * @param {number} x2 - 点p2横坐标。
  65994. * @param {number} y2 - 点p2纵坐标。
  65995. * @param {number} x - 点p横坐标。
  65996. * @param {number} y - 点p纵坐标。
  65997. * @param {Array.<number>} out - 投射点。
  65998. * @returns {number} 投射距离。
  65999. */
  66000. }, {
  66001. key: "quadraticProjectPoint",
  66002. value: function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
  66003. // 临时变量
  66004. var _v0 = this.vector.create();
  66005. var _v1 = this.vector.create();
  66006. var _v2 = this.vector.create();
  66007. // http://pomax.github.io/bezierinfo/#projections
  66008. var t;
  66009. var interval = 0.005;
  66010. var d = Infinity;
  66011. _v0[0] = x;
  66012. _v0[1] = y;
  66013. // 先粗略估计一下可能的最小距离的 t 值
  66014. // PENDING
  66015. for (var _t = 0; _t < 1; _t += 0.05) {
  66016. _v1[0] = this.quadraticAt(x0, x1, x2, _t);
  66017. _v1[1] = this.quadraticAt(y0, y1, y2, _t);
  66018. var d1 = this.vector.distSquare(_v0, _v1);
  66019. if (d1 < d) {
  66020. t = _t;
  66021. d = d1;
  66022. }
  66023. }
  66024. d = Infinity;
  66025. // At most 32 iteration
  66026. for (var i = 0; i < 32; i++) {
  66027. if (interval < this.EPSILON) {
  66028. break;
  66029. }
  66030. var prev = t - interval;
  66031. var next = t + interval;
  66032. // t - interval
  66033. _v1[0] = this.quadraticAt(x0, x1, x2, prev);
  66034. _v1[1] = this.quadraticAt(y0, y1, y2, prev);
  66035. var _d2 = this.vector.distSquare(_v1, _v0);
  66036. if (prev >= 0 && _d2 < d) {
  66037. t = prev;
  66038. d = _d2;
  66039. } else {
  66040. // t + interval
  66041. _v2[0] = this.quadraticAt(x0, x1, x2, next);
  66042. _v2[1] = this.quadraticAt(y0, y1, y2, next);
  66043. var d2 = this.vector.distSquare(_v2, _v0);
  66044. if (next <= 1 && d2 < d) {
  66045. t = next;
  66046. d = d2;
  66047. } else {
  66048. interval *= 0.5;
  66049. }
  66050. }
  66051. }
  66052. // t
  66053. if (out) {
  66054. out[0] = this.quadraticAt(x0, x1, x2, t);
  66055. out[1] = this.quadraticAt(y0, y1, y2, t);
  66056. }
  66057. // console.log(interval, i);
  66058. return Math.sqrt(d);
  66059. }
  66060. }]);
  66061. return Curve;
  66062. }();
  66063. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Area.js
  66064. function Area_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66065. 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); } }
  66066. 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; }
  66067. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  66068. * This program are made available under the terms of the Apache License, Version 2.0
  66069. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66070. /**
  66071. * @class LevelRenderer.Tool.Area
  66072. * @category Visualization Theme
  66073. * @classdesc LevelRenderer 工具-图形范围判断
  66074. * @private
  66075. */
  66076. var Area = /*#__PURE__*/function () {
  66077. function Area() {
  66078. Area_classCallCheck(this, Area);
  66079. /**
  66080. * @member {LevelRenderer.Tool.Util} LevelRenderer.Tool.Areal.prototype.util
  66081. * @description 基础工具对象。
  66082. */
  66083. this.util = new levelRenderer_Util_Util();
  66084. /**
  66085. * @member {LevelRenderer.Tool.Curve} LevelRenderer.Tool.Areal.prototype.curve
  66086. * @description 曲线工具对象
  66087. */
  66088. this.curve = new Curve_Curve();
  66089. /**
  66090. * @member {Object} LevelRenderer.Tool.Areal.prototype._ctx
  66091. * @description Cavans2D 渲染上下文
  66092. */
  66093. this._ctx = null;
  66094. /**
  66095. * @member {Object} LevelRenderer.Tool.Areal.prototype._textWidthCache
  66096. * @description 文本宽度缓存
  66097. */
  66098. this._textWidthCache = {};
  66099. /**
  66100. * @member {Object} LevelRenderer.Tool.Areal.prototype._textHeightCache
  66101. * @description 文本高度缓存
  66102. */
  66103. this._textHeightCache = {};
  66104. /**
  66105. * @member {number} LevelRenderer.Tool.Areal.prototype._textWidthCacheCounter
  66106. * @description 文本宽度缓存数量
  66107. */
  66108. this._textWidthCacheCounter = 0;
  66109. /**
  66110. * @member {number} LevelRenderer.Tool.Areal.prototype._textHeightCacheCounter
  66111. * @description 文本高度缓存数量
  66112. */
  66113. this._textHeightCacheCounter = 0;
  66114. /**
  66115. * @member {number} LevelRenderer.Tool.Areal.prototype.TEXT_CACHE_MAX
  66116. * @description 文本最大缓存数量
  66117. */
  66118. this.TEXT_CACHE_MAX = 5000;
  66119. /**
  66120. * @member {number} LevelRenderer.Tool.Areal.prototype.PI2
  66121. * @description 2*PI 的值
  66122. */
  66123. this.PI2 = Math.PI * 2;
  66124. /**
  66125. * @member {Array.<number>} LevelRenderer.Tool.Areal.prototype.roots
  66126. * @description 临时数组
  66127. */
  66128. this.roots = [-1, -1, -1];
  66129. /**
  66130. * @member {Array.<number>} LevelRenderer.Tool.Areal.prototype.extrema
  66131. * @description 临时数组
  66132. */
  66133. this.extrema = [-1, -1];
  66134. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Area";
  66135. }
  66136. /**
  66137. * @function LevelRenderer.Tool.Areal.prototype.normalizeRadian
  66138. * @description 弧度标准化函数。
  66139. * @param {number} angle - 弧度值。
  66140. * @returns {number} 标准化后的弧度值。
  66141. */
  66142. Area_createClass(Area, [{
  66143. key: "normalizeRadian",
  66144. value: function normalizeRadian(angle) {
  66145. angle %= this.PI2;
  66146. if (angle < 0) {
  66147. angle += this.PI2;
  66148. }
  66149. return angle;
  66150. }
  66151. /**
  66152. * @function LevelRenderer.Tool.Areal.prototype.isInside
  66153. * @description 包含判断。
  66154. * @param {Object} shape - 图形。
  66155. * @param {number} area - 目标区域。
  66156. * @param {number} x - 横坐标。
  66157. * @param {number} y - 纵坐标。
  66158. * @returns {boolean} 图形是否包含鼠标位置。
  66159. */
  66160. }, {
  66161. key: "isInside",
  66162. value: function isInside(shape, area, x, y) {
  66163. if (!area || !shape) {
  66164. // 无参数或不支持类型
  66165. return false;
  66166. }
  66167. var zoneType = shape.type;
  66168. this._ctx = this._ctx || this.util.getContext();
  66169. // 未实现或不可用时则数学运算,主要是line,brokenLine,ring
  66170. var _mathReturn = this._mathMethod(shape, area, x, y);
  66171. if (typeof _mathReturn != 'undefined') {
  66172. return _mathReturn;
  66173. }
  66174. if (shape.buildPath && this._ctx.isPointInPath) {
  66175. return this._buildPathMethod(shape, this._ctx, area, x, y);
  66176. }
  66177. // 上面的方法都行不通时
  66178. switch (zoneType) {
  66179. case 'ellipse': // Todo,不精确
  66180. case 'smicellipse':
  66181. // Todo,不精确
  66182. return true;
  66183. // 旋轮曲线 不准确
  66184. case 'trochoid':
  66185. var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d;
  66186. return this.isInsideCircle(area, x, y, _r);
  66187. // 玫瑰线 不准确
  66188. case 'rose':
  66189. return this.isInsideCircle(area, x, y, area.maxr);
  66190. // 路径,椭圆,曲线等-----------------13
  66191. default:
  66192. return false;
  66193. // Todo,暂不支持
  66194. }
  66195. }
  66196. /**
  66197. * @function LevelRenderer.Tool.Areal.prototype._mathMethod
  66198. * @description 包含判断。用数学方法判断,三个方法中最快,但是支持的shape少。
  66199. * @param {Object} shape - 图形。
  66200. * @param {number} area - 目标区域。
  66201. * @param {number} x - 横坐标。
  66202. * @param {number} y - 纵坐标。
  66203. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  66204. */
  66205. }, {
  66206. key: "_mathMethod",
  66207. value: function _mathMethod(shape, area, x, y) {
  66208. var zoneType = shape.type;
  66209. // 在矩形内则部分图形需要进一步判断
  66210. switch (zoneType) {
  66211. // 贝塞尔曲线
  66212. case 'bezier-curve':
  66213. if (typeof area.cpX2 === 'undefined') {
  66214. return this.isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y);
  66215. }
  66216. return this.isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y);
  66217. // 线
  66218. case 'line':
  66219. return this.isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y);
  66220. // 折线
  66221. case 'broken-line':
  66222. return this.isInsideBrokenLine(area.pointList, area.lineWidth, x, y);
  66223. // 扩展折线
  66224. case 'smicbroken-line':
  66225. {
  66226. // SMIC-修改 - start
  66227. var icX = x;
  66228. var icY = y;
  66229. if (shape.refOriginalPosition) {
  66230. icX = x - shape.refOriginalPosition[0];
  66231. icY = y - shape.refOriginalPosition[1];
  66232. }
  66233. return this.isInsideBrokenLine(area.pointList, area.lineWidth, icX, icY);
  66234. }
  66235. //初始代码:
  66236. // return isInsideBrokenLine(
  66237. // area.pointList, area.lineWidth, x, y
  66238. // );
  66239. // SMIC-修改 - end
  66240. // 圆环
  66241. case 'ring':
  66242. return this.isInsideRing(area.x, area.y, area.r0, area.r, x, y);
  66243. case 'smicring':
  66244. {
  66245. var areaX = area.x;
  66246. var areaY = area.y;
  66247. if (shape.refOriginalPosition) {
  66248. areaX = area.x + shape.refOriginalPosition[0];
  66249. areaY = area.y + shape.refOriginalPosition[1];
  66250. }
  66251. return this.isInsideRing(areaX, areaY, area.r0, area.r, x, y);
  66252. }
  66253. // 圆形
  66254. case 'circle':
  66255. return this.isInsideCircle(area.x, area.y, area.r, x, y);
  66256. // 扩展-点
  66257. case 'smicpoint':
  66258. {
  66259. // SMIC-修改 - start
  66260. var _icX = x;
  66261. var _icY = y;
  66262. if (shape.refOriginalPosition) {
  66263. _icX = x - shape.refOriginalPosition[0];
  66264. _icY = y - shape.refOriginalPosition[1];
  66265. }
  66266. return this.isInsideCircle(area.x, area.y, area.r, _icX, _icY);
  66267. }
  66268. //初始代码:
  66269. // 无
  66270. // SMIC-修改 - end
  66271. // 扇形
  66272. case 'sector':
  66273. {
  66274. var startAngle = area.startAngle * Math.PI / 180;
  66275. var endAngle = area.endAngle * Math.PI / 180;
  66276. if (!area.clockWise) {
  66277. startAngle = -startAngle;
  66278. endAngle = -endAngle;
  66279. }
  66280. return this.isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y);
  66281. }
  66282. //初始代码:
  66283. // 无
  66284. // SMIC-增加 - end
  66285. // 扇形
  66286. case 'smicsector':
  66287. {
  66288. var _startAngle = area.startAngle * Math.PI / 180;
  66289. var _endAngle = area.endAngle * Math.PI / 180;
  66290. if (!area.clockWise) {
  66291. _startAngle = -_startAngle;
  66292. _endAngle = -_endAngle;
  66293. }
  66294. var _areaX = area.x;
  66295. var _areaY = area.y;
  66296. if (shape.refOriginalPosition) {
  66297. _areaX = area.x + shape.refOriginalPosition[0];
  66298. _areaY = area.y + shape.refOriginalPosition[1];
  66299. }
  66300. return this.isInsideSector(_areaX, _areaY, area.r0, area.r, _startAngle, _endAngle, !area.clockWise, x, y);
  66301. }
  66302. // 多边形
  66303. case 'path':
  66304. return this.isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y);
  66305. case 'polygon':
  66306. case 'star':
  66307. case 'smicstar':
  66308. case 'isogon':
  66309. case 'smicisogon':
  66310. return this.isInsidePolygon(area.pointList, x, y);
  66311. // 扩展多边形
  66312. case 'smicpolygon':
  66313. {
  66314. // SMIC-修改 - start
  66315. var _icX2 = x;
  66316. var _icY2 = y;
  66317. if (shape.refOriginalPosition) {
  66318. _icX2 = x - shape.refOriginalPosition[0];
  66319. _icY2 = y - shape.refOriginalPosition[1];
  66320. }
  66321. //岛洞面
  66322. if (shape.holePolygonPointLists && shape.holePolygonPointLists.length > 0) {
  66323. var isOnBase = this.isInsidePolygon(area.pointList, _icX2, _icY2);
  66324. // 遍历岛洞子面
  66325. var holePLS = shape.holePolygonPointLists;
  66326. var isOnHole = false;
  66327. for (var i = 0, holePLSen = holePLS.length; i < holePLSen; i++) {
  66328. var holePL = holePLS[i];
  66329. var isOnSubHole = this.isInsidePolygon(holePL, _icX2, _icY2);
  66330. if (isOnSubHole === true) {
  66331. isOnHole = true;
  66332. }
  66333. }
  66334. // 捕获判断
  66335. return isOnBase === true && isOnHole === false;
  66336. } else {
  66337. return this.isInsidePolygon(area.pointList, _icX2, _icY2);
  66338. }
  66339. }
  66340. // 初始代码:
  66341. // 无
  66342. // SMIC-修改 - end
  66343. // 文本
  66344. case 'text':
  66345. var rect = area.__rect || shape.getRect(area);
  66346. return this.isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y);
  66347. // 扩展文本
  66348. case 'smictext':
  66349. //用文本背景矩形判断
  66350. var textBg = shape.getTextBackground(area);
  66351. return this.isInsidePolygon(textBg, x, y);
  66352. //初始代码:
  66353. // 无
  66354. // SMIC-修改 - end
  66355. // 矩形
  66356. case 'rectangle':
  66357. case 'image':
  66358. // 图片
  66359. return this.isInsideRect(area.x, area.y, area.width, area.height, x, y);
  66360. case 'smicimage':
  66361. {
  66362. var _areaX2 = area.x;
  66363. var _areaY2 = area.y;
  66364. if (shape.refOriginalPosition) {
  66365. _areaX2 = area.x + shape.refOriginalPosition[0];
  66366. _areaY2 = area.y + shape.refOriginalPosition[1];
  66367. }
  66368. return this.isInsideRect(_areaX2, _areaY2, area.width, area.height, x, y);
  66369. }
  66370. //// 扩展矩形
  66371. //case 'smicpolygon':
  66372. // // SMIC-修改 - start
  66373. // var icX = x;
  66374. // var icY = y;
  66375. // if(shape.refOriginalPosition) {
  66376. // icX = x - shape.refOriginalPosition[0];
  66377. // icY = y - shape.refOriginalPosition[1];
  66378. // }
  66379. // return this.isInsideRect(
  66380. // area.x, area.y, area.width, area.height, icX, icY
  66381. // );
  66382. //初始代码:
  66383. // 无
  66384. // SMIC-修改 - end
  66385. }
  66386. }
  66387. /**
  66388. * @function LevelRenderer.Tool.Areal.prototype._buildPathMethod
  66389. * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。
  66390. * @param {Object} shape - 图形。
  66391. * @param {Object} context - 上下文。
  66392. * @param {number} area - 目标区域。
  66393. * @param {number} x - 横坐标。
  66394. * @param {number} y - 纵坐标。
  66395. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  66396. */
  66397. }, {
  66398. key: "_buildPathMethod",
  66399. value: function _buildPathMethod(shape, context, area, x, y) {
  66400. // 图形类实现路径创建了则用类的path
  66401. context.beginPath();
  66402. shape.buildPath(context, area);
  66403. context.closePath();
  66404. return context.isPointInPath(x, y);
  66405. }
  66406. /**
  66407. * @function LevelRenderer.Tool.Areal.prototype.isOutside
  66408. * @description 图形是否不包含鼠标位置。
  66409. * @param {Object} shape - 图形。
  66410. * @param {number} area - 目标区域。
  66411. * @param {number} x - 横坐标。
  66412. * @param {number} y - 纵坐标。
  66413. * @returns {boolean} 图形是否不包含鼠标位置, true表示坐标处在图形外。
  66414. */
  66415. }, {
  66416. key: "isOutside",
  66417. value: function isOutside(shape, area, x, y) {
  66418. return !this.isInside(shape, area, x, y);
  66419. }
  66420. /**
  66421. * @function LevelRenderer.Tool.Areal.prototype.isInsideLine
  66422. * @description 线段包含判断。
  66423. * @param {number} x0 - 线起始点横坐标。
  66424. * @param {number} y0 - 线起始点纵坐标。
  66425. * @param {number} x1 - 线终点横坐标。
  66426. * @param {number} y1 - 线终点纵坐标。
  66427. * @param {number} lineWidth - 线宽。
  66428. * @param {number} x - 鼠标位置横坐标。
  66429. * @param {number} y - 鼠标位置纵坐标。
  66430. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形内。
  66431. */
  66432. }, {
  66433. key: "isInsideLine",
  66434. value: function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) {
  66435. if (lineWidth === 0) {
  66436. return false;
  66437. }
  66438. var _l = Math.max(lineWidth, 5);
  66439. var _a = 0;
  66440. var _b = 0;
  66441. // Quick reject
  66442. 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) {
  66443. return false;
  66444. }
  66445. if (x0 !== x1) {
  66446. _a = (y0 - y1) / (x0 - x1);
  66447. _b = (x0 * y1 - x1 * y0) / (x0 - x1);
  66448. } else {
  66449. return Math.abs(x - x0) <= _l / 2;
  66450. }
  66451. var tmp = _a * x - y + _b;
  66452. var _s = tmp * tmp / (_a * _a + 1);
  66453. return _s <= _l / 2 * _l / 2;
  66454. }
  66455. /**
  66456. * @function LevelRenderer.Tool.Areal.prototype.isInsideCubicStroke
  66457. * @description 三次贝塞尔曲线描边包含判断。
  66458. * @param {number} x0 - 点1横坐标。
  66459. * @param {number} y0 - 点1纵坐标。
  66460. * @param {number} x1 - 点2横坐标。
  66461. * @param {number} y1 - 点2纵坐标。
  66462. * @param {number} x2 - 点3纵坐标。
  66463. * @param {number} y2 - 点3纵坐标。
  66464. * @param {number} lineWidth - 线宽。
  66465. * @param {number} x - 鼠标位置横坐标。
  66466. * @param {number} y - 鼠标位置纵坐标。
  66467. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66468. */
  66469. }, {
  66470. key: "isInsideCubicStroke",
  66471. value: function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
  66472. if (lineWidth === 0) {
  66473. return false;
  66474. }
  66475. var _l = Math.max(lineWidth, 5);
  66476. // Quick reject
  66477. 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) {
  66478. return false;
  66479. }
  66480. var d = this.curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);
  66481. return d <= _l / 2;
  66482. }
  66483. /**
  66484. * @function LevelRenderer.Tool.Areal.prototype.isInsideQuadraticStroke
  66485. * @description 二次贝塞尔曲线描边包含判断。
  66486. * @param {number} x0 - 点1横坐标。
  66487. * @param {number} y0 - 点1纵坐标。
  66488. * @param {number} x1 - 点2横坐标。
  66489. * @param {number} y1 - 点2纵坐标。
  66490. * @param {number} x2 - 点3纵坐标。
  66491. * @param {number} y2 - 点3纵坐标。
  66492. * @param {number} lineWidth - 线宽。
  66493. * @param {number} x - 鼠标位置横坐标。
  66494. * @param {number} y - 鼠标位置纵坐标。
  66495. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66496. */
  66497. }, {
  66498. key: "isInsideQuadraticStroke",
  66499. value: function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
  66500. if (lineWidth === 0) {
  66501. return false;
  66502. }
  66503. var _l = Math.max(lineWidth, 5);
  66504. // Quick reject
  66505. 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) {
  66506. return false;
  66507. }
  66508. var d = this.curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);
  66509. return d <= _l / 2;
  66510. }
  66511. /**
  66512. * @function LevelRenderer.Tool.Areal.prototype.isInsideArcStroke
  66513. * @description 圆弧描边包含判断。
  66514. * @param {number} cx - 圆心横坐标。
  66515. * @param {number} cy - 圆心纵坐标。
  66516. * @param {number} r - 圆半径。
  66517. * @param {number} startAngle - 起始角度。
  66518. * @param {number} endAngle - 终止角度。
  66519. * @param {number} anticlockwise - 顺时针还是逆时针。
  66520. * @param {number} lineWidth - 线宽。
  66521. * @param {number} x - 鼠标位置横坐标。
  66522. * @param {number} y - 鼠标位置纵坐标。
  66523. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66524. */
  66525. }, {
  66526. key: "isInsideArcStroke",
  66527. value: function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {
  66528. var PI2 = this.PI2;
  66529. if (lineWidth === 0) {
  66530. return false;
  66531. }
  66532. var _l = Math.max(lineWidth, 5);
  66533. x -= cx;
  66534. y -= cy;
  66535. var d = Math.sqrt(x * x + y * y);
  66536. if (d - _l > r || d + _l < r) {
  66537. return false;
  66538. }
  66539. if (Math.abs(startAngle - endAngle) >= PI2) {
  66540. // Is a circle
  66541. return true;
  66542. }
  66543. if (anticlockwise) {
  66544. var tmp = startAngle;
  66545. startAngle = this.normalizeRadian(endAngle);
  66546. endAngle = this.normalizeRadian(tmp);
  66547. } else {
  66548. startAngle = this.normalizeRadian(startAngle);
  66549. endAngle = this.normalizeRadian(endAngle);
  66550. }
  66551. if (startAngle > endAngle) {
  66552. endAngle += PI2;
  66553. }
  66554. var angle = Math.atan2(y, x);
  66555. if (angle < 0) {
  66556. angle += PI2;
  66557. }
  66558. return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;
  66559. }
  66560. /**
  66561. * @function LevelRenderer.Tool.Areal.prototype.isInsideBrokenLine
  66562. * @description 图形 BrokenLine 是否包含鼠标位置, true表示坐标处在图形内。
  66563. * @param {Array} points - 曲线点对象。
  66564. * @param {number} lineWidth - 线宽。
  66565. * @param {number} x - 鼠标位置横坐标。
  66566. * @param {number} y - 鼠标位置纵坐标。
  66567. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66568. */
  66569. }, {
  66570. key: "isInsideBrokenLine",
  66571. value: function isInsideBrokenLine(points, lineWidth, x, y) {
  66572. var _lineWidth = Math.max(lineWidth, 10);
  66573. for (var i = 0, l = points.length - 1; i < l; i++) {
  66574. var x0 = points[i][0];
  66575. var y0 = points[i][1];
  66576. var x1 = points[i + 1][0];
  66577. var y1 = points[i + 1][1];
  66578. if (this.isInsideLine(x0, y0, x1, y1, _lineWidth, x, y)) {
  66579. return true;
  66580. }
  66581. }
  66582. return false;
  66583. }
  66584. /**
  66585. * @function LevelRenderer.Tool.Areal.prototype.isInsideRing
  66586. * @description 图形 Ring 是否包含鼠标位置, true表示坐标处在图形内。
  66587. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66588. */
  66589. }, {
  66590. key: "isInsideRing",
  66591. value: function isInsideRing(cx, cy, r0, r, x, y) {
  66592. var d = (x - cx) * (x - cx) + (y - cy) * (y - cy);
  66593. return d < r * r && d > r0 * r0;
  66594. }
  66595. /**
  66596. * @function LevelRenderer.Tool.Areal.prototype.isInsideRect
  66597. * @description 图形 Rect 是否包含鼠标位置, true表示坐标处在图形内。
  66598. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66599. */
  66600. }, {
  66601. key: "isInsideRect",
  66602. value: function isInsideRect(x0, y0, width, height, x, y) {
  66603. return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height;
  66604. }
  66605. /**
  66606. * @function LevelRenderer.Tool.Areal.prototype.isInsideCircle
  66607. * @description 图形 Circle 是否包含鼠标位置, true表示坐标处在图形内。
  66608. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66609. */
  66610. }, {
  66611. key: "isInsideCircle",
  66612. value: function isInsideCircle(x0, y0, r, x, y) {
  66613. return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r;
  66614. }
  66615. /**
  66616. * @function LevelRenderer.Tool.Areal.prototype.isInsideSector
  66617. * @description 图形 Sector 是否包含鼠标位置, true表示坐标处在图形内。
  66618. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66619. */
  66620. }, {
  66621. key: "isInsideSector",
  66622. value: function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) {
  66623. return this.isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y);
  66624. }
  66625. /**
  66626. * @function LevelRenderer.Tool.Areal.prototype.isInsidePolygon
  66627. * @description 图形 Polygon 是否包含鼠标位置, true表示坐标处在图形内。与 canvas 一样采用 non-zero winding rule
  66628. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  66629. */
  66630. }, {
  66631. key: "isInsidePolygon",
  66632. value: function isInsidePolygon(points, x, y) {
  66633. var N = points.length;
  66634. var w = 0;
  66635. for (var i = 0, j = N - 1; i < N; i++) {
  66636. var x0 = points[j][0];
  66637. var y0 = points[j][1];
  66638. var x1 = points[i][0];
  66639. var y1 = points[i][1];
  66640. w += this.windingLine(x0, y0, x1, y1, x, y);
  66641. j = i;
  66642. }
  66643. return w !== 0;
  66644. }
  66645. /**
  66646. * @function LevelRenderer.Tool.Areal.prototype.windingLine
  66647. */
  66648. }, {
  66649. key: "windingLine",
  66650. value: function windingLine(x0, y0, x1, y1, x, y) {
  66651. if (y > y0 && y > y1 || y < y0 && y < y1) {
  66652. return 0;
  66653. }
  66654. if (y1 == y0) {
  66655. return 0;
  66656. }
  66657. var dir = y1 < y0 ? 1 : -1;
  66658. var t = (y - y0) / (y1 - y0);
  66659. var x_ = t * (x1 - x0) + x0;
  66660. return x_ > x ? dir : 0;
  66661. }
  66662. /**
  66663. * @function LevelRenderer.Tool.Areal.prototype.swapExtrema
  66664. */
  66665. }, {
  66666. key: "swapExtrema",
  66667. value: function swapExtrema() {
  66668. var tmp = this.extrema[0];
  66669. this.extrema[0] = this.extrema[1];
  66670. this.extrema[1] = tmp;
  66671. }
  66672. /**
  66673. * @function LevelRenderer.Tool.Areal.prototype.windingCubic
  66674. */
  66675. }, {
  66676. key: "windingCubic",
  66677. value: function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
  66678. var curve = this.curve;
  66679. var roots = this.roots;
  66680. var extrema = this.extrema;
  66681. // Quick reject
  66682. if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {
  66683. return 0;
  66684. }
  66685. var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);
  66686. if (nRoots === 0) {
  66687. return 0;
  66688. } else {
  66689. var w = 0;
  66690. var nExtrema = -1;
  66691. var y0_, y1_;
  66692. for (var i = 0; i < nRoots; i++) {
  66693. var t = roots[i];
  66694. var x_ = curve.cubicAt(x0, x1, x2, x3, t);
  66695. if (x_ < x) {
  66696. // Quick reject
  66697. continue;
  66698. }
  66699. if (nExtrema < 0) {
  66700. nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);
  66701. if (extrema[1] < extrema[0] && nExtrema > 1) {
  66702. this.swapExtrema();
  66703. }
  66704. y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);
  66705. if (nExtrema > 1) {
  66706. y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);
  66707. }
  66708. }
  66709. if (nExtrema == 2) {
  66710. // 分成三段单调函数
  66711. if (t < extrema[0]) {
  66712. w += y0_ < y0 ? 1 : -1;
  66713. } else if (t < extrema[1]) {
  66714. w += y1_ < y0_ ? 1 : -1;
  66715. } else {
  66716. w += y3 < y1_ ? 1 : -1;
  66717. }
  66718. } else {
  66719. // 分成两段单调函数
  66720. if (t < extrema[0]) {
  66721. w += y0_ < y0 ? 1 : -1;
  66722. } else {
  66723. w += y3 < y0_ ? 1 : -1;
  66724. }
  66725. }
  66726. }
  66727. return w;
  66728. }
  66729. }
  66730. /**
  66731. * @function LevelRenderer.Tool.Areal.prototype.windingQuadratic
  66732. */
  66733. }, {
  66734. key: "windingQuadratic",
  66735. value: function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
  66736. var curve = this.curve;
  66737. var roots = this.roots;
  66738. // Quick reject
  66739. if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {
  66740. return 0;
  66741. }
  66742. var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);
  66743. if (nRoots === 0) {
  66744. return 0;
  66745. } else {
  66746. var t = curve.quadraticExtremum(y0, y1, y2);
  66747. if (t >= 0 && t <= 1) {
  66748. var w = 0;
  66749. var y_ = curve.quadraticAt(y0, y1, y2, t);
  66750. for (var i = 0; i < nRoots; i++) {
  66751. var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);
  66752. if (x_ > x) {
  66753. continue;
  66754. }
  66755. if (roots[i] < t) {
  66756. w += y_ < y0 ? 1 : -1;
  66757. } else {
  66758. w += y2 < y_ ? 1 : -1;
  66759. }
  66760. }
  66761. return w;
  66762. } else {
  66763. var _x_ = curve.quadraticAt(x0, x1, x2, roots[0]);
  66764. if (_x_ > x) {
  66765. return 0;
  66766. }
  66767. return y2 < y0 ? 1 : -1;
  66768. }
  66769. }
  66770. }
  66771. /**
  66772. * @function LevelRenderer.Tool.Areal.prototype.windingArc
  66773. * // TODO Arc 旋转
  66774. */
  66775. }, {
  66776. key: "windingArc",
  66777. value: function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
  66778. var roots = this.roots;
  66779. var PI2 = this.PI2;
  66780. y -= cy;
  66781. if (y > r || y < -r) {
  66782. return 0;
  66783. }
  66784. var tmp = Math.sqrt(r * r - y * y);
  66785. roots[0] = -tmp;
  66786. roots[1] = tmp;
  66787. if (Math.abs(startAngle - endAngle) >= PI2) {
  66788. // Is a circle
  66789. startAngle = 0;
  66790. endAngle = PI2;
  66791. var dir = anticlockwise ? 1 : -1;
  66792. if (x >= roots[0] + cx && x <= roots[1] + cx) {
  66793. return dir;
  66794. } else {
  66795. return 0;
  66796. }
  66797. }
  66798. if (anticlockwise) {
  66799. var _tmp = startAngle;
  66800. startAngle = this.normalizeRadian(endAngle);
  66801. endAngle = this.normalizeRadian(_tmp);
  66802. } else {
  66803. startAngle = this.normalizeRadian(startAngle);
  66804. endAngle = this.normalizeRadian(endAngle);
  66805. }
  66806. if (startAngle > endAngle) {
  66807. endAngle += PI2;
  66808. }
  66809. var w = 0;
  66810. for (var i = 0; i < 2; i++) {
  66811. var x_ = roots[i];
  66812. if (x_ + cx > x) {
  66813. var angle = Math.atan2(y, x_);
  66814. var _dir = anticlockwise ? 1 : -1;
  66815. if (angle < 0) {
  66816. angle = PI2 + angle;
  66817. }
  66818. if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {
  66819. if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {
  66820. _dir = -_dir;
  66821. }
  66822. w += _dir;
  66823. }
  66824. }
  66825. }
  66826. return w;
  66827. }
  66828. /**
  66829. * @function LevelRenderer.Tool.Areal.prototype.isInsidePath
  66830. * @description 与 canvas 一样采用 non-zero winding rule
  66831. */
  66832. }, {
  66833. key: "isInsidePath",
  66834. value: function isInsidePath(pathArray, lineWidth, brushType, x, y) {
  66835. var w = 0;
  66836. var xi = 0;
  66837. var yi = 0;
  66838. var x0 = 0;
  66839. var y0 = 0;
  66840. var beginSubpath = true;
  66841. var firstCmd = true;
  66842. brushType = brushType || 'fill';
  66843. var hasStroke = brushType === 'stroke' || brushType === 'both';
  66844. var hasFill = brushType === 'fill' || brushType === 'both';
  66845. // var roots = [-1, -1, -1];
  66846. for (var i = 0; i < pathArray.length; i++) {
  66847. var seg = pathArray[i];
  66848. var p = seg.points;
  66849. // Begin a new subpath
  66850. if (beginSubpath || seg.command === 'M') {
  66851. if (i > 0) {
  66852. // Close previous subpath
  66853. if (hasFill) {
  66854. w += this.windingLine(xi, yi, x0, y0, x, y);
  66855. }
  66856. if (w !== 0) {
  66857. return true;
  66858. }
  66859. }
  66860. x0 = p[p.length - 2];
  66861. y0 = p[p.length - 1];
  66862. beginSubpath = false;
  66863. if (firstCmd && seg.command !== 'A') {
  66864. // 如果第一个命令不是M, 是lineTo, bezierCurveTo
  66865. // 等绘制命令的话,是会从该绘制的起点开始算的
  66866. // Arc 会在之后做单独处理所以这里忽略
  66867. firstCmd = false;
  66868. xi = x0;
  66869. yi = y0;
  66870. }
  66871. }
  66872. switch (seg.command) {
  66873. case 'M':
  66874. xi = p[0];
  66875. yi = p[1];
  66876. break;
  66877. case 'L':
  66878. if (hasStroke) {
  66879. if (this.isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) {
  66880. return true;
  66881. }
  66882. }
  66883. if (hasFill) {
  66884. w += this.windingLine(xi, yi, p[0], p[1], x, y);
  66885. }
  66886. xi = p[0];
  66887. yi = p[1];
  66888. break;
  66889. case 'C':
  66890. if (hasStroke) {
  66891. if (this.isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) {
  66892. return true;
  66893. }
  66894. }
  66895. if (hasFill) {
  66896. w += this.windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y);
  66897. }
  66898. xi = p[4];
  66899. yi = p[5];
  66900. break;
  66901. case 'Q':
  66902. if (hasStroke) {
  66903. if (this.isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) {
  66904. return true;
  66905. }
  66906. }
  66907. if (hasFill) {
  66908. w += this.windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y);
  66909. }
  66910. xi = p[2];
  66911. yi = p[3];
  66912. break;
  66913. case 'A':
  66914. // TODO Arc 旋转
  66915. // TODO Arc 判断的开销比较大
  66916. var cx = p[0];
  66917. var cy = p[1];
  66918. var rx = p[2];
  66919. var ry = p[3];
  66920. var theta = p[4];
  66921. var dTheta = p[5];
  66922. var x1 = Math.cos(theta) * rx + cx;
  66923. var y1 = Math.sin(theta) * ry + cy;
  66924. // 不是直接使用 arc 命令
  66925. if (!firstCmd) {
  66926. w += this.windingLine(xi, yi, x1, y1);
  66927. } else {
  66928. firstCmd = false;
  66929. // 第一个命令起点还未定义
  66930. x0 = x1;
  66931. y0 = y1;
  66932. }
  66933. // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放
  66934. var _x = (x - cx) * ry / rx + cx;
  66935. if (hasStroke) {
  66936. if (this.isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) {
  66937. return true;
  66938. }
  66939. }
  66940. if (hasFill) {
  66941. w += this.windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y);
  66942. }
  66943. xi = Math.cos(theta + dTheta) * rx + cx;
  66944. yi = Math.sin(theta + dTheta) * ry + cy;
  66945. break;
  66946. case 'z':
  66947. if (hasStroke) {
  66948. if (this.isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) {
  66949. return true;
  66950. }
  66951. }
  66952. beginSubpath = true;
  66953. break;
  66954. }
  66955. }
  66956. if (hasFill) {
  66957. w += this.windingLine(xi, yi, x0, y0, x, y);
  66958. }
  66959. return w !== 0;
  66960. }
  66961. /**
  66962. * @function LevelRenderer.Tool.Areal.prototype.getTextWidth
  66963. * @description 测算多行文本宽度
  66964. */
  66965. }, {
  66966. key: "getTextWidth",
  66967. value: function getTextWidth(text, textFont) {
  66968. var key = text + ':' + textFont;
  66969. if (this._textWidthCache[key]) {
  66970. return this._textWidthCache[key];
  66971. }
  66972. this._ctx = this._ctx || this.util.getContext();
  66973. this._ctx.save();
  66974. if (textFont) {
  66975. this._ctx.font = textFont;
  66976. }
  66977. text = (text + '').split('\n');
  66978. var width = 0;
  66979. for (var i = 0, l = text.length; i < l; i++) {
  66980. width = Math.max(this._ctx.measureText(text[i]).width, width);
  66981. }
  66982. this._ctx.restore();
  66983. this._textWidthCache[key] = width;
  66984. if (++this._textWidthCacheCounter > this.TEXT_CACHE_MAX) {
  66985. // 内存释放
  66986. this._textWidthCacheCounter = 0;
  66987. this._textWidthCache = {};
  66988. }
  66989. return width;
  66990. }
  66991. /**
  66992. * @function LevelRenderer.Tool.Areal.prototype.getTextHeight
  66993. * @description 测算多行文本高度
  66994. */
  66995. }, {
  66996. key: "getTextHeight",
  66997. value: function getTextHeight(text, textFont) {
  66998. var key = text + ':' + textFont;
  66999. if (this._textHeightCache[key]) {
  67000. return this._textHeightCache[key];
  67001. }
  67002. this._ctx = this._ctx || this.util.getContext();
  67003. this._ctx.save();
  67004. if (textFont) {
  67005. this._ctx.font = textFont;
  67006. }
  67007. text = (text + '').split('\n');
  67008. // 比较粗暴
  67009. //var height = (this._ctx.measureText('国').width + 2) * text.length; //打包不支持中文,替换掉
  67010. var height = (this._ctx.measureText('ZH').width + 2) * text.length;
  67011. this._ctx.restore();
  67012. this._textHeightCache[key] = height;
  67013. if (++this._textHeightCacheCounter > this.TEXT_CACHE_MAX) {
  67014. // 内存释放
  67015. this._textHeightCacheCounter = 0;
  67016. this._textHeightCache = {};
  67017. }
  67018. return height;
  67019. }
  67020. }]);
  67021. return Area;
  67022. }();
  67023. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/ComputeBoundingBox.js
  67024. function ComputeBoundingBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67025. 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); } }
  67026. 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; }
  67027. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67028. * This program are made available under the terms of the Apache License, Version 2.0
  67029. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67030. /**
  67031. * @class LevelRenderer.Tool.ComputeBoundingBox
  67032. * @category Visualization Theme
  67033. * @classdesc LevelRenderer 工具-图形 Bounds 计算
  67034. * @private
  67035. */
  67036. var ComputeBoundingBox = /*#__PURE__*/function () {
  67037. function ComputeBoundingBox() {
  67038. ComputeBoundingBox_classCallCheck(this, ComputeBoundingBox);
  67039. if (arguments.length === 3) {
  67040. this.computeBoundingBox(arguments);
  67041. }
  67042. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.ComputeBoundingBox";
  67043. }
  67044. /**
  67045. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.computeBoundingBox
  67046. * @description 从顶点数组中计算出最小包围盒,写入'min'和'max'中。
  67047. * @param {Array.<Object>} points - 顶点数组。
  67048. * @param {Array.<number>} min - 最小
  67049. * @param {Array.<number>} max - 最大
  67050. */
  67051. ComputeBoundingBox_createClass(ComputeBoundingBox, [{
  67052. key: "computeBoundingBox",
  67053. value: function computeBoundingBox(points, min, max) {
  67054. if (points.length === 0) {
  67055. return;
  67056. }
  67057. var left = points[0][0];
  67058. var right = points[0][0];
  67059. var top = points[0][1];
  67060. var bottom = points[0][1];
  67061. for (var i = 1; i < points.length; i++) {
  67062. var p = points[i];
  67063. if (p[0] < left) {
  67064. left = p[0];
  67065. }
  67066. if (p[0] > right) {
  67067. right = p[0];
  67068. }
  67069. if (p[1] < top) {
  67070. top = p[1];
  67071. }
  67072. if (p[1] > bottom) {
  67073. bottom = p[1];
  67074. }
  67075. }
  67076. min[0] = left;
  67077. min[1] = top;
  67078. max[0] = right;
  67079. max[1] = bottom;
  67080. }
  67081. /**
  67082. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.cubeBezier
  67083. * @description 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入'min'和'max'中。原:computeCubeBezierBoundingBox。
  67084. * @param {Array.<number>} p0 - 三阶贝塞尔曲线p0点
  67085. * @param {Array.<number>} p1 - 三阶贝塞尔曲线p1点
  67086. * @param {Array.<number>} p2 - 三阶贝塞尔曲线p2点
  67087. * @param {Array.<number>} p3 - 三阶贝塞尔曲线p3点
  67088. * @param {Array.<number>} min - 最小
  67089. * @param {Array.<number>} max - 最大
  67090. */
  67091. }, {
  67092. key: "cubeBezier",
  67093. value: function cubeBezier(p0, p1, p2, p3, min, max) {
  67094. var curve = new Curve_Curve();
  67095. var xDim = [];
  67096. curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim);
  67097. for (var i = 0; i < xDim.length; i++) {
  67098. xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]);
  67099. }
  67100. var yDim = [];
  67101. curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim);
  67102. for (var _i2 = 0; _i2 < yDim.length; _i2++) {
  67103. yDim[_i2] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[_i2]);
  67104. }
  67105. xDim.push(p0[0], p3[0]);
  67106. yDim.push(p0[1], p3[1]);
  67107. var left = Math.min.apply(null, xDim);
  67108. var right = Math.max.apply(null, xDim);
  67109. var top = Math.min.apply(null, yDim);
  67110. var bottom = Math.max.apply(null, yDim);
  67111. min[0] = left;
  67112. min[1] = top;
  67113. max[0] = right;
  67114. max[1] = bottom;
  67115. }
  67116. /**
  67117. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.quadraticBezier
  67118. * @description 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入'min'和'max'中。原:computeQuadraticBezierBoundingBox。
  67119. * @param {Array.<number>} p0 - 二阶贝塞尔曲线p0点
  67120. * @param {Array.<number>} p1 - 二阶贝塞尔曲线p1点
  67121. * @param {Array.<number>} p2 - 二阶贝塞尔曲线p2点
  67122. * @param {Array.<number>} min - 最小
  67123. * @param {Array.<number>} max - 最大
  67124. */
  67125. }, {
  67126. key: "quadraticBezier",
  67127. value: function quadraticBezier(p0, p1, p2, min, max) {
  67128. var curve = new Curve_Curve();
  67129. // Find extremities, where derivative in x dim or y dim is zero
  67130. var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]);
  67131. var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]);
  67132. t1 = Math.max(Math.min(t1, 1), 0);
  67133. t2 = Math.max(Math.min(t2, 1), 0);
  67134. var ct1 = 1 - t1;
  67135. var ct2 = 1 - t2;
  67136. var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0];
  67137. var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1];
  67138. var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0];
  67139. var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1];
  67140. min[0] = Math.min(p0[0], p2[0], x1, x2);
  67141. min[1] = Math.min(p0[1], p2[1], y1, y2);
  67142. max[0] = Math.max(p0[0], p2[0], x1, x2);
  67143. max[1] = Math.max(p0[1], p2[1], y1, y2);
  67144. }
  67145. /**
  67146. * @function LevelRenderer.Tool.ComputeBoundingBox.prototype.arc
  67147. * @description 从圆弧中计算出最小包围盒,写入'min'和'max'中。原:computeArcBoundingBox。
  67148. * @param {number} x - 圆弧中心点 x
  67149. * @param {number} y - 圆弧中心点 y
  67150. * @param {number} r - 圆弧半径
  67151. * @param {number} startAngle - 圆弧开始角度
  67152. * @param {number} endAngle - 圆弧结束角度
  67153. * @param {number} anticlockwise - 是否是顺时针
  67154. * @param {number} min - 最小
  67155. * @param {number} max - 最大
  67156. */
  67157. }, {
  67158. key: "arc",
  67159. value: function arc(x, y, r, startAngle, endAngle, anticlockwise, min, max) {
  67160. var vec2 = new levelRenderer_Vector_Vector();
  67161. var start = vec2.create();
  67162. var end = vec2.create();
  67163. var extremity = vec2.create();
  67164. start[0] = Math.cos(startAngle) * r + x;
  67165. start[1] = Math.sin(startAngle) * r + y;
  67166. end[0] = Math.cos(endAngle) * r + x;
  67167. end[1] = Math.sin(endAngle) * r + y;
  67168. vec2.min(min, start, end);
  67169. vec2.max(max, start, end);
  67170. // Thresh to [0, Math.PI * 2]
  67171. startAngle = startAngle % (Math.PI * 2);
  67172. if (startAngle < 0) {
  67173. startAngle = startAngle + Math.PI * 2;
  67174. }
  67175. endAngle = endAngle % (Math.PI * 2);
  67176. if (endAngle < 0) {
  67177. endAngle = endAngle + Math.PI * 2;
  67178. }
  67179. if (startAngle > endAngle && !anticlockwise) {
  67180. endAngle += Math.PI * 2;
  67181. } else if (startAngle < endAngle && anticlockwise) {
  67182. startAngle += Math.PI * 2;
  67183. }
  67184. if (anticlockwise) {
  67185. var tmp = endAngle;
  67186. endAngle = startAngle;
  67187. startAngle = tmp;
  67188. }
  67189. // var number = 0;
  67190. // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;
  67191. for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {
  67192. if (angle > startAngle) {
  67193. extremity[0] = Math.cos(angle) * r + x;
  67194. extremity[1] = Math.sin(angle) * r + y;
  67195. vec2.min(min, extremity, min);
  67196. vec2.max(max, extremity, max);
  67197. }
  67198. }
  67199. }
  67200. }]);
  67201. return ComputeBoundingBox;
  67202. }();
  67203. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Env.js
  67204. function Env_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67205. 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); } }
  67206. 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; }
  67207. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67208. * This program are made available under the terms of the Apache License, Version 2.0
  67209. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67210. /**
  67211. * @class LevelRenderer.Tool.Env
  67212. * @category Visualization Theme
  67213. * @classdesc 环境识别
  67214. * @private
  67215. */
  67216. var Env = /*#__PURE__*/function () {
  67217. function Env() {
  67218. Env_classCallCheck(this, Env);
  67219. // Zepto.js
  67220. // (c) 2010-2013 Thomas Fuchs
  67221. // Zepto.js may be freely distributed under the MIT license.
  67222. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Env";
  67223. var me = this;
  67224. function detect(ua) {
  67225. var os = me.os = {};
  67226. var browser = me.browser = {};
  67227. var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
  67228. var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
  67229. var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
  67230. var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
  67231. var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
  67232. var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
  67233. var touchpad = webos && ua.match(/TouchPad/);
  67234. var kindle = ua.match(/Kindle\/([\d.]+)/);
  67235. var silk = ua.match(/Silk\/([\d._]+)/);
  67236. var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
  67237. var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
  67238. var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
  67239. var playbook = ua.match(/PlayBook/);
  67240. var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
  67241. var firefox = ua.match(/Firefox\/([\d.]+)/);
  67242. var ie = ua.match(/MSIE ([\d.]+)/);
  67243. var safari = webkit && ua.match(/Mobile\//) && !chrome;
  67244. var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;
  67245. // Todo: clean this up with a better OS/browser seperation:
  67246. // - discern (more) between multiple browsers on android
  67247. // - decide if kindle fire in silk mode is android or not
  67248. // - Firefox on Android doesn't specify the Android version
  67249. // - possibly devide in os, device and browser hashes
  67250. /*eslint-disable*/
  67251. if (browser.webkit = !!webkit) {
  67252. browser.version = webkit[1];
  67253. }
  67254. if (android) {
  67255. os.android = true;
  67256. os.version = android[2];
  67257. }
  67258. if (iphone && !ipod) {
  67259. os.ios = os.iphone = true;
  67260. os.version = iphone[2].replace(/_/g, '.');
  67261. }
  67262. if (ipad) {
  67263. os.ios = os.ipad = true;
  67264. os.version = ipad[2].replace(/_/g, '.');
  67265. }
  67266. if (ipod) {
  67267. os.ios = os.ipod = true;
  67268. os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
  67269. }
  67270. if (webos) {
  67271. os.webos = true;
  67272. os.version = webos[2];
  67273. }
  67274. if (touchpad) {
  67275. os.touchpad = true;
  67276. }
  67277. if (blackberry) {
  67278. os.blackberry = true;
  67279. os.version = blackberry[2];
  67280. }
  67281. if (bb10) {
  67282. os.bb10 = true;
  67283. os.version = bb10[2];
  67284. }
  67285. if (rimtabletos) {
  67286. os.rimtabletos = true;
  67287. os.version = rimtabletos[2];
  67288. }
  67289. if (playbook) {
  67290. browser.playbook = true;
  67291. }
  67292. if (kindle) {
  67293. os.kindle = true;
  67294. os.version = kindle[1];
  67295. }
  67296. if (silk) {
  67297. browser.silk = true;
  67298. browser.version = silk[1];
  67299. }
  67300. if (!silk && os.android && ua.match(/Kindle Fire/)) {
  67301. browser.silk = true;
  67302. }
  67303. if (chrome) {
  67304. browser.chrome = true;
  67305. browser.version = chrome[1];
  67306. }
  67307. if (firefox) {
  67308. browser.firefox = true;
  67309. browser.version = firefox[1];
  67310. }
  67311. if (ie) {
  67312. browser.ie = true;
  67313. browser.version = ie[1];
  67314. }
  67315. if (safari && (ua.match(/Safari/) || !!os.ios)) {
  67316. browser.safari = true;
  67317. }
  67318. if (webview) {
  67319. browser.webview = true;
  67320. }
  67321. if (ie) {
  67322. browser.ie = true;
  67323. browser.version = ie[1];
  67324. }
  67325. os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/));
  67326. 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/)));
  67327. return {
  67328. browser: browser,
  67329. os: os,
  67330. // 原生canvas支持
  67331. canvasSupported: document.createElement('canvas').getContext ? true : false
  67332. };
  67333. }
  67334. return detect(navigator.userAgent);
  67335. }
  67336. Env_createClass(Env, [{
  67337. key: "destory",
  67338. value: function destory() {
  67339. return true;
  67340. }
  67341. }]);
  67342. return Env;
  67343. }();
  67344. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Event.js
  67345. function Event_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67346. 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); } }
  67347. 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; }
  67348. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67349. * This program are made available under the terms of the Apache License, Version 2.0
  67350. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67351. /**
  67352. * @class LevelRenderer.Tool.Event
  67353. * @category Visualization Theme
  67354. * @classdesc LevelRenderer 工具-事件辅助类
  67355. * @private
  67356. */
  67357. var Event_Event = /*#__PURE__*/function () {
  67358. function Event() {
  67359. Event_classCallCheck(this, Event);
  67360. /**
  67361. * @member {function} LevelRenderer.Tool.Event.prototype.stop
  67362. * @description 停止冒泡和阻止默认行为
  67363. */
  67364. this.stop = typeof window.addEventListener === 'function' ? function (e) {
  67365. e.preventDefault();
  67366. e.stopPropagation();
  67367. e.cancelBubble = true;
  67368. } : function (e) {
  67369. e.returnValue = false;
  67370. e.cancelBubble = true;
  67371. };
  67372. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Event";
  67373. }
  67374. /**
  67375. * @function LevelRenderer.Tool.Event.prototype.getX
  67376. * @description 提取鼠标(手指)x坐标。
  67377. * @param {Event} e - 事件。
  67378. * @returns {number} 鼠标(手指)x坐标。
  67379. */
  67380. Event_createClass(Event, [{
  67381. key: "getX",
  67382. value: function getX(e) {
  67383. 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;
  67384. }
  67385. /**
  67386. * @function LevelRenderer.Tool.Event.prototype.getY
  67387. * @description 提取鼠标(手指)y坐标。
  67388. * @param {Event} e - 事件。
  67389. * @returns {number} 鼠标(手指)y坐标。
  67390. */
  67391. }, {
  67392. key: "getY",
  67393. value: function getY(e) {
  67394. 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;
  67395. }
  67396. /**
  67397. * @function LevelRenderer.Tool.Event.prototype.getDelta
  67398. * @description 提取鼠标滚轮变化。
  67399. * @param {Event} e - 事件。
  67400. * @returns {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动。
  67401. */
  67402. }, {
  67403. key: "getDelta",
  67404. value: function getDelta(e) {
  67405. return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail;
  67406. }
  67407. }]);
  67408. return Event;
  67409. }();
  67410. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Http.js
  67411. 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); }
  67412. function Http_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67413. 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); } }
  67414. 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; }
  67415. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67416. * This program are made available under the terms of the Apache License, Version 2.0
  67417. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67418. /**
  67419. * @private
  67420. * @class LevelRenderer.Tool.Http
  67421. * @category Visualization Theme
  67422. * @classdesc LevelRenderer 工具-Http
  67423. */
  67424. var Http = /*#__PURE__*/function () {
  67425. function Http() {
  67426. Http_classCallCheck(this, Http);
  67427. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Http";
  67428. }
  67429. /**
  67430. * @function LevelRenderer.Tool.Http.prototype.get
  67431. * @description get请求。
  67432. * @param {(string|IHTTPGetOption)} url - 请求url
  67433. * @param {function} onsuccess - 请求成功函数
  67434. * @param {function} onerror - 请求失败函数
  67435. * @param {Object} opts - 额外参数
  67436. * @returns {number} cos值
  67437. */
  67438. Http_createClass(Http, [{
  67439. key: "get",
  67440. value: function get(url, onsuccess, onerror) {
  67441. if (Http_typeof(url) === 'object') {
  67442. var obj = url;
  67443. url = obj.url;
  67444. onsuccess = obj.onsuccess;
  67445. onerror = obj.onerror;
  67446. }
  67447. var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new window.ActiveXObject('Microsoft.XMLHTTP');
  67448. xhr.open('GET', url, true);
  67449. xhr.onreadystatechange = function () {
  67450. if (xhr.readyState == 4) {
  67451. if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
  67452. onsuccess && onsuccess(xhr.responseText);
  67453. } else {
  67454. onerror && onerror();
  67455. }
  67456. xhr.onreadystatechange = new Function();
  67457. xhr = null;
  67458. }
  67459. };
  67460. xhr.send(null);
  67461. }
  67462. }]);
  67463. return Http;
  67464. }();
  67465. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Config.js
  67466. 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); } }
  67467. 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; }
  67468. function Config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67469. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67470. * This program are made available under the terms of the Apache License, Version 2.0
  67471. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67472. var Config = /*#__PURE__*/Config_createClass(function Config() {
  67473. Config_classCallCheck(this, Config);
  67474. });
  67475. /**
  67476. * @enum EVENT
  67477. * @description 事件
  67478. * @type {Object}
  67479. * @private
  67480. */
  67481. Config.EVENT = {
  67482. //窗口大小变化
  67483. RESIZE: 'resize',
  67484. //鼠标按钮被(手指)按下,事件对象是:目标图形元素或空
  67485. CLICK: 'click',
  67486. //双击事件
  67487. DBLCLICK: 'dblclick',
  67488. //鼠标滚轮变化,事件对象是:目标图形元素或空
  67489. MOUSEWHEEL: 'mousewheel',
  67490. //鼠标(手指)被移动,事件对象是:目标图形元素或空
  67491. MOUSEMOVE: 'mousemove',
  67492. //鼠标移到某图形元素之上,事件对象是:目标图形元素
  67493. MOUSEOVER: 'mouseover',
  67494. //鼠标从某图形元素移开,事件对象是:目标图形元素
  67495. MOUSEOUT: 'mouseout',
  67496. //鼠标按钮(手指)被按下,事件对象是:目标图形元素或空
  67497. MOUSEDOWN: 'mousedown',
  67498. //鼠标按键(手指)被松开,事件对象是:目标图形元素或空
  67499. MOUSEUP: 'mouseup',
  67500. //全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定
  67501. GLOBALOUT: 'globalout',
  67502. // 一次成功元素拖拽的行为事件过程是:
  67503. // dragstart > dragenter > dragover [> dragleave] > drop > dragend
  67504. //开始拖拽时触发,事件对象是:被拖拽图形元素
  67505. DRAGSTART: 'dragstart',
  67506. //拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素
  67507. DRAGEND: 'dragend',
  67508. //拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素
  67509. DRAGENTER: 'dragenter',
  67510. //拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素
  67511. DRAGOVER: 'dragover',
  67512. //拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素
  67513. DRAGLEAVE: 'dragleave',
  67514. //拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素
  67515. DROP: 'drop',
  67516. //touch end - start < delay is click
  67517. touchClickDelay: 300
  67518. };
  67519. /**
  67520. * @enum catchBrushException
  67521. * @description 是否异常捕获
  67522. * @type {boolean}
  67523. * @private
  67524. */
  67525. Config.catchBrushException = false;
  67526. /**
  67527. * @enum debugMode
  67528. * @description debug 日志选项:catchBrushException 为 true 下有效。
  67529. * 0 : 不生成debug数据,发布用
  67530. * 1 : 异常抛出,调试用
  67531. * 2 : 控制台输出,调试用
  67532. * @type {boolean}
  67533. * @private
  67534. */
  67535. Config.debugMode = 0;
  67536. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Log.js
  67537. function Log_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67538. 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); } }
  67539. 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; }
  67540. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67541. * This program are made available under the terms of the Apache License, Version 2.0
  67542. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67543. /**
  67544. * @private
  67545. * @class LevelRenderer.Tool.Log
  67546. * @category Visualization Theme
  67547. * @classdesc LevelRenderer 工具-日志
  67548. */
  67549. var Log = /*#__PURE__*/function () {
  67550. function Log() {
  67551. Log_classCallCheck(this, Log);
  67552. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Log";
  67553. return function () {
  67554. if (+Config.debugMode === 0) {
  67555. return;
  67556. } else if (+Config.debugMode === 1) {
  67557. for (var k in arguments) {
  67558. throw new Error(arguments[k]);
  67559. }
  67560. } else if (+Config.debugMode > 1) {
  67561. for (var _k2 in arguments) {
  67562. console.log(arguments[_k2]);
  67563. }
  67564. }
  67565. };
  67566. /* for debug
  67567. return function(mes) {
  67568. document.getElementById('wrong-message').innerHTML =
  67569. mes + ' ' + (new Date() - 0)
  67570. + '<br/>'
  67571. + document.getElementById('wrong-message').innerHTML;
  67572. };
  67573. */
  67574. }
  67575. Log_createClass(Log, [{
  67576. key: "destory",
  67577. value: function destory() {
  67578. return true;
  67579. }
  67580. }]);
  67581. return Log;
  67582. }();
  67583. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Math.js
  67584. function Math_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67585. 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); } }
  67586. 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; }
  67587. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67588. * This program are made available under the terms of the Apache License, Version 2.0
  67589. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67590. /**
  67591. * @private
  67592. * @class LevelRenderer.Tool.Math
  67593. * @category Visualization Theme
  67594. * @classdesc LevelRenderer 工具-数学辅助类
  67595. */
  67596. var MathTool = /*#__PURE__*/function () {
  67597. function MathTool() {
  67598. Math_classCallCheck(this, MathTool);
  67599. /**
  67600. * @member {number} LevelRenderer.Tool.Math._radians
  67601. * @description 角度与弧度转化参数
  67602. */
  67603. this._radians = window.Math.PI / 180;
  67604. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Math";
  67605. }
  67606. /**
  67607. * @function LevelRenderer.Tool.Math.prototype.sin
  67608. * @description 正弦函数。
  67609. * @param {number} angle - 弧度(角度)参数。
  67610. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  67611. * @returns {number} sin 值。
  67612. */
  67613. Math_createClass(MathTool, [{
  67614. key: "sin",
  67615. value: function sin(angle, isDegrees) {
  67616. return window.Math.sin(isDegrees ? angle * this._radians : angle);
  67617. }
  67618. /**
  67619. * @function LevelRenderer.Tool.Math.prototype.cos
  67620. * @description 余弦函数。
  67621. * @param {number} angle - 弧度(角度)参数。
  67622. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  67623. * @returns {number} cos 值。
  67624. */
  67625. }, {
  67626. key: "cos",
  67627. value: function cos(angle, isDegrees) {
  67628. return window.Math.cos(isDegrees ? angle * this._radians : angle);
  67629. }
  67630. /**
  67631. * @function LevelRenderer.Tool.Math.prototype.degreeToRadian
  67632. * @description 角度转弧度。
  67633. * @param {number} angle - 弧度(角度)参数。
  67634. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  67635. * @returns {number} 弧度值。
  67636. */
  67637. }, {
  67638. key: "degreeToRadian",
  67639. value: function degreeToRadian(angle) {
  67640. return angle * this._radians;
  67641. }
  67642. /**
  67643. * @function LevelRenderer.Tool.Math.prototype.radianToDegree
  67644. * @description 弧度转角度。
  67645. * @param {number} angle - 弧度(角度)参数。
  67646. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  67647. * @returns {number} 角度。
  67648. */
  67649. }, {
  67650. key: "radianToDegree",
  67651. value: function radianToDegree(angle) {
  67652. return angle / this._radians;
  67653. }
  67654. }]);
  67655. return MathTool;
  67656. }();
  67657. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Matrix.js
  67658. function Matrix_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67659. 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); } }
  67660. 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; }
  67661. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67662. * This program are made available under the terms of the Apache License, Version 2.0
  67663. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67664. /**
  67665. * @private
  67666. * @class LevelRenderer.Tool.Matrix
  67667. * @category Visualization Theme
  67668. * @classdesc LevelRenderer 工具-3x2矩阵操作类
  67669. */
  67670. var Matrix = /*#__PURE__*/function () {
  67671. function Matrix() {
  67672. Matrix_classCallCheck(this, Matrix);
  67673. /**
  67674. * @member {Object} LevelRenderer.Tool.Matrix.prototype.ArrayCtor
  67675. * @description 数组类型控制
  67676. */
  67677. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  67678. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Matrix";
  67679. }
  67680. /**
  67681. * @function LevelRenderer.Tool.Matrix.prototype.create
  67682. * @description 创建一个单位矩阵。
  67683. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  67684. */
  67685. Matrix_createClass(Matrix, [{
  67686. key: "create",
  67687. value: function create() {
  67688. var ArrayCtor = this.ArrayCtor;
  67689. var out = new ArrayCtor(6);
  67690. this.identity(out);
  67691. return out;
  67692. }
  67693. /**
  67694. * @function LevelRenderer.Tool.Matrix.prototype.identity
  67695. * @description 设置矩阵为单位矩阵。
  67696. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  67697. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  67698. */
  67699. }, {
  67700. key: "identity",
  67701. value: function identity(out) {
  67702. out[0] = 1;
  67703. out[1] = 0;
  67704. out[2] = 0;
  67705. out[3] = 1;
  67706. out[4] = 0;
  67707. out[5] = 0;
  67708. return out;
  67709. }
  67710. /**
  67711. * @function LevelRenderer.Tool.Matrix.prototype.copy
  67712. * @description 复制矩阵。
  67713. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  67714. * @returns {(Float32Array|Array.<number>)} 克隆矩阵。
  67715. */
  67716. }, {
  67717. key: "copy",
  67718. value: function copy(out, m) {
  67719. out[0] = m[0];
  67720. out[1] = m[1];
  67721. out[2] = m[2];
  67722. out[3] = m[3];
  67723. out[4] = m[4];
  67724. out[5] = m[5];
  67725. return out;
  67726. }
  67727. /**
  67728. * @function LevelRenderer.Tool.Matrix.prototype.mul
  67729. * @description 矩阵相乘。
  67730. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  67731. * @param {(Float32Array|Array.<number>)} m1 - 矩阵m1。
  67732. * @param {(Float32Array|Array.<number>)} m2- 矩阵m2。
  67733. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  67734. */
  67735. }, {
  67736. key: "mul",
  67737. value: function mul(out, m1, m2) {
  67738. out[0] = m1[0] * m2[0] + m1[2] * m2[1];
  67739. out[1] = m1[1] * m2[0] + m1[3] * m2[1];
  67740. out[2] = m1[0] * m2[2] + m1[2] * m2[3];
  67741. out[3] = m1[1] * m2[2] + m1[3] * m2[3];
  67742. out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
  67743. out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
  67744. return out;
  67745. }
  67746. /**
  67747. * @function LevelRenderer.Tool.Matrix.prototype.mul
  67748. * @description 平移变换。
  67749. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  67750. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  67751. * @param {(Float32Array|Array.<number>)} v- 平移参数。
  67752. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  67753. */
  67754. }, {
  67755. key: "translate",
  67756. value: function translate(out, a, v) {
  67757. out[0] = a[0];
  67758. out[1] = a[1];
  67759. out[2] = a[2];
  67760. out[3] = a[3];
  67761. out[4] = a[4] + v[0];
  67762. out[5] = a[5] + v[1];
  67763. return out;
  67764. }
  67765. /**
  67766. * @function LevelRenderer.Tool.Matrix.prototype.rotate
  67767. * @description 平移变换。
  67768. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  67769. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  67770. * @param {(Float32Array|Array.<number>)} rad - 旋转参数。
  67771. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  67772. */
  67773. }, {
  67774. key: "rotate",
  67775. value: function rotate(out, a, rad) {
  67776. var aa = a[0];
  67777. var ac = a[2];
  67778. var atx = a[4];
  67779. var ab = a[1];
  67780. var ad = a[3];
  67781. var aty = a[5];
  67782. var st = Math.sin(rad);
  67783. var ct = Math.cos(rad);
  67784. out[0] = aa * ct + ab * st;
  67785. out[1] = -aa * st + ab * ct;
  67786. out[2] = ac * ct + ad * st;
  67787. out[3] = -ac * st + ct * ad;
  67788. out[4] = ct * atx + st * aty;
  67789. out[5] = ct * aty - st * atx;
  67790. return out;
  67791. }
  67792. /**
  67793. * @function LevelRenderer.Tool.Matrix.prototype.scale
  67794. * @description 缩放变换。
  67795. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  67796. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  67797. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  67798. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  67799. */
  67800. }, {
  67801. key: "scale",
  67802. value: function scale(out, a, v) {
  67803. var vx = v[0];
  67804. var vy = v[1];
  67805. out[0] = a[0] * vx;
  67806. out[1] = a[1] * vy;
  67807. out[2] = a[2] * vx;
  67808. out[3] = a[3] * vy;
  67809. out[4] = a[4] * vx;
  67810. out[5] = a[5] * vy;
  67811. return out;
  67812. }
  67813. /**
  67814. * @function LevelRenderer.Tool.Matrix.prototype.invert
  67815. * @description 求逆矩阵。
  67816. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  67817. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  67818. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  67819. */
  67820. }, {
  67821. key: "invert",
  67822. value: function invert(out, a) {
  67823. var aa = a[0];
  67824. var ac = a[2];
  67825. var atx = a[4];
  67826. var ab = a[1];
  67827. var ad = a[3];
  67828. var aty = a[5];
  67829. var det = aa * ad - ab * ac;
  67830. if (!det) {
  67831. return null;
  67832. }
  67833. det = 1.0 / det;
  67834. out[0] = ad * det;
  67835. out[1] = -ab * det;
  67836. out[2] = -ac * det;
  67837. out[3] = aa * det;
  67838. out[4] = (ac * aty - ad * atx) * det;
  67839. out[5] = (ab * atx - aa * aty) * det;
  67840. return out;
  67841. }
  67842. /**
  67843. * @function LevelRenderer.Tool.Matrix.prototype.mulVector
  67844. * @description 矩阵左乘向量。
  67845. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  67846. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  67847. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  67848. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  67849. */
  67850. }, {
  67851. key: "mulVector",
  67852. value: function mulVector(out, a, v) {
  67853. var aa = a[0];
  67854. var ac = a[2];
  67855. var atx = a[4];
  67856. var ab = a[1];
  67857. var ad = a[3];
  67858. var aty = a[5];
  67859. out[0] = v[0] * aa + v[1] * ac + atx;
  67860. out[1] = v[0] * ab + v[1] * ad + aty;
  67861. return out;
  67862. }
  67863. }]);
  67864. return Matrix;
  67865. }();
  67866. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SUtil.js
  67867. function SUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67868. 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); } }
  67869. 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; }
  67870. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  67871. * This program are made available under the terms of the Apache License, Version 2.0
  67872. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67873. var SUtil_SUtil = /*#__PURE__*/function () {
  67874. function SUtil() {
  67875. SUtil_classCallCheck(this, SUtil);
  67876. }
  67877. SUtil_createClass(SUtil, null, [{
  67878. key: "SUtil_smoothBezier",
  67879. value:
  67880. /**
  67881. * @function LevelRenderer.SUtil.SUtil_smoothBezier
  67882. * @description 贝塞尔平滑曲线。
  67883. * @private
  67884. * @param {Array} points - 线段顶点数组。
  67885. * @param {number} smooth - 平滑等级, 0-1。
  67886. * @param {boolean} isLoop - isLoop。
  67887. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  67888. * @param {Array.<number>} [originalPosition=[0, 0]] - 参考原点。
  67889. * @return {Array} 生成的平滑节点数组。
  67890. */
  67891. function SUtil_smoothBezier(points, smooth, isLoop, constraint, originalPosition) {
  67892. if (!originalPosition || originalPosition.length !== 2) {
  67893. originalPosition = [0, 0];
  67894. }
  67895. var __OP = originalPosition;
  67896. var cps = [];
  67897. var v = [];
  67898. var v1 = [];
  67899. var v2 = [];
  67900. var hasConstraint = !!constraint;
  67901. var min, max;
  67902. if (hasConstraint) {
  67903. min = [Infinity, Infinity];
  67904. max = [-Infinity, -Infinity];
  67905. var _len = points.length;
  67906. for (var i = 0; i < _len; i++) {
  67907. SUtil.Util_vector.min(min, min, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  67908. SUtil.Util_vector.max(max, max, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  67909. }
  67910. // 与指定的包围盒做并集
  67911. SUtil.Util_vector.min(min, min, constraint[0]);
  67912. SUtil.Util_vector.max(max, max, constraint[1]);
  67913. }
  67914. var len = points.length;
  67915. for (var _i2 = 0; _i2 < len; _i2++) {
  67916. var point = [points[_i2][0] + __OP[0], points[_i2][1] + __OP[1]];
  67917. var prevPoint = void 0;
  67918. var nextPoint = void 0;
  67919. if (isLoop) {
  67920. prevPoint = [points[_i2 ? _i2 - 1 : len - 1][0] + __OP[0], points[_i2 ? _i2 - 1 : len - 1][1] + __OP[1]];
  67921. nextPoint = [points[(_i2 + 1) % len][0] + __OP[0], points[(_i2 + 1) % len][1] + __OP[1]];
  67922. } else {
  67923. if (_i2 === 0 || _i2 === len - 1) {
  67924. cps.push([points[_i2][0] + __OP[0], points[_i2][1] + __OP[1]]);
  67925. continue;
  67926. } else {
  67927. prevPoint = [points[_i2 - 1][0] + __OP[0], points[_i2 - 1][1] + __OP[1]];
  67928. nextPoint = [points[_i2 + 1][0] + __OP[0], points[_i2 + 1][1] + __OP[1]];
  67929. }
  67930. }
  67931. SUtil.Util_vector.sub(v, nextPoint, prevPoint);
  67932. // use degree to scale the handle length
  67933. SUtil.Util_vector.scale(v, v, smooth);
  67934. var d0 = SUtil.Util_vector.distance(point, prevPoint);
  67935. var d1 = SUtil.Util_vector.distance(point, nextPoint);
  67936. var sum = d0 + d1;
  67937. if (sum !== 0) {
  67938. d0 /= sum;
  67939. d1 /= sum;
  67940. }
  67941. SUtil.Util_vector.scale(v1, v, -d0);
  67942. SUtil.Util_vector.scale(v2, v, d1);
  67943. var cp0 = SUtil.Util_vector.add([], point, v1);
  67944. var cp1 = SUtil.Util_vector.add([], point, v2);
  67945. if (hasConstraint) {
  67946. SUtil.Util_vector.max(cp0, cp0, min);
  67947. SUtil.Util_vector.min(cp0, cp0, max);
  67948. SUtil.Util_vector.max(cp1, cp1, min);
  67949. SUtil.Util_vector.min(cp1, cp1, max);
  67950. }
  67951. cps.push(cp0);
  67952. cps.push(cp1);
  67953. }
  67954. if (isLoop) {
  67955. cps.push(cps.shift());
  67956. }
  67957. return cps;
  67958. }
  67959. /**
  67960. * @function LevelRenderer.SUtil.SUtil_smoothSpline
  67961. * @description 插值折线。
  67962. * @private
  67963. * @param {Array} points - 线段顶点数组。
  67964. * @param {boolean} isLoop - isLoop。
  67965. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  67966. * @param {Array.<number>} originalPosition - 参考原点。默认值:[0, 0]。
  67967. * @return {Array} 生成的平滑节点数组。
  67968. */
  67969. }, {
  67970. key: "SUtil_smoothSpline",
  67971. value: function SUtil_smoothSpline(points, isLoop, constraint, originalPosition) {
  67972. if (!originalPosition || originalPosition.length !== 2) {
  67973. originalPosition = [0, 0];
  67974. }
  67975. var __OP = originalPosition;
  67976. var len = points.length;
  67977. var ret = [];
  67978. var distance = 0;
  67979. for (var i = 1; i < len; i++) {
  67980. 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]]);
  67981. }
  67982. var segs = distance / 5;
  67983. segs = segs < len ? len : segs;
  67984. for (var _i4 = 0; _i4 < segs; _i4++) {
  67985. var pos = _i4 / (segs - 1) * (isLoop ? len : len - 1);
  67986. var idx = Math.floor(pos);
  67987. var w = pos - idx;
  67988. var p0 = void 0;
  67989. var p1 = [points[idx % len][0] + __OP[0], points[idx % len][1] + __OP[1]];
  67990. var p2 = void 0;
  67991. var p3 = void 0;
  67992. if (!isLoop) {
  67993. p0 = [points[idx === 0 ? idx : idx - 1][0] + __OP[0], points[idx === 0 ? idx : idx - 1][1] + __OP[1]];
  67994. p2 = [points[idx > len - 2 ? len - 1 : idx + 1][0] + __OP[0], points[idx > len - 2 ? len - 1 : idx + 1][1] + __OP[1]];
  67995. p3 = [points[idx > len - 3 ? len - 1 : idx + 2][0] + __OP[0], points[idx > len - 3 ? len - 1 : idx + 2][1] + __OP[1]];
  67996. } else {
  67997. p0 = [points[(idx - 1 + len) % len][0] + __OP[0], points[(idx - 1 + len) % len][1] + __OP[1]];
  67998. p2 = [points[(idx + 1) % len][0] + __OP[0], points[(idx + 1) % len][1] + __OP[1]];
  67999. p3 = [points[(idx + 2) % len][0] + __OP[0], points[(idx + 2) % len][1] + __OP[1]];
  68000. }
  68001. var w2 = w * w;
  68002. var w3 = w * w2;
  68003. 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)]);
  68004. }
  68005. return ret;
  68006. // inner Function
  68007. function interpolate(p0, p1, p2, p3, t, t2, t3) {
  68008. var v0 = (p2 - p0) * 0.5;
  68009. var v1 = (p3 - p1) * 0.5;
  68010. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  68011. }
  68012. }
  68013. /**
  68014. * @function LevelRenderer.SUtil.SUtil_dashedLineTo
  68015. * @description 虚线 lineTo。
  68016. */
  68017. }, {
  68018. key: "SUtil_dashedLineTo",
  68019. value: function SUtil_dashedLineTo(ctx, x1, y1, x2, y2, dashLength, customDashPattern) {
  68020. // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx
  68021. var dashPattern = [5, 5];
  68022. dashLength = typeof dashLength != 'number' ? 5 : dashLength;
  68023. if (ctx.setLineDash) {
  68024. dashPattern[0] = dashLength;
  68025. dashPattern[1] = dashLength;
  68026. if (customDashPattern && customDashPattern instanceof Array) {
  68027. ctx.setLineDash(customDashPattern);
  68028. } else {
  68029. ctx.setLineDash(dashPattern);
  68030. }
  68031. // ctx.setLineDash(dashPattern);
  68032. ctx.moveTo(x1, y1);
  68033. ctx.lineTo(x2, y2);
  68034. return;
  68035. }
  68036. var dx = x2 - x1;
  68037. var dy = y2 - y1;
  68038. var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength);
  68039. dx = dx / numDashes;
  68040. dy = dy / numDashes;
  68041. var flag = true;
  68042. for (var i = 0; i < numDashes; ++i) {
  68043. if (flag) {
  68044. ctx.moveTo(x1, y1);
  68045. } else {
  68046. ctx.lineTo(x1, y1);
  68047. }
  68048. flag = !flag;
  68049. x1 += dx;
  68050. y1 += dy;
  68051. }
  68052. ctx.lineTo(x2, y2);
  68053. }
  68054. }]);
  68055. return SUtil;
  68056. }();
  68057. // 把所有工具对象放到全局静态变量上,以便直接调用工具方法,
  68058. // 避免使用工具时频繁的创建工具对象带来的性能消耗。
  68059. SUtil_SUtil.Util_area = new Area();
  68060. SUtil_SUtil.Util_color = new Color();
  68061. SUtil_SUtil.Util_computeBoundingBox = new ComputeBoundingBox();
  68062. SUtil_SUtil.Util_curve = new Curve_Curve();
  68063. SUtil_SUtil.Util_env = new Env();
  68064. SUtil_SUtil.Util_event = new Event_Event();
  68065. SUtil_SUtil.Util_http = new Http();
  68066. SUtil_SUtil.Util_log = new Log();
  68067. SUtil_SUtil.Util_math = new MathTool();
  68068. SUtil_SUtil.Util_matrix = new Matrix();
  68069. SUtil_SUtil.Util = new levelRenderer_Util_Util();
  68070. SUtil_SUtil.Util_vector = new levelRenderer_Vector_Vector();
  68071. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Transformable.js
  68072. function Transformable_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68073. 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); } }
  68074. 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; }
  68075. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68076. * This program are made available under the terms of the Apache License, Version 2.0
  68077. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68078. /**
  68079. * @private
  68080. * @class LevelRenderer.Transformable
  68081. * @category Visualization Theme
  68082. * @classdesc 可变换超类,所有支持 Canvas Transform 变换操作的类均是此类的子类。此类不可实例化。
  68083. */
  68084. var Transformable = /*#__PURE__*/function () {
  68085. function Transformable() {
  68086. Transformable_classCallCheck(this, Transformable);
  68087. /**
  68088. * @member {Array.<number>} LevelRenderer.Transformable.prototype.position
  68089. * @description 平移,默认值:[0, 0]。
  68090. */
  68091. this.position = [0, 0];
  68092. /**
  68093. * @member {Array.<number>} LevelRenderer.Transformable.prototype.rotation
  68094. * @description 旋转,可以通过数组二三项指定旋转的原点,默认值:[0, 0, 0]。
  68095. */
  68096. this.rotation = [0, 0, 0];
  68097. /**
  68098. * @member {Array.<number>} LevelRenderer.Transformable.prototype.scale
  68099. * @description 缩放,可以通过数组三四项指定缩放的原点,默认值:[1, 1, 0, 0]。
  68100. */
  68101. this.scale = [1, 1, 0, 0];
  68102. /**
  68103. * @member {boolean} LevelRenderer.Transformable.prototype.needLocalTransform
  68104. * @description 是否变换。默认值:false。
  68105. */
  68106. this.needLocalTransform = false;
  68107. /**
  68108. * @member {boolean} LevelRenderer.Transformable.prototype.needTransform
  68109. * @description 是否有坐标变换。默认值:false。
  68110. */
  68111. this.needTransform = false;
  68112. this.CLASS_NAME = "SuperMap.LevelRenderer.Transformable";
  68113. /**
  68114. * @function LevelRenderer.Transformable.prototype.lookAt
  68115. * @description 设置图形的朝向。
  68116. */
  68117. this.lookAt = function () {
  68118. var v = SUtil_SUtil.Util_vector.create();
  68119. // {Array.<Number>|Float32Array} target
  68120. return function (target) {
  68121. if (!this.transform) {
  68122. this.transform = SUtil_SUtil.Util_matrix.create();
  68123. }
  68124. var m = this.transform;
  68125. SUtil_SUtil.Util_vector.sub(v, target, this.position);
  68126. if (isAroundZero(v[0]) && isAroundZero(v[1])) {
  68127. return;
  68128. }
  68129. SUtil_SUtil.Util_vector.normalize(v, v);
  68130. // Y Axis
  68131. // TODO Scale origin ?
  68132. m[2] = v[0] * this.scale[1];
  68133. m[3] = v[1] * this.scale[1];
  68134. // X Axis
  68135. m[0] = v[1] * this.scale[0];
  68136. m[1] = -v[0] * this.scale[0];
  68137. // Position
  68138. m[4] = this.position[0];
  68139. m[5] = this.position[1];
  68140. this.decomposeTransform();
  68141. function isAroundZero(val) {
  68142. var EPSILON = 5e-5;
  68143. return val > -EPSILON && val < EPSILON;
  68144. }
  68145. };
  68146. }();
  68147. }
  68148. /**
  68149. * @function LevelRenderer.Transformable.prototype.destroy
  68150. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  68151. */
  68152. Transformable_createClass(Transformable, [{
  68153. key: "destroy",
  68154. value: function destroy() {
  68155. this.position = null;
  68156. this.rotation = null;
  68157. this.scale = null;
  68158. this.needLocalTransform = null;
  68159. this.needTransform = null;
  68160. }
  68161. /**
  68162. * @function LevelRenderer.Transformable.prototype.updateNeedTransform
  68163. * @description 更新 needLocalTransform
  68164. */
  68165. }, {
  68166. key: "updateNeedTransform",
  68167. value: function updateNeedTransform() {
  68168. this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);
  68169. function isNotAroundZero(val) {
  68170. var EPSILON = 5e-5;
  68171. return val > EPSILON || val < -EPSILON;
  68172. }
  68173. }
  68174. /**
  68175. * @function LevelRenderer.Transformable.prototype.updateTransform
  68176. * @description 判断是否需要有坐标变换,更新 needTransform 属性。如果有坐标变换,则从 position, rotation, scale 以及父节点的 transform 计算出自身的 transform 矩阵。
  68177. */
  68178. }, {
  68179. key: "updateTransform",
  68180. value: function updateTransform() {
  68181. this.updateNeedTransform();
  68182. if (this.parent) {
  68183. this.needTransform = this.needLocalTransform || this.parent.needTransform;
  68184. } else {
  68185. this.needTransform = this.needLocalTransform;
  68186. }
  68187. if (!this.needTransform) {
  68188. return;
  68189. }
  68190. var origin = [0, 0];
  68191. var m = this.transform || SUtil_SUtil.Util_matrix.create();
  68192. SUtil_SUtil.Util_matrix.identity(m);
  68193. if (this.needLocalTransform) {
  68194. if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) {
  68195. origin[0] = -this.scale[2] || 0;
  68196. origin[1] = -this.scale[3] || 0;
  68197. var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  68198. if (haveOrigin) {
  68199. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  68200. }
  68201. SUtil_SUtil.Util_matrix.scale(m, m, this.scale);
  68202. if (haveOrigin) {
  68203. origin[0] = -origin[0];
  68204. origin[1] = -origin[1];
  68205. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  68206. }
  68207. }
  68208. if (this.rotation instanceof Array) {
  68209. if (this.rotation[0] !== 0) {
  68210. origin[0] = -this.rotation[1] || 0;
  68211. origin[1] = -this.rotation[2] || 0;
  68212. var _haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  68213. if (_haveOrigin) {
  68214. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  68215. }
  68216. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation[0]);
  68217. if (_haveOrigin) {
  68218. origin[0] = -origin[0];
  68219. origin[1] = -origin[1];
  68220. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  68221. }
  68222. }
  68223. } else {
  68224. if (+this.rotation !== 0) {
  68225. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation);
  68226. }
  68227. }
  68228. if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) {
  68229. SUtil_SUtil.Util_matrix.translate(m, m, this.position);
  68230. }
  68231. }
  68232. // 保存这个变换矩阵
  68233. this.transform = m;
  68234. // 应用父节点变换
  68235. if (this.parent && this.parent.needTransform) {
  68236. if (this.needLocalTransform) {
  68237. SUtil_SUtil.Util_matrix.mul(this.transform, this.parent.transform, this.transform);
  68238. } else {
  68239. SUtil_SUtil.Util_matrix.copy(this.transform, this.parent.transform);
  68240. }
  68241. }
  68242. function isNotAroundZero(val) {
  68243. var EPSILON = 5e-5;
  68244. return val > EPSILON || val < -EPSILON;
  68245. }
  68246. }
  68247. /**
  68248. * @function LevelRenderer.Transformable.prototype.setTransform
  68249. * @description 将自己的 transform 应用到 context 上。
  68250. *
  68251. * @param {Context2D} ctx - Context2D 上下文。
  68252. */
  68253. }, {
  68254. key: "setTransform",
  68255. value: function setTransform(ctx) {
  68256. if (this.needTransform) {
  68257. var m = this.transform;
  68258. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  68259. }
  68260. }
  68261. /**
  68262. * @function LevelRenderer.Transformable.prototype.decomposeTransform
  68263. * @description 分解`transform`矩阵到`position`, `rotation`, `scale` 。
  68264. */
  68265. }, {
  68266. key: "decomposeTransform",
  68267. value: function decomposeTransform() {
  68268. if (!this.transform) {
  68269. return;
  68270. }
  68271. var m = this.transform;
  68272. var sx = m[0] * m[0] + m[1] * m[1];
  68273. var position = this.position;
  68274. var scale = this.scale;
  68275. var rotation = this.rotation;
  68276. if (isNotAroundZero(sx - 1)) {
  68277. sx = Math.sqrt(sx);
  68278. }
  68279. var sy = m[2] * m[2] + m[3] * m[3];
  68280. if (isNotAroundZero(sy - 1)) {
  68281. sy = Math.sqrt(sy);
  68282. }
  68283. position[0] = m[4];
  68284. position[1] = m[5];
  68285. scale[0] = sx;
  68286. scale[1] = sy;
  68287. scale[2] = scale[3] = 0;
  68288. rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx);
  68289. rotation[1] = rotation[2] = 0;
  68290. function isNotAroundZero(val) {
  68291. var EPSILON = 5e-5;
  68292. return val > EPSILON || val < -EPSILON;
  68293. }
  68294. }
  68295. }]);
  68296. return Transformable;
  68297. }();
  68298. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Shape.js
  68299. 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); }
  68300. function Shape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68301. 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); } }
  68302. 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; }
  68303. 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); }
  68304. function Shape_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Shape_getPrototypeOf(object); if (object === null) break; } return object; }
  68305. 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); }
  68306. 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); }
  68307. 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); }; }
  68308. 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); }
  68309. function Shape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68310. 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; } }
  68311. function Shape_getPrototypeOf(o) { Shape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Shape_getPrototypeOf(o); }
  68312. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  68313. * This program are made available under the terms of the Apache License, Version 2.0
  68314. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68315. /**
  68316. * @private
  68317. * @class LevelRenderer.Shape
  68318. * @category Visualization Theme
  68319. * @classdesc 图形(shape)基类。
  68320. * @extends LevelRenderer.Eventful
  68321. * @extends LevelRenderer.Transformable
  68322. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  68323. */
  68324. var Shape_Shape = /*#__PURE__*/function (_mixin) {
  68325. Shape_inherits(Shape, _mixin);
  68326. var _super = Shape_createSuper(Shape);
  68327. function Shape(options) {
  68328. var _this;
  68329. Shape_classCallCheck(this, Shape);
  68330. _this = _super.call(this, options);
  68331. options = options || {};
  68332. /**
  68333. * @member {string} LevelRenderer.Shape.prototype.id
  68334. * @description 唯一标识。
  68335. */
  68336. _this.id = null;
  68337. /**
  68338. * @member {Object} LevelRenderer.Shape.prototype.style
  68339. * @description 基础绘制样式。
  68340. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  68341. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  68342. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  68343. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  68344. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  68345. * @param {number} style.opacity - 绘制透明度。默认值:1。
  68346. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  68347. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  68348. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  68349. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  68350. * @param {string} style.text - 图形中的附加文本。默认值:""。
  68351. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  68352. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  68353. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  68354. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  68355. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  68356. *
  68357. */
  68358. _this.style = {};
  68359. /**
  68360. * @member {Object} LevelRenderer.Shape.prototype.style.__rect
  68361. * @description 包围图形的最小矩形盒子。
  68362. *
  68363. * @param {number} x - 左上角顶点x轴坐标。
  68364. * @param {number} y - 左上角顶点y轴坐标。
  68365. * @param {number} width - 包围盒矩形宽度。
  68366. * @param {number} height - 包围盒矩形高度。
  68367. */
  68368. /**
  68369. * @member {Object} LevelRenderer.Shape.prototype.highlightStyle
  68370. * @description 高亮样式。
  68371. *
  68372. * @param {string} highlightStyle.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  68373. * @param {string} highlightStyle.color - 填充颜色。默认值:"#000000'"。
  68374. * @param {string} highlightStyle.strokeColor - 描边颜色。默认值:"#000000'"。
  68375. * @param {string} highlightStyle.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  68376. * @param {number} highlightStyle.lineWidth - 描边宽度。默认值:1。
  68377. * @param {number} highlightStyle.opacity - 绘制透明度。默认值:1。
  68378. * @param {number} highlightStyle.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  68379. * @param {number} highlightStyle.shadowColor - 阴影颜色。默认值:"#000000'"。
  68380. * @param {number} highlightStyle.shadowOffsetX - 阴影横向偏移。默认值:0。
  68381. * @param {number} highlightStyle.shadowOffsetY - 阴影纵向偏移。默认值:0。
  68382. * @param {string} highlightStyle.text - 图形中的附加文本。默认值:""。
  68383. * @param {string} highlightStyle.textColor - 文本颜色。默认值:"#000000'"。
  68384. * @param {string} highlightStyle.textFont - 附加文本样式。示例:'bold 18px verdana'。
  68385. * @param {string} highlightStyle.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  68386. * @param {string} highlightStyle.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  68387. * @param {string} highlightStyle.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  68388. */
  68389. _this.highlightStyle = null;
  68390. /**
  68391. * @member {Object} LevelRenderer.Shape.prototype.parent
  68392. * @description 父节点,只读属性。<LevelRenderer.Group>
  68393. */
  68394. _this.parent = null;
  68395. /**
  68396. * @member {boolean} LevelRenderer.Shape.prototype.__dirty
  68397. * @description {boolean}
  68398. */
  68399. _this.__dirty = true;
  68400. /**
  68401. * @member {Array} LevelRenderer.Shape.prototype.__clipShapes
  68402. * @description {Array}
  68403. *
  68404. */
  68405. _this.__clipShapes = [];
  68406. /**
  68407. * @member {boolean} LevelRenderer.Shape.prototype.invisible
  68408. * @description 图形是否可见,为 true 时不绘制图形,但是仍能触发鼠标事件。默认值:false。
  68409. */
  68410. _this.invisible = false;
  68411. /**
  68412. * @member {boolean} LevelRenderer.Shape.prototype.ignore
  68413. * @description 图形是否忽略,为 true 时忽略图形的绘制以及事件触发。默认值:false。
  68414. */
  68415. _this.ignore = false;
  68416. /**
  68417. * @member {boolean} LevelRenderer.Shape.prototype.zlevel
  68418. * @description z 层 level,决定绘画在哪层 canvas 中。默认值:0。
  68419. */
  68420. _this.zlevel = 0;
  68421. /**
  68422. * @member {boolean} LevelRenderer.Shape.prototype.draggable
  68423. * @description 是否可拖拽。默认值:false。
  68424. */
  68425. _this.draggable = false;
  68426. /**
  68427. * @member {boolean} LevelRenderer.Shape.prototype.clickable
  68428. * @description 是否可点击。默认值:false。
  68429. */
  68430. _this.clickable = false;
  68431. /**
  68432. * @member {boolean} LevelRenderer.Shape.prototype.hoverable
  68433. * @description 是否可以 hover。默认值:true。
  68434. */
  68435. _this.hoverable = true;
  68436. /**
  68437. * @member {number} LevelRenderer.Shape.prototype.z
  68438. * @description z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面,但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。默认值:0。
  68439. */
  68440. _this.z = 0;
  68441. //地理扩展
  68442. /**
  68443. * @member {Array.<number>} LevelRenderer.Shape.prototype.refOriginalPosition
  68444. * @description 图形参考原点位置,图形的参考中心位置。
  68445. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  68446. *
  68447. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  68448. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  68449. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  68450. *
  68451. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  68452. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  68453. * refOriginalPosition 的值为 [0, 0] 时,形的位置信息才是 canvas 绝对位置。
  68454. *
  68455. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  68456. *
  68457. * refOriginalPosition。默认值是: [0, 0]。
  68458. */
  68459. _this.refOriginalPosition = [0, 0];
  68460. /**
  68461. * @member {string} LevelRenderer.Shape.prototype.refDataID
  68462. * @description 图形所关联数据的 ID。
  68463. *
  68464. */
  68465. _this.refDataID = null;
  68466. /**
  68467. * @member {boolean} LevelRenderer.Shape.prototype.isHoverByRefDataID
  68468. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  68469. *
  68470. */
  68471. _this.isHoverByRefDataID = false;
  68472. /**
  68473. * @member {string} LevelRenderer.Shape.prototype.refDataHoverGroup
  68474. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  68475. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  68476. *
  68477. */
  68478. _this.refDataHoverGroup = null;
  68479. /**
  68480. * @member {Object} LevelRenderer.Shape.prototype.dataInfo
  68481. * @description 图形的数据信息。
  68482. *
  68483. */
  68484. _this.dataInfo = null;
  68485. Util_Util.extend(Shape_assertThisInitialized(_this), options);
  68486. _this.id = _this.id || Util_Util.createUniqueID("smShape_");
  68487. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape";
  68488. /**
  68489. * @function LevelRenderer.Shape.prototype.getTansform
  68490. * @description 变换鼠标位置到 shape 的局部坐标空间
  68491. *
  68492. */
  68493. _this.getTansform = function () {
  68494. var invTransform = [];
  68495. return function (x, y) {
  68496. var originPos = [x, y];
  68497. // 对鼠标的坐标也做相同的变换
  68498. if (this.needTransform && this.transform) {
  68499. SUtil_SUtil.Util_matrix.invert(invTransform, this.transform);
  68500. SUtil_SUtil.Util_matrix.mulVector(originPos, invTransform, [x, y, 1]);
  68501. if (x == originPos[0] && y == originPos[1]) {
  68502. // 避免外部修改导致的 needTransform 不准确
  68503. this.updateNeedTransform();
  68504. }
  68505. }
  68506. return originPos;
  68507. };
  68508. }();
  68509. return _this;
  68510. }
  68511. /**
  68512. * @function LevelRenderer.Shape.prototype.destroy
  68513. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  68514. */
  68515. Shape_createClass(Shape, [{
  68516. key: "destroy",
  68517. value: function destroy() {
  68518. this.id = null;
  68519. this.style = null;
  68520. this.highlightStyle = null;
  68521. this.parent = null;
  68522. this.__dirty = null;
  68523. this.__clipShapes = null;
  68524. this.invisible = null;
  68525. this.ignore = null;
  68526. this.zlevel = null;
  68527. this.draggable = null;
  68528. this.clickable = null;
  68529. this.hoverable = null;
  68530. this.z = null;
  68531. this.refOriginalPosition = null;
  68532. this.refDataID = null;
  68533. this.refDataHoverGroup = null;
  68534. this.isHoverByRefDataID = null;
  68535. this.dataInfo = null;
  68536. Shape_get(Shape_getPrototypeOf(Shape.prototype), "destroy", this).call(this);
  68537. }
  68538. /**
  68539. * @function LevelRenderer.Shape.prototype.brush
  68540. * @description 绘制图形。
  68541. *
  68542. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  68543. * @param {boolean} isHighlight - 是否使用高亮属性。
  68544. * @param {function} updateCallback - 需要异步加载资源的 shape 可以通过这个 callback(e),让painter更新视图,base.brush 没用,需要的话重载 brush。
  68545. */
  68546. }, {
  68547. key: "brush",
  68548. value: function brush(ctx, isHighlight) {
  68549. var style = this.beforeBrush(ctx, isHighlight);
  68550. ctx.beginPath();
  68551. this.buildPath(ctx, style);
  68552. switch (style.brushType) {
  68553. /* jshint ignore:start */
  68554. case 'both':
  68555. this.setCtxGlobalAlpha(ctx, "fill", style);
  68556. ctx.fill();
  68557. if (style.lineWidth > 0) {
  68558. this.setCtxGlobalAlpha(ctx, "stroke", style);
  68559. ctx.stroke();
  68560. }
  68561. this.setCtxGlobalAlpha(ctx, "reset", style);
  68562. break;
  68563. case 'stroke':
  68564. this.setCtxGlobalAlpha(ctx, "stroke", style);
  68565. style.lineWidth > 0 && ctx.stroke();
  68566. this.setCtxGlobalAlpha(ctx, "reset", style);
  68567. break;
  68568. /* jshint ignore:end */
  68569. default:
  68570. this.setCtxGlobalAlpha(ctx, "fill", style);
  68571. ctx.fill();
  68572. this.setCtxGlobalAlpha(ctx, "reset", style);
  68573. break;
  68574. }
  68575. this.drawText(ctx, style, this.style);
  68576. this.afterBrush(ctx);
  68577. }
  68578. /**
  68579. * @function LevelRenderer.Shape.prototype.beforeBrush
  68580. * @description 具体绘制操作前的一些公共操作。
  68581. *
  68582. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  68583. * @param {boolean} isHighlight - 是否使用高亮属性。
  68584. * @return {Object} 处理后的样式。
  68585. */
  68586. }, {
  68587. key: "beforeBrush",
  68588. value: function beforeBrush(ctx, isHighlight) {
  68589. var style = this.style;
  68590. if (this.brushTypeOnly) {
  68591. style.brushType = this.brushTypeOnly;
  68592. }
  68593. if (isHighlight) {
  68594. // 根据style扩展默认高亮样式
  68595. style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly);
  68596. }
  68597. if (this.brushTypeOnly == 'stroke') {
  68598. style.strokeColor = style.strokeColor || style.color;
  68599. }
  68600. ctx.save();
  68601. this.doClip(ctx);
  68602. this.setContext(ctx, style);
  68603. // 设置transform
  68604. this.setTransform(ctx);
  68605. return style;
  68606. }
  68607. /**
  68608. * @function LevelRenderer.Shape.prototype.afterBrush
  68609. * @description 绘制后的处理。
  68610. *
  68611. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  68612. *
  68613. */
  68614. }, {
  68615. key: "afterBrush",
  68616. value: function afterBrush(ctx) {
  68617. ctx.restore();
  68618. }
  68619. /**
  68620. * @function LevelRenderer.Shape.prototype.setContext
  68621. * @description 设置 fillStyle, strokeStyle, shadow 等通用绘制样式。
  68622. *
  68623. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  68624. * @param {Object} style - 样式。
  68625. *
  68626. */
  68627. }, {
  68628. key: "setContext",
  68629. value: function setContext(ctx, style) {
  68630. 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']];
  68631. for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) {
  68632. var styleProp = STYLE_CTX_MAP[i][0];
  68633. var styleValue = style[styleProp];
  68634. var ctxProp = STYLE_CTX_MAP[i][1];
  68635. if (typeof styleValue != 'undefined') {
  68636. ctx[ctxProp] = styleValue;
  68637. }
  68638. }
  68639. }
  68640. /**
  68641. * @function LevelRenderer.Shape.prototype.doClip
  68642. *
  68643. */
  68644. }, {
  68645. key: "doClip",
  68646. value: function doClip(ctx) {
  68647. var clipShapeInvTransform = SUtil_SUtil.Util_matrix.create();
  68648. if (this.__clipShapes) {
  68649. for (var i = 0; i < this.__clipShapes.length; i++) {
  68650. var clipShape = this.__clipShapes[i];
  68651. if (clipShape.needTransform) {
  68652. var m = clipShape.transform;
  68653. SUtil_SUtil.Util_matrix.invert(clipShapeInvTransform, m);
  68654. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  68655. }
  68656. ctx.beginPath();
  68657. clipShape.buildPath(ctx, clipShape.style);
  68658. ctx.clip();
  68659. // Transform back
  68660. if (clipShape.needTransform) {
  68661. var _m = clipShapeInvTransform;
  68662. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  68663. }
  68664. }
  68665. }
  68666. }
  68667. /**
  68668. * @function LevelRenderer.Shape.prototype.getHighlightStyle
  68669. * @description 根据默认样式扩展高亮样式
  68670. *
  68671. * @param {Object} style - 样式。
  68672. * @param {Object} highlightStyle - 高亮样式。
  68673. * @param {string} brushTypeOnly - brushTypeOnly。
  68674. *
  68675. */
  68676. }, {
  68677. key: "getHighlightStyle",
  68678. value: function getHighlightStyle(style, highlightStyle, brushTypeOnly) {
  68679. var newStyle = {};
  68680. for (var k in style) {
  68681. newStyle[k] = style[k];
  68682. }
  68683. var highlightColor = SUtil_SUtil.Util_color.getHighlightColor();
  68684. // 根据highlightStyle扩展
  68685. if (style.brushType != 'stroke') {
  68686. // 带填充则用高亮色加粗边线
  68687. newStyle.strokeColor = highlightColor;
  68688. // SMIC-方法修改 - start
  68689. newStyle.lineWidth = style.lineWidth || 1;
  68690. // 原始代码
  68691. // newStyle.lineWidth = (style.lineWidth || 1)
  68692. // + this.getHighlightZoom();
  68693. // 修改代码1
  68694. // if(!style.lineType || style.lineType === "solid"){
  68695. // newStyle.lineWidth = (style.lineWidth || 1)
  68696. // + this.getHighlightZoom();
  68697. // }
  68698. // else{
  68699. // newStyle.lineWidth = (style.lineWidth || 1);
  68700. // }
  68701. // SMIC-方法修改 - end
  68702. newStyle.brushType = 'both';
  68703. } else {
  68704. if (brushTypeOnly != 'stroke') {
  68705. // 描边型的则用原色加工高亮
  68706. newStyle.strokeColor = highlightColor;
  68707. // SMIC-方法修改 - start
  68708. newStyle.lineWidth = style.lineWidth || 1;
  68709. // 原始代码
  68710. // newStyle.lineWidth = (style.lineWidth || 1)
  68711. // + this.getHighlightZoom();
  68712. // 修改代码1
  68713. // if(!style.lineType || style.lineType === "solid"){
  68714. // newStyle.lineWidth = (style.lineWidth || 1)
  68715. // + this.getHighlightZoom();
  68716. // }
  68717. // else{
  68718. // newStyle.lineWidth = (style.lineWidth || 1);
  68719. // }
  68720. // SMIC-方法修改 - end
  68721. } else {
  68722. // 线型的则用原色加工高亮
  68723. newStyle.strokeColor = highlightStyle.strokeColor || SUtil_SUtil.Util_color.mix(style.strokeColor, SUtil_SUtil.Util_color.toRGB(highlightColor));
  68724. }
  68725. }
  68726. // 可自定义覆盖默认值
  68727. for (var _k2 in highlightStyle) {
  68728. if (typeof highlightStyle[_k2] != 'undefined') {
  68729. newStyle[_k2] = highlightStyle[_k2];
  68730. }
  68731. }
  68732. return newStyle;
  68733. }
  68734. /**
  68735. * @function LevelRenderer.Shape.prototype.getHighlightZoom
  68736. * @description 高亮放大效果参数,当前统一设置为6,如有需要差异设置,通过 this.type 判断实例类型
  68737. *
  68738. */
  68739. }, {
  68740. key: "getHighlightZoom",
  68741. value: function getHighlightZoom() {
  68742. return this.type != 'text' ? 6 : 2;
  68743. }
  68744. /**
  68745. * @function LevelRenderer.Shape.prototype.drift
  68746. * @description 移动位置
  68747. *
  68748. * @param {Object} dx - 横坐标变化。
  68749. * @param {Object} dy - 纵坐标变化。
  68750. *
  68751. */
  68752. }, {
  68753. key: "drift",
  68754. value: function drift(dx, dy) {
  68755. this.position[0] += dx;
  68756. this.position[1] += dy;
  68757. }
  68758. /**
  68759. * @function LevelRenderer.Shape.prototype.buildPath
  68760. * @description 构建绘制的Path。子类必须重新实现此方法。
  68761. *
  68762. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  68763. * @param {Object} style - 样式。
  68764. */
  68765. }, {
  68766. key: "buildPath",
  68767. value: function buildPath(ctx, style) {
  68768. // eslint-disable-line no-unused-vars
  68769. SUtil_SUtil.Util_log('buildPath not implemented in ' + this.type);
  68770. }
  68771. /**
  68772. * @function LevelRenderer.Shape.prototype.getRect
  68773. * @description 计算返回包围盒矩形。子类必须重新实现此方法。
  68774. *
  68775. * @param {Object} style - 样式。
  68776. */
  68777. }, {
  68778. key: "getRect",
  68779. value: function getRect(style) {
  68780. // eslint-disable-line no-unused-vars
  68781. SUtil_SUtil.Util_log('getRect not implemented in ' + this.type);
  68782. }
  68783. /**
  68784. * @function LevelRenderer.Shape.prototype.isCover
  68785. * @description 判断鼠标位置是否在图形内。
  68786. *
  68787. * @param {number} x - x。
  68788. * @param {number} y - y。
  68789. */
  68790. }, {
  68791. key: "isCover",
  68792. value: function isCover(x, y) {
  68793. var originPos = this.getTansform(x, y);
  68794. x = originPos[0];
  68795. y = originPos[1];
  68796. // 快速预判并保留判断矩形
  68797. var rect = this.style.__rect;
  68798. if (!rect) {
  68799. rect = this.style.__rect = this.getRect(this.style);
  68800. }
  68801. if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
  68802. // 矩形内
  68803. return SUtil_SUtil.Util_area.isInside(this, this.style, x, y);
  68804. }
  68805. return false;
  68806. }
  68807. /**
  68808. * @function LevelRenderer.Shape.prototype.drawText
  68809. * @description 绘制附加文本。
  68810. *
  68811. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  68812. * @param {string} style - 样式。
  68813. * @param {string} normalStyle - normalStyle 默认样式,用于定位文字显示。
  68814. */
  68815. }, {
  68816. key: "drawText",
  68817. value: function drawText(ctx, style, normalStyle) {
  68818. if (typeof style.text == 'undefined' || style.text === false) {
  68819. return;
  68820. }
  68821. // 字体颜色策略
  68822. var textColor = style.textColor || style.color || style.strokeColor;
  68823. ctx.fillStyle = textColor;
  68824. // 文本与图形间空白间隙
  68825. var dd = 10;
  68826. var al; // 文本水平对齐
  68827. var bl; // 文本垂直对齐
  68828. var tx; // 文本横坐标
  68829. var ty; // 文本纵坐标
  68830. var textPosition = style.textPosition // 用户定义
  68831. || this.textPosition // shape默认
  68832. || 'top'; // 全局默认
  68833. // Smic 方法修改 -start
  68834. var __OP = [];
  68835. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  68836. __OP = [0, 0];
  68837. } else {
  68838. __OP = this.refOriginalPosition;
  68839. }
  68840. //原代码:
  68841. // Smic 方法修改 -end
  68842. switch (textPosition) {
  68843. case 'inside':
  68844. case 'top':
  68845. case 'bottom':
  68846. case 'left':
  68847. case 'right':
  68848. if (this.getRect) {
  68849. var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style);
  68850. switch (textPosition) {
  68851. case 'inside':
  68852. tx = rect.x + rect.width / 2;
  68853. ty = rect.y + rect.height / 2;
  68854. al = 'center';
  68855. bl = 'middle';
  68856. if (style.brushType != 'stroke' && textColor == style.color) {
  68857. ctx.fillStyle = '#fff';
  68858. }
  68859. break;
  68860. case 'left':
  68861. tx = rect.x - dd;
  68862. ty = rect.y + rect.height / 2;
  68863. al = 'end';
  68864. bl = 'middle';
  68865. break;
  68866. case 'right':
  68867. tx = rect.x + rect.width + dd;
  68868. ty = rect.y + rect.height / 2;
  68869. al = 'start';
  68870. bl = 'middle';
  68871. break;
  68872. case 'top':
  68873. tx = rect.x + rect.width / 2;
  68874. ty = rect.y - dd;
  68875. al = 'center';
  68876. bl = 'bottom';
  68877. break;
  68878. case 'bottom':
  68879. tx = rect.x + rect.width / 2;
  68880. ty = rect.y + rect.height + dd;
  68881. al = 'center';
  68882. bl = 'top';
  68883. break;
  68884. }
  68885. }
  68886. break;
  68887. case 'start':
  68888. case 'end':
  68889. var xStart = 0;
  68890. var xEnd = 0;
  68891. var yStart = 0;
  68892. var yEnd = 0;
  68893. if (typeof style.pointList != 'undefined') {
  68894. var pointList = style.pointList;
  68895. if (pointList.length < 2) {
  68896. // 少于2个点就不画了~
  68897. return;
  68898. }
  68899. var length = pointList.length;
  68900. switch (textPosition) {
  68901. // Smic 方法修改 -start
  68902. case 'start':
  68903. xStart = pointList[0][0] + __OP[0];
  68904. xEnd = pointList[1][0] + __OP[0];
  68905. yStart = pointList[0][1] + __OP[1];
  68906. yEnd = pointList[1][1] + __OP[1];
  68907. break;
  68908. case 'end':
  68909. xStart = pointList[length - 2][0] + __OP[0];
  68910. xEnd = pointList[length - 1][0] + __OP[0];
  68911. yStart = pointList[length - 2][1] + __OP[1];
  68912. yEnd = pointList[length - 1][1] + __OP[1];
  68913. break;
  68914. //原代码:
  68915. /*
  68916. case 'start':
  68917. xStart = pointList[0][0];
  68918. xEnd = pointList[1][0];
  68919. yStart = pointList[0][1];
  68920. yEnd = pointList[1][1];
  68921. break;
  68922. case 'end':
  68923. xStart = pointList[length - 2][0];
  68924. xEnd = pointList[length - 1][0];
  68925. yStart = pointList[length - 2][1];
  68926. yEnd = pointList[length - 1][1];
  68927. break;
  68928. */
  68929. // Smic 方法修改 -end
  68930. }
  68931. } else {
  68932. // Smic 方法修改 -start
  68933. xStart = style.xStart + __OP[0] || 0;
  68934. xEnd = style.xEnd + __OP[0] || 0;
  68935. yStart = style.yStart + __OP[1] || 0;
  68936. yEnd = style.yEnd + __OP[1] || 0;
  68937. //原代码:
  68938. /*
  68939. xStart = style.xStart || 0;
  68940. xEnd = style.xEnd || 0;
  68941. yStart = style.yStart || 0;
  68942. yEnd = style.yEnd || 0;
  68943. */
  68944. // Smic 方法修改 -end
  68945. }
  68946. switch (textPosition) {
  68947. case 'start':
  68948. al = xStart < xEnd ? 'end' : 'start';
  68949. bl = yStart < yEnd ? 'bottom' : 'top';
  68950. tx = xStart;
  68951. ty = yStart;
  68952. break;
  68953. case 'end':
  68954. al = xStart < xEnd ? 'start' : 'end';
  68955. bl = yStart < yEnd ? 'top' : 'bottom';
  68956. tx = xEnd;
  68957. ty = yEnd;
  68958. break;
  68959. }
  68960. dd -= 4;
  68961. if (xStart && xEnd && xStart != xEnd) {
  68962. tx -= al == 'end' ? dd : -dd;
  68963. } else {
  68964. al = 'center';
  68965. }
  68966. if (yStart != yEnd) {
  68967. ty -= bl == 'bottom' ? dd : -dd;
  68968. } else {
  68969. bl = 'middle';
  68970. }
  68971. break;
  68972. case 'specific':
  68973. tx = style.textX || 0;
  68974. ty = style.textY || 0;
  68975. al = 'start';
  68976. bl = 'middle';
  68977. break;
  68978. }
  68979. // Smic 方法修改 -start
  68980. if (style.labelXOffset && !isNaN(style.labelXOffset)) {
  68981. tx += style.labelXOffset;
  68982. }
  68983. if (style.labelYOffset && !isNaN(style.labelYOffset)) {
  68984. ty += style.labelYOffset;
  68985. }
  68986. //原代码:
  68987. // Smic 方法修改 -end
  68988. if (tx != null && ty != null) {
  68989. Shape._fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl);
  68990. }
  68991. }
  68992. /**
  68993. * @function LevelRenderer.Shape.prototype.modSelf
  68994. * @description 图形发生改变
  68995. */
  68996. }, {
  68997. key: "modSelf",
  68998. value: function modSelf() {
  68999. this.__dirty = true;
  69000. if (this.style) {
  69001. this.style.__rect = null;
  69002. }
  69003. if (this.highlightStyle) {
  69004. this.highlightStyle.__rect = null;
  69005. }
  69006. }
  69007. /**
  69008. * @function LevelRenderer.Shape.prototype.isSilent
  69009. * @description 图形是否会触发事件,通过 bind 绑定的事件
  69010. */
  69011. }, {
  69012. key: "isSilent",
  69013. value: function isSilent() {
  69014. 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);
  69015. }
  69016. /**
  69017. * @function LevelRenderer.Shape.prototype.setCtxGlobalAlpha
  69018. * @description 设置 Cavans 上下文全局透明度
  69019. *
  69020. * @param {Object} _ctx - Cavans 上下文
  69021. * @param {string} type - one of 'stroke', 'fill', or 'reset'
  69022. * @param {Object} style - Symbolizer hash
  69023. */
  69024. }, {
  69025. key: "setCtxGlobalAlpha",
  69026. value: function setCtxGlobalAlpha(_ctx, type, style) {
  69027. if (type === "fill") {
  69028. _ctx.globalAlpha = typeof style["fillOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['fillOpacity'];
  69029. } else if (type === "stroke") {
  69030. _ctx.globalAlpha = typeof style["strokeOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['strokeOpacity'];
  69031. } else {
  69032. _ctx.globalAlpha = typeof style["opacity"] === "undefined" ? 1 : style['opacity'];
  69033. }
  69034. }
  69035. /**
  69036. * @function LevelRenderer.Shape.prototype._fillText
  69037. * @description 填充文本
  69038. */
  69039. }], [{
  69040. key: "_fillText",
  69041. value: function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) {
  69042. if (textFont) {
  69043. ctx.font = textFont;
  69044. }
  69045. ctx.textAlign = textAlign;
  69046. ctx.textBaseline = textBaseline;
  69047. var rect = Shape._getTextRect(text, x, y, textFont, textAlign, textBaseline);
  69048. text = (text + '').split('\n');
  69049. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  69050. switch (textBaseline) {
  69051. case 'top':
  69052. y = rect.y;
  69053. break;
  69054. case 'bottom':
  69055. y = rect.y + lineHeight;
  69056. break;
  69057. default:
  69058. y = rect.y + lineHeight / 2;
  69059. }
  69060. for (var i = 0, l = text.length; i < l; i++) {
  69061. ctx.fillText(text[i], x, y);
  69062. y += lineHeight;
  69063. }
  69064. }
  69065. /**
  69066. * @function LevelRenderer.Shape._getTextRect
  69067. * @description 返回矩形区域,用于局部刷新和文字定位
  69068. *
  69069. * @param {string} text - text。
  69070. * @param {number} x - x。
  69071. * @param {number} y - y。
  69072. * @param {string} textFont - textFont。
  69073. * @param {string} textAlign - textAlign。
  69074. * @param {string} textBaseline - textBaseline。
  69075. * @return {Object} 矩形区域。
  69076. */
  69077. }, {
  69078. key: "_getTextRect",
  69079. value: function _getTextRect(text, x, y, textFont, textAlign, textBaseline) {
  69080. var width = SUtil_SUtil.Util_area.getTextWidth(text, textFont);
  69081. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  69082. text = (text + '').split('\n');
  69083. switch (textAlign) {
  69084. case 'end':
  69085. case 'right':
  69086. x -= width;
  69087. break;
  69088. case 'center':
  69089. x -= width / 2;
  69090. break;
  69091. }
  69092. switch (textBaseline) {
  69093. case 'top':
  69094. break;
  69095. case 'bottom':
  69096. y -= lineHeight * text.length;
  69097. break;
  69098. default:
  69099. y -= lineHeight * text.length / 2;
  69100. }
  69101. return {
  69102. x: x,
  69103. y: y,
  69104. width: width,
  69105. height: lineHeight * text.length
  69106. };
  69107. }
  69108. }]);
  69109. return Shape;
  69110. }(mixinExt(Eventful, Transformable));
  69111. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPoint.js
  69112. 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); }
  69113. function SmicPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69114. 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); } }
  69115. 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; }
  69116. 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); }
  69117. function SmicPoint_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPoint_getPrototypeOf(object); if (object === null) break; } return object; }
  69118. 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); }
  69119. 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); }
  69120. 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); }; }
  69121. 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); }
  69122. function SmicPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69123. 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; } }
  69124. function SmicPoint_getPrototypeOf(o) { SmicPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPoint_getPrototypeOf(o); }
  69125. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  69126. * This program are made available under the terms of the Apache License, Version 2.0
  69127. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69128. /**
  69129. * @private
  69130. * @class LevelRenderer.Shape.SmicPoint
  69131. * @category Visualization Theme
  69132. * @classdesc 点。
  69133. * @extends LevelRenderer.Shape
  69134. * @example
  69135. * var shape = new LevelRenderer.Shape.SmicPoint({
  69136. * style: {
  69137. * x: 100,
  69138. * y: 100,
  69139. * r: 40,
  69140. * brushType: 'both',
  69141. * color: 'blue',
  69142. * strokeColor: 'red',
  69143. * lineWidth: 3,
  69144. * text: 'point'
  69145. * }
  69146. * });
  69147. * levelRenderer.addShape(shape);
  69148. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  69149. *
  69150. */
  69151. var SmicPoint = /*#__PURE__*/function (_Shape) {
  69152. SmicPoint_inherits(SmicPoint, _Shape);
  69153. var _super = SmicPoint_createSuper(SmicPoint);
  69154. function SmicPoint(options) {
  69155. var _this;
  69156. SmicPoint_classCallCheck(this, SmicPoint);
  69157. _this = _super.call(this, options);
  69158. /**
  69159. * @member {string} LevelRenderer.Shape.SmicPoint.prototype.type
  69160. * @description 图形类型。
  69161. */
  69162. _this.type = 'smicpoint';
  69163. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  69164. _this.refOriginalPosition = [0, 0];
  69165. }
  69166. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPoint";
  69167. return _this;
  69168. }
  69169. /**
  69170. * @function cdestroy
  69171. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  69172. */
  69173. SmicPoint_createClass(SmicPoint, [{
  69174. key: "destroy",
  69175. value: function destroy() {
  69176. this.type = null;
  69177. SmicPoint_get(SmicPoint_getPrototypeOf(SmicPoint.prototype), "destroy", this).call(this);
  69178. }
  69179. /**
  69180. * @function LevelRenderer.Shape.SmicPoint.prototype.buildPath
  69181. * @description 创建点触。
  69182. *
  69183. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69184. * @param {Object} style - style。
  69185. *
  69186. */
  69187. }, {
  69188. key: "buildPath",
  69189. value: function buildPath(ctx, style) {
  69190. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69191. this.refOriginalPosition = [0, 0];
  69192. }
  69193. var __OP = this.refOriginalPosition;
  69194. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, true);
  69195. return;
  69196. }
  69197. /**
  69198. * @function LevelRenderer.Shape.SmicPoint.prototype.getRect
  69199. * @description 计算返回点的包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  69200. *
  69201. * @param {Object} style - style
  69202. * @return {Object} 边框对象。包含属性:x,y,width,height。
  69203. */
  69204. }, {
  69205. key: "getRect",
  69206. value: function getRect(style) {
  69207. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69208. this.refOriginalPosition = [0, 0];
  69209. }
  69210. var __OP = this.refOriginalPosition;
  69211. if (style.__rect) {
  69212. return style.__rect;
  69213. }
  69214. var lineWidth;
  69215. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  69216. lineWidth = style.lineWidth || 1;
  69217. } else {
  69218. lineWidth = 0;
  69219. }
  69220. style.__rect = {
  69221. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  69222. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  69223. width: style.r * 2 + lineWidth,
  69224. height: style.r * 2 + lineWidth
  69225. };
  69226. return style.__rect;
  69227. }
  69228. }]);
  69229. return SmicPoint;
  69230. }(Shape_Shape);
  69231. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicText.js
  69232. 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); }
  69233. function SmicText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69234. 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); } }
  69235. 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; }
  69236. 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); }
  69237. function SmicText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicText_getPrototypeOf(object); if (object === null) break; } return object; }
  69238. 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); }
  69239. 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); }
  69240. 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); }; }
  69241. 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); }
  69242. function SmicText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69243. 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; } }
  69244. function SmicText_getPrototypeOf(o) { SmicText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicText_getPrototypeOf(o); }
  69245. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  69246. * This program are made available under the terms of the Apache License, Version 2.0
  69247. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69248. /**
  69249. * @private
  69250. * @class LevelRenderer.Shape.SmicText
  69251. * @category Visualization Theme
  69252. * @extends {LevelRenderer.Shape}
  69253. * @example
  69254. * var shape = new LevelRenderer.Shape.SmicText({
  69255. * style: {
  69256. * text: 'Label',
  69257. * x: 100,
  69258. * y: 100,
  69259. * textFont: '14px Arial'
  69260. * }
  69261. * });
  69262. * levelRenderer.addShape(shape);
  69263. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  69264. */
  69265. var SmicText = /*#__PURE__*/function (_Shape) {
  69266. SmicText_inherits(SmicText, _Shape);
  69267. var _super = SmicText_createSuper(SmicText);
  69268. function SmicText(options) {
  69269. var _this;
  69270. SmicText_classCallCheck(this, SmicText);
  69271. _this = _super.call(this, options);
  69272. /**
  69273. * @member {string} LevelRenderer.Shape.SmicText.prototype.type
  69274. * @description 图形类型.
  69275. */
  69276. _this.type = 'smictext';
  69277. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  69278. _this.refOriginalPosition = [0, 0];
  69279. }
  69280. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicText";
  69281. return _this;
  69282. }
  69283. /**
  69284. * @function LevelRenderer.Shape.SmicText.prototype.destroy
  69285. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  69286. */
  69287. SmicText_createClass(SmicText, [{
  69288. key: "destroy",
  69289. value: function destroy() {
  69290. this.type = null;
  69291. SmicText_get(SmicText_getPrototypeOf(SmicText.prototype), "destroy", this).call(this);
  69292. }
  69293. /**
  69294. * @function LevelRenderer.Shape.SmicText.prototype.brush
  69295. * @description 笔触。
  69296. *
  69297. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69298. * @param {boolean} isHighlight - 是否使用高亮属性。
  69299. *
  69300. */
  69301. }, {
  69302. key: "brush",
  69303. value: function brush(ctx, isHighlight) {
  69304. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69305. this.refOriginalPosition = [0, 0];
  69306. }
  69307. var __OP = this.refOriginalPosition;
  69308. var style = this.style;
  69309. if (isHighlight) {
  69310. // 根据style扩展默认高亮样式
  69311. style = this.getHighlightStyle(style, this.highlightStyle || {});
  69312. }
  69313. if (typeof style.text == 'undefined' || style.text === false) {
  69314. return;
  69315. }
  69316. ctx.save();
  69317. this.doClip(ctx);
  69318. this.setContext(ctx, style);
  69319. // 设置transform
  69320. this.setTransform(ctx);
  69321. if (style.textFont) {
  69322. ctx.font = style.textFont;
  69323. }
  69324. ctx.textAlign = style.textAlign || 'start';
  69325. ctx.textBaseline = style.textBaseline || 'middle';
  69326. var text = (style.text + '').split('\n');
  69327. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  69328. var rect = this.getRectNoRotation(style);
  69329. // var x = style.x;
  69330. var x = style.x + __OP[0];
  69331. var y;
  69332. if (style.textBaseline == 'top') {
  69333. y = rect.y;
  69334. } else if (style.textBaseline == 'bottom') {
  69335. y = rect.y + lineHeight;
  69336. } else {
  69337. y = rect.y + lineHeight / 2;
  69338. }
  69339. var ox = style.x + __OP[0];
  69340. var oy = style.y + __OP[1];
  69341. //文本绘制
  69342. for (var i = 0, l = text.length; i < l; i++) {
  69343. //是否渲染矩形背景及颜色
  69344. if (style.labelRect) {
  69345. //+4,-2是为了让文字距边框左右边缘有点间隔
  69346. ctx.fillRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  69347. ctx.fillStyle = style.strokeColor;
  69348. ctx.strokeRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  69349. ctx.fillStyle = style.textColor;
  69350. }
  69351. switch (style.brushType) {
  69352. case 'stroke':
  69353. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69354. if (style.textRotation && style.textRotation !== 0) {
  69355. ctx.save();
  69356. ctx.translate(ox, oy);
  69357. ctx.rotate(style.textRotation * Math.PI / 180);
  69358. if (style.textBaseline == 'top') {
  69359. if (style.maxWidth) {
  69360. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  69361. } else {
  69362. ctx.strokeText(text[i], 0, lineHeight * i);
  69363. }
  69364. } else if (style.textBaseline == 'bottom') {
  69365. if (style.maxWidth) {
  69366. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  69367. } else {
  69368. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  69369. }
  69370. } else {
  69371. if (style.maxWidth) {
  69372. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  69373. } else {
  69374. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  69375. }
  69376. }
  69377. ctx.restore();
  69378. } else {
  69379. if (style.maxWidth) {
  69380. ctx.strokeText(text[i], x, y, style.maxWidth);
  69381. } else {
  69382. ctx.strokeText(text[i], x, y);
  69383. }
  69384. }
  69385. this.setCtxGlobalAlpha(ctx, "reset", style);
  69386. break;
  69387. case 'both':
  69388. if (style.textRotation && style.textRotation !== 0) {
  69389. ctx.save();
  69390. ctx.translate(ox, oy);
  69391. ctx.rotate(style.textRotation * Math.PI / 180);
  69392. if (style.textBaseline == 'top') {
  69393. if (style.maxWidth) {
  69394. this.setCtxGlobalAlpha(ctx, "fill", style);
  69395. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  69396. this.setCtxGlobalAlpha(ctx, "reset", style);
  69397. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69398. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  69399. this.setCtxGlobalAlpha(ctx, "reset", style);
  69400. } else {
  69401. this.setCtxGlobalAlpha(ctx, "fill", style);
  69402. ctx.fillText(text[i], 0, lineHeight * i);
  69403. this.setCtxGlobalAlpha(ctx, "reset", style);
  69404. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69405. ctx.strokeText(text[i], 0, lineHeight * i);
  69406. this.setCtxGlobalAlpha(ctx, "reset", style);
  69407. }
  69408. } else if (style.textBaseline == 'bottom') {
  69409. if (style.maxWidth) {
  69410. this.setCtxGlobalAlpha(ctx, "fill", style);
  69411. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  69412. this.setCtxGlobalAlpha(ctx, "reset", style);
  69413. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69414. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  69415. this.setCtxGlobalAlpha(ctx, "reset", style);
  69416. } else {
  69417. this.setCtxGlobalAlpha(ctx, "fill", style);
  69418. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  69419. this.setCtxGlobalAlpha(ctx, "reset", style);
  69420. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69421. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  69422. this.setCtxGlobalAlpha(ctx, "reset", style);
  69423. }
  69424. } else {
  69425. if (style.maxWidth) {
  69426. this.setCtxGlobalAlpha(ctx, "fill", style);
  69427. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  69428. this.setCtxGlobalAlpha(ctx, "reset", style);
  69429. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69430. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  69431. this.setCtxGlobalAlpha(ctx, "reset", style);
  69432. } else {
  69433. this.setCtxGlobalAlpha(ctx, "fill", style);
  69434. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  69435. this.setCtxGlobalAlpha(ctx, "reset", style);
  69436. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69437. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  69438. this.setCtxGlobalAlpha(ctx, "reset", style);
  69439. }
  69440. }
  69441. ctx.restore();
  69442. } else {
  69443. if (style.maxWidth) {
  69444. this.setCtxGlobalAlpha(ctx, "fill", style);
  69445. ctx.fillText(text[i], x, y, style.maxWidth);
  69446. this.setCtxGlobalAlpha(ctx, "reset", style);
  69447. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69448. ctx.strokeText(text[i], x, y, style.maxWidth);
  69449. this.setCtxGlobalAlpha(ctx, "reset", style);
  69450. } else {
  69451. this.setCtxGlobalAlpha(ctx, "fill", style);
  69452. ctx.fillText(text[i], x, y);
  69453. this.setCtxGlobalAlpha(ctx, "reset", style);
  69454. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69455. ctx.strokeText(text[i], x, y);
  69456. this.setCtxGlobalAlpha(ctx, "reset", style);
  69457. }
  69458. }
  69459. break;
  69460. default:
  69461. //fill or others
  69462. this.setCtxGlobalAlpha(ctx, "fill", style);
  69463. if (style.textRotation && style.textRotation !== 0) {
  69464. ctx.save();
  69465. ctx.translate(ox, oy);
  69466. ctx.rotate(style.textRotation * Math.PI / 180);
  69467. if (style.textBaseline == 'top') {
  69468. if (style.maxWidth) {
  69469. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  69470. } else {
  69471. ctx.fillText(text[i], 0, lineHeight * i);
  69472. }
  69473. } else if (style.textBaseline == 'bottom') {
  69474. if (style.maxWidth) {
  69475. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  69476. } else {
  69477. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  69478. }
  69479. } else {
  69480. if (style.maxWidth) {
  69481. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  69482. } else {
  69483. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  69484. }
  69485. }
  69486. ctx.restore();
  69487. } else {
  69488. if (style.maxWidth) {
  69489. ctx.fillText(text[i], x, y, style.maxWidth);
  69490. } else {
  69491. ctx.fillText(text[i], x, y);
  69492. }
  69493. }
  69494. this.setCtxGlobalAlpha(ctx, "reset", style);
  69495. }
  69496. y += lineHeight;
  69497. }
  69498. ctx.restore();
  69499. return;
  69500. }
  69501. /**
  69502. * @function LevelRenderer.Shape.SmicText.prototype.getRect
  69503. * @description 返回文字包围盒矩形
  69504. */
  69505. }, {
  69506. key: "getRect",
  69507. value: function getRect(style) {
  69508. if (style.__rect) {
  69509. return style.__rect;
  69510. }
  69511. var left, top, right, bottom;
  69512. var tbg = this.getTextBackground(style, true);
  69513. for (var i = 0, len = tbg.length; i < len; i++) {
  69514. var poi = tbg[i];
  69515. //用第一个点初始化
  69516. if (i == 0) {
  69517. left = poi[0];
  69518. right = poi[0];
  69519. top = poi[1];
  69520. bottom = poi[1];
  69521. } else {
  69522. if (poi[0] < left) {
  69523. left = poi[0];
  69524. }
  69525. if (poi[0] > right) {
  69526. right = poi[0];
  69527. }
  69528. if (poi[1] < top) {
  69529. top = poi[1];
  69530. }
  69531. if (poi[1] > bottom) {
  69532. bottom = poi[1];
  69533. }
  69534. }
  69535. }
  69536. style.__rect = {
  69537. x: left,
  69538. y: top,
  69539. width: right - left,
  69540. height: bottom - top
  69541. };
  69542. return style.__rect;
  69543. }
  69544. /**
  69545. * @function LevelRenderer.Shape.SmicText.prototype.getRectNoRotation
  69546. * @description 返回忽略旋转和maxWidth时文字包围盒矩形
  69547. */
  69548. }, {
  69549. key: "getRectNoRotation",
  69550. value: function getRectNoRotation(style) {
  69551. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69552. this.refOriginalPosition = [0, 0];
  69553. }
  69554. var __OP = this.refOriginalPosition;
  69555. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  69556. var width = SUtil_SUtil.Util_area.getTextWidth(style.text, style.textFont);
  69557. var height = SUtil_SUtil.Util_area.getTextHeight(style.text, style.textFont);
  69558. //处理文字位置,注:文本的绘制是由此 rect 决定
  69559. var textX = style.x + __OP[0]; // 默认start == left
  69560. if (style.textAlign == 'end' || style.textAlign == 'right') {
  69561. textX -= width;
  69562. } else if (style.textAlign == 'center') {
  69563. textX -= width / 2;
  69564. }
  69565. var textY;
  69566. if (style.textBaseline == 'top') {
  69567. // textY = style.y;
  69568. textY = style.y + __OP[1];
  69569. } else if (style.textBaseline == 'bottom') {
  69570. textY = style.y + __OP[1] - height;
  69571. } else {
  69572. // middle
  69573. textY = style.y + __OP[1] - height / 2;
  69574. }
  69575. var isWidthChangeByMaxWidth = false;
  69576. var widthBeforeChangeByMaxWidth;
  69577. //处理 maxWidth
  69578. if (style.maxWidth) {
  69579. var maxWidth = parseInt(style.maxWidth);
  69580. if (maxWidth < width) {
  69581. widthBeforeChangeByMaxWidth = width;
  69582. isWidthChangeByMaxWidth = true;
  69583. width = maxWidth;
  69584. }
  69585. textX = style.x + __OP[0];
  69586. if (style.textAlign == 'end' || style.textAlign == 'right') {
  69587. textX -= width;
  69588. } else if (style.textAlign == 'center') {
  69589. textX -= width / 2;
  69590. }
  69591. }
  69592. //处理斜体字
  69593. if (style.textFont) {
  69594. var textFont = style.textFont;
  69595. var textFontStr = textFont.toLowerCase();
  69596. if (textFontStr.indexOf("italic") > -1) {
  69597. if (isWidthChangeByMaxWidth === true) {
  69598. width += lineHeight / 3 * (width / widthBeforeChangeByMaxWidth);
  69599. } else {
  69600. width += lineHeight / 3;
  69601. }
  69602. }
  69603. }
  69604. var rect = {
  69605. x: textX,
  69606. y: textY,
  69607. width: width,
  69608. height: height
  69609. };
  69610. return rect;
  69611. }
  69612. /**
  69613. * @function LevelRenderer.Shape.SmicText.prototype.getTextBackground
  69614. * @description 获取文本背景框范围
  69615. *
  69616. * @param {Object} style - 样式。
  69617. * @param {boolean} redo - 是否强制重新计算 textBackground。
  69618. */
  69619. }, {
  69620. key: "getTextBackground",
  69621. value: function getTextBackground(style, redo) {
  69622. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69623. this.refOriginalPosition = [0, 0];
  69624. }
  69625. var __OP = this.refOriginalPosition;
  69626. if (!redo && style.__textBackground) {
  69627. return style.__textBackground;
  69628. }
  69629. //不旋转时矩形框
  69630. var rect = this.getRectNoRotation(style);
  69631. //旋转中心点
  69632. var ox = style.x + __OP[0];
  69633. var oy = style.y + __OP[1];
  69634. //背景框
  69635. var background = [];
  69636. if (style.textRotation && style.textRotation !== 0) {
  69637. var textRotation = style.textRotation;
  69638. var ltPoi = this.getRotatedLocation(rect.x, rect.y, ox, oy, textRotation);
  69639. var rtPoi = this.getRotatedLocation(rect.x + rect.width, rect.y, ox, oy, textRotation);
  69640. var rbPoi = this.getRotatedLocation(rect.x + rect.width, rect.y + rect.height, ox, oy, textRotation);
  69641. var lbPoi = this.getRotatedLocation(rect.x, rect.y + rect.height, ox, oy, textRotation);
  69642. background.push(ltPoi);
  69643. background.push(rtPoi);
  69644. background.push(rbPoi);
  69645. background.push(lbPoi);
  69646. } else {
  69647. var _ltPoi = [rect.x, rect.y];
  69648. var _rtPoi = [rect.x + rect.width, rect.y];
  69649. var _rbPoi = [rect.x + rect.width, rect.y + rect.height];
  69650. var _lbPoi = [rect.x, rect.y + rect.height];
  69651. background.push(_ltPoi);
  69652. background.push(_rtPoi);
  69653. background.push(_rbPoi);
  69654. background.push(_lbPoi);
  69655. }
  69656. style.__textBackground = background;
  69657. return style.__textBackground;
  69658. }
  69659. /**
  69660. * @function LevelRenderer.Shape.SmicText.prototype.getRotatedLocation
  69661. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)
  69662. *
  69663. * @param {number} x - 旋转点横坐标。
  69664. * @param {number} y - 旋转点纵坐标。
  69665. * @param {number} rx - 旋转中心点横坐标。
  69666. * @param {number} ry - 旋转中心点纵坐标。
  69667. * @param {number} angle - 旋转角度(度)。
  69668. * @return {Array.<number>} 旋转后的坐标位置,长度为 2 的一维数组,数组第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  69669. */
  69670. }, {
  69671. key: "getRotatedLocation",
  69672. value: function getRotatedLocation(x, y, rx, ry, angle) {
  69673. var loc = new Array(),
  69674. x0,
  69675. y0;
  69676. y = -y;
  69677. ry = -ry;
  69678. angle = -angle; //顺时针旋转
  69679. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  69680. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  69681. loc[0] = x0;
  69682. loc[1] = -y0;
  69683. return loc;
  69684. }
  69685. }]);
  69686. return SmicText;
  69687. }(Shape_Shape);
  69688. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicCircle.js
  69689. 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); }
  69690. function SmicCircle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69691. 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); } }
  69692. 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; }
  69693. 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); }
  69694. function SmicCircle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicCircle_getPrototypeOf(object); if (object === null) break; } return object; }
  69695. 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); }
  69696. 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); }
  69697. 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); }; }
  69698. 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); }
  69699. function SmicCircle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69700. 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; } }
  69701. function SmicCircle_getPrototypeOf(o) { SmicCircle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicCircle_getPrototypeOf(o); }
  69702. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  69703. * This program are made available under the terms of the Apache License, Version 2.0
  69704. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69705. /**
  69706. * @private
  69707. * @class LevelRenderer.Shape.SmicCircle
  69708. * @category Visualization Theme
  69709. * @classdesc 圆形
  69710. * @extends LevelRenderer.Shape
  69711. * @example
  69712. * var shape = new LevelRenderer.Shape.SmicCircle({
  69713. * style: {
  69714. * x: 100,
  69715. * y: 100,
  69716. * r: 60,
  69717. * brushType: "both",
  69718. * color: "blue",
  69719. * strokeColor: "red",
  69720. * lineWidth: 3,
  69721. * text: "Circle"
  69722. * }
  69723. * });
  69724. * levelRenderer.addShape(shape);
  69725. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  69726. *
  69727. */
  69728. var SmicCircle = /*#__PURE__*/function (_Shape) {
  69729. SmicCircle_inherits(SmicCircle, _Shape);
  69730. var _super = SmicCircle_createSuper(SmicCircle);
  69731. function SmicCircle(options) {
  69732. var _this;
  69733. SmicCircle_classCallCheck(this, SmicCircle);
  69734. _this = _super.call(this, options);
  69735. /**
  69736. * @member {string} LevelRenderer.Shape.SmicCircle.prototype.type
  69737. * @description 图形类型。
  69738. */
  69739. _this.type = 'smiccircle';
  69740. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  69741. _this.refOriginalPosition = [0, 0];
  69742. }
  69743. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicCircle";
  69744. return _this;
  69745. }
  69746. /**
  69747. * @function LevelRenderer.Shape.SmicCircle.prototype.destroy
  69748. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  69749. */
  69750. SmicCircle_createClass(SmicCircle, [{
  69751. key: "destroy",
  69752. value: function destroy() {
  69753. this.type = null;
  69754. SmicCircle_get(SmicCircle_getPrototypeOf(SmicCircle.prototype), "destroy", this).call(this);
  69755. }
  69756. /**
  69757. * @function LevelRenderer.Shape.SmicCircle.prototype.buildPath
  69758. * @description 创建图形路径。
  69759. *
  69760. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69761. * @param {Object} style - style。
  69762. *
  69763. */
  69764. }, {
  69765. key: "buildPath",
  69766. value: function buildPath(ctx, style) {
  69767. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69768. this.refOriginalPosition = [0, 0];
  69769. }
  69770. var __OP = this.refOriginalPosition;
  69771. var x = style.x + __OP[0]; // 圆心x
  69772. var y = style.y + __OP[1]; // 圆心y
  69773. ctx.moveTo(x + style.r, y);
  69774. ctx.arc(x, y, style.r, 0, Math.PI * 2, true);
  69775. return true;
  69776. }
  69777. /**
  69778. * @function LevelRenderer.Shape.SmicCircle.prototype.getRect
  69779. * @description 返回圆形包围盒矩形
  69780. *
  69781. * @param {Object} style - style
  69782. * @return {Object} 边框对象。包含属性:x,y,width,height。
  69783. *
  69784. */
  69785. }, {
  69786. key: "getRect",
  69787. value: function getRect(style) {
  69788. if (style.__rect) {
  69789. return style.__rect;
  69790. }
  69791. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69792. this.refOriginalPosition = [0, 0];
  69793. }
  69794. var __OP = this.refOriginalPosition;
  69795. var x = style.x + __OP[0]; // 圆心x
  69796. var y = style.y + __OP[1]; // 圆心y
  69797. var r = style.r; // 圆r
  69798. var lineWidth;
  69799. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  69800. lineWidth = style.lineWidth || 1;
  69801. } else {
  69802. lineWidth = 0;
  69803. }
  69804. style.__rect = {
  69805. x: Math.round(x - r - lineWidth / 2),
  69806. y: Math.round(y - r - lineWidth / 2),
  69807. width: r * 2 + lineWidth,
  69808. height: r * 2 + lineWidth
  69809. };
  69810. return style.__rect;
  69811. }
  69812. }]);
  69813. return SmicCircle;
  69814. }(Shape_Shape);
  69815. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPolygon.js
  69816. 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); }
  69817. function SmicPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69818. 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); } }
  69819. 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; }
  69820. 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); }
  69821. function SmicPolygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPolygon_getPrototypeOf(object); if (object === null) break; } return object; }
  69822. 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); }
  69823. 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); }
  69824. 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); }; }
  69825. 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); }
  69826. function SmicPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69827. 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; } }
  69828. function SmicPolygon_getPrototypeOf(o) { SmicPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPolygon_getPrototypeOf(o); }
  69829. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  69830. * This program are made available under the terms of the Apache License, Version 2.0
  69831. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69832. /**
  69833. * @private
  69834. * @class LevelRenderer.Shape.SmicPolygon
  69835. * @category Visualization Theme
  69836. * @classdesc 多边形。
  69837. * @extends LevelRenderer.Shape
  69838. * @example
  69839. * var shape = new LevelRenderer.Shape.SmicPolygon({
  69840. * style: {
  69841. * // 100x100 的正方形
  69842. * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]],
  69843. * color: 'blue'
  69844. * }
  69845. * });
  69846. * levelRenderer.addShape(shape);
  69847. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  69848. */
  69849. var SmicPolygon = /*#__PURE__*/function (_Shape) {
  69850. SmicPolygon_inherits(SmicPolygon, _Shape);
  69851. var _super = SmicPolygon_createSuper(SmicPolygon);
  69852. function SmicPolygon(options) {
  69853. var _this;
  69854. SmicPolygon_classCallCheck(this, SmicPolygon);
  69855. _this = _super.call(this, options);
  69856. /**
  69857. * @member {string} LevelRenderer.Shape.SmicPolygon.prototype.type
  69858. * @description 图形类型.
  69859. */
  69860. _this.type = 'smicpolygon';
  69861. /**
  69862. * @member {Array} LevelRenderer.Shape.SmicPolygon.prototype._holePolygonPointList
  69863. * @description 岛洞面多边形顶点数组(三维数组)
  69864. *
  69865. */
  69866. _this.holePolygonPointLists = null;
  69867. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  69868. _this.refOriginalPosition = [0, 0];
  69869. }
  69870. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPolygon";
  69871. return _this;
  69872. }
  69873. /**
  69874. * @function LevelRenderer.Shape.SmicPolygon.prototype.destroy
  69875. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  69876. */
  69877. SmicPolygon_createClass(SmicPolygon, [{
  69878. key: "destroy",
  69879. value: function destroy() {
  69880. this.type = null;
  69881. this.holePolygonPointLists = null;
  69882. SmicPolygon_get(SmicPolygon_getPrototypeOf(SmicPolygon.prototype), "destroy", this).call(this);
  69883. }
  69884. /**
  69885. * @function LevelRenderer.Shape.SmicPolygon.prototype.brush
  69886. * @description 笔触。
  69887. *
  69888. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69889. * @param {boolean} isHighlight - 是否使用高亮属性。
  69890. *
  69891. */
  69892. }, {
  69893. key: "brush",
  69894. value: function brush(ctx, isHighlight) {
  69895. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  69896. this.refOriginalPosition = [0, 0];
  69897. }
  69898. var style = this.style;
  69899. if (isHighlight) {
  69900. // 根据style扩展默认高亮样式
  69901. style = this.getHighlightStyle(style, this.highlightStyle || {});
  69902. }
  69903. ctx.save();
  69904. this.setContext(ctx, style);
  69905. // 设置 transform
  69906. this.setTransform(ctx);
  69907. // 先 fill 再stroke
  69908. var hasPath = false;
  69909. if (style.brushType == 'fill' || style.brushType == 'both' || typeof style.brushType == 'undefined') {
  69910. // 默认为fill
  69911. ctx.beginPath();
  69912. if (style.lineType == 'dashed' || style.lineType == 'dotted' || style.lineType == 'dot' || style.lineType == 'dash' || style.lineType == 'dashdot' || style.lineType == 'longdash' || style.lineType == 'longdashdot') {
  69913. // 特殊处理,虚线围不成path,实线再build一次
  69914. this.buildPath(ctx, {
  69915. lineType: 'solid',
  69916. lineWidth: style.lineWidth,
  69917. pointList: style.pointList
  69918. });
  69919. } else {
  69920. this.buildPath(ctx, style);
  69921. hasPath = true; // 这个path能用
  69922. }
  69923. ctx.closePath();
  69924. this.setCtxGlobalAlpha(ctx, "fill", style);
  69925. ctx.fill();
  69926. this.setCtxGlobalAlpha(ctx, "reset", style);
  69927. }
  69928. if (style.lineWidth > 0 && (style.brushType == 'stroke' || style.brushType == 'both')) {
  69929. if (!hasPath) {
  69930. ctx.beginPath();
  69931. this.buildPath(ctx, style);
  69932. }
  69933. this.setCtxGlobalAlpha(ctx, "stroke", style);
  69934. ctx.stroke();
  69935. this.setCtxGlobalAlpha(ctx, "reset", style);
  69936. }
  69937. this.drawText(ctx, style, this.style);
  69938. //岛洞
  69939. var hpStyle = Util_Util.cloneObject(style);
  69940. if (hpStyle.pointList) {
  69941. if (this.holePolygonPointLists && this.holePolygonPointLists.length > 0) {
  69942. var holePLS = this.holePolygonPointLists;
  69943. var holePLSen = holePLS.length;
  69944. for (var i = 0; i < holePLSen; i++) {
  69945. var holePL = holePLS[i];
  69946. //岛洞面
  69947. hpStyle.pointList = holePL;
  69948. ctx.globalCompositeOperation = "destination-out";
  69949. // 先 fill 再stroke
  69950. hasPath = false;
  69951. if (hpStyle.brushType == 'fill' || hpStyle.brushType == 'both' || typeof hpStyle.brushType == 'undefined') {
  69952. // 默认为fill
  69953. ctx.beginPath();
  69954. if (hpStyle.lineType == 'dashed' || hpStyle.lineType == 'dotted' || hpStyle.lineType == 'dot' || hpStyle.lineType == 'dash' || hpStyle.lineType == 'dashdot' || hpStyle.lineType == 'longdash' || hpStyle.lineType == 'longdashdot') {
  69955. // 特殊处理,虚线围不成path,实线再build一次
  69956. this.buildPath(ctx, {
  69957. lineType: 'solid',
  69958. lineWidth: hpStyle.lineWidth,
  69959. pointList: hpStyle.pointList
  69960. });
  69961. } else {
  69962. this.buildPath(ctx, hpStyle);
  69963. hasPath = true; // 这个path能用
  69964. }
  69965. ctx.closePath();
  69966. this.setCtxGlobalAlpha(ctx, "fill", hpStyle);
  69967. ctx.fill();
  69968. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  69969. }
  69970. if (hpStyle.lineWidth > 0 && (hpStyle.brushType == 'stroke' || hpStyle.brushType == 'both')) {
  69971. if (!hasPath) {
  69972. ctx.beginPath();
  69973. this.buildPath(ctx, hpStyle);
  69974. }
  69975. //如果描边,先回复 globalCompositeOperation 默认值再描边。
  69976. ctx.globalCompositeOperation = "source-over";
  69977. this.setCtxGlobalAlpha(ctx, "stroke", hpStyle);
  69978. ctx.stroke();
  69979. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  69980. } else {
  69981. ctx.globalCompositeOperation = "source-over";
  69982. }
  69983. }
  69984. }
  69985. }
  69986. ctx.restore();
  69987. return;
  69988. }
  69989. /**
  69990. * @function LevelRenderer.Shape.SmicPolygon.prototype.buildPath
  69991. * @description 创建多边形路径。
  69992. *
  69993. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  69994. * @param {Object} style - style。
  69995. *
  69996. */
  69997. }, {
  69998. key: "buildPath",
  69999. value: function buildPath(ctx, style) {
  70000. if (style.showShadow) {
  70001. ctx.shadowBlur = style.shadowBlur;
  70002. ctx.shadowColor = style.shadowColor;
  70003. ctx.shadowOffsetX = style.shadowOffsetX;
  70004. ctx.shadowOffsetY = style.shadowOffsetY;
  70005. }
  70006. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70007. this.refOriginalPosition = [0, 0];
  70008. }
  70009. var __OP = this.refOriginalPosition;
  70010. // 虽然能重用 brokenLine,但底层图形基于性能考虑,重复代码减少调用吧
  70011. var pointList = style.pointList;
  70012. if (pointList.length < 2) {
  70013. // 少于2个点就不画了~
  70014. return;
  70015. }
  70016. if (style.smooth && style.smooth !== 'spline') {
  70017. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, true, style.smoothConstraint, __OP);
  70018. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70019. var cp1;
  70020. var cp2;
  70021. var p;
  70022. var len = pointList.length;
  70023. for (var i = 0; i < len; i++) {
  70024. cp1 = controlPoints[i * 2];
  70025. cp2 = controlPoints[i * 2 + 1];
  70026. p = [pointList[(i + 1) % len][0] + __OP[0], pointList[(i + 1) % len][1] + __OP[1]];
  70027. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  70028. }
  70029. } else {
  70030. if (style.smooth === 'spline') {
  70031. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, true, null, __OP);
  70032. }
  70033. if (!style.lineType || style.lineType == 'solid') {
  70034. // 默认为实线
  70035. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70036. for (var _i2 = 1; _i2 < pointList.length; _i2++) {
  70037. ctx.lineTo(pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1]);
  70038. }
  70039. ctx.lineTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70040. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  70041. // SMIC-方法修改 - start
  70042. var dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  70043. style._dashLength = dashLengthForStyle;
  70044. var dashLength = style.lineWidth || 1;
  70045. var pattern1 = dashLength;
  70046. var pattern2 = dashLength;
  70047. //dashed
  70048. if (style.lineType === 'dashed') {
  70049. pattern1 *= 5;
  70050. pattern2 *= 5;
  70051. if (style.lineCap && style.lineCap !== "butt") {
  70052. pattern1 -= dashLength;
  70053. pattern2 += dashLength;
  70054. }
  70055. }
  70056. //dotted
  70057. if (style.lineType === 'dotted') {
  70058. if (style.lineCap && style.lineCap !== "butt") {
  70059. pattern1 = 1;
  70060. pattern2 += dashLength;
  70061. }
  70062. }
  70063. //dot
  70064. if (style.lineType === 'dot') {
  70065. pattern2 *= 4;
  70066. if (style.lineCap && style.lineCap !== "butt") {
  70067. pattern1 = 1;
  70068. pattern2 += dashLength;
  70069. }
  70070. }
  70071. //dash
  70072. if (style.lineType === 'dash') {
  70073. pattern1 *= 4;
  70074. pattern2 *= 4;
  70075. if (style.lineCap && style.lineCap !== "butt") {
  70076. pattern1 -= dashLength;
  70077. pattern2 += dashLength;
  70078. }
  70079. }
  70080. //longdash
  70081. if (style.lineType === 'longdash') {
  70082. pattern1 *= 8;
  70083. pattern2 *= 4;
  70084. if (style.lineCap && style.lineCap !== "butt") {
  70085. pattern1 -= dashLength;
  70086. pattern2 += dashLength;
  70087. }
  70088. }
  70089. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70090. for (var _i4 = 1; _i4 < pointList.length; _i4++) {
  70091. 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]);
  70092. }
  70093. 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]);
  70094. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  70095. var _dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  70096. style._dashLength = _dashLengthForStyle;
  70097. var _dashLength = style.lineWidth || 1;
  70098. var _pattern = _dashLength;
  70099. var _pattern2 = _dashLength;
  70100. var pattern3 = _dashLength;
  70101. var pattern4 = _dashLength;
  70102. //dashdot
  70103. if (style.lineType === 'dashdot') {
  70104. _pattern *= 4;
  70105. _pattern2 *= 4;
  70106. pattern4 *= 4;
  70107. if (style.lineCap && style.lineCap !== "butt") {
  70108. _pattern -= _dashLength;
  70109. _pattern2 += _dashLength;
  70110. pattern3 = 1;
  70111. pattern4 += _dashLength;
  70112. }
  70113. }
  70114. //longdashdot
  70115. if (style.lineType === 'longdashdot') {
  70116. _pattern *= 8;
  70117. _pattern2 *= 4;
  70118. pattern4 *= 4;
  70119. if (style.lineCap && style.lineCap !== "butt") {
  70120. _pattern -= _dashLength;
  70121. _pattern2 += _dashLength;
  70122. pattern3 = 1;
  70123. pattern4 += _dashLength;
  70124. }
  70125. }
  70126. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70127. for (var _i6 = 1; _i6 < pointList.length; _i6++) {
  70128. 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]);
  70129. }
  70130. 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]);
  70131. }
  70132. }
  70133. return;
  70134. }
  70135. /**
  70136. * @function LevelRenderer.Shape.SmicPolygon.prototype.getRect
  70137. * @description 计算返回多边形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  70138. *
  70139. * @param {Object} style - style
  70140. * @return {Object} 边框对象。包含属性:x,y,width,height。
  70141. *
  70142. */
  70143. }, {
  70144. key: "getRect",
  70145. value: function getRect(style, refOriginalPosition) {
  70146. var __OP;
  70147. if (!refOriginalPosition) {
  70148. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70149. this.refOriginalPosition = [0, 0];
  70150. }
  70151. __OP = this.refOriginalPosition;
  70152. } else {
  70153. __OP = refOriginalPosition;
  70154. }
  70155. if (style.__rect) {
  70156. return style.__rect;
  70157. }
  70158. var minX = Number.MAX_VALUE;
  70159. var maxX = Number.MIN_VALUE;
  70160. var minY = Number.MAX_VALUE;
  70161. var maxY = Number.MIN_VALUE;
  70162. var pointList = style.pointList;
  70163. for (var i = 0, l = pointList.length; i < l; i++) {
  70164. if (pointList[i][0] + __OP[0] < minX) {
  70165. minX = pointList[i][0] + __OP[0];
  70166. }
  70167. if (pointList[i][0] + __OP[0] > maxX) {
  70168. maxX = pointList[i][0] + __OP[0];
  70169. }
  70170. if (pointList[i][1] + __OP[1] < minY) {
  70171. minY = pointList[i][1] + __OP[1];
  70172. }
  70173. if (pointList[i][1] + __OP[1] > maxY) {
  70174. maxY = pointList[i][1] + __OP[1];
  70175. }
  70176. }
  70177. var lineWidth;
  70178. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  70179. lineWidth = style.lineWidth || 1;
  70180. } else {
  70181. lineWidth = 0;
  70182. }
  70183. style.__rect = {
  70184. x: Math.round(minX - lineWidth / 2),
  70185. y: Math.round(minY - lineWidth / 2),
  70186. width: maxX - minX + lineWidth,
  70187. height: maxY - minY + lineWidth
  70188. };
  70189. return style.__rect;
  70190. }
  70191. }]);
  70192. return SmicPolygon;
  70193. }(Shape_Shape);
  70194. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicBrokenLine.js
  70195. 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); }
  70196. function SmicBrokenLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70197. 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); } }
  70198. 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; }
  70199. 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); }
  70200. function SmicBrokenLine_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicBrokenLine_getPrototypeOf(object); if (object === null) break; } return object; }
  70201. 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); }
  70202. 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); }
  70203. 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); }; }
  70204. 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); }
  70205. function SmicBrokenLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70206. 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; } }
  70207. function SmicBrokenLine_getPrototypeOf(o) { SmicBrokenLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicBrokenLine_getPrototypeOf(o); }
  70208. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  70209. * This program are made available under the terms of the Apache License, Version 2.0
  70210. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70211. /**
  70212. * @private
  70213. * @class LevelRenderer.Shape.SmicBrokenLine
  70214. * @category Visualization Theme
  70215. * @classdesc 折线(ic)。
  70216. * @extends LevelRenderer.Shape
  70217. * @example
  70218. * var shape = new LevelRenderer.Shape.SmicBrokenLine({
  70219. * style: {
  70220. * pointList: [[0, 0], [100, 100], [100, 0]],
  70221. * smooth: 'bezier',
  70222. * strokeColor: 'purple'
  70223. * }
  70224. * });
  70225. * levelRenderer.addShape(shape);
  70226. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  70227. *
  70228. */
  70229. var SmicBrokenLine = /*#__PURE__*/function (_Shape) {
  70230. SmicBrokenLine_inherits(SmicBrokenLine, _Shape);
  70231. var _super = SmicBrokenLine_createSuper(SmicBrokenLine);
  70232. function SmicBrokenLine(options) {
  70233. var _this;
  70234. SmicBrokenLine_classCallCheck(this, SmicBrokenLine);
  70235. _this = _super.call(this, options);
  70236. /**
  70237. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.brushTypeOnly
  70238. * @description 线条只能描边。
  70239. */
  70240. _this.brushTypeOnly = 'stroke';
  70241. /**
  70242. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.textPosition
  70243. * @description 文本位置。
  70244. */
  70245. _this.textPosition = 'end';
  70246. /**
  70247. * @member {string} LevelRenderer.Shape.SmicBrokenLine.prototype.type
  70248. * @description 图形类型.
  70249. */
  70250. _this.type = 'smicbroken-line';
  70251. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  70252. _this.refOriginalPosition = [0, 0];
  70253. }
  70254. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicBrokenLine";
  70255. return _this;
  70256. }
  70257. /**
  70258. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.destroy
  70259. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  70260. */
  70261. SmicBrokenLine_createClass(SmicBrokenLine, [{
  70262. key: "destroy",
  70263. value: function destroy() {
  70264. this.brushTypeOnly = null;
  70265. this.textPosition = null;
  70266. this.type = null;
  70267. SmicBrokenLine_get(SmicBrokenLine_getPrototypeOf(SmicBrokenLine.prototype), "destroy", this).call(this);
  70268. }
  70269. /**
  70270. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.buildPath
  70271. * @description 创建折线路径。
  70272. *
  70273. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  70274. * @param {Object} style - style。
  70275. *
  70276. */
  70277. }, {
  70278. key: "buildPath",
  70279. value: function buildPath(ctx, style) {
  70280. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70281. this.refOriginalPosition = [0, 0];
  70282. }
  70283. var __OP = this.refOriginalPosition;
  70284. var pointList = style.pointList;
  70285. if (pointList.length < 2) {
  70286. // 少于2个点就不画了~
  70287. return;
  70288. }
  70289. var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length));
  70290. if (style.smooth && style.smooth !== 'spline') {
  70291. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, false, style.smoothConstraint, __OP);
  70292. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70293. var cp1;
  70294. var cp2;
  70295. var p;
  70296. for (var _i2 = 0; _i2 < len - 1; _i2++) {
  70297. cp1 = controlPoints[_i2 * 2];
  70298. cp2 = controlPoints[_i2 * 2 + 1];
  70299. p = [pointList[_i2 + 1][0] + __OP[0], pointList[_i2 + 1][1] + __OP[1]];
  70300. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  70301. }
  70302. } else {
  70303. if (style.smooth === 'spline') {
  70304. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, null, null, __OP);
  70305. len = pointList.length;
  70306. }
  70307. if (!style.lineType || style.lineType === 'solid') {
  70308. // 默认为实线
  70309. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70310. for (var _i4 = 1; _i4 < len; _i4++) {
  70311. ctx.lineTo(pointList[_i4][0] + __OP[0], pointList[_i4][1] + __OP[1]);
  70312. }
  70313. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  70314. var dashLength = style.lineWidth || 1;
  70315. var pattern1 = dashLength;
  70316. var pattern2 = dashLength;
  70317. //dashed
  70318. if (style.lineType === 'dashed') {
  70319. pattern1 *= 5;
  70320. pattern2 *= 5;
  70321. if (style.lineCap && style.lineCap !== "butt") {
  70322. pattern1 -= dashLength;
  70323. pattern2 += dashLength;
  70324. }
  70325. }
  70326. //dotted
  70327. if (style.lineType === 'dotted') {
  70328. if (style.lineCap && style.lineCap !== "butt") {
  70329. pattern1 = 1;
  70330. pattern2 += dashLength;
  70331. }
  70332. }
  70333. //dot
  70334. if (style.lineType === 'dot') {
  70335. pattern2 *= 4;
  70336. if (style.lineCap && style.lineCap !== "butt") {
  70337. pattern1 = 1;
  70338. pattern2 += dashLength;
  70339. }
  70340. }
  70341. //dash
  70342. if (style.lineType === 'dash') {
  70343. pattern1 *= 4;
  70344. pattern2 *= 4;
  70345. if (style.lineCap && style.lineCap !== "butt") {
  70346. pattern1 -= dashLength;
  70347. pattern2 += dashLength;
  70348. }
  70349. }
  70350. //longdash
  70351. if (style.lineType === 'longdash') {
  70352. pattern1 *= 8;
  70353. pattern2 *= 4;
  70354. if (style.lineCap && style.lineCap !== "butt") {
  70355. pattern1 -= dashLength;
  70356. pattern2 += dashLength;
  70357. }
  70358. }
  70359. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70360. for (var i = 1; i < len; i++) {
  70361. 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]);
  70362. }
  70363. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  70364. var _dashLength = style.lineWidth || 1;
  70365. var _pattern = _dashLength;
  70366. var _pattern2 = _dashLength;
  70367. var pattern3 = _dashLength;
  70368. var pattern4 = _dashLength;
  70369. //dashdot
  70370. if (style.lineType === 'dashdot') {
  70371. _pattern *= 4;
  70372. _pattern2 *= 4;
  70373. pattern4 *= 4;
  70374. if (style.lineCap && style.lineCap !== "butt") {
  70375. _pattern -= _dashLength;
  70376. _pattern2 += _dashLength;
  70377. pattern3 = 1;
  70378. pattern4 += _dashLength;
  70379. }
  70380. }
  70381. //longdashdot
  70382. if (style.lineType === 'longdashdot') {
  70383. _pattern *= 8;
  70384. _pattern2 *= 4;
  70385. pattern4 *= 4;
  70386. if (style.lineCap && style.lineCap !== "butt") {
  70387. _pattern -= _dashLength;
  70388. _pattern2 += _dashLength;
  70389. pattern3 = 1;
  70390. pattern4 += _dashLength;
  70391. }
  70392. }
  70393. _dashLength = (style.lineWidth || 1) * (style.lineType === 'dashed' ? 5 : 1);
  70394. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  70395. for (var _i6 = 1; _i6 < len; _i6++) {
  70396. 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]);
  70397. }
  70398. }
  70399. }
  70400. return;
  70401. }
  70402. /**
  70403. * @function LevelRenderer.Shape.SmicBrokenLine.prototype.getRect
  70404. * @description 计算返回折线包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  70405. *
  70406. * @param {Object} style - style
  70407. * @return {Object} 边框对象。包含属性:x,y,width,height。
  70408. */
  70409. }, {
  70410. key: "getRect",
  70411. value: function getRect(style) {
  70412. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70413. this.refOriginalPosition = [0, 0];
  70414. }
  70415. var __OP = this.refOriginalPosition;
  70416. return SmicPolygon.prototype.getRect.apply(this, [style, __OP]);
  70417. }
  70418. }]);
  70419. return SmicBrokenLine;
  70420. }(Shape_Shape);
  70421. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicImage.js
  70422. 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); }
  70423. function SmicImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70424. 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); } }
  70425. 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; }
  70426. 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); }
  70427. function SmicImage_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicImage_getPrototypeOf(object); if (object === null) break; } return object; }
  70428. 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); }
  70429. 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); }
  70430. 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); }; }
  70431. 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); }
  70432. function SmicImage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70433. 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; } }
  70434. function SmicImage_getPrototypeOf(o) { SmicImage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicImage_getPrototypeOf(o); }
  70435. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  70436. * This program are made available under the terms of the Apache License, Version 2.0
  70437. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70438. /**
  70439. * @private
  70440. * @class LevelRenderer.Shape.SmicImage
  70441. * @category Visualization Theme
  70442. * @classdesc 图片绘制。
  70443. * @extends LevelRenderer.Shape
  70444. * @example
  70445. * var shape = new LevelRenderer.Shape.SmicImage({
  70446. * style: {
  70447. * image: 'test.jpg',
  70448. * x: 100,
  70449. * y: 100
  70450. * }
  70451. * });
  70452. * levelRenderer.addShape(shape);
  70453. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  70454. *
  70455. */
  70456. var SmicImage = /*#__PURE__*/function (_Shape) {
  70457. SmicImage_inherits(SmicImage, _Shape);
  70458. var _super = SmicImage_createSuper(SmicImage);
  70459. function SmicImage(options) {
  70460. var _this;
  70461. SmicImage_classCallCheck(this, SmicImage);
  70462. _this = _super.call(this, options);
  70463. /**
  70464. * @member {string} LevelRenderer.Shape.SmicImage.prototype.type
  70465. * @description 图形类型。
  70466. */
  70467. _this.type = 'smicimage';
  70468. /**
  70469. * @member {string} LevelRenderer.Shape.SmicImage.prototype._imageCache
  70470. * @description 图片缓存。
  70471. */
  70472. _this._imageCache = {};
  70473. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  70474. _this.refOriginalPosition = [0, 0];
  70475. }
  70476. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicImage";
  70477. return _this;
  70478. }
  70479. /**
  70480. * @function LevelRenderer.Shape.SmicImage.prototype.destroy
  70481. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  70482. */
  70483. SmicImage_createClass(SmicImage, [{
  70484. key: "destroy",
  70485. value: function destroy() {
  70486. this.type = null;
  70487. this._imageCache = null;
  70488. SmicImage_get(SmicImage_getPrototypeOf(SmicImage.prototype), "destroy", this).call(this);
  70489. }
  70490. /**
  70491. * @function LevelRenderer.Shape.SmicImage.prototype.buildPath
  70492. * @description 创建图片。
  70493. *
  70494. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  70495. * @param {Object} style - style。
  70496. *
  70497. */
  70498. }, {
  70499. key: "brush",
  70500. value: function brush(ctx, isHighlight, refresh) {
  70501. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70502. this.refOriginalPosition = [0, 0];
  70503. }
  70504. var __OP = this.refOriginalPosition;
  70505. var style = this.style || {};
  70506. if (isHighlight) {
  70507. // 根据style扩展默认高亮样式
  70508. style = this.getHighlightStyle(style, this.highlightStyle || {});
  70509. }
  70510. var image = style.image;
  70511. var me = this;
  70512. if (typeof image === 'string') {
  70513. var src = image;
  70514. if (this._imageCache[src]) {
  70515. image = this._imageCache[src];
  70516. } else {
  70517. image = new Image();
  70518. image.onload = function () {
  70519. image.onload = null;
  70520. clearTimeout(SmicImage._refreshTimeout);
  70521. SmicImage._needsRefresh.push(me);
  70522. // 防止因为缓存短时间内触发多次onload事件
  70523. SmicImage._refreshTimeout = setTimeout(function () {
  70524. refresh && refresh(SmicImage._needsRefresh);
  70525. // 清空 needsRefresh
  70526. SmicImage._needsRefresh = [];
  70527. }, 10);
  70528. };
  70529. image.src = src;
  70530. this._imageCache[src] = image;
  70531. }
  70532. }
  70533. if (image) {
  70534. // 图片已经加载完成
  70535. if (image.nodeName.toUpperCase() == 'IMG') {
  70536. if (window.ActiveXObject) {
  70537. if (image.readyState != 'complete') {
  70538. return;
  70539. }
  70540. } else {
  70541. if (!image.complete) {
  70542. return;
  70543. }
  70544. }
  70545. }
  70546. // Else is canvas
  70547. var width = style.width || image.width;
  70548. var height = style.height || image.height;
  70549. var x = style.x + __OP[0];
  70550. var y = style.y + __OP[1];
  70551. // 图片加载失败
  70552. if (!image.width || !image.height) {
  70553. return;
  70554. }
  70555. ctx.save();
  70556. this.doClip(ctx);
  70557. this.setContext(ctx, style);
  70558. // 设置transform
  70559. this.setTransform(ctx);
  70560. if (style.sWidth && style.sHeight) {
  70561. var sx = style.sx + __OP[0] || 0;
  70562. var sy = style.sy + __OP[1] || 0;
  70563. ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);
  70564. } else if (style.sx && style.sy) {
  70565. var _sx = style.sx + __OP[0];
  70566. var _sy = style.sy + __OP[1];
  70567. var sWidth = width - _sx;
  70568. var sHeight = height - _sy;
  70569. ctx.drawImage(image, _sx, _sy, sWidth, sHeight, x, y, width, height);
  70570. } else {
  70571. ctx.drawImage(image, x, y, width, height);
  70572. }
  70573. // 如果没设置宽和高的话自动根据图片宽高设置
  70574. if (!style.width) {
  70575. style.width = width;
  70576. }
  70577. if (!style.height) {
  70578. style.height = height;
  70579. }
  70580. if (!this.style.width) {
  70581. this.style.width = width;
  70582. }
  70583. if (!this.style.height) {
  70584. this.style.height = height;
  70585. }
  70586. this.drawText(ctx, style, this.style);
  70587. ctx.restore();
  70588. }
  70589. }
  70590. /**
  70591. * @function LevelRenderer.Shape.SmicImage.prototype.getRect
  70592. * @description 计算返回图片的包围盒矩形。
  70593. *
  70594. * @param {Object} style - style
  70595. * @return {Object} 边框对象。包含属性:x,y,width,height。
  70596. */
  70597. }, {
  70598. key: "getRect",
  70599. value: function getRect(style) {
  70600. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70601. this.refOriginalPosition = [0, 0];
  70602. }
  70603. var __OP = this.refOriginalPosition;
  70604. return {
  70605. x: style.x + __OP[0],
  70606. y: style.y + __OP[1],
  70607. width: style.width,
  70608. height: style.height
  70609. };
  70610. }
  70611. /**
  70612. * @function LevelRenderer.Shape.SmicImage.prototype.clearCache
  70613. * @description 清除图片缓存。
  70614. *
  70615. * @param {Object} style - style
  70616. * @return {Object} 边框对象。包含属性:x,y,width,height。
  70617. *
  70618. */
  70619. }, {
  70620. key: "clearCache",
  70621. value: function clearCache() {
  70622. this._imageCache = {};
  70623. }
  70624. }]);
  70625. return SmicImage;
  70626. }(Shape_Shape);
  70627. SmicImage._needsRefresh = [];
  70628. SmicImage._refreshTimeout = null;
  70629. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRectangle.js
  70630. 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); }
  70631. function SmicRectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70632. 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); } }
  70633. 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; }
  70634. 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); }
  70635. function SmicRectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  70636. 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); }
  70637. 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); }
  70638. 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); }; }
  70639. 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); }
  70640. function SmicRectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70641. 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; } }
  70642. function SmicRectangle_getPrototypeOf(o) { SmicRectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRectangle_getPrototypeOf(o); }
  70643. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  70644. * This program are made available under the terms of the Apache License, Version 2.0
  70645. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70646. /**
  70647. * @private
  70648. * @class LevelRenderer.Shape.SmicRectangle
  70649. * @category Visualization Theme
  70650. * @classdesc 矩形。
  70651. * @extends LevelRenderer.Shape
  70652. * @example
  70653. * var shape = new LevelRenderer.Shape.SmicRectangle({
  70654. * style: {
  70655. * x: 0,
  70656. * y: 0,
  70657. * width: 100,
  70658. * height: 100,
  70659. * radius: 20
  70660. * }
  70661. * });
  70662. * levelRenderer.addShape(shape);
  70663. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  70664. */
  70665. var SmicRectangle = /*#__PURE__*/function (_Shape) {
  70666. SmicRectangle_inherits(SmicRectangle, _Shape);
  70667. var _super = SmicRectangle_createSuper(SmicRectangle);
  70668. function SmicRectangle(options) {
  70669. var _this;
  70670. SmicRectangle_classCallCheck(this, SmicRectangle);
  70671. _this = _super.call(this, options);
  70672. /**
  70673. * @member {string} LevelRenderer.Shape.SmicRectangle.prototype.type
  70674. * @description 图形类型.
  70675. */
  70676. _this.type = 'smicrectangle';
  70677. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  70678. _this.refOriginalPosition = [0, 0];
  70679. }
  70680. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRectangle";
  70681. return _this;
  70682. }
  70683. /**
  70684. * @function LevelRenderer.Shape.SmicRectangle.prototype.destroy
  70685. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  70686. */
  70687. SmicRectangle_createClass(SmicRectangle, [{
  70688. key: "destroy",
  70689. value: function destroy() {
  70690. this.type = null;
  70691. SmicRectangle_get(SmicRectangle_getPrototypeOf(SmicRectangle.prototype), "destroy", this).call(this);
  70692. }
  70693. /**
  70694. * APIMethod: _buildRadiusPath
  70695. * 创建矩形的圆角路径。
  70696. *
  70697. * Parameters:
  70698. * ctx - {CanvasRenderingContext2D} Context2D 上下文。
  70699. * style - {Object} style。
  70700. *
  70701. */
  70702. }, {
  70703. key: "_buildRadiusPath",
  70704. value: function _buildRadiusPath(ctx, style) {
  70705. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70706. this.refOriginalPosition = [0, 0];
  70707. }
  70708. var __OP = this.refOriginalPosition;
  70709. // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4
  70710. // r缩写为1 相当于 [1, 1, 1, 1]
  70711. // r缩写为[1] 相当于 [1, 1, 1, 1]
  70712. // r缩写为[1, 2] 相当于 [1, 2, 1, 2]
  70713. // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]
  70714. var x = style.x + __OP[0];
  70715. var y = style.y + __OP[1];
  70716. var width = style.width;
  70717. var height = style.height;
  70718. var r = style.radius;
  70719. var r1;
  70720. var r2;
  70721. var r3;
  70722. var r4;
  70723. if (typeof r === 'number') {
  70724. r1 = r2 = r3 = r4 = r;
  70725. } else if (r instanceof Array) {
  70726. if (r.length === 1) {
  70727. r1 = r2 = r3 = r4 = r[0];
  70728. } else if (r.length === 2) {
  70729. r1 = r3 = r[0];
  70730. r2 = r4 = r[1];
  70731. } else if (r.length === 3) {
  70732. r1 = r[0];
  70733. r2 = r4 = r[1];
  70734. r3 = r[2];
  70735. } else {
  70736. r1 = r[0];
  70737. r2 = r[1];
  70738. r3 = r[2];
  70739. r4 = r[3];
  70740. }
  70741. } else {
  70742. r1 = r2 = r3 = r4 = 0;
  70743. }
  70744. var total;
  70745. if (r1 + r2 > width) {
  70746. total = r1 + r2;
  70747. r1 *= width / total;
  70748. r2 *= width / total;
  70749. }
  70750. if (r3 + r4 > width) {
  70751. total = r3 + r4;
  70752. r3 *= width / total;
  70753. r4 *= width / total;
  70754. }
  70755. if (r2 + r3 > height) {
  70756. total = r2 + r3;
  70757. r2 *= height / total;
  70758. r3 *= height / total;
  70759. }
  70760. if (r1 + r4 > height) {
  70761. total = r1 + r4;
  70762. r1 *= height / total;
  70763. r4 *= height / total;
  70764. }
  70765. ctx.moveTo(x + r1, y);
  70766. ctx.lineTo(x + width - r2, y);
  70767. r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2);
  70768. ctx.lineTo(x + width, y + height - r3);
  70769. r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height);
  70770. ctx.lineTo(x + r4, y + height);
  70771. r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4);
  70772. ctx.lineTo(x, y + r1);
  70773. r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
  70774. }
  70775. /**
  70776. * @function LevelRenderer.Shape.SmicRectangle.prototype.buildPath
  70777. * @description 创建矩形路径。
  70778. *
  70779. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  70780. * @param {Object} style - style。
  70781. *
  70782. */
  70783. }, {
  70784. key: "buildPath",
  70785. value: function buildPath(ctx, style) {
  70786. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70787. this.refOriginalPosition = [0, 0];
  70788. }
  70789. var __OP = this.refOriginalPosition;
  70790. if (!style.radius) {
  70791. ctx.moveTo(style.x + __OP[0], style.y + __OP[1]);
  70792. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1]);
  70793. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1] + style.height);
  70794. ctx.lineTo(style.x + __OP[0], style.y + __OP[1] + style.height);
  70795. ctx.lineTo(style.x + __OP[0], style.y + __OP[1]);
  70796. // ctx.rect(style.x, style.y, style.width, style.height);
  70797. } else {
  70798. this._buildRadiusPath(ctx, style);
  70799. }
  70800. ctx.closePath();
  70801. return;
  70802. }
  70803. /**
  70804. * @function LevelRenderer.Shape.SmicRectangle.prototype.getRect
  70805. * @description 计算返回矩形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  70806. *
  70807. * @param {Object} style - style
  70808. * @return {Object} 边框对象。包含属性:x,y,width,height。
  70809. */
  70810. }, {
  70811. key: "getRect",
  70812. value: function getRect(style) {
  70813. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70814. this.refOriginalPosition = [0, 0];
  70815. }
  70816. var __OP = this.refOriginalPosition;
  70817. if (style.__rect) {
  70818. return style.__rect;
  70819. }
  70820. var lineWidth;
  70821. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  70822. lineWidth = style.lineWidth || 1;
  70823. } else {
  70824. lineWidth = 0;
  70825. }
  70826. style.__rect = {
  70827. x: Math.round(style.x + __OP[0] - lineWidth / 2),
  70828. y: Math.round(style.y + __OP[1] - lineWidth / 2),
  70829. width: style.width + lineWidth,
  70830. height: style.height + lineWidth
  70831. };
  70832. return style.__rect;
  70833. }
  70834. }]);
  70835. return SmicRectangle;
  70836. }(Shape_Shape);
  70837. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicSector.js
  70838. 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); }
  70839. function SmicSector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70840. 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); } }
  70841. 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; }
  70842. 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); }
  70843. function SmicSector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicSector_getPrototypeOf(object); if (object === null) break; } return object; }
  70844. 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); }
  70845. 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); }
  70846. 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); }; }
  70847. 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); }
  70848. function SmicSector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70849. 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; } }
  70850. function SmicSector_getPrototypeOf(o) { SmicSector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicSector_getPrototypeOf(o); }
  70851. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  70852. * This program are made available under the terms of the Apache License, Version 2.0
  70853. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70854. /**
  70855. * @private
  70856. * @class LevelRenderer.Shape.SmicSector
  70857. * @category Visualization Theme
  70858. * @classdesc 扇形。
  70859. * @extends LevelRenderer.Shape
  70860. * @example
  70861. * var shape = new LevelRenderer.Shape.SmicSector({
  70862. * style: {
  70863. * x: 100,
  70864. * y: 100,
  70865. * r: 60,
  70866. * r0: 30,
  70867. * startAngle: 0,
  70868. * endEngle: 180
  70869. * }
  70870. * });
  70871. * levelRenderer.addShape(shape);
  70872. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  70873. *
  70874. */
  70875. var SmicSector = /*#__PURE__*/function (_Shape) {
  70876. SmicSector_inherits(SmicSector, _Shape);
  70877. var _super = SmicSector_createSuper(SmicSector);
  70878. function SmicSector(options) {
  70879. var _this;
  70880. SmicSector_classCallCheck(this, SmicSector);
  70881. _this = _super.call(this, options);
  70882. /**
  70883. * @member {string} LevelRenderer.Shape.SmicSector.protptype.type
  70884. * @description 图形类型。
  70885. */
  70886. _this.type = 'smicsector';
  70887. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  70888. _this.refOriginalPosition = [0, 0];
  70889. }
  70890. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicSector";
  70891. return _this;
  70892. }
  70893. /**
  70894. * @function LevelRenderer.Shape.SmicSector.prototype.destroy
  70895. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  70896. */
  70897. SmicSector_createClass(SmicSector, [{
  70898. key: "destroy",
  70899. value: function destroy() {
  70900. this.type = null;
  70901. SmicSector_get(SmicSector_getPrototypeOf(SmicSector.prototype), "destroy", this).call(this);
  70902. }
  70903. /**
  70904. * @function LevelRenderer.Shape.SmicSector.prototype.buildPath
  70905. * @description 创建扇形路径。
  70906. *
  70907. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  70908. * @param {Object} style - style。
  70909. *
  70910. */
  70911. }, {
  70912. key: "buildPath",
  70913. value: function buildPath(ctx, style) {
  70914. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70915. this.refOriginalPosition = [0, 0];
  70916. }
  70917. var __OP = this.refOriginalPosition;
  70918. var x = style.x + __OP[0]; // 圆心x
  70919. var y = style.y + __OP[1]; // 圆心y
  70920. var r0 = style.r0 || 0; // 形内半径[0,r)
  70921. var r = style.r; // 扇形外半径(0,r]
  70922. var startAngle = style.startAngle; // 起始角度[0,360)
  70923. var endAngle = style.endAngle; // 结束角度(0,360]
  70924. var clockWise = style.clockWise || false;
  70925. startAngle = SUtil_SUtil.Util_math.degreeToRadian(startAngle);
  70926. endAngle = SUtil_SUtil.Util_math.degreeToRadian(endAngle);
  70927. if (!clockWise) {
  70928. // 扇形默认是逆时针方向,Y轴向上
  70929. // 这个跟arc的标准不一样,为了兼容echarts
  70930. startAngle = -startAngle;
  70931. endAngle = -endAngle;
  70932. }
  70933. var unitX = SUtil_SUtil.Util_math.cos(startAngle);
  70934. var unitY = SUtil_SUtil.Util_math.sin(startAngle);
  70935. ctx.moveTo(unitX * r0 + x, unitY * r0 + y);
  70936. ctx.lineTo(unitX * r + x, unitY * r + y);
  70937. ctx.arc(x, y, r, startAngle, endAngle, !clockWise);
  70938. ctx.lineTo(SUtil_SUtil.Util_math.cos(endAngle) * r0 + x, SUtil_SUtil.Util_math.sin(endAngle) * r0 + y);
  70939. if (r0 !== 0) {
  70940. ctx.arc(x, y, r0, endAngle, startAngle, clockWise);
  70941. }
  70942. ctx.closePath();
  70943. return;
  70944. }
  70945. /**
  70946. * @function LevelRenderer.Shape.SmicSector.prototype.getRect
  70947. * @description 返回扇形包围盒矩形
  70948. *
  70949. * @param {Object} style - style
  70950. * @return {Object} 边框对象。包含属性:x,y,width,height。
  70951. *
  70952. */
  70953. }, {
  70954. key: "getRect",
  70955. value: function getRect(style) {
  70956. if (style.__rect) {
  70957. return style.__rect;
  70958. }
  70959. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  70960. this.refOriginalPosition = [0, 0];
  70961. }
  70962. var __OP = this.refOriginalPosition;
  70963. var min0 = SUtil_SUtil.Util_vector.create();
  70964. var min1 = SUtil_SUtil.Util_vector.create();
  70965. var max0 = SUtil_SUtil.Util_vector.create();
  70966. var max1 = SUtil_SUtil.Util_vector.create();
  70967. var x = style.x + __OP[0]; // 圆心x
  70968. var y = style.y + __OP[1]; // 圆心y
  70969. var r0 = style.r0 || 0; // 形内半径[0,r)
  70970. var r = style.r; // 扇形外半径(0,r]
  70971. var startAngle = SUtil_SUtil.Util_math.degreeToRadian(style.startAngle);
  70972. var endAngle = SUtil_SUtil.Util_math.degreeToRadian(style.endAngle);
  70973. var clockWise = style.clockWise;
  70974. if (!clockWise) {
  70975. startAngle = -startAngle;
  70976. endAngle = -endAngle;
  70977. }
  70978. if (r0 > 1) {
  70979. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0);
  70980. } else {
  70981. min0[0] = max0[0] = x;
  70982. min0[1] = max0[1] = y;
  70983. }
  70984. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1);
  70985. SUtil_SUtil.Util_vector.min(min0, min0, min1);
  70986. SUtil_SUtil.Util_vector.max(max0, max0, max1);
  70987. style.__rect = {
  70988. x: min0[0],
  70989. y: min0[1],
  70990. width: max0[0] - min0[0],
  70991. height: max0[1] - min0[1]
  70992. };
  70993. return style.__rect;
  70994. }
  70995. }]);
  70996. return SmicSector;
  70997. }(Shape_Shape);
  70998. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeFactory.js
  70999. function ShapeFactory_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71000. 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); } }
  71001. 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; }
  71002. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  71003. * This program are made available under the terms of the Apache License, Version 2.0
  71004. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71005. /**
  71006. * @class FeatureShapeFactory
  71007. * @aliasclass Feature.ShapeFactory
  71008. * @deprecatedclass SuperMap.Feature.ShapeFactory
  71009. * @category Visualization Theme
  71010. * @classdesc 图形工厂类。
  71011. * 目前支持创建的图形有:<br>
  71012. * 用于统计专题图:<br>
  71013. * 点 - 参数对象 <{@link ShapeParametersPoint}> <br>
  71014. * 线 - 参数对象 <{@link ShapeParametersLine}> <br>
  71015. * 面 - 参数对象 <{@link ShapeParametersPolygon}> <br>
  71016. * 矩形 - 参数对象 <{@link ShapeParametersPolygon}> <br>
  71017. * 扇形 - 参数对象 <{@link ShapeParametersSector}> <br>
  71018. * 标签 - 参数对象 <{@link ShapeParametersLabel}> <br>
  71019. * 图片 - 参数对象 <{@link ShapeParametersImage}> <br>
  71020. * 用于符号专题图:<br>
  71021. * 圆形 - 参数对象:<{@link ShapeParametersCircle}>
  71022. * @param {Object} [shapeParameters] - 图形参数对象,<{@link ShapeParameters}> 子类对象。
  71023. * @usage
  71024. */
  71025. var ShapeFactory = /*#__PURE__*/function () {
  71026. function ShapeFactory(shapeParameters) {
  71027. ShapeFactory_classCallCheck(this, ShapeFactory);
  71028. /**
  71029. * @member {Object} FeatureShapeFactory.prototype.shapeParameters
  71030. * @description 图形参数对象,<{@link ShapeParameters}> 子类对象。必设参数,默认值 null。
  71031. */
  71032. this.shapeParameters = shapeParameters;
  71033. this.CLASS_NAME = "SuperMap.Feature.ShapeFactory";
  71034. }
  71035. /**
  71036. * @function FeatureShapeFactory.prototype.destroy
  71037. * @description 销毁图形工厂类对象。
  71038. */
  71039. ShapeFactory_createClass(ShapeFactory, [{
  71040. key: "destroy",
  71041. value: function destroy() {
  71042. this.shapeParameters = null;
  71043. }
  71044. /**
  71045. * @function FeatureShapeFactory.prototype.createShape
  71046. * @description 创建一个图形。具体图形由 shapeParameters 决定。
  71047. * @param {Object} shapeParameters - 图形参数对象,<{@link ShapeParameters}> 子类对象。
  71048. * 此参数可选,如果使用此参数(不为 null),shapeParameters 属性值将被修改为参数的值,然后再使用 shapeParameters 属性值创建图形;
  71049. * 如果不使用此参数,createShape 方法将直接使用 shapeParameters 属性创建图形。
  71050. * @returns {Object} 图形对象(或 null - 图形创建失败)。
  71051. */
  71052. }, {
  71053. key: "createShape",
  71054. value: function createShape(shapeParameters) {
  71055. if (shapeParameters) {
  71056. this.shapeParameters = shapeParameters;
  71057. }
  71058. if (!this.shapeParameters) {
  71059. return null;
  71060. }
  71061. var sps = this.shapeParameters;
  71062. if (sps instanceof Point_Point) {
  71063. // 点
  71064. //设置style
  71065. var style = new Object();
  71066. style["x"] = sps.x;
  71067. style["y"] = sps.y;
  71068. style["r"] = sps.r;
  71069. style = Util_Util.copyAttributesWithClip(style, sps.style, ['x', 'y']);
  71070. //创建图形
  71071. var shape = new SmicPoint();
  71072. shape.style = ShapeFactory.transformStyle(style);
  71073. shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  71074. Util_Util.copyAttributesWithClip(shape, sps, ['x', 'y', 'style', 'highlightStyle']);
  71075. return shape;
  71076. } else if (sps instanceof Line_Line) {
  71077. // 线
  71078. //检查参数 pointList 是否存在
  71079. if (!sps.pointList) {
  71080. return null;
  71081. }
  71082. // 设置style
  71083. var _style = new Object();
  71084. _style["pointList"] = sps.pointList;
  71085. _style = Util_Util.copyAttributesWithClip(_style, sps.style, ['pointList']);
  71086. // 创建图形
  71087. var _shape = new SmicBrokenLine();
  71088. _shape.style = ShapeFactory.transformStyle(_style);
  71089. _shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  71090. Util_Util.copyAttributesWithClip(_shape, sps, ['pointList', 'style', 'highlightStyle']);
  71091. return _shape;
  71092. } else if (sps instanceof feature_Polygon_Polygon) {
  71093. // 面
  71094. //检查参数 pointList 是否存在
  71095. if (!sps.pointList) {
  71096. return null;
  71097. }
  71098. //设置style
  71099. var _style2 = new Object();
  71100. _style2["pointList"] = sps.pointList;
  71101. _style2 = Util_Util.copyAttributesWithClip(_style2, sps.style, ['pointList']);
  71102. //创建图形
  71103. var _shape2 = new SmicPolygon();
  71104. _shape2.style = ShapeFactory.transformStyle(_style2);
  71105. _shape2.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  71106. Util_Util.copyAttributesWithClip(_shape2, sps, ['pointList', 'style', "highlightStyle"]);
  71107. return _shape2;
  71108. } else if (sps instanceof Rectangle_Rectangle) {
  71109. // 矩形
  71110. //检查参数 pointList 是否存在
  71111. if (!sps.x && !sps.y & !sps.width & !sps.height) {
  71112. return null;
  71113. }
  71114. //设置style
  71115. var _style3 = new Object();
  71116. _style3["x"] = sps.x;
  71117. _style3["y"] = sps.y;
  71118. _style3["width"] = sps.width;
  71119. _style3["height"] = sps.height;
  71120. _style3 = Util_Util.copyAttributesWithClip(_style3, sps.style, ['x', 'y', 'width', 'height']);
  71121. //创建图形
  71122. var _shape3 = new SmicRectangle();
  71123. _shape3.style = ShapeFactory.transformStyle(_style3);
  71124. _shape3.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  71125. Util_Util.copyAttributesWithClip(_shape3, sps, ['x', 'y', 'width', 'height', 'style', 'highlightStyle']);
  71126. return _shape3;
  71127. } else if (sps instanceof Sector) {
  71128. // 扇形
  71129. //设置style
  71130. var _style4 = new Object();
  71131. _style4["x"] = sps.x;
  71132. _style4["y"] = sps.y;
  71133. _style4["r"] = sps.r;
  71134. _style4["startAngle"] = sps.startAngle;
  71135. _style4["endAngle"] = sps.endAngle;
  71136. if (sps["r0"]) {
  71137. _style4["r0"] = sps.r0;
  71138. }
  71139. if (sps["clockWise"]) {
  71140. _style4["clockWise"] = sps.clockWise;
  71141. }
  71142. _style4 = Util_Util.copyAttributesWithClip(_style4, sps.style, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle']);
  71143. //创建图形
  71144. var _shape4 = new SmicSector();
  71145. _shape4.style = ShapeFactory.transformStyle(_style4);
  71146. _shape4.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  71147. Util_Util.copyAttributesWithClip(_shape4, sps, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle', 'style', 'highlightStyle']);
  71148. return _shape4;
  71149. } else if (sps instanceof Label) {
  71150. // 标签
  71151. //设置style
  71152. var _style5 = new Object();
  71153. _style5["x"] = sps.x;
  71154. _style5["y"] = sps.y;
  71155. _style5["text"] = sps.text;
  71156. _style5 = Util_Util.copyAttributesWithClip(_style5, sps.style, ['x', 'y', 'text']);
  71157. //创建图形
  71158. var _shape5 = new SmicText();
  71159. _shape5.style = ShapeFactory.transformStyle(_style5);
  71160. _shape5.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  71161. Util_Util.copyAttributesWithClip(_shape5, sps, ['x', 'y', 'text', 'style', 'highlightStyle']);
  71162. return _shape5;
  71163. } else if (sps instanceof Image_Image) {
  71164. // 图片
  71165. //设置style
  71166. var _style6 = new Object();
  71167. _style6["x"] = sps.x;
  71168. _style6["y"] = sps.y;
  71169. if (sps["image"]) {
  71170. _style6["image"] = sps.image;
  71171. }
  71172. if (sps["width"]) {
  71173. _style6["width"] = sps.width;
  71174. }
  71175. if (sps["height"]) {
  71176. _style6["height"] = sps.height;
  71177. }
  71178. if (sps["sx"]) {
  71179. _style6["sx"] = sps.sx;
  71180. }
  71181. if (sps["sy"]) {
  71182. _style6["sy"] = sps.sy;
  71183. }
  71184. if (sps["sWidth"]) {
  71185. _style6["sWidth"] = sps.sWidth;
  71186. }
  71187. if (sps["sHeight"]) {
  71188. _style6["sHeight"] = sps.sHeight;
  71189. }
  71190. _style6 = Util_Util.copyAttributesWithClip(_style6, sps.style, ['x', 'y', 'image', 'width', 'height', 'sx', 'sy', 'sWidth', 'sHeight']);
  71191. //创建图形
  71192. var _shape6 = new SmicImage();
  71193. _shape6.style = ShapeFactory.transformStyle(_style6);
  71194. _shape6.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  71195. Util_Util.copyAttributesWithClip(_shape6, sps, ['x', 'y', 'image', 'width', 'height', 'style', 'highlightStyle']);
  71196. return _shape6;
  71197. } else if (sps instanceof Circle_Circle) {
  71198. //圆形 用于符号专题图
  71199. //设置stytle
  71200. var _style7 = new Object();
  71201. _style7["x"] = sps.x;
  71202. _style7["r"] = sps.r;
  71203. _style7["y"] = sps.y;
  71204. _style7 = Util_Util.copyAttributesWithClip(_style7, sps.style, ['x', 'y', 'r']);
  71205. //创建图形
  71206. var _shape7 = new SmicCircle();
  71207. _shape7.style = ShapeFactory.transformStyle(_style7);
  71208. _shape7.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  71209. Util_Util.copyAttributesWithClip(_shape7, sps, ['x', 'y', 'r', 'style', 'highlightStyle', 'lineWidth', 'text', 'textPosition']);
  71210. return _shape7;
  71211. }
  71212. return null;
  71213. }
  71214. /**
  71215. * @function FeatureShapeFactory.prototype.transformStyle
  71216. * @description 将用户 feature.style (类 Svg style 标准) 的样式,转换为 levelRenderer 的样式标准(类 CSS-Canvas 样式)
  71217. * @param {Object} style - 用户 style。
  71218. * @returns {Object} 符合 levelRenderer 的 style。
  71219. */
  71220. }], [{
  71221. key: "transformStyle",
  71222. value: function transformStyle(style) {
  71223. var newStyle = {};
  71224. //字体 ["font-style", "font-variant", "font-weight", "font-size / line-height", "font-family"];
  71225. var fontStr = ["normal", "normal", "normal", "12", "arial,sans-serif"];
  71226. //画笔类型 ["fill", "stroke"];
  71227. var brushType = [true, false];
  71228. for (var ss in style) {
  71229. switch (ss) {
  71230. case "fill":
  71231. brushType[0] = style[ss];
  71232. break;
  71233. case "fillColor":
  71234. newStyle["color"] = style[ss];
  71235. break;
  71236. case "stroke":
  71237. brushType[1] = style[ss];
  71238. break;
  71239. case "strokeWidth":
  71240. newStyle["lineWidth"] = style[ss];
  71241. break;
  71242. case "strokeLinecap":
  71243. newStyle["lineCap"] = style[ss];
  71244. break;
  71245. case "strokeLineJoin":
  71246. newStyle["lineJoin"] = style[ss];
  71247. break;
  71248. case "strokeDashstyle":
  71249. newStyle["lineType"] = style[ss];
  71250. break;
  71251. case "pointRadius":
  71252. newStyle["r"] = style[ss];
  71253. break;
  71254. case "label":
  71255. newStyle["text"] = style[ss];
  71256. break;
  71257. case "labelRect":
  71258. newStyle["labelRect"] = style[ss];
  71259. break;
  71260. case "fontColor":
  71261. newStyle["textColor"] = style[ss];
  71262. break;
  71263. case "fontStyle":
  71264. fontStr[0] = style[ss];
  71265. break;
  71266. case "fontVariant":
  71267. fontStr[1] = style[ss];
  71268. break;
  71269. case "fontWeight":
  71270. fontStr[2] = style[ss];
  71271. break;
  71272. case "fontSize":
  71273. var unit = "";
  71274. if (style[ss] && style[ss].toString().indexOf("px") < 0) {
  71275. unit = "px";
  71276. }
  71277. fontStr[3] = style[ss] + unit;
  71278. break;
  71279. case "fontFamily":
  71280. fontStr[4] = style[ss];
  71281. break;
  71282. case "fontOpacity":
  71283. newStyle["opacity"] = style[ss];
  71284. break;
  71285. case "labelPosition":
  71286. newStyle["textPosition"] = style[ss];
  71287. break;
  71288. case "labelAlign":
  71289. newStyle["textAlign"] = style[ss];
  71290. break;
  71291. case "labelBaseline":
  71292. newStyle["textBaseline"] = style[ss];
  71293. break;
  71294. case "labelRotation":
  71295. newStyle["textRotation"] = style[ss];
  71296. break;
  71297. default:
  71298. newStyle[ss] = style[ss];
  71299. break;
  71300. }
  71301. }
  71302. //拼接字体字符串
  71303. newStyle["textFont"] = fontStr.join(" ");
  71304. //画笔类型
  71305. if (brushType[0] === true && brushType[1] === false) {
  71306. newStyle["brushType"] = "fill";
  71307. } else if (brushType[0] === false && brushType[1] === true) {
  71308. newStyle["brushType"] = "stroke";
  71309. } else if (brushType[0] === true && brushType[1] === true) {
  71310. newStyle["brushType"] = "both";
  71311. } else {
  71312. newStyle["brushType"] = "fill";
  71313. }
  71314. //默认线宽 1
  71315. if (newStyle["lineWidth"] == null) {
  71316. newStyle["lineWidth"] = 1;
  71317. }
  71318. return newStyle;
  71319. }
  71320. /**
  71321. * @function FeatureShapeFactory.prototype.Background
  71322. * @description 创建一个矩形背景框图形对象。
  71323. * @param {FeatureShapeFactory} shapeFactory - 图形工厂对象。
  71324. * @param {Array.<number>} box - 框区域,长度为 4 的一维数组,像素坐标,[left, bottom, right, top]。
  71325. * @param {Object} setting - 图表配置参数。本函数中图形配置对象 setting 可设属性:
  71326. * @param {Object} setting.backgroundStyle - 背景样式,此样式对象对象可设属性:<ShapeParametersRectangle#style>。
  71327. * @param {Array.<number>} [setting.backgroundRadius=[0,0,0,0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  71328. * @returns {Object} 背景框图形,一个可视化图形(矩形)对象。
  71329. */
  71330. }, {
  71331. key: "Background",
  71332. value: function Background(shapeFactory, box, setting) {
  71333. var sets = setting ? setting : {};
  71334. // 背景框图形参数对象
  71335. var bgSP = new Rectangle_Rectangle(box[0], box[3], Math.abs(box[2] - box[0]), Math.abs(box[3] - box[1]));
  71336. // 默认样式
  71337. bgSP.style = {
  71338. fillColor: "#f3f3f3"
  71339. };
  71340. // 设置用户 style
  71341. if (sets.backgroundStyle) {
  71342. Util_Util.copyAttributesWithClip(bgSP.style, sets.backgroundStyle);
  71343. }
  71344. // 设置背景框圆角参数
  71345. if (sets.backgroundRadius) {
  71346. bgSP.style["radius"] = sets.backgroundRadius;
  71347. }
  71348. // 禁止背景框响应事件
  71349. bgSP.clickable = false;
  71350. bgSP.hoverable = false;
  71351. return shapeFactory.createShape(bgSP);
  71352. }
  71353. /**
  71354. * @function FeatureShapeFactory.prototype.GraphAxis
  71355. * @description 创建一个统计图表坐标轴图形对象组。
  71356. * @param {FeatureShapeFactory} shapeFactory - 图形工厂对象。
  71357. * @param {Array.<number>} dataViewBox - 统计图表模型的数据视图框,长度为 4 的一维数组,像素坐标,[left, bottom, right, top]。
  71358. * @param {Object} setting - 图表配置参数。
  71359. * @param {Object} setting.axisStyle - 坐标轴样式,此样式对象对象可设属性:<ShapeParametersLine#style>。
  71360. * @param {boolean} [setting.axisUseArrow=false] - 坐标轴是否使用箭头。
  71361. * @param {number} [setting.axisYTick=0] - y 轴刻度数量,0表示不使用箭头。
  71362. * @param {Array.<string>} setting.axisYLabels - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  71363. * @param {Object} setting.axisYLabelsStyle - y 轴上的标签组样式,此样式对象对象可设属性:<ShapeParametersLabel#style>。
  71364. * @param {Array.<number>} [setting.axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正,默认值:0。
  71365. * @param {Array.<string>} setting.axisXLabels - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  71366. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xPositions 数量相同(即标签个数与数据个数相等时), 按照 xPositions 提供的位置在水平方向上排布标签,否则沿数据视图框下面条边等距排布标签。
  71367. * @param {Object} setting.axisXLabelsStyle - x 轴上的标签组样式,此样式对象对象可设属性:<ShapeParametersLabel#style>。
  71368. * @param {Array.<number>} [setting.axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:0。
  71369. * @param {boolean} setting.useXReferenceLine - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  71370. * @param {Object} setting.xReferenceLineStyle - 水平参考线样式,此样式对象对象可设属性:<ShapeParametersLine#style>。
  71371. * @param {number} [setting.axis3DParameter=0] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  71372. * @param {Object} xShapeInfo - X 方向上的图形信息对象,包含两个属性。
  71373. * @param {Array.<number>} xShapeInfo.xPositions - 图形在 x 轴方向上的像素坐标值,是一个一维数组,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  71374. * @param {number} xShapeInfo.width - 图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  71375. * @returns {Array.<Object>} 统计图表坐标轴图形对象数组。
  71376. */
  71377. }, {
  71378. key: "GraphAxis",
  71379. value: function GraphAxis(shapeFactory, dataViewBox, setting, xShapeInfo) {
  71380. var dvb = dataViewBox;
  71381. var sets = setting ? setting : {};
  71382. // 参考线图形对象组
  71383. var refLines = [];
  71384. //坐标轴箭头对象组
  71385. var arrows = [];
  71386. // 是否使用参水平考线,默认不使用
  71387. var isAddRefLine = sets.useXReferenceLine ? sets.useXReferenceLine : false;
  71388. // y 轴上的刻度
  71389. var axisytick = sets.axisYTick && !isNaN(sets.axisYTick) ? sets.axisYTick : 0;
  71390. // 坐标轴节点数组
  71391. var pois = [];
  71392. //z 轴箭头数组
  71393. var zArrowPois = [];
  71394. // x,y 轴主干节点数组
  71395. var xMainPois = [];
  71396. if (axisytick == 0) {
  71397. xMainPois.push([dvb[0], dvb[3] - 5]);
  71398. xMainPois.push([dvb[0], dvb[1]]);
  71399. // 3D 坐标轴 第三象限平分线
  71400. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  71401. var axis3DParameter = parseInt(sets.axis3DParameter);
  71402. var axis3DPoi = [dvb[0] - axis3DParameter, dvb[1] + axis3DParameter];
  71403. // 添加 3D 轴节点
  71404. if (sets.axisUseArrow) {
  71405. // 添加 3D 轴箭头节点坐标
  71406. //箭头坐标
  71407. zArrowPois.push([axis3DPoi[0] + 1.5, axis3DPoi[1] - 7.5]);
  71408. zArrowPois.push([axis3DPoi[0] - 1, axis3DPoi[1] + 1]);
  71409. zArrowPois.push([axis3DPoi[0] + 7.5, axis3DPoi[1] - 1.5]);
  71410. //3D轴
  71411. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  71412. } else {
  71413. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  71414. }
  71415. xMainPois.push([dvb[0], dvb[1]]);
  71416. }
  71417. xMainPois.push([dvb[2] + 5, dvb[1]]);
  71418. } else {
  71419. // 单位刻度长度
  71420. var unitTick = Math.abs(dvb[1] - dvb[3]) / axisytick;
  71421. // 刻度 y 坐标
  71422. var thckY = dvb[3];
  71423. xMainPois.push([dvb[0], thckY - 5]);
  71424. for (var i = 0; i < axisytick; i++) {
  71425. xMainPois.push([dvb[0], thckY]);
  71426. xMainPois.push([dvb[0] - 5, thckY]);
  71427. xMainPois.push([dvb[0], thckY]);
  71428. // 参考线
  71429. if (isAddRefLine) {
  71430. // 参考线参数对象
  71431. var refLineSP = new Line_Line([[dvb[0], thckY], [dvb[2], thckY]]);
  71432. // 参考线默认样式对象
  71433. refLineSP.style = {
  71434. strokeColor: "#cfcfcf",
  71435. strokeLinecap: "butt",
  71436. strokeLineJoin: "round",
  71437. strokeWidth: 1
  71438. };
  71439. // 禁止事件
  71440. refLineSP.clickable = false;
  71441. refLineSP.hoverable = false;
  71442. // 用户style
  71443. if (sets.xReferenceLineStyle) {
  71444. Util_Util.copyAttributesWithClip(refLineSP.style, sets.xReferenceLineStyle);
  71445. }
  71446. // 生成参考线图形对象
  71447. refLines.push(shapeFactory.createShape(refLineSP));
  71448. }
  71449. // y 刻度增量
  71450. thckY += unitTick;
  71451. }
  71452. xMainPois.push([dvb[0], dvb[1]]);
  71453. // 3D 坐标轴 第三象限平分线
  71454. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  71455. var _axis3DParameter = parseInt(sets.axis3DParameter);
  71456. var _axis3DPoi = [dvb[0] - _axis3DParameter, dvb[1] + _axis3DParameter];
  71457. /*
  71458. // 箭头计算过程
  71459. var axis3DPoiRef = [axis3DPoi[0] + 7, axis3DPoi[1] - 7]; // 7 是 10 为斜边 cos(45度)时邻边的值
  71460. var axis3DPoiLT = [axis3DPoiRef[0] - 4, axis3DPoiRef[1] - 4];
  71461. var axis3DPoiRB = [axis3DPoiRef[0] + 4, axis3DPoiRef[1] + 4];
  71462. if(sets.axisUseArrow){
  71463. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  71464. xMainPois.push([axis3DPoiLT[0], axis3DPoiLT[1]]);
  71465. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  71466. xMainPois.push([axis3DPoiRB[0], axis3DPoiRB[1]]);
  71467. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  71468. }
  71469. else{
  71470. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  71471. }
  71472. */
  71473. // 添加 3D 轴节点
  71474. if (sets.axisUseArrow) {
  71475. // 添加 3D 轴和箭头坐标
  71476. //箭头坐标
  71477. zArrowPois.push([_axis3DPoi[0] + 1.5, _axis3DPoi[1] - 7.5]);
  71478. zArrowPois.push([_axis3DPoi[0] - 1, _axis3DPoi[1] + 1]);
  71479. zArrowPois.push([_axis3DPoi[0] + 7.5, _axis3DPoi[1] - 1.5]);
  71480. //3D轴
  71481. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  71482. } else {
  71483. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  71484. }
  71485. xMainPois.push([dvb[0], dvb[1]]);
  71486. }
  71487. xMainPois.push([dvb[2] + 5, dvb[1]]);
  71488. }
  71489. // 坐标轴箭头
  71490. if (sets.axisUseArrow) {
  71491. // x 轴箭头节点数组
  71492. var xArrowPois = [[dvb[2] + 5, dvb[1] + 4], [dvb[2] + 13, dvb[1]], [dvb[2] + 5, dvb[1] - 4]];
  71493. // y 轴箭头节点数组
  71494. var yArrowPois = [[dvb[0] - 4, dvb[3] - 5], [dvb[0], dvb[3] - 13], [dvb[0] + 4, dvb[3] - 5]];
  71495. //x轴箭头
  71496. var xSP = new feature_Polygon_Polygon(xArrowPois);
  71497. xSP.style = {
  71498. fillColor: "#008acd"
  71499. };
  71500. Util_Util.copyAttributesWithClip(xSP.style, sets.axisStyle);
  71501. arrows.push(shapeFactory.createShape(xSP));
  71502. //y轴箭头
  71503. var ySP = new feature_Polygon_Polygon(yArrowPois);
  71504. ySP.style = {
  71505. fillColor: "#008acd"
  71506. };
  71507. Util_Util.copyAttributesWithClip(ySP.style, sets.axisStyle);
  71508. arrows.push(shapeFactory.createShape(ySP));
  71509. // z轴箭头 坐标轴箭头是否要使用
  71510. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  71511. var zSP = new feature_Polygon_Polygon(zArrowPois);
  71512. zSP.style = {
  71513. fillColor: "#008acd"
  71514. };
  71515. Util_Util.copyAttributesWithClip(zSP.style, sets.axisStyle);
  71516. arrows.push(shapeFactory.createShape(zSP));
  71517. }
  71518. }
  71519. //不带箭头的坐标轴
  71520. pois = xMainPois;
  71521. // 坐标轴参数对象
  71522. var axisSP = new Line_Line(pois);
  71523. // 坐标轴默认style
  71524. axisSP.style = {
  71525. strokeLinecap: "butt",
  71526. strokeLineJoin: "round",
  71527. strokeColor: "#008acd",
  71528. strokeWidth: 1
  71529. };
  71530. // 用户 style
  71531. if (sets.axisStyle) {
  71532. Util_Util.copyAttributesWithClip(axisSP.style, sets.axisStyle);
  71533. }
  71534. // 禁止事件
  71535. axisSP.clickable = false;
  71536. axisSP.hoverable = false;
  71537. // 创建坐标轴图形对象
  71538. var axisMain = [shapeFactory.createShape(axisSP)];
  71539. // Y 轴标签
  71540. var yLabels = [];
  71541. if (sets.axisYLabels && sets.axisYLabels.length && sets.axisYLabels.length > 0) {
  71542. var axisYLabels = sets.axisYLabels;
  71543. var len = axisYLabels.length;
  71544. // 标签偏移量
  71545. var ylOffset = [0, 0];
  71546. if (sets.axisYLabelsOffset && sets.axisYLabelsOffset.length) {
  71547. ylOffset = sets.axisYLabelsOffset;
  71548. }
  71549. if (len == 1) {
  71550. // 标签参数对象
  71551. var labelYSP = new Label(dvb[0] - 5 + ylOffset[0], dvb[3] + ylOffset[1], axisYLabels[0]);
  71552. labelYSP.style = {
  71553. labelAlign: "right"
  71554. };
  71555. // 用户 style
  71556. if (sets.axisYLabelsStyle) {
  71557. Util_Util.copyAttributesWithClip(labelYSP.style, sets.axisYLabelsStyle);
  71558. }
  71559. // 禁止事件
  71560. labelYSP.clickable = false;
  71561. labelYSP.hoverable = false;
  71562. // 制作标签
  71563. yLabels.push(shapeFactory.createShape(labelYSP));
  71564. } else {
  71565. var labelY = dvb[3];
  71566. // y 轴标签单位距离
  71567. var yUnit = Math.abs(dvb[1] - dvb[3]) / (len - 1);
  71568. for (var j = 0; j < len; j++) {
  71569. // 标签参数对象
  71570. var _labelYSP = new Label(dvb[0] - 5 + ylOffset[0], labelY + ylOffset[1], axisYLabels[j]);
  71571. _labelYSP.style = {
  71572. labelAlign: "right"
  71573. };
  71574. // 用户 style
  71575. if (sets.axisYLabelsStyle) {
  71576. Util_Util.copyAttributesWithClip(_labelYSP.style, sets.axisYLabelsStyle);
  71577. }
  71578. // 禁止事件
  71579. _labelYSP.clickable = false;
  71580. _labelYSP.hoverable = false;
  71581. // 制作标签
  71582. yLabels.push(shapeFactory.createShape(_labelYSP));
  71583. // y 轴标签 y 方向增量
  71584. labelY += yUnit;
  71585. }
  71586. }
  71587. }
  71588. // X 轴标签
  71589. var xLabels = [];
  71590. if (sets.axisXLabels && sets.axisXLabels.length && sets.axisXLabels.length > 0) {
  71591. var axisXLabels = sets.axisXLabels;
  71592. var _len = axisXLabels.length;
  71593. // 标签偏移量
  71594. var xlOffset = [0, 0];
  71595. if (sets.axisXLabelsOffset && sets.axisXLabelsOffset.length) {
  71596. xlOffset = sets.axisXLabelsOffset;
  71597. }
  71598. // 标签个数与数据字段个数相等等时,标签在 x 轴均匀排列
  71599. if (xShapeInfo && xShapeInfo.xPositions && xShapeInfo.xPositions.length && xShapeInfo.xPositions.length == _len) {
  71600. var xsCenter = xShapeInfo.xPositions;
  71601. for (var K = 0; K < _len; K++) {
  71602. // 标签参数对象
  71603. var labelXSP = new Label(xsCenter[K] + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[K]);
  71604. // 默认 style
  71605. labelXSP.style = {
  71606. labelAlign: "center",
  71607. labelBaseline: "top"
  71608. };
  71609. // 用户 style
  71610. if (sets.axisXLabelsStyle) {
  71611. Util_Util.copyAttributesWithClip(labelXSP.style, sets.axisXLabelsStyle);
  71612. }
  71613. // 禁止事件
  71614. labelXSP.clickable = false;
  71615. labelXSP.hoverable = false;
  71616. // 创建标签对象
  71617. xLabels.push(shapeFactory.createShape(labelXSP));
  71618. }
  71619. } else {
  71620. if (_len == 1) {
  71621. // 标签参数对象
  71622. var _labelXSP = new Label(dvb[0] - 5 + xlOffset[0], dvb[1] + xlOffset[0], axisXLabels[0]);
  71623. // 默认 style
  71624. _labelXSP.style = {
  71625. labelAlign: "center",
  71626. labelBaseline: "top"
  71627. };
  71628. // 用户 style
  71629. if (sets.axisXLabelsStyle) {
  71630. Util_Util.copyAttributesWithClip(_labelXSP.style, sets.axisXLabelsStyle);
  71631. }
  71632. // 禁止事件
  71633. _labelXSP.clickable = false;
  71634. _labelXSP.hoverable = false;
  71635. // 创建标签对象
  71636. xLabels.push(shapeFactory.createShape(_labelXSP));
  71637. } else {
  71638. var labelX = dvb[0];
  71639. // x 轴标签单位距离
  71640. var xUnit = Math.abs(dvb[2] - dvb[0]) / (_len - 1);
  71641. for (var m = 0; m < _len; m++) {
  71642. // 标签参数对象
  71643. var _labelXSP2 = new Label(labelX + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[m]);
  71644. // 默认 style
  71645. _labelXSP2.style = {
  71646. labelAlign: "center",
  71647. labelBaseline: "top"
  71648. };
  71649. // 用户 style
  71650. if (sets.axisXLabelsStyle) {
  71651. Util_Util.copyAttributesWithClip(_labelXSP2.style, sets.axisXLabelsStyle);
  71652. }
  71653. // 禁止事件
  71654. _labelXSP2.clickable = false;
  71655. _labelXSP2.hoverable = false;
  71656. // 创建标签对象
  71657. xLabels.push(shapeFactory.createShape(_labelXSP2));
  71658. // x 轴标签 x 方向增量
  71659. labelX += xUnit;
  71660. }
  71661. }
  71662. }
  71663. }
  71664. // 组装并返回构成坐标轴的图形
  71665. return refLines.concat(axisMain).concat(yLabels).concat(xLabels).concat(arrows);
  71666. }
  71667. /**
  71668. * @function FeatureShapeFactory.prototype.ShapeStyleTool
  71669. * @description 一个图形 style 处理工具。此工具将指定的默认 style,通用 style,按 styleGroup 取得的 style 和按数据值 value 范围取得的 style 进行合并,得到图形最终的 style。
  71670. * @param {Object} defaultStyle - 默认style,此样式对象可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。
  71671. * @param {Object} style - 图形对象基础 style,此参数控制图形的基础样式,可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。优先级低于 styleGroup,styleByCodomain。
  71672. * @param {Array.<Object>} styleGroup - 一个 style 数组,优先级低于 styleByCodomain,高于 style。此数组每个元素是样式对象,
  71673. * 其可设属性根据图形类型参考 <{@link ShapeParameters}> 子类对象的 style 属性。通过 index 参数从 styleGroup 中取 style。
  71674. * @param {Array.<Object>} styleByCodomain - 按数据(参数 value)所在值域范围控制数据的可视化对象样式。
  71675. * (start code)
  71676. * // styleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  71677. * // start: 值域值下限(包含);
  71678. * // end: 值域值上限(不包含);
  71679. * // style: 数据可视化图形的 style,其可设属性根据图形类型参考 <ShapeParameters> 子类对象的 style 属性。
  71680. * // dataStyleByCodomain 数组形如:
  71681. * [
  71682. * {
  71683. * start:0,
  71684. * end:250,
  71685. * style:{
  71686. * fillColor:"#00CD00"
  71687. * }
  71688. * },
  71689. * {
  71690. * start:250,
  71691. * end:500,
  71692. * style:{
  71693. * fillColor:"#00EE00"
  71694. * }
  71695. * },
  71696. * {
  71697. * start:500,
  71698. * end:750,
  71699. * style:{
  71700. * fillColor:"#00FF7F"
  71701. * }
  71702. * },
  71703. * {
  71704. * start:750,
  71705. * end:1500,
  71706. * style:{
  71707. * fillColor:"#00FF00"
  71708. * }
  71709. * }
  71710. * ]
  71711. * (end)
  71712. * @param {number} index - styleGroup 的索引值,用于取出 styleGroup 指定的 style。
  71713. * @param {number} value - 数据值,用于取出 styleByCodomain 指定的 style。
  71714. * @returns {Object} 合并后的样式 (style) 对象。
  71715. */
  71716. }, {
  71717. key: "ShapeStyleTool",
  71718. value: function ShapeStyleTool(defaultStyle, style, styleGroup, styleByCodomain, index, value) {
  71719. // 用 defaultStyle 初始化 style 对象
  71720. var finalStyle = defaultStyle ? defaultStyle : {};
  71721. // 基础 style
  71722. if (style) {
  71723. Util_Util.copyAttributesWithClip(finalStyle, style);
  71724. }
  71725. // 按索引赋 style
  71726. if (styleGroup && styleGroup.length && typeof index !== "undefined" && !isNaN(index) && index >= 0) {
  71727. if (styleGroup[index]) {
  71728. Util_Util.copyAttributesWithClip(finalStyle, styleGroup[index]);
  71729. }
  71730. }
  71731. // 按值域赋 style
  71732. if (styleByCodomain && styleByCodomain.length && typeof value !== "undefined") {
  71733. var dsc = styleByCodomain;
  71734. var dscLen = dsc.length;
  71735. var v = parseFloat(value);
  71736. for (var i = 0; i < dscLen; i++) {
  71737. if (dsc[i].start <= v && v < dsc[i].end) {
  71738. Util_Util.copyAttributesWithClip(finalStyle, dsc[i].style);
  71739. break;
  71740. }
  71741. }
  71742. }
  71743. return finalStyle;
  71744. }
  71745. }]);
  71746. return ShapeFactory;
  71747. }();
  71748. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Theme.js
  71749. function feature_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71750. 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); } }
  71751. 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; }
  71752. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  71753. * This program are made available under the terms of the Apache License, Version 2.0
  71754. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71755. /**
  71756. * @class FeatureTheme
  71757. * @aliasclass Feature.Theme
  71758. * @deprecatedclass SuperMap.Feature.Theme
  71759. * @category Visualization Theme
  71760. * @classdesc 专题要素基类。
  71761. * @param {Object} data - 用户数据,用于生成可视化 shape。
  71762. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  71763. * @usage
  71764. */
  71765. var Theme_Theme = /*#__PURE__*/function () {
  71766. function Theme(data, layer) {
  71767. feature_Theme_classCallCheck(this, Theme);
  71768. if (!data) {
  71769. return;
  71770. }
  71771. // layer 必须已经添加到地图, 且已初始化渲染器
  71772. if (!layer || !layer.map || !layer.renderer) {
  71773. return;
  71774. }
  71775. /**
  71776. * @member {string} FeatureTheme.prototype.id
  71777. * @description 专题要素唯一标识。
  71778. */
  71779. this.id = Util_Util.createUniqueID(this.CLASS_NAME + "_");
  71780. /**
  71781. * @member {LonLat} FeatureTheme.prototype.lonlat
  71782. * @description 专题要素地理参考位置。子类中必须根据用户数据(或地理位置参数)对其赋值。
  71783. */
  71784. this.lonlat = null;
  71785. /**
  71786. * @member {Array.<number>} FeatureTheme.prototype.location
  71787. * @description 专题要素像素参考位置。通常由地理参考位置决定。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  71788. */
  71789. this.location = [];
  71790. /**
  71791. * @readonly
  71792. * @member {Object} FeatureTheme.prototype.data
  71793. * @description 用户数据,用于生成可视化 shape,可在子类中规定数据格式或类型,如:<{@link FeatureVector}>。
  71794. */
  71795. this.data = data;
  71796. /**
  71797. * @readonly
  71798. * @member {Array.<Object>} FeatureTheme.prototype.shapes
  71799. * @description 构成此专题要素的可视化图形对象数组,数组顺序控制渲染。
  71800. */
  71801. this.shapes = [];
  71802. /**
  71803. * @readonly
  71804. * @member {SuperMap.Layer.Theme} FeatureTheme.prototype.layer
  71805. * @description 此专题要素所在专题图层。
  71806. */
  71807. this.layer = layer;
  71808. this.CLASS_NAME = "SuperMap.Feature.Theme";
  71809. }
  71810. /**
  71811. * @function FeatureTheme.prototype.destroy
  71812. * @description 销毁专题要素。
  71813. */
  71814. feature_Theme_createClass(Theme, [{
  71815. key: "destroy",
  71816. value: function destroy() {
  71817. this.data = null;
  71818. this.id = null;
  71819. this.lonlat = null;
  71820. this.location = null;
  71821. this.shapes = null;
  71822. this.layer = null;
  71823. }
  71824. /**
  71825. * @function FeatureTheme.prototype.getLocalXY
  71826. * @description 地理坐标转为像素坐标。
  71827. * @param {GeometryPoint|GeometryGeoText|LonLat} coordinate - 地理坐标点。
  71828. * @returns {Array.<number>} 长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  71829. */
  71830. }, {
  71831. key: "getLocalXY",
  71832. value: function getLocalXY(coordinate) {
  71833. var resolution = this.layer.map.getResolution();
  71834. var extent = this.layer.map.getExtent();
  71835. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  71836. var x = coordinate.x / resolution + -extent.left / resolution;
  71837. var y = extent.top / resolution - coordinate.y / resolution;
  71838. return [x, y];
  71839. } else if (coordinate instanceof LonLat) {
  71840. var _x = coordinate.lon / resolution + -extent.left / resolution;
  71841. var _y = extent.top / resolution - coordinate.lat / resolution;
  71842. return [_x, _y];
  71843. } else {
  71844. return null;
  71845. }
  71846. }
  71847. }]);
  71848. return Theme;
  71849. }();
  71850. ;// CONCATENATED MODULE: ./src/common/overlay/Graph.js
  71851. 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); }
  71852. function Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71853. 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); } }
  71854. 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; }
  71855. 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); }
  71856. function Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Graph_getPrototypeOf(object); if (object === null) break; } return object; }
  71857. 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); }
  71858. 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); }
  71859. 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); }; }
  71860. 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); }
  71861. function Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  71862. 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; } }
  71863. function Graph_getPrototypeOf(o) { Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graph_getPrototypeOf(o); }
  71864. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  71865. * This program are made available under the terms of the Apache License, Version 2.0
  71866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71867. /**
  71868. * @class FeatureThemeGraph
  71869. * @aliasclass Feature.Theme.Graph
  71870. * @deprecatedclass SuperMap.Feature.Theme.Graph
  71871. * @category Visualization Theme
  71872. * @classdesc 统计专题要素基类。
  71873. * 此类定义了统计专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  71874. * 统计专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <FeatureThemeGraph.setting> 的基础属性只有 7 个,
  71875. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  71876. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  71877. * @extends FeatureTheme
  71878. * @param {FeatureVector} data - 用户数据。
  71879. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  71880. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  71881. * @param {Object} setting - 图表配置对象。
  71882. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  71883. * @usage
  71884. */
  71885. var Graph = /*#__PURE__*/function (_Theme) {
  71886. Graph_inherits(Graph, _Theme);
  71887. var _super = Graph_createSuper(Graph);
  71888. function Graph(data, layer, fields, setting, lonlat, options) {
  71889. var _this;
  71890. Graph_classCallCheck(this, Graph);
  71891. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  71892. /**
  71893. * @member {FeatureShapeFactory} FeatureThemeGraph.prototype.shapeFactory
  71894. * @description 内置的图形工厂对象,调用其 createShape 方法创建图形。
  71895. */
  71896. _this.shapeFactory = new ShapeFactory();
  71897. /**
  71898. * @member {Object} FeatureThemeGraph.prototype.shapeParameters
  71899. * @description 当前图形参数对象,<{@link ShapeParameters}> 的子类对象。
  71900. */
  71901. _this.shapeParameters = null;
  71902. /**
  71903. * @member {boolean} [FeatureThemeGraph.prototype.RelativeCoordinate]
  71904. * @description 图形是否已经计算了相对坐标。
  71905. */
  71906. _this.RelativeCoordinate = false;
  71907. /**
  71908. * @member {Object} FeatureThemeGraph.prototype.setting
  71909. * @description 图表配置对象,该对象控制着图表的可视化显示。
  71910. * @param {number} width - 专题要素(图表)宽度。
  71911. * @param {number} height - 专题要素(图表)高度。
  71912. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  71913. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  71914. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  71915. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox
  71916. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  71917. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。
  71918. * 如果不设置此参数,在取数据值时不对数据做小数位处理。
  71919. *
  71920. */
  71921. _this.setting = null;
  71922. /**
  71923. * @readonly
  71924. * @member {Array.<number>} FeatureThemeGraph.prototype.origonPoint
  71925. * @description 专题要素(图表)原点,图表左上角点像素坐标,是长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  71926. */
  71927. _this.origonPoint = null;
  71928. /**
  71929. * @readonly
  71930. * @member {Array.<number>} FeatureThemeGraph.prototype.chartBox
  71931. * @description 专题要素(图表)区域,即图表框,长度为 4 的一维数组,数组的 4 个元素依次表示图表框左端 x 坐标值、
  71932. * 下端 y坐标值、右端 x坐标值、上端 y 坐标值;[left, bottom, right, top]。
  71933. */
  71934. _this.chartBox = null;
  71935. /**
  71936. * @readonly
  71937. * @member {Bounds} FeatureThemeGraph.prototype.chartBounds
  71938. * @description 图表 Bounds 随着 lonlat、XOffset、YOffset 更新,注意 chartBounds 是图表像素范围,不是地理范围。
  71939. */
  71940. _this.chartBounds = null;
  71941. /**
  71942. * @readonly
  71943. * @member {number} FeatureThemeGraph.prototype.width
  71944. * @description 专题要素(图表)宽度 。
  71945. */
  71946. _this.width = null;
  71947. /**
  71948. * @readonly
  71949. * @member {number} FeatureThemeGraph.prototype.height
  71950. * @description 专题要素(图表)高度 。
  71951. */
  71952. _this.height = null;
  71953. /**
  71954. * @readonly
  71955. * @member {number} FeatureThemeGraph.prototype.XOffset
  71956. * @description 专题要素(图表)在 X 方向上的偏移值,单位像素。
  71957. */
  71958. _this.XOffset = 0;
  71959. /**
  71960. * @readonly
  71961. * @member {number} FeatureThemeGraph.prototype.YOffset
  71962. * @description 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  71963. */
  71964. _this.YOffset = 0;
  71965. /**
  71966. * @readonly
  71967. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBParameter
  71968. * @description 数据视图框参数,长度为 4 的一维数组(数组元素值 >= 0),[leftOffset, bottomOffset, rightOffset, topOffset],chartBox 内偏距值。
  71969. * 此属性用于指定数据视图框 dataViewBox 的范围。
  71970. */
  71971. _this.DVBParameter = null;
  71972. /**
  71973. * @readonly
  71974. * @member {Array.<number>} FeatureThemeGraph.prototype.dataViewBox
  71975. * @description 数据视图框,长度为 4 的一维数组,[left, bottom, right, top]。
  71976. * dataViewBox 是统计专题要素最核心的内容,它负责解释数据在一个像素区域里的数据可视化含义,
  71977. * 这种含义用可视化图形表达出来,这些表示数据的图形和一些辅助图形组合在一起构成统计专题图表。
  71978. */
  71979. _this.dataViewBox = null;
  71980. /**
  71981. * @readonly
  71982. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBCodomain
  71983. * @description 数据视图框的内允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  71984. * dataViewBox 中允许的数据范围,对数据溢出值域范围情况的处理需要在 assembleShapes 中进行。
  71985. */
  71986. _this.DVBCodomain = null;
  71987. /**
  71988. * @readonly
  71989. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBCenterPoint
  71990. * @description 数据视图框中心点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  71991. */
  71992. _this.DVBCenterPoint = null;
  71993. /**
  71994. * @readonly
  71995. * @member {string} FeatureThemeGraph.prototype.DVBUnitValue
  71996. * @description 单位值。在 assembleShapes() 中初始化其具体意义,例如:饼图的 DVBUnitValue 可以定义为"360/数据总和",
  71997. * 折线图的 DVBUnitValue 可以定义为 "DVBCodomain/DVBHeight"。
  71998. */
  71999. _this.DVBUnitValue = null;
  72000. /**
  72001. * @readonly
  72002. * @member {Array.<number>} FeatureThemeGraph.prototype.DVBOrigonPoint
  72003. * @description 数据视图框原点,数据视图框左上角点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  72004. */
  72005. _this.DVBOrigonPoint = null;
  72006. /**
  72007. * @readonly
  72008. * @member {number} FeatureThemeGraph.prototype.DVBWidth
  72009. * @description 数据视图框宽度。
  72010. */
  72011. _this.DVBWidth = null;
  72012. /**
  72013. * @readonly
  72014. * @member {number} FeatureThemeGraph.prototype.DVBHeight
  72015. * @description 数据视图框高度。
  72016. */
  72017. _this.DVBHeight = null;
  72018. /**
  72019. * @readonly
  72020. * @member {Array.<number>} FeatureThemeGraph.prototype.origonPointOffset
  72021. * @description 数据视图框原点相对于图表框的原点偏移量,长度为 2 的一维数组,第一个元素表示 x 偏移量,第二个元素表示 y 偏移量。
  72022. */
  72023. _this.origonPointOffset = null;
  72024. /**
  72025. * @readonly
  72026. * @member {Array.<string>} FeatureThemeGraph.prototype.fields
  72027. * @description 数据{FeatureVector}属性字段。
  72028. */
  72029. _this.fields = fields || [];
  72030. /**
  72031. * @readonly
  72032. * @member {Array.<number>} FeatureThemeGraph.prototype.dataValues
  72033. * @description 图表展示的数据值,通过 fields 从数据 feature 属性中获得。
  72034. */
  72035. _this.dataValues = null;
  72036. // 图表位置
  72037. if (lonlat) {
  72038. _this.lonlat = lonlat;
  72039. } else {
  72040. // 默认使用 bounds 中心
  72041. _this.lonlat = _this.data.geometry.getBounds().getCenterLonLat();
  72042. }
  72043. // 配置项检测与赋值
  72044. if (setting && setting.width && setting.height && setting.codomain) {
  72045. _this.setting = setting;
  72046. }
  72047. _this.CLASS_NAME = "SuperMap.Feature.Theme.Graph";
  72048. return _this;
  72049. }
  72050. /**
  72051. * @function FeatureThemeGraph.prototype.destroy
  72052. * @description 销毁专题要素。
  72053. */
  72054. Graph_createClass(Graph, [{
  72055. key: "destroy",
  72056. value: function destroy() {
  72057. this.shapeFactory = null;
  72058. this.shapeParameters = null;
  72059. this.width = null;
  72060. this.height = null;
  72061. this.origonPoint = null;
  72062. this.chartBox = null;
  72063. this.dataViewBox = null;
  72064. this.chartBounds = null;
  72065. this.DVBParameter = null;
  72066. this.DVBOrigonPoint = null;
  72067. this.DVBCenterPoint = null;
  72068. this.DVBWidth = null;
  72069. this.DVBHeight = null;
  72070. this.DVBCodomain = null;
  72071. this.DVBUnitValue = null;
  72072. this.origonPointOffset = null;
  72073. this.XOffset = null;
  72074. this.YOffset = null;
  72075. this.fields = null;
  72076. this.dataValues = null;
  72077. this.setting = null;
  72078. Graph_get(Graph_getPrototypeOf(Graph.prototype), "destroy", this).call(this);
  72079. }
  72080. /**
  72081. * @function FeatureThemeGraph.prototype.initBaseParameter
  72082. * @description 初始化专题要素(图表)基础参数。在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  72083. * 调用此函数关系到 setting 对象的以下属性。
  72084. * @param {number} width - 专题要素(图表)宽度。
  72085. * @param {number} height - 专题要素(图表)高度。
  72086. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  72087. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  72088. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  72089. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox。
  72090. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  72091. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  72092. * @returns {boolean} 初始化参数是否成功。
  72093. */
  72094. }, {
  72095. key: "initBaseParameter",
  72096. value: function initBaseParameter() {
  72097. // 参数初始化是否成功
  72098. var isSuccess = true;
  72099. // setting 属性是否已成功赋值
  72100. if (!this.setting) {
  72101. return false;
  72102. }
  72103. var sets = this.setting;
  72104. // 检测 setting 的必设参数
  72105. if (!(sets.width && sets.height && sets.codomain)) {
  72106. return false;
  72107. }
  72108. // 数据
  72109. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  72110. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  72111. this.dataValues = dataEffective ? dataEffective : [];
  72112. // 基础参数 width, height, codomain
  72113. this.width = parseFloat(sets.width);
  72114. this.height = parseFloat(sets.height);
  72115. this.DVBCodomain = sets.codomain;
  72116. // 图表偏移
  72117. // if(sets.XOffset) {this.XOffset = sets.XOffset};
  72118. // if(sets.YOffset) {this.YOffset = sets.YOffset};
  72119. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  72120. this.YOffset = sets.YOffset ? sets.YOffset : 0;
  72121. // 其他默认值
  72122. this.origonPoint = [];
  72123. this.chartBox = [];
  72124. this.dataViewBox = [];
  72125. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  72126. this.DVBOrigonPoint = [];
  72127. this.DVBCenterPoint = [];
  72128. this.origonPointOffset = [];
  72129. // 图表位置
  72130. this.resetLocation();
  72131. // 专题要素宽度 w
  72132. var w = this.width;
  72133. // 专题要素高度 h
  72134. var h = this.height;
  72135. // 专题要素像素位置 loc
  72136. var loc = this.location;
  72137. // 专题要素像素位置 loc
  72138. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2];
  72139. // 专题要素原点(左上角)
  72140. var op = this.origonPoint;
  72141. // 图表框([left, bottom, right, top])
  72142. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]];
  72143. // 图表框
  72144. var cb = this.chartBox;
  72145. // 数据视图框参数,它是图表框各方向对应的内偏距
  72146. var dbbP = this.DVBParameter;
  72147. // 数据视图框 ([left, bottom, right, top])
  72148. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]];
  72149. // 数据视图框
  72150. var dvb = this.dataViewBox;
  72151. //检查数据视图框是否合法
  72152. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  72153. return false;
  72154. }
  72155. // 数据视图框原点
  72156. this.DVBOrigonPoint = [dvb[0], dvb[3]];
  72157. // 数据视图框宽度
  72158. this.DVBWidth = Math.abs(dvb[2] - dvb[0]);
  72159. // 数据视图框高度
  72160. this.DVBHeight = Math.abs(dvb[1] - dvb[3]);
  72161. // 数据视图框中心点
  72162. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2];
  72163. // 数据视图框原点与图表框的原点偏移量
  72164. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  72165. return isSuccess;
  72166. }
  72167. /**
  72168. * @function FeatureThemeGraph.prototype.resetLocation
  72169. * @description 根据地理位置 lonlat 重置专题要素(图表)位置。
  72170. * @param {LonLat} lonlat - 专题要素新的像素中心位置。
  72171. * @returns {Array.<number>} 新专题要素像素参考位置。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  72172. */
  72173. }, {
  72174. key: "resetLocation",
  72175. value: function resetLocation(lonlat) {
  72176. if (lonlat) {
  72177. this.lonlat = lonlat;
  72178. }
  72179. // 获取地理位置对应的像素坐标 newLocalLX
  72180. var newLocalLX = this.getLocalXY(this.lonlat);
  72181. // 处理偏移量 XOffset, YOffset
  72182. newLocalLX[0] += this.XOffset;
  72183. newLocalLX[1] += this.YOffset;
  72184. // 将图形位置赋予 location 属性(注意 location 属性表示的是专题要素中心位置)
  72185. this.location = newLocalLX;
  72186. // 更新图表像素 Bounds
  72187. var w = this.width;
  72188. var h = this.height;
  72189. var loc = this.location;
  72190. this.chartBounds = new Bounds(loc[0] - w / 2, loc[1] + h / 2, loc[0] + w / 2, loc[1] - h / 2);
  72191. //重新计算当前渐变色
  72192. this.resetLinearGradient();
  72193. return loc;
  72194. }
  72195. /**
  72196. * @function FeatureThemeGraph.prototype.resetLinearGradient
  72197. * @description resetLocation 中调用 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图渐变色 所以子类实现此方法)。
  72198. */
  72199. }, {
  72200. key: "resetLinearGradient",
  72201. value: function resetLinearGradient() {
  72202. //子类实现此方法
  72203. }
  72204. /**
  72205. * @function FeatureThemeGraph.prototype.shapesConvertToRelativeCoordinate
  72206. * @description 将(构成图表)图形的节点转为相对坐标表示,此函数必须且只能在 assembleShapes() 结束时调用。
  72207. */
  72208. }, {
  72209. key: "shapesConvertToRelativeCoordinate",
  72210. value: function shapesConvertToRelativeCoordinate() {
  72211. var shapes = this.shapes;
  72212. var shapeROP = this.location;
  72213. for (var i = 0, len = shapes.length; i < len; i++) {
  72214. shapes[i].refOriginalPosition = shapeROP;
  72215. var style = shapes[i].style;
  72216. for (var sty in style) {
  72217. switch (sty) {
  72218. case "pointList":
  72219. var pl = style[sty];
  72220. for (var j = 0, len2 = pl.length; j < len2; j++) {
  72221. pl[j][0] -= shapeROP[0];
  72222. pl[j][1] -= shapeROP[1];
  72223. }
  72224. break;
  72225. case "x":
  72226. style[sty] -= shapeROP[0];
  72227. break;
  72228. case "y":
  72229. style[sty] -= shapeROP[1];
  72230. break;
  72231. default:
  72232. break;
  72233. }
  72234. }
  72235. }
  72236. this.RelativeCoordinate = true;
  72237. }
  72238. /**
  72239. * @function FeatureThemeGraph.prototype.assembleShapes
  72240. * @description 图形装配函数。抽象方法,可视化子类必须实现此方法。<br>
  72241. * 重写此方法的步骤:<br>
  72242. * 1. 图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。<br>
  72243. * 2. 调用 initBaseParameter() 方法初始化模型属性值,此步骤必须执行,只有当 initBaseParameter 返回 true 时才可以允许进行后续步骤。<br>
  72244. * 3. 计算图形参数,制作图形,图形组合。在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。<br>
  72245. * 4. 调用 shapesConvertToRelativeCoordinate() 方法,将图形的坐标值转为相对坐标,此步骤必须执行。
  72246. * @example
  72247. * //子类实现 assembleShapes() 接口的步骤示例:
  72248. * assembleShapes: function(){
  72249. * // 第一步:图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。此步骤是非必须过程。
  72250. *
  72251. * // 图表配置对象
  72252. * var sets = this.setting;
  72253. * // 默认数据视图框,这里展示在使用坐标轴和不使用坐标轴情况下对数据视图框参数赋予不同的默认值
  72254. * if(!sets.dataViewBoxParameter){
  72255. * if(typeof(sets.useAxis) === "undefined" || sets.useAxis){
  72256. * sets.dataViewBoxParameter = [45, 15, 15, 15];
  72257. * }
  72258. * else{
  72259. * sets.dataViewBoxParameter = [5, 5, 5, 5];
  72260. * }
  72261. * }
  72262. *
  72263. * // 第二步:初始化图表模型基本参数,只有在图表模型基本参数初始化成功时才可模型相关属性,如 this.dataViewBox、 this.DVBCodomain等。此步骤是必须过程。
  72264. * if(!this.initBaseParameter()) return;
  72265. *
  72266. * // 第三步:用图形组装图表,在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。
  72267. * // 定义图表数据视图框中单位值的含义,下面行代码表示将数据视图框单位值定义为数据视图框高度上每像素代表的数据值
  72268. * this.DVBUnitValue = (this.codomain[1] - this.codomain[0])/this.DVBHeight;
  72269. * var uv = this.DVBUnitValue;
  72270. *
  72271. * // 图形参数计算代码......
  72272. *
  72273. * // 关于图形装配,实际上就是利用图形工程对象 this.shapeFactory 的 createShape() 方法通过图形参数对象创建可视化的图形对象,并把这些图形对象按序添加到模型的图形库(his.shapes)中。下面的代码演示创建一个面图形参数对象,并允许通过图形配置对象设置图形的 style 和 highlightStyle,
  72274. * var barParams = new ShapeParametersPolygon(poiLists);
  72275. * barParams.style = sets.barStyle? sets.barStyle:{fillColor: "lightblue"};
  72276. * barParams.highlightStyle = sets.barHoverStyle? sets.barHoverStyle:{fillColor: "blue"};
  72277. * // 图形携带数据ID信息
  72278. * barParams.refDataID = this.data.id;
  72279. * // 创建图形并添加到图表图形数组中
  72280. * this.shapes.push(this.shapeFactory.createShape(barParams));
  72281. *
  72282. * // 第四步:调用 shapesConvertToRelativeCoordinate() 方法,将图形库(his.shapes)中的图形转为由相对坐标表示的图形,客户端统计专题图模块从结构上要求可视化图形使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数。此步骤是必须过程。
  72283. * this.shapesConvertToRelativeCoordinate();
  72284. * },
  72285. */
  72286. }, {
  72287. key: "assembleShapes",
  72288. value: function assembleShapes() {
  72289. //子类必须实现此方法
  72290. }
  72291. /**
  72292. * @function FeatureThemeGraph.prototype.getLocalXY
  72293. * @description 地理坐标转为像素坐标。
  72294. * @param {LonLat} lonlat - 带转换的地理坐标。
  72295. * @returns 屏幕像素坐标。
  72296. */
  72297. }, {
  72298. key: "getLocalXY",
  72299. value: function getLocalXY(lonlat) {
  72300. return this.layer.getLocalXY(lonlat);
  72301. }
  72302. }]);
  72303. return Graph;
  72304. }(Theme_Theme);
  72305. /**
  72306. * @function FeatureTheme.getDataValues
  72307. * @description 根据字段名数组获取指定数据(feature)的属性值数组。属性值类型必须为 Number。
  72308. * @param {FeatureVector} data - 数据。
  72309. * @param {Array.<string>} [fields] - 字段名数组。
  72310. * @param {number} [decimalNumber] - 小数位处理参数,对获取到的属性数据值进行小数位处理。
  72311. * @returns {Array.<string>} 字段名数组对应的属性数据值数组。
  72312. */
  72313. Theme_Theme.getDataValues = function (data, fields, decimalNumber) {
  72314. if (!data.attributes) {
  72315. return false;
  72316. }
  72317. var fieldsValue = [];
  72318. var attrs = data.attributes;
  72319. for (var i = 0; i < fields.length; i++) {
  72320. for (var field in attrs) {
  72321. if (field !== fields[i]) {
  72322. continue;
  72323. }
  72324. // 数字转换判断
  72325. try {
  72326. if (!isNaN(decimalNumber) && decimalNumber >= 0) {
  72327. fieldsValue.push(parseFloat(attrs[field].toString()).toFixed(decimalNumber));
  72328. } else {
  72329. fieldsValue.push(parseFloat(attrs[field].toString()));
  72330. }
  72331. } catch (e) {
  72332. throw new Error("not a number");
  72333. }
  72334. }
  72335. }
  72336. if (fieldsValue.length === fields.length) {
  72337. return fieldsValue;
  72338. } else {
  72339. return false;
  72340. }
  72341. };
  72342. ;// CONCATENATED MODULE: ./src/common/overlay/Bar.js
  72343. 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); }
  72344. function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72345. 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); } }
  72346. 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; }
  72347. 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); }
  72348. function Bar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar_getPrototypeOf(object); if (object === null) break; } return object; }
  72349. 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); }
  72350. 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); }
  72351. 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); }; }
  72352. 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); }
  72353. function Bar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72354. 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; } }
  72355. function Bar_getPrototypeOf(o) { Bar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar_getPrototypeOf(o); }
  72356. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  72357. * This program are made available under the terms of the Apache License, Version 2.0
  72358. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72359. /**
  72360. * @class FeatureThemeBar
  72361. * @aliasclass Feature.Theme.Bar
  72362. * @deprecatedclass SuperMap.Feature.Theme.Bar
  72363. * @classdesc 柱状图 。
  72364. * @category Visualization Theme
  72365. * @example
  72366. * // barStyleByCodomain参数用法如下:
  72367. * // barStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  72368. * // start: 值域值下限(包含);
  72369. * // end: 值域值上限(不包含);
  72370. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  72371. * // barStyleByCodomain 数组形如:
  72372. * [
  72373. * {
  72374. * start:0,
  72375. * end:250,
  72376. * style:{
  72377. * fillColor:"#00CD00"
  72378. * }
  72379. * },
  72380. * {
  72381. * start:250,
  72382. * end:500,
  72383. * style:{
  72384. * fillColor:"#00EE00"
  72385. * }
  72386. * },
  72387. * {
  72388. * start:500,
  72389. * end:750,
  72390. * style:{
  72391. * fillColor:"#00FF7F"
  72392. * }
  72393. * },
  72394. * {
  72395. * start:750,
  72396. * end:1500,
  72397. * style:{
  72398. * fillColor:"#00FF00"
  72399. * }
  72400. * }
  72401. * ]
  72402. * @extends FeatureThemeGraph
  72403. * @param {FeatureVector} data - 用户数据。
  72404. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  72405. * @param {Array.<string>} fields - data 属性中的参与此图表生成的属性字段名称。
  72406. * @param {FeatureThemeBar.setting} setting - 图表配置对象。
  72407. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  72408. * @usage
  72409. * @private
  72410. */
  72411. var Bar = /*#__PURE__*/function (_Graph) {
  72412. Bar_inherits(Bar, _Graph);
  72413. var _super = Bar_createSuper(Bar);
  72414. function Bar(data, layer, fields, setting, lonlat) {
  72415. var _this;
  72416. Bar_classCallCheck(this, Bar);
  72417. _this = _super.call(this, data, layer, fields, setting, lonlat);
  72418. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar";
  72419. return _this;
  72420. }
  72421. /**
  72422. * @function FeatureThemeBar.prototype.destroy
  72423. * @override
  72424. */
  72425. Bar_createClass(Bar, [{
  72426. key: "destroy",
  72427. value: function destroy() {
  72428. Bar_get(Bar_getPrototypeOf(Bar.prototype), "destroy", this).call(this);
  72429. }
  72430. /**
  72431. * @function FeatureThemeBar.prototype.assembleShapes
  72432. * @description 图表图形装配函数。
  72433. */
  72434. }, {
  72435. key: "assembleShapes",
  72436. value: function assembleShapes() {
  72437. //默认渐变颜色数组
  72438. var deafaultColors = [["#00FF00", "#00CD00"], ["#00CCFF", "#5E87A2"], ["#00FF66", "#669985"], ["#CCFF00", "#94A25E"], ["#FF9900", "#A2945E"]];
  72439. //默认阴影
  72440. var deafaultShawdow = {
  72441. showShadow: true,
  72442. shadowBlur: 8,
  72443. shadowColor: "rgba(100,100,100,0.8)",
  72444. shadowOffsetX: 2,
  72445. shadowOffsetY: 2
  72446. };
  72447. // 图表配置对象
  72448. var sets = this.setting;
  72449. if (!sets.barLinearGradient) {
  72450. sets.barLinearGradient = deafaultColors;
  72451. }
  72452. // 默认数据视图框
  72453. if (!sets.dataViewBoxParameter) {
  72454. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  72455. sets.dataViewBoxParameter = [45, 15, 15, 15];
  72456. } else {
  72457. sets.dataViewBoxParameter = [5, 5, 5, 5];
  72458. }
  72459. }
  72460. // 重要步骤:初始化参数
  72461. if (!this.initBaseParameter()) {
  72462. return;
  72463. }
  72464. // 值域
  72465. var codomain = this.DVBCodomain;
  72466. // 重要步骤:定义图表 BaFeatureThemeBarr 数据视图框中单位值的含义
  72467. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  72468. // 数据视图域
  72469. var dvb = this.dataViewBox;
  72470. // 用户数据值
  72471. var fv = this.dataValues;
  72472. if (fv.length < 1) {
  72473. return;
  72474. } // 没有数据
  72475. // 数据溢出值域范围处理
  72476. for (var _i2 = 0, fvLen = fv.length; _i2 < fvLen; _i2++) {
  72477. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  72478. return;
  72479. }
  72480. }
  72481. // 获取 x 轴上的图形信息
  72482. var xShapeInfo = this.calculateXShapeInfo();
  72483. if (!xShapeInfo) {
  72484. return;
  72485. }
  72486. // 每个柱条 x 位置
  72487. var xsLoc = xShapeInfo.xPositions;
  72488. // 柱条宽度
  72489. var xsWdith = xShapeInfo.width;
  72490. // 背景框,默认启用
  72491. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  72492. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  72493. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  72494. }
  72495. // 坐标轴, 默认启用
  72496. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  72497. // 添加坐标轴图形数组
  72498. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  72499. }
  72500. for (var i = 0; i < fv.length; i++) {
  72501. // 计算柱条 top 边的 y 轴坐标值
  72502. var yPx = dvb[1] - (fv[i] - codomain[0]) / this.DVBUnitValue;
  72503. // 柱条节点数组
  72504. 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]];
  72505. // 柱条参数对象(一个面参数对象)
  72506. var barParams = new feature_Polygon_Polygon(poiLists);
  72507. // 柱条 阴影 style
  72508. if (typeof sets.showShadow === "undefined" || sets.showShadow) {
  72509. if (sets.barShadowStyle) {
  72510. var sss = sets.barShadowStyle;
  72511. if (sss.shadowBlur) {
  72512. deafaultShawdow.shadowBlur = sss.shadowBlur;
  72513. }
  72514. if (sss.shadowColor) {
  72515. deafaultShawdow.shadowColor = sss.shadowColor;
  72516. }
  72517. if (sss.shadowOffsetX) {
  72518. deafaultShawdow.shadowOffsetX = sss.shadowOffsetX;
  72519. }
  72520. if (sss.shadowOffsetY) {
  72521. deafaultShawdow.shadowOffsetY = sss.shadowOffsetY;
  72522. }
  72523. }
  72524. barParams.style = {};
  72525. Util_Util.copyAttributesWithClip(barParams.style, deafaultShawdow);
  72526. }
  72527. // 图形携带的数据信息
  72528. barParams.refDataID = this.data.id;
  72529. barParams.dataInfo = {
  72530. field: this.fields[i],
  72531. value: fv[i]
  72532. };
  72533. // 柱条 hover click
  72534. if (typeof sets.barHoverAble !== "undefined") {
  72535. barParams.hoverable = sets.barHoverAble;
  72536. }
  72537. if (typeof sets.barClickAble !== "undefined") {
  72538. barParams.clickable = sets.barClickAble;
  72539. }
  72540. // 创建柱条并添加到图表图形数组中
  72541. this.shapes.push(this.shapeFactory.createShape(barParams));
  72542. }
  72543. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  72544. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  72545. this.shapesConvertToRelativeCoordinate();
  72546. }
  72547. /**
  72548. * @function FeatureThemeBar.prototype.calculateXShapeInfo
  72549. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  72550. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  72551. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  72552. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  72553. * 本函数中图形配置对象 setting 可设属性:
  72554. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  72555. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  72556. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  72557. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  72558. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  72559. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  72560. *
  72561. */
  72562. }, {
  72563. key: "calculateXShapeInfo",
  72564. value: function calculateXShapeInfo() {
  72565. var dvb = this.dataViewBox; // 数据视图框
  72566. var sets = this.setting; // 图表配置对象
  72567. var fvc = this.dataValues.length; // 数组值个数
  72568. if (fvc < 1) {
  72569. return null;
  72570. }
  72571. var xBlank; // x 轴空白间隔参数
  72572. var xShapePositions = []; // x 轴上图形的位置
  72573. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  72574. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  72575. // x 轴空白间隔参数处理
  72576. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  72577. xBlank = sets.xShapeBlank;
  72578. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  72579. if (xsLen <= fvc) {
  72580. return null;
  72581. }
  72582. xShapeWidth = xsLen / fvc;
  72583. } else {
  72584. // 默认使用等距离空白间隔,空白间隔为图形宽度
  72585. xShapeWidth = dvbWidth / (2 * fvc + 1);
  72586. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  72587. }
  72588. // 图形 x 轴上的位置计算
  72589. var xOffset = 0;
  72590. for (var i = 0; i < fvc; i++) {
  72591. if (i == 0) {
  72592. xOffset = xBlank[0] + xShapeWidth / 2;
  72593. } else {
  72594. xOffset += xShapeWidth + xBlank[1];
  72595. }
  72596. xShapePositions.push(dvb[0] + xOffset);
  72597. }
  72598. return {
  72599. "xPositions": xShapePositions,
  72600. "width": xShapeWidth
  72601. };
  72602. }
  72603. /**
  72604. * @function FeatureThemeBar.prototype.resetLinearGradient
  72605. * @description 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图 所以子类实现此方法)。
  72606. */
  72607. }, {
  72608. key: "resetLinearGradient",
  72609. value: function resetLinearGradient() {
  72610. if (this.RelativeCoordinate) {
  72611. var shpelength = this.shapes.length;
  72612. var barLinearGradient = this.setting.barLinearGradient;
  72613. var index = -1;
  72614. for (var i = 0; i < shpelength; i++) {
  72615. var shape = this.shapes[i];
  72616. if (shape.CLASS_NAME === "SuperMap.LevelRenderer.Shape.SmicPolygon") {
  72617. var style = shape.style;
  72618. //计算出当前的绝对 x y
  72619. var x1 = this.location[0] + style.pointList[0][0];
  72620. var x2 = this.location[0] + style.pointList[1][0];
  72621. //渐变颜色
  72622. index++;
  72623. //以防定义的颜色数组不够用
  72624. if (index >= barLinearGradient.length) {
  72625. index = index % barLinearGradient.length;
  72626. }
  72627. var color1 = barLinearGradient[index][0];
  72628. var color2 = barLinearGradient[index][1];
  72629. //颜色
  72630. var zcolor = new Color();
  72631. var linearGradient = zcolor.getLinearGradient(x1, 0, x2, 0, [[0, color1], [1, color2]]);
  72632. //赋值
  72633. shape.style.color = linearGradient;
  72634. }
  72635. }
  72636. }
  72637. }
  72638. }]);
  72639. return Bar;
  72640. }(Graph);
  72641. ;// CONCATENATED MODULE: ./src/common/overlay/Bar3D.js
  72642. 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); }
  72643. function Bar3D_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72644. 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); } }
  72645. 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; }
  72646. 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); }
  72647. function Bar3D_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar3D_getPrototypeOf(object); if (object === null) break; } return object; }
  72648. 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); }
  72649. 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); }
  72650. 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); }; }
  72651. 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); }
  72652. function Bar3D_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72653. 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; } }
  72654. function Bar3D_getPrototypeOf(o) { Bar3D_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar3D_getPrototypeOf(o); }
  72655. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  72656. * This program are made available under the terms of the Apache License, Version 2.0
  72657. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72658. /**
  72659. * @class FeatureThemeBar3D
  72660. * @aliasclass Feature.Theme.Bar3D
  72661. * @deprecatedclass SuperMap.Feature.Theme.Bar3D
  72662. * @classdesc 三维柱状图 。
  72663. * @category Visualization Theme
  72664. * @extends FeatureThemeGraph
  72665. * @param {FeatureVector} data - 用户数据。
  72666. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  72667. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  72668. * @param {FeatureThemeBar3D.setting} setting - 图表配置对象。
  72669. * @param {LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  72670. *
  72671. *
  72672. * @example
  72673. * // barFaceStyleByCodomain 用法示例如下:
  72674. * // barFaceStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  72675. * // start: 值域值下限(包含);
  72676. * // end: 值域值上限(不包含);
  72677. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  72678. * // barFaceStyleByCodomain 数组形如:
  72679. * [
  72680. * {
  72681. * start:0,
  72682. * end:250,
  72683. * style:{
  72684. * fillColor:"#00CD00"
  72685. * }
  72686. * },
  72687. * {
  72688. * start:250,
  72689. * end:500,
  72690. * style:{
  72691. * fillColor:"#00EE00"
  72692. * }
  72693. * },
  72694. * {
  72695. * start:500,
  72696. * end:750,
  72697. * style:{
  72698. * fillColor:"#00FF7F"
  72699. * }
  72700. * },
  72701. * {
  72702. * start:750,
  72703. * end:1500,
  72704. * style:{
  72705. * fillColor:"#00FF00"
  72706. * }
  72707. * }
  72708. * ]
  72709. *
  72710. * @example
  72711. * // barSideStyleByCodomain 用法示例如下:
  72712. * // barSideStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  72713. * // start: 值域值下限(包含);
  72714. * // end: 值域值上限(不包含);
  72715. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersPolygon.style> 。
  72716. * // barSideStyleByCodomain 数组形如:
  72717. * [
  72718. * {
  72719. * start:0,
  72720. * end:250,
  72721. * style:{
  72722. * fillColor:"#00CD00"
  72723. * }
  72724. * },
  72725. * {
  72726. * start:250,
  72727. * end:500,
  72728. * style:{
  72729. * fillColor:"#00EE00"
  72730. * }
  72731. * },
  72732. * {
  72733. * start:500,
  72734. * end:750,
  72735. * style:{
  72736. * fillColor:"#00FF7F"
  72737. * }
  72738. * },
  72739. * {
  72740. * start:750,
  72741. * end:1500,
  72742. * style:{
  72743. * fillColor:"#00FF00"
  72744. * }
  72745. * }
  72746. * ]
  72747. *
  72748. * @example
  72749. * // barTopStyleByCodomain 用法示例如下:
  72750. * // barTopStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  72751. * // start: 值域值下限(包含);
  72752. * // end: 值域值上限(不包含);
  72753. * // style: 数据可视化图形的 style,这个样式对象的可设属性:<ShapeParametersPolygon.style> 。
  72754. * // barTopStyleByCodomain 数组形如:
  72755. * [
  72756. * {
  72757. * start:0,
  72758. * end:250,
  72759. * style:{
  72760. * fillColor:"#00CD00"
  72761. * }
  72762. * },
  72763. * {
  72764. * start:250,
  72765. * end:500,
  72766. * style:{
  72767. * fillColor:"#00EE00"
  72768. * }
  72769. * },
  72770. * {
  72771. * start:500,
  72772. * end:750,
  72773. * style:{
  72774. * fillColor:"#00FF7F"
  72775. * }
  72776. * },
  72777. * {
  72778. * start:750,
  72779. * end:1500,
  72780. * style:{
  72781. * fillColor:"#00FF00"
  72782. * }
  72783. * }
  72784. * ]
  72785. * @usage
  72786. * @private
  72787. */
  72788. var Bar3D = /*#__PURE__*/function (_Graph) {
  72789. Bar3D_inherits(Bar3D, _Graph);
  72790. var _super = Bar3D_createSuper(Bar3D);
  72791. function Bar3D(data, layer, fields, setting, lonlat) {
  72792. var _this;
  72793. Bar3D_classCallCheck(this, Bar3D);
  72794. _this = _super.call(this, data, layer, fields, setting, lonlat);
  72795. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar3D";
  72796. return _this;
  72797. }
  72798. /**
  72799. * @function FeatureThemeBar3D.prototype.destroy
  72800. * @override
  72801. */
  72802. Bar3D_createClass(Bar3D, [{
  72803. key: "destroy",
  72804. value: function destroy() {
  72805. Bar3D_get(Bar3D_getPrototypeOf(Bar3D.prototype), "destroy", this).call(this);
  72806. }
  72807. /**
  72808. * @function FeatureThemeBar3D.prototype.assembleShapes
  72809. * @description 图形装配实现(扩展接口)。
  72810. */
  72811. }, {
  72812. key: "assembleShapes",
  72813. value: function assembleShapes() {
  72814. // 图表配置对象
  72815. var sets = this.setting;
  72816. // 默认数据视图框
  72817. if (!sets.dataViewBoxParameter) {
  72818. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  72819. sets.dataViewBoxParameter = [45, 25, 20, 20];
  72820. } else {
  72821. sets.dataViewBoxParameter = [5, 5, 5, 5];
  72822. }
  72823. }
  72824. // 3d 柱图的坐标轴默认使用坐标轴箭头
  72825. sets.axisUseArrow = typeof sets.axisUseArrow !== "undefined" ? sets.axisUseArrow : true;
  72826. sets.axisXLabelsOffset = typeof sets.axisXLabelsOffset !== "undefined" ? sets.axisXLabelsOffset : [-10, 10];
  72827. // 重要步骤:初始化参数
  72828. if (!this.initBaseParameter()) {
  72829. return;
  72830. }
  72831. // 值域
  72832. var codomain = this.DVBCodomain;
  72833. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  72834. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  72835. // 数据视图域
  72836. var dvb = this.dataViewBox;
  72837. // 用户数据值
  72838. var fv = this.dataValues;
  72839. if (fv.length < 1) {
  72840. return;
  72841. } // 没有数据
  72842. // 数据溢出值域范围处理
  72843. for (var i = 0, fvLen = fv.length; i < fvLen; i++) {
  72844. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  72845. return;
  72846. }
  72847. }
  72848. // 获取 x 轴上的图形信息
  72849. var xShapeInfo = this.calculateXShapeInfo();
  72850. if (!xShapeInfo) {
  72851. return;
  72852. }
  72853. // 每个柱条 x 位置
  72854. var xsLoc = xShapeInfo.xPositions;
  72855. // 柱条宽度
  72856. var xsWdith = xShapeInfo.width;
  72857. // 坐标轴, 默认启用
  72858. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  72859. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  72860. }
  72861. // 坐标轴
  72862. if (!sets.axis3DParameter || isNaN(sets.axis3DParameter) || sets.axis3DParameter < 15) {
  72863. sets.axis3DParameter = 20;
  72864. }
  72865. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  72866. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  72867. }
  72868. // 3d 偏移量, 默认值 10;
  72869. var offset3d = sets.bar3DParameter && !isNaN(sets.bar3DParameter) ? sets.bar3DParameter : 10;
  72870. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  72871. // 无 3d 偏移量时的柱面顶部 y 坐标
  72872. var yPx = dvb[1] - (fv[_i2] - codomain[0]) / this.DVBUnitValue;
  72873. // 无 3d 偏移量时的柱面的左、右端 x 坐标
  72874. var iPoiL = xsLoc[_i2] - xsWdith / 2;
  72875. var iPoiR = xsLoc[_i2] + xsWdith / 2;
  72876. // 3d 柱顶面节点
  72877. var bar3DTopPois = [[iPoiL, yPx], [iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  72878. // 3d 柱侧面节点
  72879. var bar3DSidePois = [[iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR, dvb[1]]];
  72880. // 3d 柱正面节点
  72881. var bar3DFacePois = [[iPoiL - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  72882. if (offset3d <= 0) {
  72883. // offset3d <= 0 时正面不偏移
  72884. bar3DFacePois = [[iPoiL, dvb[1]], [iPoiR, dvb[1]], [iPoiR, yPx], [iPoiL, yPx]];
  72885. }
  72886. // 新建 3d 柱面顶面、侧面、正面图形参数对象
  72887. var polyTopSP = new feature_Polygon_Polygon(bar3DTopPois);
  72888. var polySideSP = new feature_Polygon_Polygon(bar3DSidePois);
  72889. var polyFaceSP = new feature_Polygon_Polygon(bar3DFacePois);
  72890. // 侧面、正面图形 style 默认值
  72891. sets.barSideStyle = sets.barSideStyle ? sets.barSideStyle : sets.barFaceStyle;
  72892. sets.barSideStyleByFields = sets.barSideStyleByFields ? sets.barSideStyleByFields : sets.barFaceStyleByFields;
  72893. sets.barSideStyleByCodomain = sets.barSideStyleByCodomain ? sets.barSideStyleByCodomain : sets.barFaceStyleByCodomain;
  72894. sets.barTopStyle = sets.barTopStyle ? sets.barTopStyle : sets.barFaceStyle;
  72895. sets.barTopStyleByFields = sets.barTopStyleByFields ? sets.barTopStyleByFields : sets.barFaceStyleByFields;
  72896. sets.barTopStyleByCodomain = sets.barTopStyleByCodomain ? sets.barTopStyleByCodomain : sets.barFaceStyleByCodomain;
  72897. // 顶面、侧面、正面图形 style
  72898. polyFaceSP.style = ShapeFactory.ShapeStyleTool({
  72899. stroke: true,
  72900. strokeColor: "#ffffff",
  72901. fillColor: "#ee9900"
  72902. }, sets.barFaceStyle, sets.barFaceStyleByFields, sets.barFaceStyleByCodomain, _i2, fv[_i2]);
  72903. polySideSP.style = ShapeFactory.ShapeStyleTool({
  72904. stroke: true,
  72905. strokeColor: "#ffffff",
  72906. fillColor: "#ee9900"
  72907. }, sets.barSideStyle, sets.barSideStyleByFields, sets.barSideStyleByCodomain, _i2, fv[_i2]);
  72908. polyTopSP.style = ShapeFactory.ShapeStyleTool({
  72909. stroke: true,
  72910. strokeColor: "#ffffff",
  72911. fillColor: "#ee9900"
  72912. }, sets.barTopStyle, sets.barTopStyleByFields, sets.barTopStyleByCodomain, _i2, fv[_i2]);
  72913. // 3d 柱条高亮样式
  72914. sets.barSideHoverStyle = sets.barSideHoverStyle ? sets.barSideHoverStyle : sets.barFaceHoverStyle;
  72915. sets.barTopHoverStyle = sets.barTopHoverStyle ? sets.barTopHoverStyle : sets.barFaceHoverStyle;
  72916. polyFaceSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  72917. stroke: true
  72918. }, sets.barFaceHoverStyle);
  72919. polySideSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  72920. stroke: true
  72921. }, sets.barSideHoverStyle);
  72922. polyTopSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  72923. stroke: true
  72924. }, sets.barTopHoverStyle);
  72925. // 图形携带的数据 id 信息 & 高亮模式
  72926. polyTopSP.refDataID = polySideSP.refDataID = polyFaceSP.refDataID = this.data.id;
  72927. // hover 模式(组合)
  72928. polyTopSP.isHoverByRefDataID = polySideSP.isHoverByRefDataID = polyFaceSP.isHoverByRefDataID = true;
  72929. // 高亮组(当鼠标 hover 到组内任何一个图形,整个组的图形都会高亮。refDataHoverGroup 在 isHoverByRefDataID 为 true 时有效)
  72930. polyTopSP.refDataHoverGroup = polySideSP.refDataHoverGroup = polyFaceSP.refDataHoverGroup = Util_Util.createUniqueID("lr_shg");
  72931. // 图形携带的数据信息
  72932. polyTopSP.dataInfo = polySideSP.dataInfo = polyFaceSP.dataInfo = {
  72933. field: this.fields[_i2],
  72934. value: fv[_i2]
  72935. };
  72936. // 3d 柱条顶面、侧面、正面图形 hover click 设置
  72937. if (typeof sets.barHoverAble !== "undefined") {
  72938. polyTopSP.hoverable = polySideSP.hoverable = polyFaceSP.hoverable = sets.barHoverAble;
  72939. }
  72940. if (typeof sets.barClickAble !== "undefined") {
  72941. polyTopSP.clickable = polySideSP.clickable = polyFaceSP.clickable = sets.barClickAble;
  72942. }
  72943. // 创建3d 柱条的顶面、侧面、正面图形并添加到图表的图形列表数组
  72944. this.shapes.push(this.shapeFactory.createShape(polySideSP));
  72945. this.shapes.push(this.shapeFactory.createShape(polyTopSP));
  72946. this.shapes.push(this.shapeFactory.createShape(polyFaceSP));
  72947. }
  72948. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  72949. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  72950. this.shapesConvertToRelativeCoordinate();
  72951. }
  72952. /**
  72953. * @function FeatureThemeBar3D.prototype.calculateXShapeInfo
  72954. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  72955. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  72956. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  72957. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  72958. * 本函数中图形配置对象 setting 可设属性:
  72959. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  72960. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  72961. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  72962. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  72963. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  72964. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  72965. */
  72966. }, {
  72967. key: "calculateXShapeInfo",
  72968. value: function calculateXShapeInfo() {
  72969. var dvb = this.dataViewBox; // 数据视图框
  72970. var sets = this.setting; // 图表配置对象
  72971. var fvc = this.dataValues.length; // 数组值个数
  72972. if (fvc < 1) {
  72973. return null;
  72974. }
  72975. var xBlank; // x 轴空白间隔参数
  72976. var xShapePositions = []; // x 轴上图形的位置
  72977. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  72978. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  72979. // x 轴空白间隔参数处理
  72980. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  72981. xBlank = sets.xShapeBlank;
  72982. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  72983. if (xsLen <= fvc) {
  72984. return null;
  72985. }
  72986. xShapeWidth = xsLen / fvc;
  72987. } else {
  72988. // 默认使用等距离空白间隔,空白间隔为图形宽度
  72989. xShapeWidth = dvbWidth / (2 * fvc + 1);
  72990. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  72991. }
  72992. // 图形 x 轴上的位置计算
  72993. var xOffset = 0;
  72994. for (var i = 0; i < fvc; i++) {
  72995. if (i == 0) {
  72996. xOffset = xBlank[0] + xShapeWidth / 2;
  72997. } else {
  72998. xOffset += xShapeWidth + xBlank[1];
  72999. }
  73000. xShapePositions.push(dvb[0] + xOffset);
  73001. }
  73002. return {
  73003. "xPositions": xShapePositions,
  73004. "width": xShapeWidth
  73005. };
  73006. }
  73007. }]);
  73008. return Bar3D;
  73009. }(Graph);
  73010. ;// CONCATENATED MODULE: ./src/common/overlay/RankSymbol.js
  73011. 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); }
  73012. function RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73013. 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); } }
  73014. 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; }
  73015. 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); }
  73016. function RankSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RankSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  73017. 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); }
  73018. 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); }
  73019. 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); }; }
  73020. 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); }
  73021. function RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73022. 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; } }
  73023. function RankSymbol_getPrototypeOf(o) { RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbol_getPrototypeOf(o); }
  73024. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73025. * This program are made available under the terms of the Apache License, Version 2.0
  73026. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73027. /**
  73028. * @class FeatureThemeRankSymbol
  73029. * @aliasclass Feature.Theme.RankSymbol
  73030. * @deprecatedclass SuperMap.Feature.Theme.RankSymbol
  73031. * @category Visualization Theme
  73032. * @classdesc 符号专题要素基类。此类定义了符号专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  73033. * 符号专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <FeatureThemeRankSymbol.setting> 的基础属性只有 5 个,
  73034. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  73035. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  73036. * @param {FeatureVector} data - 用户数据。
  73037. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  73038. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  73039. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  73040. * @param {Object} setting - 图表配置对象。除了以下 5 个基础属性,此对象的可设属性在不同子类中有较大差异,不同子类中对同一属性的解释也可能不同,请在此类的子类中查看 setting 对象的可设属性和属性含义。
  73041. * @param {Array.<number>} setting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  73042. * @param {number} [setting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  73043. * @param {number} [setting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  73044. * @param {Array.<number>} [setting.dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  73045. * @param {number} [setting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  73046. * @extends FeatureThemeGraph
  73047. * @usage
  73048. */
  73049. var RankSymbol = /*#__PURE__*/function (_Graph) {
  73050. RankSymbol_inherits(RankSymbol, _Graph);
  73051. var _super = RankSymbol_createSuper(RankSymbol);
  73052. function RankSymbol(data, layer, fields, setting, lonlat, options) {
  73053. var _this;
  73054. RankSymbol_classCallCheck(this, RankSymbol);
  73055. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  73056. /**
  73057. * @member {Object} FeatureThemeRankSymbol.prototype.setting
  73058. * @description 符号配置对象,该对象控制着图表的可视化显示。
  73059. */
  73060. _this.setting = null;
  73061. // 配置项检测与赋值
  73062. if (setting && setting.codomain) {
  73063. _this.setting = setting;
  73064. _this.DVBCodomain = _this.setting.codomain;
  73065. }
  73066. _this.CLASS_NAME = "SuperMap.Feature.Theme.RankSymbol";
  73067. return _this;
  73068. }
  73069. /**
  73070. * @function FeatureThemeRankSymbol.prototype.destroy
  73071. * @description 销毁专题要素。
  73072. */
  73073. RankSymbol_createClass(RankSymbol, [{
  73074. key: "destroy",
  73075. value: function destroy() {
  73076. this.setting = null;
  73077. RankSymbol_get(RankSymbol_getPrototypeOf(RankSymbol.prototype), "destroy", this).call(this);
  73078. }
  73079. /**
  73080. * @function FeatureThemeRankSymbol.prototype.initBaseParameter
  73081. * @description 初始化专题要素(图形)基础参数。
  73082. * 在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  73083. * 调用此函数关系到 setting 对象的以下属性。
  73084. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  73085. * @param {number} [XOffset] - 专题要素(图形)在 X 方向上的偏移值,单位像素。
  73086. * @param {number} [YOffset] - 专题要素(图形)在 Y 方向上的偏移值,单位像素。
  73087. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图形框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  73088. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  73089. * @returns {boolean} 初始化参数是否成功。
  73090. */
  73091. }, {
  73092. key: "initBaseParameter",
  73093. value: function initBaseParameter() {
  73094. // 参数初始化是否成功
  73095. var isSuccess = true;
  73096. // setting 属性是否已成功赋值
  73097. if (!this.setting) {
  73098. return false;
  73099. }
  73100. var sets = this.setting;
  73101. // 图表偏移
  73102. if (sets.XOffset) {
  73103. this.XOffset = sets.XOffset;
  73104. }
  73105. if (sets.YOffset) {
  73106. this.YOffset = sets.YOffset;
  73107. }
  73108. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  73109. this.YOffset = sets.YOffset ? sets.YOffset : 0;
  73110. // 其他默认值
  73111. this.origonPoint = [];
  73112. this.chartBox = [];
  73113. this.dataViewBox = [];
  73114. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  73115. this.DVBOrigonPoint = [];
  73116. this.DVBCenterPoint = [];
  73117. this.origonPointOffset = [];
  73118. // 图表位置
  73119. this.resetLocation();
  73120. // 专题要素宽度 w
  73121. var w = this.width;
  73122. // 专题要素高度 h
  73123. var h = this.height;
  73124. // 专题要素像素位置 loc
  73125. var loc = this.location;
  73126. // 专题要素像素位置 loc
  73127. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2];
  73128. // 专题要素原点(左上角)
  73129. var op = this.origonPoint;
  73130. // 图表框([left, bottom, right, top])
  73131. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]];
  73132. // 图表框
  73133. var cb = this.chartBox;
  73134. // 数据视图框参数,它是图表框各方向对应的内偏距
  73135. var dbbP = this.DVBParameter;
  73136. // 数据视图框 ([left, bottom, right, top])
  73137. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]];
  73138. // 数据视图框
  73139. var dvb = this.dataViewBox;
  73140. //检查数据视图框是否合法
  73141. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  73142. return false;
  73143. }
  73144. // 数据视图框原点
  73145. this.DVBOrigonPoint = [dvb[0], dvb[3]];
  73146. // 数据视图框宽度
  73147. this.DVBWidth = Math.abs(dvb[2] - dvb[0]);
  73148. // 数据视图框高度
  73149. this.DVBHeight = Math.abs(dvb[1] - dvb[3]);
  73150. // 数据视图框中心点
  73151. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2];
  73152. // 数据视图框原点与图表框的原点偏移量
  73153. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  73154. return isSuccess;
  73155. }
  73156. }]);
  73157. return RankSymbol;
  73158. }(Graph);
  73159. ;// CONCATENATED MODULE: ./src/common/overlay/Circle.js
  73160. 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); }
  73161. function overlay_Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73162. 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); } }
  73163. 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; }
  73164. 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); }
  73165. function overlay_Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  73166. 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); }
  73167. 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); }
  73168. 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); }; }
  73169. 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); }
  73170. function overlay_Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73171. 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; } }
  73172. 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); }
  73173. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73174. * This program are made available under the terms of the Apache License, Version 2.0
  73175. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73176. /**
  73177. * @class FeatureThemeCircle
  73178. * @aliasclass Feature.Theme.Circle
  73179. * @deprecatedclass SuperMap.Feature.Theme.Circle
  73180. * @classdesc 圆类。
  73181. * @category Visualization Theme
  73182. * @extends FeatureThemeRankSymbol
  73183. * @param {FeatureVector} data - 用户数据。
  73184. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  73185. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  73186. * @param {FeatureThemeCircle.setting} setting - 图表配置对象。
  73187. * @param {LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  73188. * @usage
  73189. * @private
  73190. */
  73191. var Circle = /*#__PURE__*/function (_RankSymbol) {
  73192. overlay_Circle_inherits(Circle, _RankSymbol);
  73193. var _super = overlay_Circle_createSuper(Circle);
  73194. function Circle(data, layer, fields, setting, lonlat) {
  73195. var _this;
  73196. overlay_Circle_classCallCheck(this, Circle);
  73197. _this = _super.call(this, data, layer, fields, setting, lonlat);
  73198. _this.CLASS_NAME = "SuperMap.Feature.Theme.Circle";
  73199. return _this;
  73200. }
  73201. /**
  73202. * @function FeatureThemeCircle.prototype.destroy
  73203. * @override
  73204. */
  73205. overlay_Circle_createClass(Circle, [{
  73206. key: "destroy",
  73207. value: function destroy() {
  73208. overlay_Circle_get(overlay_Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  73209. }
  73210. /**
  73211. * @function FeatureThemeCircle.prototype.assembleShapes
  73212. * @description 装配图形(扩展接口)。
  73213. */
  73214. }, {
  73215. key: "assembleShapes",
  73216. value: function assembleShapes() {
  73217. //默认填充颜色
  73218. var defaultFillColor = "#ff9277";
  73219. // setting 属性是否已成功赋值
  73220. if (!this.setting) {
  73221. return false;
  73222. }
  73223. var sets = this.setting;
  73224. // 检测 setting 的必设参数
  73225. if (!sets.codomain) {
  73226. return false;
  73227. }
  73228. // 数据
  73229. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  73230. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  73231. this.dataValues = dataEffective ? dataEffective : [];
  73232. // 数据值数组
  73233. var fv = this.dataValues;
  73234. //if(fv.length != 1) return; // 没有数据 或者数据不唯一
  73235. //if(fv[0] < 0) return; //数据为负值
  73236. //用户应该定义最大 最小半径 默认最大半径MaxR:100 最小半径MinR:0;
  73237. if (!sets.maxR) {
  73238. sets.maxR = 100;
  73239. }
  73240. if (!sets.minR) {
  73241. sets.minR = 0;
  73242. }
  73243. // 值域范围
  73244. var codomain = this.DVBCodomain;
  73245. // 重要步骤:定义Circle数据视图框中单位值的含义,单位值:1所代表的长度
  73246. // 用户定义了值域范围
  73247. if (codomain && codomain[1] - codomain[0] > 0) {
  73248. this.DVBUnitValue = sets.maxR / (codomain[1] - codomain[0]);
  73249. } else {
  73250. //this.DVBUnitValue = sets.maxR / maxValue;
  73251. this.DVBUnitValue = sets.maxR;
  73252. }
  73253. var uv = this.DVBUnitValue;
  73254. //圆半径
  73255. var r = fv[0] * uv + sets.minR;
  73256. this.width = 2 * r;
  73257. this.height = 2 * r;
  73258. // 重要步骤:初始化参数
  73259. if (!this.initBaseParameter()) {
  73260. return;
  73261. }
  73262. //假如用户设置了值域范围 没有在值域范围直接返回
  73263. if (codomain) {
  73264. if (fv[0] < codomain[0] || fv[0] > codomain[1]) {
  73265. return;
  73266. }
  73267. }
  73268. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为圆心
  73269. //圆形对象参数
  73270. var circleSP = new Circle_Circle(dvbCenter[0], dvbCenter[1], r);
  73271. //circleSP.sytle 初始化
  73272. circleSP.style = ShapeFactory.ShapeStyleTool(null, sets.circleStyle, null, null, 0);
  73273. //图形的填充颜色
  73274. if (typeof sets.fillColor !== "undefined") {
  73275. //用户自定义
  73276. circleSP.style.fillColor = sets.fillColor;
  73277. } else {
  73278. //当前默认
  73279. circleSP.style.fillColor = defaultFillColor;
  73280. }
  73281. //圆形 Hover样式
  73282. circleSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.circleHoverStyle);
  73283. //圆形 Hover 与 click 设置
  73284. if (typeof sets.circleHoverAble !== "undefined") {
  73285. circleSP.hoverable = sets.circleHoverAble;
  73286. }
  73287. if (typeof sets.circleClickAble !== "undefined") {
  73288. circleSP.clickable = sets.circleClickAble;
  73289. }
  73290. //图形携带的数据信息
  73291. circleSP.refDataID = this.data.id;
  73292. circleSP.dataInfo = {
  73293. field: this.fields[0],
  73294. r: r,
  73295. value: fv[0]
  73296. };
  73297. // 创建扇形并把此扇形添加到图表图形数组
  73298. this.shapes.push(this.shapeFactory.createShape(circleSP));
  73299. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  73300. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  73301. this.shapesConvertToRelativeCoordinate();
  73302. }
  73303. }]);
  73304. return Circle;
  73305. }(RankSymbol);
  73306. ;// CONCATENATED MODULE: ./src/common/overlay/Line.js
  73307. 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); }
  73308. function overlay_Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73309. 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); } }
  73310. 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; }
  73311. 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); }
  73312. function overlay_Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Line_getPrototypeOf(object); if (object === null) break; } return object; }
  73313. 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); }
  73314. 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); }
  73315. 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); }; }
  73316. 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); }
  73317. function overlay_Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73318. 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; } }
  73319. 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); }
  73320. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73321. * This program are made available under the terms of the Apache License, Version 2.0
  73322. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73323. /**
  73324. * @class FeatureThemeLine
  73325. * @aliasclass Feature.Theme.Line
  73326. * @deprecatedclass SuperMap.Feature.Theme.Line
  73327. * @classdesc 折线图。
  73328. * @category Visualization Theme
  73329. * @example
  73330. * // pointStyleByCodomain 参数用法示例
  73331. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  73332. * // start: 值域值下限(包含);
  73333. * // end: 值域值上限(不包含);
  73334. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <Point.style> 。
  73335. * // pointStyleByCodomain 数组形如:
  73336. * [
  73337. * {
  73338. * start:0,
  73339. * end:250,
  73340. * style:{
  73341. * fillColor:"#00CD00"
  73342. * }
  73343. * },
  73344. * {
  73345. * start:250,
  73346. * end:500,
  73347. * style:{
  73348. * fillColor:"#00EE00"
  73349. * }
  73350. * },
  73351. * {
  73352. * start:500,
  73353. * end:750,
  73354. * style:{
  73355. * fillColor:"#00FF7F"
  73356. * }
  73357. * },
  73358. * {
  73359. * start:750,
  73360. * end:1500,
  73361. * style:{
  73362. * fillColor:"#00FF00"
  73363. * }
  73364. * }
  73365. * ]
  73366. *
  73367. * @extends FeatureThemeGraph
  73368. * @param {FeatureVector} data - 用户数据。
  73369. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  73370. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  73371. * @param {FeatureThemeLine.setting} setting - 图表配置对象。
  73372. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  73373. * @usage
  73374. * @private
  73375. */
  73376. var Line = /*#__PURE__*/function (_Graph) {
  73377. overlay_Line_inherits(Line, _Graph);
  73378. var _super = overlay_Line_createSuper(Line);
  73379. function Line(data, layer, fields, setting, lonlat, options) {
  73380. var _this;
  73381. overlay_Line_classCallCheck(this, Line);
  73382. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  73383. _this.CLASS_NAME = "SuperMap.Feature.Theme.Line";
  73384. return _this;
  73385. }
  73386. /**
  73387. * @function FeatureThemeLine.prototype.destroy
  73388. * @override
  73389. */
  73390. overlay_Line_createClass(Line, [{
  73391. key: "destroy",
  73392. value: function destroy() {
  73393. overlay_Line_get(overlay_Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  73394. }
  73395. /**
  73396. * @function FeatureThemeLine.prototype.assembleShapes
  73397. * @description 装配图形(扩展接口)。
  73398. */
  73399. }, {
  73400. key: "assembleShapes",
  73401. value: function assembleShapes() {
  73402. // 图表配置对象
  73403. var sets = this.setting;
  73404. // 默认数据视图框
  73405. if (!sets.dataViewBoxParameter) {
  73406. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  73407. sets.dataViewBoxParameter = [45, 15, 15, 15];
  73408. } else {
  73409. sets.dataViewBoxParameter = [5, 5, 5, 5];
  73410. }
  73411. }
  73412. // 重要步骤:初始化参数
  73413. if (!this.initBaseParameter()) {
  73414. return;
  73415. }
  73416. var dvb = this.dataViewBox;
  73417. // 值域
  73418. var codomain = this.DVBCodomain;
  73419. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  73420. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  73421. var uv = this.DVBUnitValue;
  73422. // 数据值数组
  73423. var fv = this.dataValues;
  73424. if (fv.length < 1) {
  73425. return;
  73426. } // 没有数据
  73427. // 获取 x 轴上的图形信息
  73428. var xShapeInfo = this.calculateXShapeInfo();
  73429. if (!xShapeInfo) {
  73430. return;
  73431. }
  73432. // 折线每个节点的 x 位置
  73433. var xsLoc = xShapeInfo.xPositions;
  73434. // 背景框,默认启用
  73435. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  73436. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  73437. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  73438. }
  73439. // 折线图必须使用坐标轴
  73440. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  73441. // var isDataEffective = true;
  73442. var xPx; // 折线节点 x 坐标
  73443. var yPx; // 折线节点 y 坐标
  73444. var poiLists = []; // 折线节点数组
  73445. var shapePois = []; // 折线节点图形数组
  73446. for (var i = 0, len = fv.length; i < len; i++) {
  73447. // 数据溢出值域检查
  73448. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  73449. // isDataEffective = false;
  73450. return null;
  73451. }
  73452. xPx = xsLoc[i];
  73453. yPx = dvb[1] - (fv[i] - codomain[0]) / uv;
  73454. // 折线节点参数对象
  73455. var poiSP = new Point_Point(xPx, yPx);
  73456. // 折线节点 style
  73457. poiSP.style = ShapeFactory.ShapeStyleTool({
  73458. fillColor: "#ee9900"
  73459. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]);
  73460. // 折线节点 hover 样式
  73461. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle);
  73462. // 折线节点 hover click
  73463. if (typeof sets.pointHoverAble !== "undefined") {
  73464. poiSP.hoverable = sets.pointHoverAble;
  73465. }
  73466. if (typeof sets.pointClickAble !== "undefined") {
  73467. poiSP.clickable = sets.pointClickAble;
  73468. }
  73469. // 图形携带的数据信息
  73470. poiSP.refDataID = this.data.id;
  73471. poiSP.dataInfo = {
  73472. field: this.fields[i],
  73473. value: fv[i]
  73474. };
  73475. // 创建图形并把此图形添加到折线节点图形数组
  73476. shapePois.push(this.shapeFactory.createShape(poiSP));
  73477. // 添加折线节点到折线节点数组
  73478. var poi = [xPx, yPx];
  73479. poiLists.push(poi);
  73480. }
  73481. // 折线参数对象
  73482. var lineSP = new Line_Line(poiLists);
  73483. lineSP.style = ShapeFactory.ShapeStyleTool({
  73484. strokeColor: "#ee9900"
  73485. }, sets.lineStyle);
  73486. // 禁止事件响应
  73487. lineSP.clickable = false;
  73488. lineSP.hoverable = false;
  73489. var shapeLine = this.shapeFactory.createShape(lineSP);
  73490. this.shapes.push(shapeLine);
  73491. // 添加节点到图表图形数组
  73492. this.shapes = this.shapes.concat(shapePois);
  73493. // // 数据范围检测未通过,清空图形
  73494. // if (isDataEffective === false) {
  73495. // this.shapes = [];
  73496. // }
  73497. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  73498. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  73499. this.shapesConvertToRelativeCoordinate();
  73500. }
  73501. /**
  73502. * @function FeatureThemeLine.prototype.calculateXShapeInfo
  73503. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  73504. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  73505. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  73506. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  73507. * 本函数中图形配置对象 setting 可设属性:<br>
  73508. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  73509. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  73510. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  73511. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。<br>
  73512. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  73513. */
  73514. }, {
  73515. key: "calculateXShapeInfo",
  73516. value: function calculateXShapeInfo() {
  73517. var dvb = this.dataViewBox; // 数据视图框
  73518. var sets = this.setting; // 图表配置对象
  73519. var fvc = this.dataValues.length; // 数组值个数
  73520. if (fvc < 1) {
  73521. return null;
  73522. }
  73523. var xBlank; // x 轴空白间隔参数
  73524. var xShapePositions = []; // x 轴上图形的位置
  73525. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  73526. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  73527. var unitOffset = 0; // 单位偏移量
  73528. // x 轴空白间隔参数处理
  73529. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  73530. xBlank = sets.xShapeBlank;
  73531. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  73532. if (xsLen <= fvc) {
  73533. return null;
  73534. }
  73535. unitOffset = xsLen / (fvc - 1);
  73536. } else {
  73537. // 默认使用等距离空白间隔,空白间隔为图形宽度
  73538. unitOffset = dvbWidth / (fvc + 1);
  73539. xBlank = [unitOffset, unitOffset, unitOffset];
  73540. }
  73541. // 图形 x 轴上的位置计算
  73542. var xOffset = 0;
  73543. for (var i = 0; i < fvc; i++) {
  73544. if (i == 0) {
  73545. xOffset = xBlank[0];
  73546. } else {
  73547. xOffset += unitOffset;
  73548. }
  73549. xShapePositions.push(dvb[0] + xOffset);
  73550. }
  73551. return {
  73552. "xPositions": xShapePositions,
  73553. "width": xShapeWidth
  73554. };
  73555. }
  73556. }]);
  73557. return Line;
  73558. }(Graph);
  73559. ;// CONCATENATED MODULE: ./src/common/overlay/Pie.js
  73560. 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); }
  73561. function Pie_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73562. 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); } }
  73563. 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; }
  73564. 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); }
  73565. function Pie_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Pie_getPrototypeOf(object); if (object === null) break; } return object; }
  73566. 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); }
  73567. 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); }
  73568. 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); }; }
  73569. 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); }
  73570. function Pie_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73571. 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; } }
  73572. function Pie_getPrototypeOf(o) { Pie_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Pie_getPrototypeOf(o); }
  73573. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73574. * This program are made available under the terms of the Apache License, Version 2.0
  73575. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73576. /**
  73577. * @class FeatureThemePie
  73578. * @aliasclass Feature.Theme.Pie
  73579. * @deprecatedclass SuperMap.Feature.Theme.Pie
  73580. * @classdesc 饼图。
  73581. * @category Visualization Theme
  73582. * @param {FeatureVector} data - 用户数据。
  73583. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  73584. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  73585. * @param {FeatureThemePoint.setting} setting - 图表配置对象。
  73586. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  73587. * @extends FeatureThemeGraph
  73588. * @example
  73589. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  73590. * // start: 值域值下限(包含);
  73591. * // end: 值域值上限(不包含);
  73592. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersSector.style> 。
  73593. * // sectorStyleByCodomain 数组形如:
  73594. * [
  73595. * {
  73596. * start:0,
  73597. * end:250,
  73598. * style:{
  73599. * fillColor:"#00CD00"
  73600. * }
  73601. * },
  73602. * {
  73603. * start:250,
  73604. * end:500,
  73605. * style:{
  73606. * fillColor:"#00EE00"
  73607. * }
  73608. * },
  73609. * {
  73610. * start:500,
  73611. * end:750,
  73612. * style:{
  73613. * fillColor:"#00FF7F"
  73614. * }
  73615. * },
  73616. * {
  73617. * start:750,
  73618. * end:1500,
  73619. * style:{
  73620. * fillColor:"#00FF00"
  73621. * }
  73622. * }
  73623. * ]
  73624. * @usage
  73625. * @private
  73626. */
  73627. var Pie = /*#__PURE__*/function (_Graph) {
  73628. Pie_inherits(Pie, _Graph);
  73629. var _super = Pie_createSuper(Pie);
  73630. function Pie(data, layer, fields, setting, lonlat) {
  73631. var _this;
  73632. Pie_classCallCheck(this, Pie);
  73633. _this = _super.call(this, data, layer, fields, setting, lonlat);
  73634. _this.CLASS_NAME = "SuperMap.Feature.Theme.Pie";
  73635. return _this;
  73636. }
  73637. /**
  73638. * @function FeatureThemePie.prototype.destroy
  73639. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  73640. */
  73641. Pie_createClass(Pie, [{
  73642. key: "destroy",
  73643. value: function destroy() {
  73644. Pie_get(Pie_getPrototypeOf(Pie.prototype), "destroy", this).call(this);
  73645. }
  73646. /**
  73647. * @function FeatureThemePie.prototype.assembleShapes
  73648. * @description 装配图形(扩展接口)。
  73649. */
  73650. }, {
  73651. key: "assembleShapes",
  73652. value: function assembleShapes() {
  73653. // 图表配置对象
  73654. var sets = this.setting;
  73655. // 一个默认 style 组
  73656. var defaultStyleGroup = [{
  73657. fillColor: "#ff9277"
  73658. }, {
  73659. fillColor: "#dddd00"
  73660. }, {
  73661. fillColor: "#ffc877"
  73662. }, {
  73663. fillColor: "#bbe3ff"
  73664. }, {
  73665. fillColor: "#d5ffbb"
  73666. }, {
  73667. fillColor: "#bbbbff"
  73668. }, {
  73669. fillColor: "#ddb000"
  73670. }, {
  73671. fillColor: "#b0dd00"
  73672. }, {
  73673. fillColor: "#e2bbff"
  73674. }, {
  73675. fillColor: "#ffbbe3"
  73676. }, {
  73677. fillColor: "#ff7777"
  73678. }, {
  73679. fillColor: "#ff9900"
  73680. }, {
  73681. fillColor: "#83dd00"
  73682. }, {
  73683. fillColor: "#77e3ff"
  73684. }, {
  73685. fillColor: "#778fff"
  73686. }, {
  73687. fillColor: "#c877ff"
  73688. }, {
  73689. fillColor: "#ff77ab"
  73690. }, {
  73691. fillColor: "#ff6600"
  73692. }, {
  73693. fillColor: "#aa8800"
  73694. }, {
  73695. fillColor: "#77c7ff"
  73696. }, {
  73697. fillColor: "#ad77ff"
  73698. }, {
  73699. fillColor: "#ff77ff"
  73700. }, {
  73701. fillColor: "#dd0083"
  73702. }, {
  73703. fillColor: "#777700"
  73704. }, {
  73705. fillColor: "#00aa00"
  73706. }, {
  73707. fillColor: "#0088aa"
  73708. }, {
  73709. fillColor: "#8400dd"
  73710. }, {
  73711. fillColor: "#aa0088"
  73712. }, {
  73713. fillColor: "#dd0000"
  73714. }, {
  73715. fillColor: "#772e00"
  73716. }];
  73717. // 重要步骤:初始化参数
  73718. if (!this.initBaseParameter()) {
  73719. return;
  73720. }
  73721. // 背景框,默认不启用
  73722. if (sets.useBackground) {
  73723. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  73724. }
  73725. // 数据值数组
  73726. var fv = this.dataValues;
  73727. if (fv.length < 1) {
  73728. return;
  73729. } // 没有数据
  73730. // 值域范围
  73731. var codomain = this.DVBCodomain;
  73732. // 值域范围检测
  73733. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  73734. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  73735. return;
  73736. }
  73737. }
  73738. // 值的绝对值总和
  73739. var valueSum = 0;
  73740. for (var _i4 = 0; _i4 < fv.length; _i4++) {
  73741. valueSum += Math.abs(fv[_i4]);
  73742. }
  73743. // 重要步骤:定义图表 FeatureThemePie 数据视图框中单位值的含义,单位值:每度代表的数值
  73744. this.DVBUnitValue = 360 / valueSum;
  73745. var uv = this.DVBUnitValue;
  73746. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  73747. var startAngle = 0; // 扇形起始边角度
  73748. var endAngle = 0; // 扇形终止边角度
  73749. var startAngleTmp = startAngle; // 扇形临时起始边角度
  73750. // 扇形(自适应)半径
  73751. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  73752. for (var i = 0; i < fv.length; i++) {
  73753. var fvi = Math.abs(fv[i]);
  73754. //计算终止角
  73755. if (i === 0) {
  73756. endAngle = startAngle + fvi * uv;
  73757. } else if (i === fvi.length - 1) {
  73758. endAngle = startAngleTmp;
  73759. } else {
  73760. endAngle = startAngle + fvi * uv;
  73761. }
  73762. //矫正误差计算
  73763. if (endAngle - startAngle >= 360) {
  73764. endAngle = 359.9999999;
  73765. }
  73766. // 扇形参数对象
  73767. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle);
  73768. // 扇形样式
  73769. if (typeof sets.sectorStyleByFields === "undefined") {
  73770. // 使用默认 style 组
  73771. var colorIndex = i % defaultStyleGroup.length;
  73772. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  73773. } else {
  73774. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  73775. }
  73776. // 扇形 hover 样式
  73777. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle);
  73778. // 扇形 hover 与 click 设置
  73779. if (typeof sets.sectorHoverAble !== "undefined") {
  73780. sectorSP.hoverable = sets.sectorHoverAble;
  73781. }
  73782. if (typeof sets.sectorClickAble !== "undefined") {
  73783. sectorSP.clickable = sets.sectorClickAble;
  73784. }
  73785. // 图形携带的数据信息
  73786. sectorSP.refDataID = this.data.id;
  73787. sectorSP.dataInfo = {
  73788. field: this.fields[i],
  73789. value: fv[i]
  73790. };
  73791. // 创建扇形并把此扇形添加到图表图形数组
  73792. this.shapes.push(this.shapeFactory.createShape(sectorSP));
  73793. // 把上一次的结束角度作为下一次的起始角度
  73794. startAngle = endAngle;
  73795. }
  73796. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  73797. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  73798. this.shapesConvertToRelativeCoordinate();
  73799. }
  73800. }]);
  73801. return Pie;
  73802. }(Graph);
  73803. ;// CONCATENATED MODULE: ./src/common/overlay/Point.js
  73804. 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); }
  73805. function overlay_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73806. 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); } }
  73807. 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; }
  73808. 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); }
  73809. function overlay_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  73810. 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); }
  73811. 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); }
  73812. 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); }; }
  73813. 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); }
  73814. function overlay_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73815. 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; } }
  73816. 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); }
  73817. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  73818. * This program are made available under the terms of the Apache License, Version 2.0
  73819. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73820. /**
  73821. * @class FeatureThemePoint
  73822. * @aliasclass Feature.Theme.Point
  73823. * @deprecatedclass SuperMap.Feature.Theme.Point
  73824. * @classdesc 点状图。
  73825. * @category Visualization Theme
  73826. * @param {FeatureVector} data - 用户数据。
  73827. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  73828. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  73829. * @param {FeatureThemePoint.setting} setting - 图表配置对象。
  73830. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  73831. * @example
  73832. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  73833. * // start: 值域值下限(包含);
  73834. * // end: 值域值上限(不包含);
  73835. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <Point.style> 。
  73836. * // pointStyleByCodomain 数组形如:
  73837. * [
  73838. * {
  73839. * start:0,
  73840. * end:250,
  73841. * style:{
  73842. * fillColor:"#00CD00"
  73843. * }
  73844. * },
  73845. * {
  73846. * start:250,
  73847. * end:500,
  73848. * style:{
  73849. * fillColor:"#00EE00"
  73850. * }
  73851. * },
  73852. * {
  73853. * start:500,
  73854. * end:750,
  73855. * style:{
  73856. * fillColor:"#00FF7F"
  73857. * }
  73858. * },
  73859. * {
  73860. * start:750,
  73861. * end:1500,
  73862. * style:{
  73863. * fillColor:"#00FF00"
  73864. * }
  73865. * }
  73866. * ]
  73867. * @extends FeatureThemeGraph
  73868. * @usage
  73869. * @private
  73870. */
  73871. var overlay_Point_Point = /*#__PURE__*/function (_Graph) {
  73872. overlay_Point_inherits(Point, _Graph);
  73873. var _super = overlay_Point_createSuper(Point);
  73874. function Point(data, layer, fields, setting, lonlat, options) {
  73875. var _this;
  73876. overlay_Point_classCallCheck(this, Point);
  73877. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  73878. _this.CLASS_NAME = "SuperMap.Feature.Theme.Point";
  73879. return _this;
  73880. }
  73881. /**
  73882. * @function FeatureThemePoint.prototype.destroy
  73883. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  73884. */
  73885. overlay_Point_createClass(Point, [{
  73886. key: "destroy",
  73887. value: function destroy() {
  73888. overlay_Point_get(overlay_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  73889. }
  73890. /**
  73891. * @function FeatureThemePoint.prototype.Point.assembleShapes
  73892. * @description 装配图形(扩展接口)。
  73893. */
  73894. }, {
  73895. key: "assembleShapes",
  73896. value: function assembleShapes() {
  73897. // 图表配置对象
  73898. var sets = this.setting;
  73899. // 默认数据视图框
  73900. if (!sets.dataViewBoxParameter) {
  73901. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  73902. sets.dataViewBoxParameter = [45, 15, 15, 15];
  73903. } else {
  73904. sets.dataViewBoxParameter = [5, 5, 5, 5];
  73905. }
  73906. }
  73907. // 重要步骤:初始化参数
  73908. if (!this.initBaseParameter()) {
  73909. return;
  73910. }
  73911. var dvb = this.dataViewBox;
  73912. // 值域
  73913. var codomain = this.DVBCodomain;
  73914. // 重要步骤:定义图表 FeatureThemeBar 数据视图框中单位值的含义
  73915. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  73916. var uv = this.DVBUnitValue;
  73917. var fv = this.dataValues;
  73918. // 获取 x 轴上的图形信息
  73919. var xShapeInfo = this.calculateXShapeInfo();
  73920. if (!xShapeInfo) {
  73921. return;
  73922. }
  73923. // 折线每个节点的 x 位置
  73924. var xsLoc = xShapeInfo.xPositions;
  73925. // 背景框,默认启用
  73926. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  73927. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  73928. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  73929. }
  73930. // 点状图必须使用坐标轴
  73931. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  73932. var xPx; // 图形点 x 坐标
  73933. var yPx; // 图形点 y 坐标
  73934. for (var i = 0, len = fv.length; i < len; i++) {
  73935. // 数据溢出值域检查
  73936. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  73937. //isDataEffective = false;
  73938. return null;
  73939. }
  73940. xPx = xsLoc[i];
  73941. yPx = dvb[1] - (fv[i] - codomain[0]) / uv;
  73942. // 图形点参数对象
  73943. var poiSP = new Point_Point(xPx, yPx);
  73944. // 图形点 style
  73945. poiSP.style = ShapeFactory.ShapeStyleTool({
  73946. fillColor: "#ee9900"
  73947. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]);
  73948. // 图形点 hover 样式
  73949. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle);
  73950. // 图形点 hover click
  73951. if (typeof sets.pointHoverAble !== "undefined") {
  73952. poiSP.hoverable = sets.pointHoverAble;
  73953. }
  73954. if (typeof sets.pointClickAble !== "undefined") {
  73955. poiSP.clickable = sets.pointClickAble;
  73956. }
  73957. // 图形携带的数据信息
  73958. poiSP.refDataID = this.data.id;
  73959. poiSP.dataInfo = {
  73960. field: this.fields[i],
  73961. value: fv[i]
  73962. };
  73963. // 创建图形点并把此图形添加到图表图形数组
  73964. this.shapes.push(this.shapeFactory.createShape(poiSP));
  73965. }
  73966. // 数据范围检测未通过,清空图形
  73967. // if (isDataEffective === false) {
  73968. // this.shapes = [];
  73969. // }
  73970. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  73971. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  73972. this.shapesConvertToRelativeCoordinate();
  73973. }
  73974. /**
  73975. * @function FeatureThemePoint.prototype.calculateXShapeInfo
  73976. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  73977. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  73978. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  73979. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  73980. * 本函数中图形配置对象 setting 可设属性:<br>
  73981. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  73982. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  73983. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  73984. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  73985. * width - {number}表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  73986. */
  73987. }, {
  73988. key: "calculateXShapeInfo",
  73989. value: function calculateXShapeInfo() {
  73990. var dvb = this.dataViewBox; // 数据视图框
  73991. var sets = this.setting; // 图表配置对象
  73992. var fvc = this.dataValues.length; // 数组值个数
  73993. if (fvc < 1) {
  73994. return null;
  73995. }
  73996. var xBlank; // x 轴空白间隔参数
  73997. var xShapePositions = []; // x 轴上图形的位置
  73998. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  73999. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  74000. var unitOffset = 0; // 单位偏移量
  74001. // x 轴空白间隔参数处理
  74002. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  74003. xBlank = sets.xShapeBlank;
  74004. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  74005. if (xsLen <= fvc) {
  74006. return null;
  74007. }
  74008. unitOffset = xsLen / (fvc - 1);
  74009. } else {
  74010. // 默认使用等距离空白间隔,空白间隔为图形宽度
  74011. unitOffset = dvbWidth / (fvc + 1);
  74012. xBlank = [unitOffset, unitOffset, unitOffset];
  74013. }
  74014. // 图形 x 轴上的位置计算
  74015. var xOffset = 0;
  74016. for (var i = 0; i < fvc; i++) {
  74017. if (i == 0) {
  74018. xOffset = xBlank[0];
  74019. } else {
  74020. xOffset += unitOffset;
  74021. }
  74022. xShapePositions.push(dvb[0] + xOffset);
  74023. }
  74024. return {
  74025. "xPositions": xShapePositions,
  74026. "width": xShapeWidth
  74027. };
  74028. }
  74029. }]);
  74030. return Point;
  74031. }(Graph);
  74032. ;// CONCATENATED MODULE: ./src/common/overlay/Ring.js
  74033. 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); }
  74034. function Ring_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74035. 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); } }
  74036. 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; }
  74037. 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); }
  74038. function Ring_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Ring_getPrototypeOf(object); if (object === null) break; } return object; }
  74039. 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); }
  74040. 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); }
  74041. 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); }; }
  74042. 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); }
  74043. function Ring_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74044. 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; } }
  74045. function Ring_getPrototypeOf(o) { Ring_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Ring_getPrototypeOf(o); }
  74046. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74047. * This program are made available under the terms of the Apache License, Version 2.0
  74048. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74049. /**
  74050. * @class FeatureThemeRing
  74051. * @aliasclass Feature.Theme.Ring
  74052. * @deprecatedclass SuperMap.Feature.Theme.Ring
  74053. * @classdesc 环状图。
  74054. * @category Visualization Theme
  74055. * @description 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  74056. * @param {FeatureVector} data - 用户数据。
  74057. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  74058. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  74059. * @param {FeatureThemeRing.setting} setting - 图表配置对象。
  74060. * @param {LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  74061. * @example
  74062. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  74063. * // start: 值域值下限(包含);
  74064. * // end: 值域值上限(不包含);
  74065. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <ShapeParametersSector.style> 。
  74066. * // sectorStyleByCodomain 数组形如:
  74067. * [
  74068. * {
  74069. * start:0,
  74070. * end:250,
  74071. * style:{
  74072. * fillColor:"#00CD00"
  74073. * }
  74074. * },
  74075. * {
  74076. * start:250,
  74077. * end:500,
  74078. * style:{
  74079. * fillColor:"#00EE00"
  74080. * }
  74081. * },
  74082. * {
  74083. * start:500,
  74084. * end:750,
  74085. * style:{
  74086. * fillColor:"#00FF7F"
  74087. * }
  74088. * },
  74089. * {
  74090. * start:750,
  74091. * end:1500,
  74092. * style:{
  74093. * fillColor:"#00FF00"
  74094. * }
  74095. * }
  74096. * ]
  74097. * @param {Object} [sectorHoverStyle=true] - 环状图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  74098. * @param {boolean} [sectorHoverAble=true] - 是否允许环状图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  74099. * @param {boolean} [sectorClickAble=true] - 是否允许环状图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  74100. *
  74101. * @extends FeatureThemeGraph
  74102. * @usage
  74103. * @private
  74104. */
  74105. var Ring = /*#__PURE__*/function (_Graph) {
  74106. Ring_inherits(Ring, _Graph);
  74107. var _super = Ring_createSuper(Ring);
  74108. function Ring(data, layer, fields, setting, lonlat) {
  74109. var _this;
  74110. Ring_classCallCheck(this, Ring);
  74111. _this = _super.call(this, data, layer, fields, setting, lonlat);
  74112. _this.CLASS_NAME = "SuperMap.Feature.Theme.Ring";
  74113. return _this;
  74114. }
  74115. /**
  74116. * @function FeatureThemeRing.prototype.destroy
  74117. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  74118. */
  74119. Ring_createClass(Ring, [{
  74120. key: "destroy",
  74121. value: function destroy() {
  74122. Ring_get(Ring_getPrototypeOf(Ring.prototype), "destroy", this).call(this);
  74123. }
  74124. /**
  74125. * @function FeatureThemeRing.prototype.assembleShapes
  74126. * @description 装配图形(扩展接口)。
  74127. */
  74128. }, {
  74129. key: "assembleShapes",
  74130. value: function assembleShapes() {
  74131. // 重要步骤:初始化参数
  74132. if (!this.initBaseParameter()) {
  74133. return;
  74134. }
  74135. // 一个默认 style 组
  74136. var defaultStyleGroup = [{
  74137. fillColor: "#ff9277"
  74138. }, {
  74139. fillColor: "#dddd00"
  74140. }, {
  74141. fillColor: "#ffc877"
  74142. }, {
  74143. fillColor: "#bbe3ff"
  74144. }, {
  74145. fillColor: "#d5ffbb"
  74146. }, {
  74147. fillColor: "#bbbbff"
  74148. }, {
  74149. fillColor: "#ddb000"
  74150. }, {
  74151. fillColor: "#b0dd00"
  74152. }, {
  74153. fillColor: "#e2bbff"
  74154. }, {
  74155. fillColor: "#ffbbe3"
  74156. }, {
  74157. fillColor: "#ff7777"
  74158. }, {
  74159. fillColor: "#ff9900"
  74160. }, {
  74161. fillColor: "#83dd00"
  74162. }, {
  74163. fillColor: "#77e3ff"
  74164. }, {
  74165. fillColor: "#778fff"
  74166. }, {
  74167. fillColor: "#c877ff"
  74168. }, {
  74169. fillColor: "#ff77ab"
  74170. }, {
  74171. fillColor: "#ff6600"
  74172. }, {
  74173. fillColor: "#aa8800"
  74174. }, {
  74175. fillColor: "#77c7ff"
  74176. }, {
  74177. fillColor: "#ad77ff"
  74178. }, {
  74179. fillColor: "#ff77ff"
  74180. }, {
  74181. fillColor: "#dd0083"
  74182. }, {
  74183. fillColor: "#777700"
  74184. }, {
  74185. fillColor: "#00aa00"
  74186. }, {
  74187. fillColor: "#0088aa"
  74188. }, {
  74189. fillColor: "#8400dd"
  74190. }, {
  74191. fillColor: "#aa0088"
  74192. }, {
  74193. fillColor: "#dd0000"
  74194. }, {
  74195. fillColor: "#772e00"
  74196. }];
  74197. // 图表配置对象
  74198. var sets = this.setting;
  74199. // 背景框,默认不启用
  74200. if (sets.useBackground) {
  74201. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  74202. }
  74203. // 数据值数组
  74204. var fv = this.dataValues;
  74205. if (fv.length < 1) {
  74206. return;
  74207. } // 没有数据
  74208. // 值域范围
  74209. var codomain = this.DVBCodomain;
  74210. // 值域范围检测
  74211. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  74212. if (fv[_i2] < codomain[0] || fv[_i2] > codomain[1]) {
  74213. return;
  74214. }
  74215. }
  74216. // 值的绝对值总和
  74217. var valueSum = 0;
  74218. for (var _i4 = 0; _i4 < fv.length; _i4++) {
  74219. valueSum += Math.abs(fv[_i4]);
  74220. }
  74221. // 重要步骤:定义图表 FeatureThemeRing 数据视图框中单位值的含义,单位值:每度代表的数值
  74222. this.DVBUnitValue = 360 / valueSum;
  74223. var uv = this.DVBUnitValue;
  74224. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  74225. var startAngle = 0; // 扇形起始边角度
  74226. var endAngle = 0; // 扇形终止边角度
  74227. var startAngleTmp = startAngle; // 扇形临时起始边角度
  74228. // 扇形外环(自适应)半径
  74229. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  74230. // 扇形内环(自适应)半径
  74231. var isInRange = sets.innerRingRadius >= 0 && sets.innerRingRadius < r;
  74232. var r0 = typeof sets.innerRingRadius !== "undefined" && !isNaN(sets.innerRingRadius) && isInRange ? sets.innerRingRadius : 0;
  74233. for (var i = 0; i < fv.length; i++) {
  74234. var fvi = Math.abs(fv[i]);
  74235. // 计算结束角度
  74236. if (i === 0) {
  74237. endAngle = startAngle + fvi * uv;
  74238. } else if (i === fvi.length - 1) {
  74239. endAngle = startAngleTmp;
  74240. } else {
  74241. endAngle = startAngle + fvi * uv;
  74242. }
  74243. // 扇形参数对象
  74244. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle, r0);
  74245. // 扇形样式
  74246. if (typeof sets.sectorStyleByFields === "undefined") {
  74247. // 使用默认 style 组
  74248. var colorIndex = i % defaultStyleGroup.length;
  74249. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  74250. } else {
  74251. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  74252. }
  74253. // 扇形 hover 样式
  74254. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle);
  74255. // 扇形 hover 与 click 设置
  74256. if (typeof sets.sectorHoverAble !== "undefined") {
  74257. sectorSP.hoverable = sets.sectorHoverAble;
  74258. }
  74259. if (typeof sets.sectorClickAble !== "undefined") {
  74260. sectorSP.clickable = sets.sectorClickAble;
  74261. }
  74262. // 图形携带的数据信息
  74263. sectorSP.refDataID = this.data.id;
  74264. sectorSP.dataInfo = {
  74265. field: this.fields[i],
  74266. value: fv[i]
  74267. };
  74268. // 创建扇形并把此扇形添加到图表图形数组
  74269. this.shapes.push(this.shapeFactory.createShape(sectorSP));
  74270. // 把上一次的结束角度作为下一次的起始角度
  74271. startAngle = endAngle;
  74272. }
  74273. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  74274. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  74275. this.shapesConvertToRelativeCoordinate();
  74276. }
  74277. }]);
  74278. return Ring;
  74279. }(Graph);
  74280. ;// CONCATENATED MODULE: ./src/common/overlay/ThemeVector.js
  74281. 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); }
  74282. function ThemeVector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74283. 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); } }
  74284. 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; }
  74285. 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); }
  74286. function ThemeVector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeVector_getPrototypeOf(object); if (object === null) break; } return object; }
  74287. 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); }
  74288. 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); }
  74289. 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); }; }
  74290. 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); }
  74291. function ThemeVector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74292. 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; } }
  74293. function ThemeVector_getPrototypeOf(o) { ThemeVector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeVector_getPrototypeOf(o); }
  74294. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74295. * This program are made available under the terms of the Apache License, Version 2.0
  74296. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74297. /**
  74298. * @class FeatureThemeVector
  74299. * @aliasclass Feature.Theme.ThemeVector
  74300. * @deprecatedclass SuperMap.Feature.Theme.ThemeVector
  74301. * @classdesc 矢量专题要素类。
  74302. * @category Visualization Theme
  74303. * @extends FeatureTheme
  74304. * @param {FeatureVector} data - 用户数据,的类型为矢量数据 feature。
  74305. * @param {SuperMap.Layer} layer - 此专题要素所在图层。
  74306. * @param {Object} style - 样式。
  74307. * @param {Object} options - 创建专题要素时的可选参数。
  74308. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离,单位:像素。
  74309. * @param {boolean} [options.isHoverAble=true] - 图形是否可 hover。
  74310. * @param {boolean} [options.isMultiHover=true] - 是否使用多图形高亮,isHoverAble 为 true 时生效。
  74311. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  74312. * @param {Object} [options.highlightStyle] - 高亮样式。
  74313. * @usage
  74314. */
  74315. var ThemeVector = /*#__PURE__*/function (_Theme) {
  74316. ThemeVector_inherits(ThemeVector, _Theme);
  74317. var _super = ThemeVector_createSuper(ThemeVector);
  74318. function ThemeVector(data, layer, style, options, shapeOptions) {
  74319. var _this;
  74320. ThemeVector_classCallCheck(this, ThemeVector);
  74321. _this = _super.call(this, data, layer);
  74322. //数据的 geometry 属性必须存在且类型是 Geometry 或其子类的类型
  74323. if (!data.geometry) {
  74324. return ThemeVector_possibleConstructorReturn(_this);
  74325. }
  74326. if (!(data.geometry instanceof Geometry_Geometry)) {
  74327. return ThemeVector_possibleConstructorReturn(_this);
  74328. }
  74329. /**
  74330. * @member {Bounds} [FeatureThemeVector.prototype.dataBounds]
  74331. * @description 用户数据的(feature.geometry)地理范围。
  74332. */
  74333. _this.dataBounds = data.geometry.getBounds();
  74334. /**
  74335. * @member {number} [FeatureThemeVector.prototype.nodesClipPixel=2]
  74336. * @description 节点抽稀像素距离。
  74337. */
  74338. _this.nodesClipPixel = 2;
  74339. /**
  74340. * @member {boolean} [FeatureThemeVector.prototype.isHoverAble=true]
  74341. * @description 图形是否可 hover。
  74342. */
  74343. _this.isHoverAble = true;
  74344. /**
  74345. * @member {boolean} [FeatureThemeVector.prototype.isMultiHover=true]
  74346. * @description 是否使用多图形高亮,isHoverAble 为 true 时生效。
  74347. */
  74348. _this.isMultiHover = true;
  74349. /**
  74350. * @member {boolean} [FeatureThemeVector.prototype.isClickAble=true]
  74351. * @description 图形是否可点击。
  74352. */
  74353. _this.isClickAble = true;
  74354. /**
  74355. * @member {Object} [FeatureThemeVector.prototype.highlightStyle]
  74356. * @description 高亮样式。
  74357. */
  74358. _this.highlightStyle = null;
  74359. /**
  74360. * @member {Object} [FeatureThemeVector.prototype.shapeOptions]
  74361. * @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。
  74362. */
  74363. _this.shapeOptions = {};
  74364. /**
  74365. * @member {Object} [FeatureThemeVector.prototype.style]
  74366. * @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。
  74367. */
  74368. _this.style = style || {};
  74369. _this.CLASS_NAME = "SuperMap.Feature.Theme.Vector";
  74370. _this.style = style ? style : {};
  74371. if (options) {
  74372. Util_Util.copyAttributesWithClip(ThemeVector_assertThisInitialized(_this), options, ["shapeOptions", "dataBounds"]);
  74373. }
  74374. if (shapeOptions) {
  74375. Util_Util.copyAttributesWithClip(_this.shapeOptions, shapeOptions);
  74376. }
  74377. //设置基础参数 dataBounds、lonlat、location
  74378. var geometry = data.geometry;
  74379. _this.lonlat = _this.dataBounds.getCenterLonLat();
  74380. _this.location = _this.getLocalXY(_this.lonlat);
  74381. //将地理要素转为专题要素
  74382. if (geometry instanceof LinearRing_LinearRing) {
  74383. _this.lineToTF(geometry);
  74384. } else if (geometry instanceof LineString) {
  74385. _this.lineToTF(geometry);
  74386. } else if (geometry instanceof Curve) {
  74387. //独立几何体
  74388. } else if (geometry instanceof MultiPoint) {
  74389. _this.multiPointToTF(geometry);
  74390. } else if (geometry instanceof MultiLineString) {
  74391. _this.multiLineStringToTF(geometry);
  74392. } else if (geometry instanceof MultiPolygon) {
  74393. _this.multiPolygonToTF(geometry);
  74394. } else if (geometry instanceof Polygon_Polygon) {
  74395. _this.polygonToTF(geometry);
  74396. } else if (geometry instanceof Collection) {
  74397. //独立几何体
  74398. } else if (geometry instanceof Point) {
  74399. _this.pointToTF(geometry);
  74400. } else if (geometry instanceof Rectangle) {
  74401. _this.rectangleToTF(geometry);
  74402. } else if (geometry instanceof GeoText) {
  74403. _this.geoTextToTF(geometry);
  74404. }
  74405. return _this;
  74406. }
  74407. /**
  74408. * @function FeatureThemeVector.prototype.destroy
  74409. * @override
  74410. */
  74411. ThemeVector_createClass(ThemeVector, [{
  74412. key: "destroy",
  74413. value: function destroy() {
  74414. this.style = null;
  74415. this.dataBounds = null;
  74416. this.nodesClipPixel = null;
  74417. this.isHoverAble = null;
  74418. this.isMultiHover = null;
  74419. this.isClickAble = null;
  74420. this.highlightStyle = null;
  74421. this.shapeOptions = null;
  74422. ThemeVector_get(ThemeVector_getPrototypeOf(ThemeVector.prototype), "destroy", this).call(this);
  74423. }
  74424. /**
  74425. * @function FeatureThemeVector.prototype.lineToTF
  74426. * @description 转换线和线环要素。
  74427. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 GeometryLineString 或 GeometryLineRing。
  74428. */
  74429. }, {
  74430. key: "lineToTF",
  74431. value: function lineToTF(geometry) {
  74432. var components = geometry.components;
  74433. //节点像素坐标
  74434. var localLX = [];
  74435. //参考位置,参考中心为
  74436. var refLocal = [];
  74437. var location = this.location;
  74438. var pointList = [];
  74439. //节点抽稀距离
  74440. var nCPx = this.nodesClipPixel;
  74441. for (var i = 0; i < components.length; i++) {
  74442. var components_i = components[i];
  74443. refLocal = [];
  74444. localLX = this.getLocalXY(components_i);
  74445. refLocal[0] = localLX[0] - location[0];
  74446. refLocal[1] = localLX[1] - location[1];
  74447. //抽稀 - 2 px
  74448. if (pointList.length > 0) {
  74449. var lastLocalXY = pointList[pointList.length - 1];
  74450. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  74451. continue;
  74452. }
  74453. }
  74454. //使用参考点
  74455. pointList.push(refLocal);
  74456. }
  74457. if (pointList.length < 2) {
  74458. return null;
  74459. }
  74460. //赋 style
  74461. var style = new Object();
  74462. style = Util_Util.copyAttributesWithClip(style, this.style, ['pointList']);
  74463. style.pointList = pointList;
  74464. //创建图形
  74465. var shape = new SmicBrokenLine({
  74466. style: style,
  74467. clickable: this.isClickAble,
  74468. hoverable: this.isHoverAble
  74469. });
  74470. //设置高亮样式
  74471. if (this.highlightStyle) {
  74472. shape.highlightStyle = this.highlightStyle;
  74473. }
  74474. //设置参考中心,指定图形位置
  74475. shape.refOriginalPosition = this.location;
  74476. //储存数据 id 属性,用于事件
  74477. shape.refDataID = this.data.id;
  74478. //储存数据 id 属性,用于事件-多图形同时高亮
  74479. shape.isHoverByRefDataID = this.isMultiHover;
  74480. //添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做
  74481. if (this.shapeOptions) {
  74482. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  74483. }
  74484. this.shapes.push(shape);
  74485. }
  74486. /**
  74487. * @function FeatureThemeVector.prototype.multiPointToTF
  74488. * @description 转多点要素。
  74489. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPoint。
  74490. */
  74491. }, {
  74492. key: "multiPointToTF",
  74493. value: function multiPointToTF(geometry) {
  74494. /* //-- 不抽稀
  74495. var components = geometry.components;
  74496. for(var i = 0; i < components.length; i++){
  74497. var components_i = components[i];
  74498. this.pointToTF(components_i);
  74499. }
  74500. */
  74501. var components = geometry.components;
  74502. //节点像素坐标
  74503. var localLX = [];
  74504. //参考位置,参考中心为
  74505. var refLocal = [];
  74506. var location = this.location;
  74507. var pointList = [];
  74508. //节点抽稀距离
  74509. var nCPx = this.nodesClipPixel;
  74510. for (var i = 0; i < components.length; i++) {
  74511. var components_i = components[i];
  74512. refLocal = [];
  74513. localLX = this.getLocalXY(components_i);
  74514. refLocal[0] = localLX[0] - location[0];
  74515. refLocal[1] = localLX[1] - location[1];
  74516. //抽稀
  74517. if (pointList.length > 0) {
  74518. var lastLocalXY = pointList[pointList.length - 1];
  74519. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  74520. continue;
  74521. }
  74522. }
  74523. //使用参考点
  74524. pointList.push(refLocal);
  74525. //赋 style
  74526. var style = new Object();
  74527. style.r = 6; //防止漏设此参数,默认 6 像素
  74528. style = Util_Util.copyAttributesWithClip(style, this.style);
  74529. style.x = refLocal[0];
  74530. style.y = refLocal[1];
  74531. //创建图形
  74532. var shape = new SmicPoint({
  74533. style: style,
  74534. clickable: this.isClickAble,
  74535. hoverable: this.isHoverAble
  74536. });
  74537. //设置高亮样式
  74538. if (this.highlightStyle) {
  74539. shape.highlightStyle = this.highlightStyle;
  74540. }
  74541. //设置参考中心,指定图形位置
  74542. shape.refOriginalPosition = location;
  74543. //储存数据 id 属性,用于事件
  74544. shape.refDataID = this.data.id;
  74545. //储存数据 id 属性,用于事件-多图形同时高亮
  74546. shape.isHoverByRefDataID = this.isMultiHover;
  74547. //修改一些 shape 可选属性,通常不需要这么做
  74548. if (this.shapeOptions) {
  74549. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  74550. }
  74551. this.shapes.push(shape);
  74552. }
  74553. }
  74554. /**
  74555. * @function FeatureThemeVector.prototype.multiLineStringToTF
  74556. * @description 转换多线要素。
  74557. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiLineString。
  74558. */
  74559. }, {
  74560. key: "multiLineStringToTF",
  74561. value: function multiLineStringToTF(geometry) {
  74562. var components = geometry.components;
  74563. for (var i = 0; i < components.length; i++) {
  74564. var components_i = components[i];
  74565. this.lineToTF(components_i);
  74566. }
  74567. }
  74568. /**
  74569. * @function FeatureThemeVector.prototype.multiPolygonToTF
  74570. * @description 转换多面要素。
  74571. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPolygon。
  74572. */
  74573. }, {
  74574. key: "multiPolygonToTF",
  74575. value: function multiPolygonToTF(geometry) {
  74576. var components = geometry.components;
  74577. for (var i = 0; i < components.length; i++) {
  74578. var components_i = components[i];
  74579. this.polygonToTF(components_i);
  74580. }
  74581. }
  74582. /**
  74583. * @function FeatureThemeVector.prototype.pointToTF
  74584. * @description 转换点要素。
  74585. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Point。
  74586. */
  74587. }, {
  74588. key: "pointToTF",
  74589. value: function pointToTF(geometry) {
  74590. //参考位置,参考中心为
  74591. var location = this.location;
  74592. //geometry 像素坐标
  74593. var localLX = this.getLocalXY(geometry);
  74594. //赋 style
  74595. var style = new Object();
  74596. style.r = 6; //防止漏设此参数,默认 6 像素
  74597. style = Util_Util.copyAttributesWithClip(style, this.style);
  74598. style.x = localLX[0] - location[0];
  74599. style.y = localLX[1] - location[1];
  74600. //创建图形
  74601. var shape = new SmicPoint({
  74602. style: style,
  74603. clickable: this.isClickAble,
  74604. hoverable: this.isHoverAble
  74605. });
  74606. //设置高亮样式
  74607. if (this.highlightStyle) {
  74608. shape.highlightStyle = this.highlightStyle;
  74609. }
  74610. //设置参考中心,指定图形位置
  74611. shape.refOriginalPosition = location;
  74612. //储存数据 id 属性,用于事件
  74613. shape.refDataID = this.data.id;
  74614. //储存数据 id 属性,用于事件-多图形同时高亮
  74615. shape.isHoverByRefDataID = this.isMultiHover;
  74616. //修改一些 shape 可选属性,通常不需要这么做
  74617. if (this.shapeOptions) {
  74618. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  74619. }
  74620. this.shapes.push(shape);
  74621. }
  74622. /**
  74623. * @function FeatureThemeVector.prototype.polygonToThemeFeature
  74624. * @description 转换面要素。
  74625. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Polygon。
  74626. */
  74627. }, {
  74628. key: "polygonToTF",
  74629. value: function polygonToTF(geometry) {
  74630. var components = geometry.components;
  74631. //节点像素坐标
  74632. var localLX = [];
  74633. //参考位置,参考中心为
  74634. var refLocal = [];
  74635. var location = this.location;
  74636. var pointList = [];
  74637. //岛洞
  74638. var holePolygonPointList = [];
  74639. var holePolygonPointLists = [];
  74640. //节点抽稀距离
  74641. var nCPx = this.nodesClipPixel;
  74642. for (var i = 0; i < components.length; i++) {
  74643. var components_i = components[i].components;
  74644. if (i === 0) {
  74645. // 第一个 component 正常绘制
  74646. pointList = [];
  74647. for (var j = 0; j < components_i.length; j++) {
  74648. refLocal = [];
  74649. localLX = this.getLocalXY(components_i[j]);
  74650. refLocal[0] = localLX[0] - location[0];
  74651. refLocal[1] = localLX[1] - location[1];
  74652. //抽稀 - 2 px
  74653. if (pointList.length > 0) {
  74654. var lastLocalXY = pointList[pointList.length - 1];
  74655. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  74656. continue;
  74657. }
  74658. }
  74659. //使用参考点
  74660. pointList.push(refLocal);
  74661. }
  74662. } else {
  74663. // 其它 component 作为岛洞
  74664. holePolygonPointList = [];
  74665. for (var k = 0; k < components_i.length; k++) {
  74666. refLocal = [];
  74667. localLX = this.getLocalXY(components_i[k]);
  74668. refLocal[0] = localLX[0] - location[0];
  74669. refLocal[1] = localLX[1] - location[1];
  74670. //抽稀 - 2 px
  74671. if (holePolygonPointList.length > 0) {
  74672. var lastXY = holePolygonPointList[holePolygonPointList.length - 1];
  74673. if (Math.abs(lastXY[0] - refLocal[0]) <= nCPx && Math.abs(lastXY[1] - refLocal[1]) <= nCPx) {
  74674. continue;
  74675. }
  74676. }
  74677. //使用参考点
  74678. holePolygonPointList.push(refLocal);
  74679. }
  74680. }
  74681. if (holePolygonPointList.length < 2) {
  74682. continue;
  74683. }
  74684. holePolygonPointLists.push(holePolygonPointList);
  74685. }
  74686. if (pointList.length < 2) {
  74687. return;
  74688. }
  74689. //赋 style
  74690. var style = {};
  74691. style = Util_Util.copyAttributesWithClip(style, this.style, ['pointList']);
  74692. style.pointList = pointList;
  74693. //创建图形
  74694. var shape = new SmicPolygon({
  74695. style: style,
  74696. clickable: this.isClickAble,
  74697. hoverable: this.isHoverAble
  74698. });
  74699. //设置高亮样式
  74700. if (this.highlightStyle) {
  74701. shape.highlightStyle = this.highlightStyle;
  74702. }
  74703. //设置参考中心,指定图形位置
  74704. shape.refOriginalPosition = this.location;
  74705. //储存数据 id 属性,用于事件
  74706. shape.refDataID = this.data.id;
  74707. //储存数据 id 属性,用于事件-多图形同时高亮
  74708. shape.isHoverByRefDataID = this.isMultiHover;
  74709. //岛洞面
  74710. if (holePolygonPointLists.length > 0) {
  74711. shape.holePolygonPointLists = holePolygonPointLists;
  74712. }
  74713. //修改一些 shape 可选属性,通常不需要这么做
  74714. if (this.shapeOptions) {
  74715. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  74716. }
  74717. this.shapes.push(shape);
  74718. }
  74719. /**
  74720. * @function FeatureThemeVector.prototype.rectangleToTF
  74721. * @description 转换矩形要素。
  74722. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 Rectangle。
  74723. */
  74724. }, {
  74725. key: "rectangleToTF",
  74726. value: function rectangleToTF(geometry) {
  74727. //参考位置,参考中心为
  74728. var location = this.location;
  74729. var ll = new LonLat(geometry.x, geometry.y);
  74730. //地图分辨率
  74731. var res = this.layer.map.getResolution();
  74732. //geometry 像素坐标
  74733. var localLX = this.getLocalXY(ll);
  74734. //赋 style
  74735. var style = new Object();
  74736. style.r = 6; //防止漏设此参数,默认 6 像素
  74737. style = Util_Util.copyAttributesWithClip(style, this.style);
  74738. style.x = localLX[0] - location[0];
  74739. // Rectangle 使用左下角定位, SmicRectangle 使用左上角定位,需要转换
  74740. style.y = localLX[1] - location[1] - 2 * geometry.width / res;
  74741. style.width = geometry.width / res;
  74742. style.height = geometry.height / res;
  74743. //创建图形
  74744. var shape = new SmicRectangle({
  74745. style: style,
  74746. clickable: this.isClickAble,
  74747. hoverable: this.isHoverAble
  74748. });
  74749. //设置高亮样式
  74750. if (this.highlightStyle) {
  74751. shape.highlightStyle = this.highlightStyle;
  74752. }
  74753. //设置参考中心,指定图形位置
  74754. shape.refOriginalPosition = location;
  74755. //储存数据 id 属性,用于事件
  74756. shape.refDataID = this.data.id;
  74757. //储存数据 id 属性,用于事件-多图形同时高亮
  74758. shape.isHoverByRefDataID = this.isMultiHover;
  74759. //修改一些 shape 可选属性,通常不需要这么做
  74760. if (this.shapeOptions) {
  74761. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  74762. }
  74763. this.shapes.push(shape);
  74764. }
  74765. /**
  74766. * @function FeatureThemeVector.prototype.geoTextToTF
  74767. * @description 转换文本要素。
  74768. * @param {Geometry} geometry - 用户数据几何地理信息,这里必须是 GeoText。
  74769. */
  74770. }, {
  74771. key: "geoTextToTF",
  74772. value: function geoTextToTF(geometry) {
  74773. //参考位置,参考中心为
  74774. var location = this.location;
  74775. //geometry 像素坐标
  74776. var localLX = this.getLocalXY(geometry);
  74777. //赋 style
  74778. var style = new Object();
  74779. style.r = 6; //防止漏设此参数,默认 6 像素
  74780. style = Util_Util.copyAttributesWithClip(style, this.style, ["x", "y", "text"]);
  74781. style.x = localLX[0] - location[0];
  74782. style.y = localLX[1] - location[1];
  74783. style.text = geometry.text;
  74784. //创建图形
  74785. var shape = new SmicText({
  74786. style: style,
  74787. clickable: this.isClickAble,
  74788. hoverable: this.isHoverAble
  74789. });
  74790. //设置高亮样式
  74791. if (this.highlightStyle) {
  74792. shape.highlightStyle = this.highlightStyle;
  74793. }
  74794. //设置参考中心,指定图形位置
  74795. shape.refOriginalPosition = location;
  74796. //储存数据 id 属性,用于事件
  74797. shape.refDataID = this.data.id;
  74798. //储存数据 id 属性,用于事件-多图形同时高亮
  74799. shape.isHoverByRefDataID = this.isMultiHover;
  74800. //修改一些 shape 可选属性,通常不需要这么做
  74801. if (this.shapeOptions) {
  74802. Util_Util.copyAttributesWithClip(shape, this.shapeOptions);
  74803. }
  74804. this.shapes.push(shape);
  74805. }
  74806. /**
  74807. * @function FeatureThemeVector.prototype.updateAndAddShapes
  74808. * @description 修改位置,针对地图平移操作,地图漫游操作后调用此函数。
  74809. */
  74810. }, {
  74811. key: "updateAndAddShapes",
  74812. value: function updateAndAddShapes() {
  74813. var newLocalLX = this.getLocalXY(this.lonlat);
  74814. this.location = newLocalLX;
  74815. var render = this.layer.renderer;
  74816. for (var i = 0, len = this.shapes.length; i < len; i++) {
  74817. var shape = this.shapes[i];
  74818. //设置参考中心,指定图形位置
  74819. shape.refOriginalPosition = newLocalLX;
  74820. render.addShape(shape);
  74821. }
  74822. }
  74823. /**
  74824. * @function FeatureThemeVector.prototype.getShapesCount
  74825. * @description 获得专题要素中可视化图形的数量。
  74826. * @returns {number} 可视化图形的数量。
  74827. */
  74828. }, {
  74829. key: "getShapesCount",
  74830. value: function getShapesCount() {
  74831. return this.shapes.length;
  74832. }
  74833. /**
  74834. * @function FeatureThemeVector.prototype.getLocalXY
  74835. * @description 地理坐标转为像素坐标。
  74836. * @param {LonLat} lonlat - 专题要素地理位置。
  74837. */
  74838. }, {
  74839. key: "getLocalXY",
  74840. value: function getLocalXY(lonlat) {
  74841. return this.layer.getLocalXY(lonlat);
  74842. }
  74843. }]);
  74844. return ThemeVector;
  74845. }(Theme_Theme);
  74846. ;// CONCATENATED MODULE: ./src/common/overlay/feature/index.js
  74847. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74848. * This program are made available under the terms of the Apache License, Version 2.0
  74849. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74850. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Group.js
  74851. 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); }
  74852. function Group_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74853. 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); } }
  74854. 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; }
  74855. 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); }
  74856. function Group_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Group_getPrototypeOf(object); if (object === null) break; } return object; }
  74857. 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); }
  74858. 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); }
  74859. 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); }; }
  74860. 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); }
  74861. function Group_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74862. 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; } }
  74863. function Group_getPrototypeOf(o) { Group_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Group_getPrototypeOf(o); }
  74864. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  74865. * This program are made available under the terms of the Apache License, Version 2.0
  74866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74867. /**
  74868. * @class LevelRenderer.Group
  74869. * @category Visualization Theme
  74870. * @private
  74871. * @classdesc Group 是一个容器,可以插入子节点,Group 的变换也会被应用到子节点上。
  74872. * @extends {LevelRenderer.Transformable}
  74873. * (code)
  74874. * var g = new LevelRenderer.Group();
  74875. * var Circle = new LevelRenderer.Shape.Circle();
  74876. * g.position[0] = 100;
  74877. * g.position[1] = 100;
  74878. * g.addChild(new Circle({
  74879. * style: {
  74880. * x: 100,
  74881. * y: 100,
  74882. * r: 20,
  74883. * brushType: 'fill'
  74884. * }
  74885. * }));
  74886. * LR.addGroup(g);
  74887. * (end)
  74888. * @param {Array} options - Group 的配置(options)项,可以是 Group 的自有属性,也可以是自定义的属性。
  74889. */
  74890. var Group = /*#__PURE__*/function (_mixin) {
  74891. Group_inherits(Group, _mixin);
  74892. var _super = Group_createSuper(Group);
  74893. function Group(options) {
  74894. var _this;
  74895. Group_classCallCheck(this, Group);
  74896. _this = _super.call(this, options);
  74897. options = options || {};
  74898. /**
  74899. * @member {string} LevelRenderer.Group.prototype.id
  74900. * @description Group 的唯一标识。
  74901. */
  74902. _this.id = null;
  74903. /**
  74904. * @readonly
  74905. * @member {string} [LevelRenderer.Group.prototype.type='group']
  74906. * @description 类型。
  74907. */
  74908. _this.type = 'group';
  74909. //http://www.w3.org/TR/2dcontext/#clipping-region
  74910. /**
  74911. * @member {string} LevelRenderer.Group.prototype.clipShape
  74912. * @description 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪,该图形会继承 Group 的变换。
  74913. */
  74914. _this.clipShape = null;
  74915. /**
  74916. * @member {Array} LevelRenderer.Group.prototype._children
  74917. * @description _children。
  74918. */
  74919. _this._children = [];
  74920. /**
  74921. * @member {Array} LevelRenderer.Group.prototype._storage
  74922. * @description _storage。
  74923. */
  74924. _this._storage = null;
  74925. /**
  74926. * @member {boolean} [LevelRenderer.Group.prototype.__dirty=true]
  74927. * @description __dirty。
  74928. */
  74929. _this.__dirty = true;
  74930. /**
  74931. * @member {boolean} [LevelRenderer.Group.prototype.ignore=false]
  74932. * @description 是否忽略该 Group 及其所有子节点。
  74933. */
  74934. _this.ignore = false;
  74935. Util_Util.extend(Group_assertThisInitialized(_this), options);
  74936. _this.id = _this.id || Util_Util.createUniqueID("smShapeGroup_");
  74937. _this.CLASS_NAME = "SuperMap.LevelRenderer.Group";
  74938. return _this;
  74939. }
  74940. /**
  74941. * @function LevelRenderer.Group.prototype.destroy
  74942. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  74943. */
  74944. Group_createClass(Group, [{
  74945. key: "destroy",
  74946. value: function destroy() {
  74947. this.id = null;
  74948. this.type = null;
  74949. this.clipShape = null;
  74950. this._children = null;
  74951. this._storage = null;
  74952. this.__dirty = null;
  74953. this.ignore = null;
  74954. Group_get(Group_getPrototypeOf(Group.prototype), "destroy", this).call(this);
  74955. }
  74956. /**
  74957. * @function LevelRenderer.Group.prototype.children
  74958. * @description 复制并返回一份新的包含所有儿子节点的数组。
  74959. * @returns {Array.<LevelRenderer.Shape>} 图形数组。
  74960. */
  74961. }, {
  74962. key: "children",
  74963. value: function children() {
  74964. return this._children.slice();
  74965. }
  74966. /**
  74967. * @function LevelRenderer.Group.prototype.childAt
  74968. * @description 获取指定 index 的儿子节点
  74969. * @param {number} idx - 节点索引。
  74970. * @returns {LevelRenderer.Shape} 图形。
  74971. */
  74972. }, {
  74973. key: "childAt",
  74974. value: function childAt(idx) {
  74975. return this._children[idx];
  74976. }
  74977. /**
  74978. * @function LevelRenderer.Group.prototype.addChild
  74979. * @description 添加子节点,可以是 Shape 或者 Group。
  74980. * @param {(LevelRenderer.Shape|LevelRenderer.Group)} child - 节点图形。
  74981. */
  74982. // TODO Type Check
  74983. }, {
  74984. key: "addChild",
  74985. value: function addChild(child) {
  74986. if (child == this) {
  74987. return;
  74988. }
  74989. if (child.parent == this) {
  74990. return;
  74991. }
  74992. if (child.parent) {
  74993. child.parent.removeChild(child);
  74994. }
  74995. this._children.push(child);
  74996. child.parent = this;
  74997. if (this._storage && this._storage !== child._storage) {
  74998. this._storage.addToMap(child);
  74999. if (child instanceof Group) {
  75000. child.addChildrenToStorage(this._storage);
  75001. }
  75002. }
  75003. }
  75004. /**
  75005. * @function LevelRenderer.Group.prototype.removeChild
  75006. * @description 移除子节点。
  75007. * @param {LevelRenderer.Shape} child - 需要移除的子节点图形。
  75008. */
  75009. }, {
  75010. key: "removeChild",
  75011. value: function removeChild(child) {
  75012. var idx = Util_Util.indexOf(this._children, child);
  75013. this._children.splice(idx, 1);
  75014. child.parent = null;
  75015. if (this._storage) {
  75016. this._storage.delFromMap(child.id);
  75017. if (child instanceof Group) {
  75018. child.delChildrenFromStorage(this._storage);
  75019. }
  75020. }
  75021. }
  75022. /**
  75023. * @function LevelRenderer.Group.prototype.eachChild
  75024. * @description 遍历所有子节点。
  75025. * @param {function} cb - 回调函数。
  75026. * @param {Object} context - 上下文。
  75027. */
  75028. }, {
  75029. key: "eachChild",
  75030. value: function eachChild(cb, context) {
  75031. var haveContext = !!context;
  75032. for (var i = 0; i < this._children.length; i++) {
  75033. var child = this._children[i];
  75034. if (haveContext) {
  75035. cb.call(context, child);
  75036. } else {
  75037. cb(child);
  75038. }
  75039. }
  75040. }
  75041. /**
  75042. * @function LevelRenderer.Group.prototype.traverse
  75043. * @description 深度优先遍历所有子孙节点。
  75044. * @param {function} cb - 回调函数。
  75045. * @param {Object} context - 上下文。
  75046. */
  75047. }, {
  75048. key: "traverse",
  75049. value: function traverse(cb, context) {
  75050. var haveContext = !!context;
  75051. for (var i = 0; i < this._children.length; i++) {
  75052. var child = this._children[i];
  75053. if (haveContext) {
  75054. cb.call(context, child);
  75055. } else {
  75056. cb(child);
  75057. }
  75058. if (child.type === 'group') {
  75059. child.traverse(cb, context);
  75060. }
  75061. }
  75062. }
  75063. /**
  75064. * @function LevelRenderer.Group.prototype.addChildrenToStorage
  75065. * @description 把子图形添加到仓库。
  75066. * @param {LevelRenderer.Storage} storage - 图形仓库。
  75067. */
  75068. }, {
  75069. key: "addChildrenToStorage",
  75070. value: function addChildrenToStorage(storage) {
  75071. for (var i = 0; i < this._children.length; i++) {
  75072. var child = this._children[i];
  75073. storage.addToMap(child);
  75074. if (child.type === 'group') {
  75075. child.addChildrenToStorage(storage);
  75076. }
  75077. }
  75078. }
  75079. /**
  75080. * @function LevelRenderer.Group.prototype.delChildrenFromStorage
  75081. * @description 从仓库把子图形删除。
  75082. * @param {LevelRenderer.Storage} storage - 图形仓库。
  75083. */
  75084. }, {
  75085. key: "delChildrenFromStorage",
  75086. value: function delChildrenFromStorage(storage) {
  75087. for (var i = 0; i < this._children.length; i++) {
  75088. var child = this._children[i];
  75089. storage.delFromMap(child.id);
  75090. if (child.type === 'group') {
  75091. child.delChildrenFromStorage(storage);
  75092. }
  75093. }
  75094. }
  75095. /**
  75096. * @function LevelRenderer.Group.prototype.modSelf
  75097. * @description 是否修改。
  75098. */
  75099. }, {
  75100. key: "modSelf",
  75101. value: function modSelf() {
  75102. this.__dirty = true;
  75103. }
  75104. }]);
  75105. return Group;
  75106. }(mixinExt(Eventful, Transformable));
  75107. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Storage.js
  75108. function Storage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75109. 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); } }
  75110. 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; }
  75111. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  75112. * This program are made available under the terms of the Apache License, Version 2.0
  75113. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75114. /**
  75115. * @private
  75116. * @class LevelRenderer.Storage
  75117. * @category Visualization Theme
  75118. * @classdesc 内容(图像)仓库 (M) 。
  75119. */
  75120. var Storage = /*#__PURE__*/function () {
  75121. function Storage() {
  75122. Storage_classCallCheck(this, Storage);
  75123. /**
  75124. * @member {Object} LevelRenderer.Storage.prototype._elements
  75125. * @description 所有常规形状,id 索引的 map。
  75126. */
  75127. this._elements = {};
  75128. /**
  75129. * @member {Array} LevelRenderer.Storage.prototype._hoverElements
  75130. * @description 高亮层形状,不稳定,动态增删,数组位置也是 z 轴方向,靠前显示在下方。
  75131. *
  75132. */
  75133. this._hoverElements = [];
  75134. /**
  75135. * @member {Array} LevelRenderer.Storage.prototype._roots
  75136. * @description _roots。
  75137. *
  75138. */
  75139. this._roots = [];
  75140. /**
  75141. * @member {Array} LevelRenderer.Storage.prototype._shapeList
  75142. * @description _shapeList。
  75143. *
  75144. */
  75145. this._shapeList = [];
  75146. /**
  75147. * @member {number} LevelRenderer.Storage.prototype._shapeListOffset
  75148. * @description _shapeListOffset。默认值:0。
  75149. *
  75150. */
  75151. this._shapeListOffset = 0;
  75152. this.CLASS_NAME = "SuperMap.LevelRenderer.Storage";
  75153. }
  75154. /**
  75155. * @function LevelRenderer.Storage.prototype.destroy
  75156. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  75157. */
  75158. Storage_createClass(Storage, [{
  75159. key: "destroy",
  75160. value: function destroy() {
  75161. this.dispose();
  75162. this._shapeList = null;
  75163. this._shapeListOffset = null;
  75164. }
  75165. /**
  75166. * @function LevelRenderer.Storage.prototype.iterShape
  75167. * @description 遍历迭代器。
  75168. *
  75169. * @param {function} fun - 迭代回调函数,return true终止迭代。
  75170. * @param {Object} option - 迭代参数,缺省为仅降序遍历普通层图形。
  75171. * @param {boolean} [hover=true] - 是否是高亮层图形。
  75172. * @param {string} [normal='down'] - 是否是普通层图形,迭代时是否指定及z轴顺序。可设值:'down' ,'up'。
  75173. * @param {boolean} [update=false] - 是否在迭代前更新形状列表。
  75174. * @return {LevelRenderer.Storage} this。
  75175. */
  75176. }, {
  75177. key: "iterShape",
  75178. value: function iterShape(fun, option) {
  75179. if (!option) {
  75180. var defaultIterateOption = {
  75181. hover: false,
  75182. normal: 'down',
  75183. update: false
  75184. };
  75185. option = defaultIterateOption;
  75186. }
  75187. if (option.hover) {
  75188. // 高亮层数据遍历
  75189. for (var i = 0, l = this._hoverElements.length; i < l; i++) {
  75190. var el = this._hoverElements[i];
  75191. el.updateTransform();
  75192. if (fun(el)) {
  75193. return this;
  75194. }
  75195. }
  75196. }
  75197. if (option.update) {
  75198. this.updateShapeList();
  75199. }
  75200. // 遍历: 'down' | 'up'
  75201. switch (option.normal) {
  75202. case 'down':
  75203. {
  75204. // 降序遍历,高层优先
  75205. var _l = this._shapeList.length;
  75206. while (_l--) {
  75207. if (fun(this._shapeList[_l])) {
  75208. return this;
  75209. }
  75210. }
  75211. break;
  75212. }
  75213. // case 'up':
  75214. default:
  75215. {
  75216. // 升序遍历,底层优先
  75217. for (var _i2 = 0, _l3 = this._shapeList.length; _i2 < _l3; _i2++) {
  75218. if (fun(this._shapeList[_i2])) {
  75219. return this;
  75220. }
  75221. }
  75222. break;
  75223. }
  75224. }
  75225. return this;
  75226. }
  75227. /**
  75228. * @function LevelRenderer.Storage.prototype.getHoverShapes
  75229. * @param {boolean} [update=false] - 是否在返回前更新图形的变换。
  75230. * @return {Array.<LevelRenderer.Shape>} 图形数组。
  75231. */
  75232. }, {
  75233. key: "getHoverShapes",
  75234. value: function getHoverShapes(update) {
  75235. // hoverConnect
  75236. var hoverElements = [],
  75237. len = this._hoverElements.length;
  75238. for (var i = 0; i < len; i++) {
  75239. hoverElements.push(this._hoverElements[i]);
  75240. var target = this._hoverElements[i].hoverConnect;
  75241. if (target) {
  75242. var shape;
  75243. target = target instanceof Array ? target : [target];
  75244. for (var j = 0, k = target.length; j < k; j++) {
  75245. shape = target[j].id ? target[j] : this.get(target[j]);
  75246. if (shape) {
  75247. hoverElements.push(shape);
  75248. }
  75249. }
  75250. }
  75251. }
  75252. hoverElements.sort(Storage.shapeCompareFunc);
  75253. if (update) {
  75254. for (var _i4 = 0, l = hoverElements.length; _i4 < l; _i4++) {
  75255. hoverElements[_i4].updateTransform();
  75256. }
  75257. }
  75258. return hoverElements;
  75259. }
  75260. /**
  75261. * @function LevelRenderer.Storage.prototype.getShapeList
  75262. * @description 返回所有图形的绘制队列。
  75263. *
  75264. * @param {boolean} [update=false] - 是否在返回前更新该数组。详见:<LevelRenderer.Shape> updateShapeList。
  75265. * @return {LevelRenderer.Shape} 图形。
  75266. */
  75267. }, {
  75268. key: "getShapeList",
  75269. value: function getShapeList(update) {
  75270. if (update) {
  75271. this.updateShapeList();
  75272. }
  75273. return this._shapeList;
  75274. }
  75275. /**
  75276. * @function LevelRenderer.Storage.prototype.updateShapeList
  75277. * @description 更新图形的绘制队列。每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列。
  75278. */
  75279. }, {
  75280. key: "updateShapeList",
  75281. value: function updateShapeList() {
  75282. this._shapeListOffset = 0;
  75283. var rootsLen = this._roots.length;
  75284. for (var i = 0; i < rootsLen; i++) {
  75285. var root = this._roots[i];
  75286. this._updateAndAddShape(root);
  75287. }
  75288. this._shapeList.length = this._shapeListOffset;
  75289. var shapeListLen = this._shapeList.length;
  75290. for (var _i6 = 0; _i6 < shapeListLen; _i6++) {
  75291. this._shapeList[_i6].__renderidx = _i6;
  75292. }
  75293. this._shapeList.sort(Storage.shapeCompareFunc);
  75294. }
  75295. /**
  75296. * @function LevelRenderer.Storage.prototype._updateAndAddShape
  75297. * @description 更新并添加图形。
  75298. *
  75299. */
  75300. }, {
  75301. key: "_updateAndAddShape",
  75302. value: function _updateAndAddShape(el, clipShapes) {
  75303. if (el.ignore) {
  75304. return;
  75305. }
  75306. el.updateTransform();
  75307. if (el.type == 'group') {
  75308. if (el.clipShape) {
  75309. // clipShape 的变换是基于 group 的变换
  75310. el.clipShape.parent = el;
  75311. el.clipShape.updateTransform();
  75312. // PENDING 效率影响
  75313. if (clipShapes) {
  75314. clipShapes = clipShapes.slice();
  75315. clipShapes.push(el.clipShape);
  75316. } else {
  75317. clipShapes = [el.clipShape];
  75318. }
  75319. }
  75320. for (var i = 0; i < el._children.length; i++) {
  75321. var child = el._children[i];
  75322. // Force to mark as dirty if group is dirty
  75323. child.__dirty = el.__dirty || child.__dirty;
  75324. this._updateAndAddShape(child, clipShapes);
  75325. }
  75326. // Mark group clean here
  75327. el.__dirty = false;
  75328. } else {
  75329. el.__clipShapes = clipShapes;
  75330. this._shapeList[this._shapeListOffset++] = el;
  75331. }
  75332. }
  75333. /**
  75334. * @function LevelRenderer.Storage.prototype.mod
  75335. * @description 修改图形(Shape)或者组(Group)。
  75336. *
  75337. * @param {string} elId - 唯一标识。
  75338. * @param {Object} params - 参数。
  75339. * @return {LevelRenderer.Storage} this。
  75340. */
  75341. }, {
  75342. key: "mod",
  75343. value: function mod(elId, params) {
  75344. var el = this._elements[elId];
  75345. if (el) {
  75346. el.modSelf();
  75347. if (params) {
  75348. // 如果第二个参数直接使用 shape
  75349. // parent, _storage, __startClip 三个属性会有循环引用
  75350. // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数
  75351. if (params.parent || params._storage || params.__startClip) {
  75352. var target = {};
  75353. for (var name in params) {
  75354. if (name == 'parent' || name == '_storage' || name == '__startClip') {
  75355. continue;
  75356. }
  75357. if (params.hasOwnProperty(name)) {
  75358. target[name] = params[name];
  75359. }
  75360. }
  75361. new levelRenderer_Util_Util().merge(el, target, true);
  75362. } else {
  75363. new levelRenderer_Util_Util().merge(el, params, true);
  75364. }
  75365. }
  75366. }
  75367. return this;
  75368. }
  75369. /**
  75370. * @function LevelRenderer.Storage.prototype.drift
  75371. * @description 移动指定的图形(Shape)的位置。
  75372. * @param {string} shapeId - 唯一标识。
  75373. * @param {number} dx
  75374. * @param {number} dy
  75375. * @return {LevelRenderer.Storage} this。
  75376. */
  75377. }, {
  75378. key: "drift",
  75379. value: function drift(shapeId, dx, dy) {
  75380. var shape = this._elements[shapeId];
  75381. if (shape) {
  75382. shape.needTransform = true;
  75383. if (shape.draggable === 'horizontal') {
  75384. dy = 0;
  75385. } else if (shape.draggable === 'vertical') {
  75386. dx = 0;
  75387. }
  75388. if (!shape.ondrift // ondrift
  75389. // 有onbrush并且调用执行返回false或undefined则继续
  75390. || shape.ondrift && !shape.ondrift(dx, dy)) {
  75391. shape.drift(dx, dy);
  75392. }
  75393. }
  75394. return this;
  75395. }
  75396. /**
  75397. * @function LevelRenderer.Storage.prototype.addHover
  75398. * @description 添加高亮层数据。
  75399. * @param {LevelRenderer.Shape} shape - 图形。
  75400. * @return {LevelRenderer.Storage} this。
  75401. */
  75402. }, {
  75403. key: "addHover",
  75404. value: function addHover(shape) {
  75405. shape.updateNeedTransform();
  75406. this._hoverElements.push(shape);
  75407. return this;
  75408. }
  75409. /**
  75410. * @function LevelRenderer.Storage.prototype.delHover
  75411. * @description 清空高亮层数据。
  75412. * @return {LevelRenderer.Storage} this。
  75413. */
  75414. }, {
  75415. key: "delHover",
  75416. value: function delHover() {
  75417. this._hoverElements = [];
  75418. return this;
  75419. }
  75420. /**
  75421. * @function LevelRenderer.Storage.prototype.hasHoverShape
  75422. * @description 是否有图形在高亮层里。
  75423. * @return {boolean} 是否有图形在高亮层里。
  75424. */
  75425. }, {
  75426. key: "hasHoverShape",
  75427. value: function hasHoverShape() {
  75428. return this._hoverElements.length > 0;
  75429. }
  75430. /**
  75431. * @function LevelRenderer.Storage.prototype.addRoot
  75432. * @description 添加图形(Shape)或者组(Group)到根节点。
  75433. *
  75434. * @param {(LevelRenderer.Shape/LevelRenderer.Group)} el - 图形。
  75435. *
  75436. */
  75437. }, {
  75438. key: "addRoot",
  75439. value: function addRoot(el) {
  75440. if (el instanceof Group) {
  75441. el.addChildrenToStorage(this);
  75442. }
  75443. this.addToMap(el);
  75444. this._roots.push(el);
  75445. }
  75446. /**
  75447. * @function LevelRenderer.Storage.prototype.delRoot
  75448. * @description 删除指定的图形(Shape)或者组(Group)。
  75449. *
  75450. * @param {Array.<string>} elId - 删除图形(Shape)或者组(Group)的 ID 数组。如果为空清空整个Storage。
  75451. *
  75452. */
  75453. }, {
  75454. key: "delRoot",
  75455. value: function delRoot(elId) {
  75456. if (typeof elId == 'undefined') {
  75457. // 不指定elId清空
  75458. for (var i = 0; i < this._roots.length; i++) {
  75459. var root = this._roots[i];
  75460. if (root instanceof Group) {
  75461. root.delChildrenFromStorage(this);
  75462. }
  75463. }
  75464. this._elements = {};
  75465. this._hoverElements = [];
  75466. this._roots = [];
  75467. return;
  75468. }
  75469. if (elId instanceof Array) {
  75470. var elIdLen = elId.length;
  75471. for (var _i8 = 0; _i8 < elIdLen; _i8++) {
  75472. this.delRoot(elId[_i8]);
  75473. }
  75474. return;
  75475. }
  75476. var el;
  75477. if (typeof elId == 'string') {
  75478. el = this._elements[elId];
  75479. } else {
  75480. el = elId;
  75481. }
  75482. var idx = new levelRenderer_Util_Util().indexOf(this._roots, el);
  75483. if (idx >= 0) {
  75484. this.delFromMap(el.id);
  75485. this._roots.splice(idx, 1);
  75486. if (el instanceof Group) {
  75487. el.delChildrenFromStorage(this);
  75488. }
  75489. }
  75490. }
  75491. /**
  75492. * @function LevelRenderer.Storage.prototype.addToMap
  75493. * @description 添加图形到 map。
  75494. *
  75495. * @param {LevelRenderer.Shape} el - 图形。
  75496. * @return {LevelRenderer.Storage} this。
  75497. */
  75498. }, {
  75499. key: "addToMap",
  75500. value: function addToMap(el) {
  75501. if (el instanceof Group) {
  75502. el._storage = this;
  75503. }
  75504. el.modSelf();
  75505. this._elements[el.id] = el;
  75506. return this;
  75507. }
  75508. /**
  75509. * @function LevelRenderer.Storage.prototype.get
  75510. * @description 获取指定图形。
  75511. *
  75512. * @param {string} elId - 图形 id。
  75513. * @return {LevelRenderer.Shape} 图形。
  75514. */
  75515. }, {
  75516. key: "get",
  75517. value: function get(elId) {
  75518. return this._elements[elId];
  75519. }
  75520. /**
  75521. * @function LevelRenderer.Storage.prototype.delFromMap
  75522. * @description 从 map 中删除指定图形。
  75523. *
  75524. * @param {string} elId - 图形id。
  75525. * @return {LevelRenderer.Storage} this。
  75526. */
  75527. }, {
  75528. key: "delFromMap",
  75529. value: function delFromMap(elId) {
  75530. var el = this._elements[elId];
  75531. if (el) {
  75532. delete this._elements[elId];
  75533. if (el instanceof Group) {
  75534. el._storage = null;
  75535. }
  75536. }
  75537. return this;
  75538. }
  75539. /**
  75540. * @function LevelRenderer.Storage.prototype.dispose
  75541. * @description 清空并且释放 Storage。
  75542. */
  75543. }, {
  75544. key: "dispose",
  75545. value: function dispose() {
  75546. this._elements = null;
  75547. // this._renderList = null;
  75548. this._roots = null;
  75549. this._hoverElements = null;
  75550. }
  75551. }], [{
  75552. key: "shapeCompareFunc",
  75553. value: function shapeCompareFunc(a, b) {
  75554. if (a.zlevel == b.zlevel) {
  75555. if (a.z == b.z) {
  75556. return a.__renderidx - b.__renderidx;
  75557. }
  75558. return a.z - b.z;
  75559. }
  75560. return a.zlevel - b.zlevel;
  75561. }
  75562. }]);
  75563. return Storage;
  75564. }();
  75565. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Painter.js
  75566. 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); }
  75567. 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); }
  75568. 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); }
  75569. 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); }; }
  75570. 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); }
  75571. function Painter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  75572. 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; } }
  75573. function Painter_getPrototypeOf(o) { Painter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Painter_getPrototypeOf(o); }
  75574. function Painter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75575. 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); } }
  75576. 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; }
  75577. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  75578. * This program are made available under the terms of the Apache License, Version 2.0
  75579. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75580. /**
  75581. * @private
  75582. * @class LevelRenderer.Painter
  75583. * @category Visualization Theme
  75584. * @classdesc Painter 绘图模块。
  75585. * @param {HTMLElement} root - 绘图区域(DIV)。
  75586. * @param {LevelRenderer.Storage} storage - Storage 实例。
  75587. */
  75588. var Painter = /*#__PURE__*/function () {
  75589. function Painter(root, storage) {
  75590. Painter_classCallCheck(this, Painter);
  75591. /**
  75592. * @member {HTMLElement} LevelRenderer.Painter.prototype.root
  75593. * @description 绘图容器。
  75594. *
  75595. */
  75596. this.root = root;
  75597. /**
  75598. * @member {Array} LevelRenderer.Painter.prototype.storage
  75599. * @description 图形仓库。
  75600. *
  75601. */
  75602. this.storage = storage;
  75603. /**
  75604. * @member {HTMLElement} LevelRenderer.Painter.prototype._domRoot
  75605. * @description 容器根 dom 对象。
  75606. *
  75607. */
  75608. this._domRoot = null;
  75609. /**
  75610. * @member {Object} LevelRenderer.Painter.prototype._layers
  75611. * @description 绘制层对象。
  75612. *
  75613. */
  75614. this._layers = {};
  75615. /**
  75616. * @member {Array} LevelRenderer.Painter.prototype._zlevelList
  75617. * @description 层列表。
  75618. *
  75619. */
  75620. this._zlevelList = [];
  75621. /**
  75622. * @member {Object} LevelRenderer.Painter.prototype._layerConfig
  75623. * @description 绘制层配置对象。
  75624. *
  75625. */
  75626. this._layerConfig = {};
  75627. /**
  75628. * @member {Object} LevelRenderer.Painter.prototype._bgDom
  75629. * @description 背景层 Canvas (Dom)。
  75630. *
  75631. */
  75632. this._bgDom = null;
  75633. /**
  75634. * @member {function} LevelRenderer.Painter.prototype.shapeToImage
  75635. * @description 形状转图像函数。
  75636. *
  75637. */
  75638. this.shapeToImage = null;
  75639. // retina 屏幕优化
  75640. Painter.devicePixelRatio = Math.max(window.devicePixelRatio || 1, 1);
  75641. this.CLASS_NAME = "SuperMap.LevelRenderer.Painter";
  75642. this.root.innerHTML = '';
  75643. this._width = this._getWidth(); // 宽,缓存记录
  75644. this._height = this._getHeight(); // 高,缓存记录
  75645. var domRoot = document.createElement('div');
  75646. this._domRoot = domRoot;
  75647. // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
  75648. domRoot.style.position = 'relative';
  75649. domRoot.style.overflow = 'hidden';
  75650. domRoot.style.width = this._width + 'px';
  75651. domRoot.style.height = this._height + 'px';
  75652. this.root.appendChild(domRoot);
  75653. this.shapeToImage = this._createShapeToImageProcessor();
  75654. // 创建各层canvas
  75655. // 背景
  75656. //this._bgDom = Painter.createDom('bg', 'div', this);
  75657. this._bgDom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme_background_"), 'div', this);
  75658. domRoot.appendChild(this._bgDom);
  75659. this._bgDom.onselectstart = returnFalse;
  75660. this._bgDom.style['-webkit-user-select'] = 'none';
  75661. this._bgDom.style['user-select'] = 'none';
  75662. this._bgDom.style['-webkit-touch-callout'] = 'none';
  75663. // 高亮
  75664. //var hoverLayer = new PaintLayer('_hoverLayer_', this);
  75665. var hoverLayer = new PaintLayer(Util_Util.createUniqueID("_highLightLayer_"), this);
  75666. this._layers['hover'] = hoverLayer;
  75667. domRoot.appendChild(hoverLayer.dom);
  75668. hoverLayer.initContext();
  75669. hoverLayer.dom.onselectstart = returnFalse;
  75670. hoverLayer.dom.style['-webkit-user-select'] = 'none';
  75671. hoverLayer.dom.style['user-select'] = 'none';
  75672. hoverLayer.dom.style['-webkit-touch-callout'] = 'none';
  75673. var me = this;
  75674. this.updatePainter = function (shapeList, callback) {
  75675. me.refreshShapes(shapeList, callback);
  75676. };
  75677. // 返回false的方法,用于避免页面被选中
  75678. function returnFalse() {
  75679. return false;
  75680. }
  75681. /* eslint-disable */
  75682. // 什么都不干的空方法
  75683. function doNothing() {//NOSONAR
  75684. }
  75685. /* eslint-enable */
  75686. }
  75687. /**
  75688. * @function LevelRenderer.Painter.prototype.destroy
  75689. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  75690. */
  75691. Painter_createClass(Painter, [{
  75692. key: "destroy",
  75693. value: function destroy() {
  75694. this.dispose();
  75695. this._zlevelList = null;
  75696. this._layerConfig = null;
  75697. this._bgDom = null;
  75698. this.shapeToImage = null;
  75699. }
  75700. /**
  75701. * @function LevelRenderer.Painter.prototype.render
  75702. * @description 渲染。首次绘图,创建各种 dom 和 context。
  75703. *
  75704. * @param {function} callback - 绘画结束后的回调函数。
  75705. * @return {LevelRenderer.Painter} this。
  75706. */
  75707. }, {
  75708. key: "render",
  75709. value: function render(callback) {
  75710. // TODO
  75711. this.refresh(callback, true);
  75712. return this;
  75713. }
  75714. /**
  75715. * @function LevelRenderer.Painter.prototype.refresh
  75716. * @description 刷新。
  75717. *
  75718. * @param {function} callback - 刷新结束后的回调函数。
  75719. * @param {boolean} paintAll - 强制绘制所有 shape。
  75720. * @return {LevelRenderer.Painter} this。
  75721. */
  75722. }, {
  75723. key: "refresh",
  75724. value: function refresh(callback, paintAll) {
  75725. var list = this.storage.getShapeList(true);
  75726. this._paintList(list, paintAll);
  75727. if (typeof callback == 'function') {
  75728. callback();
  75729. }
  75730. return this;
  75731. }
  75732. /**
  75733. * Method: _paintList
  75734. * 按列表绘制图形。
  75735. */
  75736. }, {
  75737. key: "_paintList",
  75738. value: function _paintList(list, paintAll) {
  75739. if (typeof paintAll == 'undefined') {
  75740. paintAll = false;
  75741. }
  75742. this._updateLayerStatus(list);
  75743. var currentLayer;
  75744. var currentZLevel;
  75745. var ctx;
  75746. for (var id in this._layers) {
  75747. if (id !== 'hover') {
  75748. this._layers[id].unusedCount++;
  75749. this._layers[id].updateTransform();
  75750. }
  75751. }
  75752. var invTransform = [];
  75753. for (var i = 0, l = list.length; i < l; i++) {
  75754. var shape = list[i];
  75755. if (currentZLevel !== shape.zlevel) {
  75756. if (currentLayer && currentLayer.needTransform) {
  75757. ctx.restore();
  75758. }
  75759. currentLayer = this.getLayer(shape.zlevel);
  75760. ctx = currentLayer.ctx;
  75761. currentZLevel = shape.zlevel;
  75762. // Reset the count
  75763. currentLayer.unusedCount = 0;
  75764. if (currentLayer.dirty || paintAll) {
  75765. currentLayer.clear();
  75766. }
  75767. if (currentLayer.needTransform) {
  75768. ctx.save();
  75769. currentLayer.setTransform(ctx);
  75770. }
  75771. }
  75772. // Start group clipping
  75773. if (ctx && shape.__startClip) {
  75774. var clipShape = shape.__startClip;
  75775. ctx.save();
  75776. // Set transform
  75777. if (clipShape.needTransform) {
  75778. var m = clipShape.transform;
  75779. SUtil_SUtil.Util_matrix.invert(invTransform, m);
  75780. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  75781. }
  75782. ctx.beginPath();
  75783. clipShape.buildPath(ctx, clipShape.style);
  75784. ctx.clip();
  75785. // Transform back
  75786. if (clipShape.needTransform) {
  75787. var _m = invTransform;
  75788. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  75789. }
  75790. }
  75791. if ((currentLayer && currentLayer.dirty || paintAll) && !shape.invisible) {
  75792. if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) {
  75793. if (Config.catchBrushException) {
  75794. try {
  75795. shape.brush(ctx, false, this.updatePainter);
  75796. } catch (error) {
  75797. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  75798. }
  75799. } else {
  75800. shape.brush(ctx, false, this.updatePainter);
  75801. }
  75802. }
  75803. }
  75804. // Stop group clipping
  75805. if (ctx && shape.__stopClip) {
  75806. ctx.restore();
  75807. }
  75808. shape.__dirty = false;
  75809. }
  75810. if (ctx && currentLayer && currentLayer.needTransform) {
  75811. ctx.restore();
  75812. }
  75813. for (var _id2 in this._layers) {
  75814. if (_id2 !== 'hover') {
  75815. var layer = this._layers[_id2];
  75816. layer.dirty = false;
  75817. // 删除过期的层
  75818. // PENDING
  75819. // if (layer.unusedCount >= 500) {
  75820. // this.delLayer(id);
  75821. // }
  75822. if (layer.unusedCount == 1) {
  75823. layer.clear();
  75824. }
  75825. }
  75826. }
  75827. }
  75828. /**
  75829. * @function LevelRenderer.Painter.prototype.getLayer
  75830. * @description 获取 zlevel 所在层,如果不存在则会创建一个新的层。
  75831. *
  75832. * @param {number} zlevel - zlevel。
  75833. * @return {LevelRenderer.Painter} this。
  75834. */
  75835. }, {
  75836. key: "getLayer",
  75837. value: function getLayer(zlevel) {
  75838. // Change draw layer
  75839. var currentLayer = this._layers[zlevel];
  75840. if (!currentLayer) {
  75841. var len = this._zlevelList.length;
  75842. var prevLayer = null;
  75843. var i = -1;
  75844. if (len > 0 && zlevel > this._zlevelList[0]) {
  75845. for (i = 0; i < len - 1; i++) {
  75846. if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) {
  75847. break;
  75848. }
  75849. }
  75850. prevLayer = this._layers[this._zlevelList[i]];
  75851. }
  75852. this._zlevelList.splice(i + 1, 0, zlevel);
  75853. // Create a new layer
  75854. //currentLayer = new PaintLayer(zlevel, this);
  75855. currentLayer = new PaintLayer(Util_Util.createUniqueID("_levelLayer_" + zlevel), this);
  75856. var prevDom = prevLayer ? prevLayer.dom : this._bgDom;
  75857. if (prevDom.nextSibling) {
  75858. prevDom.parentNode.insertBefore(currentLayer.dom, prevDom.nextSibling);
  75859. } else {
  75860. prevDom.parentNode.appendChild(currentLayer.dom);
  75861. }
  75862. currentLayer.initContext();
  75863. this._layers[zlevel] = currentLayer;
  75864. if (this._layerConfig[zlevel]) {
  75865. new levelRenderer_Util_Util().merge(currentLayer, this._layerConfig[zlevel], true);
  75866. }
  75867. currentLayer.updateTransform();
  75868. }
  75869. return currentLayer;
  75870. }
  75871. /**
  75872. * @function LevelRenderer.Painter.prototype.getLayers
  75873. * @description 获取所有已创建的层。
  75874. * @return {Array.<Painter.Layer>} 已创建的层
  75875. */
  75876. }, {
  75877. key: "getLayers",
  75878. value: function getLayers() {
  75879. return this._layers;
  75880. }
  75881. /**
  75882. * Method: _updateLayerStatus
  75883. * 更新绘制层状态。
  75884. */
  75885. }, {
  75886. key: "_updateLayerStatus",
  75887. value: function _updateLayerStatus(list) {
  75888. var layers = this._layers;
  75889. var elCounts = {};
  75890. for (var z in layers) {
  75891. if (z !== 'hover') {
  75892. elCounts[z] = layers[z].elCount;
  75893. layers[z].elCount = 0;
  75894. }
  75895. }
  75896. for (var i = 0; i < list.length; i++) {
  75897. var shape = list[i];
  75898. var zlevel = shape.zlevel;
  75899. var layer = layers[zlevel];
  75900. if (layer) {
  75901. layer.elCount++;
  75902. // 已经被标记为需要刷新
  75903. if (layer.dirty) {
  75904. continue;
  75905. }
  75906. layer.dirty = shape.__dirty;
  75907. }
  75908. }
  75909. // 层中的元素数量有发生变化
  75910. for (var _z2 in layers) {
  75911. if (_z2 !== 'hover') {
  75912. if (elCounts[_z2] !== layers[_z2].elCount) {
  75913. layers[_z2].dirty = true;
  75914. }
  75915. }
  75916. }
  75917. }
  75918. /**
  75919. * @function LevelRenderer.Painter.prototype.refreshShapes
  75920. * @description 更新的图形元素列表。
  75921. *
  75922. * @param {number} shapeList - 需要更新的图形元素列表。
  75923. * @param {number} callback - 视图更新后回调函数。
  75924. * @return {LevelRenderer.Painter} this。
  75925. */
  75926. }, {
  75927. key: "refreshShapes",
  75928. value: function refreshShapes(shapeList, callback) {
  75929. for (var i = 0, l = shapeList.length; i < l; i++) {
  75930. var shape = shapeList[i];
  75931. this.storage.mod(shape.id);
  75932. }
  75933. this.refresh(callback);
  75934. return this;
  75935. }
  75936. /**
  75937. * @function LevelRenderer.Painter.prototype.clear
  75938. * @description 清除 hover 层外所有内容。
  75939. * @return {LevelRenderer.Painter} this。
  75940. */
  75941. }, {
  75942. key: "clear",
  75943. value: function clear() {
  75944. for (var k in this._layers) {
  75945. if (k == 'hover') {
  75946. continue;
  75947. }
  75948. this._layers[k].clear();
  75949. }
  75950. return this;
  75951. }
  75952. /**
  75953. * @function LevelRenderer.Painter.prototype.modLayer
  75954. * @description 修改指定 zlevel 的绘制参数。
  75955. *
  75956. * @param {string} zlevel - zlevel。
  75957. * @param {Object} config - 配置对象。
  75958. * @param {string} [config.clearColor=0] - 每次清空画布的颜色。
  75959. * @param {boolean} [config.motionBlur=false] - 是否开启动态模糊。
  75960. * @param {number} [config.lastFrameAlpha=0.7] - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  75961. * @param {Array.<number>} config.position - 层的平移。
  75962. * @param {Array.<number>} config.rotation - 层的旋转。
  75963. * @param {Array.<number>} config.scale - 层的缩放。
  75964. * @param {boolean} config.zoomable - 层是否支持鼠标缩放操作。默认值:false。
  75965. * @param {boolean} config.panable - 层是否支持鼠标平移操作。默认值:false。
  75966. *
  75967. */
  75968. }, {
  75969. key: "modLayer",
  75970. value: function modLayer(zlevel, config) {
  75971. if (config) {
  75972. if (!this._layerConfig[zlevel]) {
  75973. this._layerConfig[zlevel] = config;
  75974. } else {
  75975. new levelRenderer_Util_Util().merge(this._layerConfig[zlevel], config, true);
  75976. }
  75977. var layer = this._layers[zlevel];
  75978. if (layer) {
  75979. new levelRenderer_Util_Util().merge(layer, this._layerConfig[zlevel], true);
  75980. }
  75981. }
  75982. }
  75983. /**
  75984. * @function LevelRenderer.Painter.prototype.delLayer
  75985. * @description 删除指定层。
  75986. *
  75987. * @param {string} zlevel - 层所在的 zlevel。
  75988. */
  75989. }, {
  75990. key: "delLayer",
  75991. value: function delLayer(zlevel) {
  75992. var layer = this._layers[zlevel];
  75993. if (!layer) {
  75994. return;
  75995. }
  75996. // Save config
  75997. this.modLayer(zlevel, {
  75998. position: layer.position,
  75999. rotation: layer.rotation,
  76000. scale: layer.scale
  76001. });
  76002. layer.dom.parentNode.removeChild(layer.dom);
  76003. delete this._layers[zlevel];
  76004. this._zlevelList.splice(new levelRenderer_Util_Util().indexOf(this._zlevelList, zlevel), 1);
  76005. }
  76006. /**
  76007. * @function LevelRenderer.Painter.prototype.refreshHover
  76008. * @description 刷新 hover 层。
  76009. * @return {LevelRenderer.Painter} this。
  76010. */
  76011. }, {
  76012. key: "refreshHover",
  76013. value: function refreshHover() {
  76014. this.clearHover();
  76015. var list = this.storage.getHoverShapes(true);
  76016. for (var i = 0, l = list.length; i < l; i++) {
  76017. this._brushHover(list[i]);
  76018. }
  76019. this.storage.delHover();
  76020. return this;
  76021. }
  76022. /**
  76023. * @function LevelRenderer.Painter.prototype.clearHover
  76024. * @description 清除 hover 层所有内容。
  76025. * @return {LevelRenderer.Painter} this。
  76026. */
  76027. }, {
  76028. key: "clearHover",
  76029. value: function clearHover() {
  76030. var hover = this._layers.hover;
  76031. hover && hover.clear();
  76032. return this;
  76033. }
  76034. /**
  76035. * @function LevelRenderer.Painter.prototype.resize
  76036. * @description 区域大小变化后重绘。
  76037. * @return {LevelRenderer.Painter} this。
  76038. */
  76039. }, {
  76040. key: "resize",
  76041. value: function resize() {
  76042. var domRoot = this._domRoot;
  76043. domRoot.style.display = 'none';
  76044. var width = this._getWidth();
  76045. var height = this._getHeight();
  76046. domRoot.style.display = '';
  76047. // 优化没有实际改变的resize
  76048. if (this._width != width || height != this._height) {
  76049. this._width = width;
  76050. this._height = height;
  76051. domRoot.style.width = width + 'px';
  76052. domRoot.style.height = height + 'px';
  76053. for (var id in this._layers) {
  76054. this._layers[id].resize(width, height);
  76055. }
  76056. this.refresh(null, true);
  76057. }
  76058. return this;
  76059. }
  76060. /**
  76061. * @function LevelRenderer.Painter.prototype.clearLayer
  76062. * @description 清除指定的一个层。
  76063. * @param {number} zLevel - 层。
  76064. */
  76065. }, {
  76066. key: "clearLayer",
  76067. value: function clearLayer(zLevel) {
  76068. var layer = this._layers[zLevel];
  76069. if (layer) {
  76070. layer.clear();
  76071. }
  76072. }
  76073. /**
  76074. * @function LevelRenderer.Painter.prototype.dispose
  76075. * @description 释放。
  76076. *
  76077. */
  76078. }, {
  76079. key: "dispose",
  76080. value: function dispose() {
  76081. this.root.innerHTML = '';
  76082. this.root = null;
  76083. this.storage = null;
  76084. this._domRoot = null;
  76085. this._layers = null;
  76086. }
  76087. /**
  76088. * @function LevelRenderer.Painter.prototype.getDomHover
  76089. * @description 获取 Hover 层的 Dom。
  76090. */
  76091. }, {
  76092. key: "getDomHover",
  76093. value: function getDomHover() {
  76094. return this._layers.hover.dom;
  76095. }
  76096. /**
  76097. * @function LevelRenderer.Painter.prototype.toDataURL
  76098. * @description 图像导出。
  76099. * @param {string} type - 图片类型。
  76100. * @param {string} backgroundColor - 背景色。默认值:'#fff'。
  76101. * @param {Object} args
  76102. * @return {string} 图片的Base64 url。
  76103. */
  76104. }, {
  76105. key: "toDataURL",
  76106. value: function toDataURL(type, backgroundColor, args) {
  76107. //var imageDom = Painter.createDom('image', 'canvas', this);
  76108. var imageDom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme.image_"), 'canvas', this);
  76109. this._bgDom.appendChild(imageDom);
  76110. var ctx = imageDom.getContext('2d');
  76111. Painter.devicePixelRatio != 1 && ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  76112. ctx.fillStyle = backgroundColor || '#fff';
  76113. ctx.rect(0, 0, this._width * Painter.devicePixelRatio, this._height * Painter.devicePixelRatio);
  76114. ctx.fill();
  76115. var self = this;
  76116. // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠
  76117. this.storage.iterShape(function (shape) {
  76118. if (!shape.invisible) {
  76119. if (!shape.onbrush // 没有onbrush
  76120. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  76121. || shape.onbrush && !shape.onbrush(ctx, false)) {
  76122. if (Config.catchBrushException) {
  76123. try {
  76124. shape.brush(ctx, false, self.updatePainter);
  76125. } catch (error) {
  76126. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  76127. }
  76128. } else {
  76129. shape.brush(ctx, false, self.updatePainter);
  76130. }
  76131. }
  76132. }
  76133. }, {
  76134. normal: 'up',
  76135. update: true
  76136. });
  76137. var image = imageDom.toDataURL(type, args);
  76138. ctx = null;
  76139. this._bgDom.removeChild(imageDom);
  76140. return image;
  76141. }
  76142. /**
  76143. * @function LevelRenderer.Painter.prototype.getWidth
  76144. * @description 获取绘图区域宽度。
  76145. * @return {number} 绘图区域宽度。
  76146. */
  76147. }, {
  76148. key: "getWidth",
  76149. value: function getWidth() {
  76150. return this._width;
  76151. }
  76152. /**
  76153. * @function LevelRenderer.Painter.prototype.getHeight
  76154. * @description 获取绘图区域高度。
  76155. * @return {number} 绘图区域高度。
  76156. */
  76157. }, {
  76158. key: "getHeight",
  76159. value: function getHeight() {
  76160. return this._height;
  76161. }
  76162. /**
  76163. * Method: _getWidth
  76164. *
  76165. */
  76166. }, {
  76167. key: "_getWidth",
  76168. value: function _getWidth() {
  76169. var root = this.root;
  76170. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  76171. return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴
  76172. - parseInt(stl.paddingRight, 10)).toFixed(0) - 0;
  76173. }
  76174. /**
  76175. * Method: _getHeight
  76176. *
  76177. */
  76178. }, {
  76179. key: "_getHeight",
  76180. value: function _getHeight() {
  76181. var root = this.root;
  76182. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  76183. return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴
  76184. - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0;
  76185. }
  76186. /**
  76187. * Method: _brushHover
  76188. *
  76189. */
  76190. }, {
  76191. key: "_brushHover",
  76192. value: function _brushHover(shape) {
  76193. var ctx = this._layers.hover.ctx;
  76194. if (!shape.onbrush // 没有onbrush
  76195. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  76196. || shape.onbrush && !shape.onbrush(ctx, true)) {
  76197. var layer = this.getLayer(shape.zlevel);
  76198. if (layer.needTransform) {
  76199. ctx.save();
  76200. layer.setTransform(ctx);
  76201. }
  76202. // Retina 优化
  76203. if (Config.catchBrushException) {
  76204. try {
  76205. shape.brush(ctx, true, this.updatePainter);
  76206. } catch (error) {
  76207. SUtil_SUtil.Util_log(error, 'hoverBrush error of ' + shape.type, shape);
  76208. }
  76209. } else {
  76210. shape.brush(ctx, true, this.updatePainter);
  76211. }
  76212. if (layer.needTransform) {
  76213. ctx.restore();
  76214. }
  76215. }
  76216. }
  76217. /**
  76218. * Method: _shapeToImage
  76219. *
  76220. */
  76221. }, {
  76222. key: "_shapeToImage",
  76223. value: function _shapeToImage(id, shape, width, height, devicePixelRatio) {
  76224. var canvas = document.createElement('canvas');
  76225. var ctx = canvas.getContext('2d');
  76226. var _devicePixelRatio = devicePixelRatio || window.devicePixelRatio || 1;
  76227. canvas.style.width = width + 'px';
  76228. canvas.style.height = height + 'px';
  76229. canvas.setAttribute('width', width * _devicePixelRatio);
  76230. canvas.setAttribute('height', height * _devicePixelRatio);
  76231. ctx.clearRect(0, 0, width * _devicePixelRatio, height * _devicePixelRatio);
  76232. var shapeTransform = {
  76233. position: shape.position,
  76234. rotation: shape.rotation,
  76235. scale: shape.scale
  76236. };
  76237. shape.position = [0, 0, 0];
  76238. shape.rotation = 0;
  76239. shape.scale = [1, 1];
  76240. if (shape) {
  76241. shape.brush(ctx, false);
  76242. }
  76243. var imgShape = new SmicImage({
  76244. id: id,
  76245. style: {
  76246. x: 0,
  76247. y: 0,
  76248. image: canvas
  76249. }
  76250. });
  76251. if (shapeTransform.position != null) {
  76252. imgShape.position = shape.position = shapeTransform.position;
  76253. }
  76254. if (shapeTransform.rotation != null) {
  76255. imgShape.rotation = shape.rotation = shapeTransform.rotation;
  76256. }
  76257. if (shapeTransform.scale != null) {
  76258. imgShape.scale = shape.scale = shapeTransform.scale;
  76259. }
  76260. return imgShape;
  76261. }
  76262. /**
  76263. * Method: _createShapeToImageProcessor
  76264. *
  76265. */
  76266. }, {
  76267. key: "_createShapeToImageProcessor",
  76268. value: function _createShapeToImageProcessor() {
  76269. var me = this;
  76270. return function (id, e, width, height) {
  76271. return me._shapeToImage(id, e, width, height, Painter.devicePixelRatio);
  76272. };
  76273. }
  76274. // SMIC-方法扩展 - start
  76275. /**
  76276. * @function LevelRenderer.Painter.prototype.updateHoverLayer
  76277. * @description 更新设置显示高亮图层。
  76278. * @param {Array} shapes - 图形数组。
  76279. */
  76280. }, {
  76281. key: "updateHoverLayer",
  76282. value: function updateHoverLayer(shapes) {
  76283. if (!(shapes instanceof Array)) {
  76284. return this;
  76285. }
  76286. //清除高亮
  76287. this.clearHover();
  76288. this.storage.delHover();
  76289. for (var i = 0; i < shapes.length; i++) {
  76290. this.storage.addHover(shapes[i]);
  76291. this._brushHover(shapes[i]);
  76292. }
  76293. }
  76294. /**
  76295. * @function LevelRenderer.Painter.prototype.createDom
  76296. * @description 创建 Dom。
  76297. *
  76298. * @param {string} id - Dom id
  76299. * @param {string} type - Dom type
  76300. * @param {LevelRenderer.Painter} painter - Painter 实例。
  76301. * @return {Object} Dom
  76302. */
  76303. }], [{
  76304. key: "createDom",
  76305. value: function createDom(id, type, painter) {
  76306. var newDom = document.createElement(type);
  76307. var width = painter._width;
  76308. var height = painter._height;
  76309. // 没append呢,请原谅我这样写,清晰~
  76310. newDom.style.position = 'absolute';
  76311. newDom.style.left = 0;
  76312. newDom.style.top = 0;
  76313. newDom.style.width = width + 'px';
  76314. newDom.style.height = height + 'px';
  76315. newDom.setAttribute('width', width * Painter.devicePixelRatio);
  76316. newDom.setAttribute('height', height * Painter.devicePixelRatio);
  76317. // id不作为索引用,避免可能造成的重名,定义为私有属性
  76318. //newDom.setAttribute('data-zr-dom-id', id);
  76319. newDom.setAttribute('id', id);
  76320. return newDom;
  76321. }
  76322. }]);
  76323. return Painter;
  76324. }();
  76325. /**
  76326. * @private
  76327. * @class Painter.Layer
  76328. * @classdesc 绘制层类。
  76329. * @extends LevelRenderer.Transformable
  76330. */
  76331. var PaintLayer = /*#__PURE__*/function (_Transformable) {
  76332. Painter_inherits(PaintLayer, _Transformable);
  76333. var _super = Painter_createSuper(PaintLayer);
  76334. /**
  76335. * @function Painter.Layer.constructor
  76336. * @description 构造函数。
  76337. *
  76338. * @param {string} id - id。
  76339. * @param {LevelRenderer.Painter} painter - Painter 实例。
  76340. *
  76341. */
  76342. function PaintLayer(id, painter) {
  76343. var _this;
  76344. Painter_classCallCheck(this, PaintLayer);
  76345. _this = _super.call(this, id, painter);
  76346. /**
  76347. * @member {Object} Painter.Layer.prototype.dom
  76348. * @description dom。
  76349. */
  76350. _this.dom = null;
  76351. /**
  76352. * @member {Object} Painter.Layer.prototype.domBack
  76353. * @description domBack。
  76354. */
  76355. _this.domBack = null;
  76356. /**
  76357. * @member {Object} Painter.Layer.prototype.ctxBack
  76358. * @description ctxBack。
  76359. */
  76360. _this.ctxBack = null;
  76361. /**
  76362. * @member {LevelRenderer.Painter} Painter.Layer.prototype.painter
  76363. * @description painter。
  76364. */
  76365. _this.painter = painter;
  76366. /**
  76367. * @member {number} Painter.Layer.prototype.unusedCount
  76368. * @description unusedCount。
  76369. */
  76370. _this.unusedCount = 0;
  76371. /**
  76372. * @member {Object} Painter.Layer.prototype.config
  76373. * @description config。
  76374. */
  76375. _this.config = null;
  76376. /**
  76377. * @member {boolean} Painter.Layer.prototype.dirty
  76378. * @description dirty。
  76379. */
  76380. _this.dirty = true;
  76381. /**
  76382. * @member {number} Painter.Layer.prototype.elCount
  76383. * @description elCount。
  76384. */
  76385. _this.elCount = 0;
  76386. // Configs
  76387. /**
  76388. * @member {string} Painter.Layer.prototype.clearColor
  76389. * @description 每次清空画布的颜色。默认值:0;
  76390. */
  76391. _this.clearColor = 0;
  76392. /**
  76393. * @member {boolean} Painter.Layer.prototype.motionBlur
  76394. * @description 是否开启动态模糊。默认值:false;
  76395. */
  76396. _this.motionBlur = false;
  76397. /**
  76398. * @member {number} Painter.Layer.prototype.lastFrameAlpha
  76399. * @description 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
  76400. */
  76401. _this.lastFrameAlpha = 0.7;
  76402. /**
  76403. * @member {boolean} Painter.Layer.prototype.zoomable
  76404. * @description 层是否支持鼠标平移操作。默认值:false;
  76405. */
  76406. _this.zoomable = false;
  76407. /**
  76408. * @member {boolean} Painter.Layer.prototype.panable
  76409. * @description 层是否支持鼠标缩放操作。默认值:false;
  76410. */
  76411. _this.panable = false;
  76412. /**
  76413. * @member {number} Painter.Layer.prototype.maxZoom
  76414. * @description maxZoom。默认值:Infinity。
  76415. */
  76416. _this.maxZoom = Infinity;
  76417. /**
  76418. * @member {number} Painter.Layer.prototype.minZoom
  76419. * @description minZoom。默认值:0。
  76420. */
  76421. _this.minZoom = 0;
  76422. /**
  76423. * @member {number} Painter.Layer.prototype.ctx
  76424. * @description Canvas 上下文。
  76425. */
  76426. _this.ctx = null;
  76427. _this.dom = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme" + id), 'canvas', painter);
  76428. _this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬
  76429. _this.dom.style['-webkit-user-select'] = 'none';
  76430. _this.dom.style['user-select'] = 'none';
  76431. _this.dom.style['-webkit-touch-callout'] = 'none';
  76432. // Function
  76433. // 返回false的方法,用于避免页面被选中
  76434. function returnFalse() {
  76435. return false;
  76436. }
  76437. _this.CLASS_NAME = "SuperMap.LevelRenderer.Painter.Layer";
  76438. return _this;
  76439. }
  76440. /**
  76441. * @function Painter.Layer.prototype.destroy
  76442. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  76443. */
  76444. Painter_createClass(PaintLayer, [{
  76445. key: "destroy",
  76446. value: function destroy() {
  76447. this.dom = null;
  76448. this.domBack = null;
  76449. this.ctxBack = null;
  76450. this.painter = null;
  76451. this.unusedCount = null;
  76452. this.config = null;
  76453. this.dirty = null;
  76454. this.elCount = null;
  76455. this.clearColor = null;
  76456. this.motionBlur = null;
  76457. this.lastFrameAlpha = null;
  76458. this.zoomable = null;
  76459. this.panable = null;
  76460. this.maxZoom = null;
  76461. this.minZoom = null;
  76462. this.ctx = null;
  76463. Transformable.destroy.apply(this, arguments);
  76464. }
  76465. /**
  76466. * @function Painter.Layer.prototype.initContext
  76467. * @description 初始化 Canvan 2D 上下文。
  76468. */
  76469. }, {
  76470. key: "initContext",
  76471. value: function initContext() {
  76472. this.ctx = this.dom.getContext('2d');
  76473. if (Painter.devicePixelRatio != 1) {
  76474. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  76475. }
  76476. }
  76477. /**
  76478. * @function Painter.Layer.prototype.createBackBuffer
  76479. * @description 创建备份缓冲。
  76480. */
  76481. }, {
  76482. key: "createBackBuffer",
  76483. value: function createBackBuffer() {
  76484. this.domBack = Painter.createDom(Util_Util.createUniqueID("SuperMap.Theme.back-" + this.id), 'canvas', this.painter);
  76485. this.ctxBack = this.domBack.getContext('2d');
  76486. if (Painter.devicePixelRatio != 1) {
  76487. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  76488. }
  76489. }
  76490. /**
  76491. * @function Painter.Layer.prototype.resize
  76492. * @description 改变大小。
  76493. *
  76494. * @param {number} width - 宽。
  76495. * @param {number} height - 高。
  76496. */
  76497. }, {
  76498. key: "resize",
  76499. value: function resize(width, height) {
  76500. this.dom.style.width = width + 'px';
  76501. this.dom.style.height = height + 'px';
  76502. this.dom.setAttribute('width', width * Painter.devicePixelRatio);
  76503. this.dom.setAttribute('height', height * Painter.devicePixelRatio);
  76504. if (Painter.devicePixelRatio != 1) {
  76505. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  76506. }
  76507. if (this.domBack) {
  76508. this.domBack.setAttribute('width', width * Painter.devicePixelRatio);
  76509. this.domBack.setAttribute('height', height * Painter.devicePixelRatio);
  76510. if (Painter.devicePixelRatio != 1) {
  76511. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  76512. }
  76513. }
  76514. }
  76515. /**
  76516. * @function Painter.Layer.prototype.clear
  76517. * @description 清空该层画布。
  76518. */
  76519. }, {
  76520. key: "clear",
  76521. value: function clear() {
  76522. var dom = this.dom;
  76523. var ctx = this.ctx;
  76524. var width = dom.width;
  76525. var height = dom.height;
  76526. var haveClearColor = this.clearColor;
  76527. var haveMotionBLur = this.motionBlur;
  76528. var lastFrameAlpha = this.lastFrameAlpha;
  76529. if (haveMotionBLur) {
  76530. if (!this.domBack) {
  76531. this.createBackBuffer();
  76532. }
  76533. this.ctxBack.globalCompositeOperation = 'copy';
  76534. this.ctxBack.drawImage(dom, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  76535. }
  76536. if (haveClearColor) {
  76537. ctx.save();
  76538. ctx.fillStyle = this.config.clearColor;
  76539. ctx.fillRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  76540. ctx.restore();
  76541. } else {
  76542. ctx.clearRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  76543. }
  76544. if (haveMotionBLur) {
  76545. var domBack = this.domBack;
  76546. ctx.save();
  76547. ctx.globalAlpha = lastFrameAlpha;
  76548. ctx.drawImage(domBack, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  76549. ctx.restore();
  76550. }
  76551. }
  76552. }]);
  76553. return PaintLayer;
  76554. }(Transformable);
  76555. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Handler.js
  76556. 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); }
  76557. function Handler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76558. 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); } }
  76559. 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; }
  76560. 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); }
  76561. 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); }
  76562. 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); }; }
  76563. 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); }
  76564. function Handler_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76565. 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; } }
  76566. function Handler_getPrototypeOf(o) { Handler_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Handler_getPrototypeOf(o); }
  76567. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  76568. * This program are made available under the terms of the Apache License, Version 2.0
  76569. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76570. /**
  76571. * @private
  76572. * @class LevelRenderer.Handler
  76573. * @category Visualization Theme
  76574. * @classdesc Handler控制模块。
  76575. * @extends {LevelRenderer.Eventful}
  76576. * @param {HTMLElement} root - 绘图区域。
  76577. * @param {LevelRenderer.Storage} storage - Storage 实例。
  76578. * @param {LevelRenderer.Painter} painter - Painter 实例。
  76579. */
  76580. var Handler = /*#__PURE__*/function (_Eventful) {
  76581. Handler_inherits(Handler, _Eventful);
  76582. var _super = Handler_createSuper(Handler);
  76583. function Handler(root, storage, painter) {
  76584. var _this;
  76585. Handler_classCallCheck(this, Handler);
  76586. _this = _super.call(this, root, storage, painter);
  76587. /**
  76588. * @member {HTMLElement} LevelRenderer.Handler.prototype.root
  76589. * @description 绘图区域
  76590. */
  76591. _this.root = root;
  76592. /**
  76593. * @member {LevelRenderer.Storage} LevelRenderer.Handler.prototype.storage
  76594. * @description Storage 实例
  76595. */
  76596. _this.storage = storage;
  76597. /**
  76598. * @member {LevelRenderer.Painter} LevelRenderer.Handler.prototype.Painter
  76599. * @description Painter 实例
  76600. */
  76601. _this.painter = painter;
  76602. /**
  76603. * @member {number} [LevelRenderer.Handler.prototype._lastX=0]
  76604. * @description 上一次鼠标位置x坐标值
  76605. */
  76606. _this._lastX = 0;
  76607. /**
  76608. * @member {number} [LevelRenderer.Handler.prototype._lastY=0]
  76609. * @description 上一次鼠标位置y坐标值
  76610. */
  76611. _this._lastY = 0;
  76612. /**
  76613. * @member {number} [LevelRenderer.Handler.prototype._mouseX=0]
  76614. * @description 当前鼠标位置x坐标值
  76615. */
  76616. _this._mouseX = 0;
  76617. /**
  76618. * @member {number} [LevelRenderer.Handler.prototype._mouseY=0]
  76619. * @description 当前鼠标位置y坐标值
  76620. */
  76621. _this._mouseY = 0;
  76622. /**
  76623. * @member {function} LevelRenderer.Handler.prototype._findHover
  76624. * @description 查找 Hover 图形
  76625. */
  76626. _this._findHover = null;
  76627. /**
  76628. * @member {Object} LevelRenderer.Handler.prototype._domHover
  76629. * @description 高亮 DOM
  76630. */
  76631. _this._domHover = null;
  76632. // 各种事件标识的私有变量
  76633. // this._hasfound = false; // 是否找到 hover 图形元素
  76634. // this._lastHover = null; // 最后一个 hover 图形元素
  76635. // this._mouseDownTarget = null;
  76636. // this._draggingTarget = null; // 当前被拖拽的图形元素
  76637. // this._isMouseDown = false;
  76638. // this._isDragging = false;
  76639. // this._lastMouseDownMoment;
  76640. // this._lastTouchMoment;
  76641. // this._lastDownButton;
  76642. _this._findHover = bind3Arg(findHover, Handler_assertThisInitialized(_this));
  76643. _this._domHover = painter.getDomHover();
  76644. _this.CLASS_NAME = "SuperMap.LevelRenderer.Handler";
  76645. var domHandlers = {
  76646. /**
  76647. * Method: resize
  76648. * 窗口大小改变响应函数。
  76649. *
  76650. * Parameters:
  76651. * event - {Event} event。
  76652. *
  76653. */
  76654. resize: function resize(event) {
  76655. event = event || window.event;
  76656. this._lastHover = null;
  76657. this._isMouseDown = 0;
  76658. // 分发SuperMap.LevelRenderer.Config.EVENT.RESIZE事件,global
  76659. this.dispatch(Config.EVENT.RESIZE, event);
  76660. },
  76661. /**
  76662. * Method: click
  76663. * 点击响应函数。
  76664. *
  76665. * Parameters:
  76666. * event - {Event} event。
  76667. *
  76668. */
  76669. click: function click(event) {
  76670. event = this._zrenderEventFixed(event);
  76671. // 分发SuperMap.LevelRenderer.Config.EVENT.CLICK事件
  76672. var _lastHover = this._lastHover;
  76673. if (_lastHover && _lastHover.clickable || !_lastHover) {
  76674. // 判断没有发生拖拽才触发click事件
  76675. if (this._clickThreshold < 10) {
  76676. this._dispatchAgency(_lastHover, Config.EVENT.CLICK, event);
  76677. }
  76678. }
  76679. this._mousemoveHandler(event);
  76680. },
  76681. /**
  76682. * Method: dblclick
  76683. * 双击响应函数。
  76684. *
  76685. * Parameters:
  76686. * event - {Event} event。
  76687. *
  76688. */
  76689. dblclick: function dblclick(event) {
  76690. event = event || window.event;
  76691. event = this._zrenderEventFixed(event);
  76692. // 分发SuperMap.LevelRenderer.Config.EVENT.DBLCLICK事件
  76693. var _lastHover = this._lastHover;
  76694. if (_lastHover && _lastHover.clickable || !_lastHover) {
  76695. // 判断没有发生拖拽才触发dblclick事件
  76696. if (this._clickThreshold < 5) {
  76697. this._dispatchAgency(_lastHover, Config.EVENT.DBLCLICK, event);
  76698. }
  76699. }
  76700. this._mousemoveHandler(event);
  76701. },
  76702. /**
  76703. * Method: mousewheel
  76704. * 鼠标滚轮响应函数。
  76705. *
  76706. * Parameters:
  76707. * event - {Event} event。
  76708. *
  76709. */
  76710. mousewheel: function mousewheel(event) {
  76711. event = this._zrenderEventFixed(event);
  76712. // http://www.sitepoint.com/html5-javascript-mouse-wheel/
  76713. // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel
  76714. var delta = event.wheelDelta // Webkit
  76715. || -event.detail; // Firefox
  76716. var scale = delta > 0 ? 1.1 : 1 / 1.1;
  76717. var layers = this.painter.getLayers();
  76718. var needsRefresh = false;
  76719. for (var z in layers) {
  76720. if (z !== 'hover') {
  76721. var layer = layers[z];
  76722. var pos = layer.position;
  76723. if (layer.zoomable) {
  76724. layer.__zoom = layer.__zoom || 1;
  76725. var newZoom = layer.__zoom;
  76726. newZoom *= scale;
  76727. newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom);
  76728. scale = newZoom / layer.__zoom;
  76729. layer.__zoom = newZoom;
  76730. // Keep the mouse center when scaling
  76731. pos[0] -= (this._mouseX - pos[0]) * (scale - 1);
  76732. pos[1] -= (this._mouseY - pos[1]) * (scale - 1);
  76733. layer.scale[0] *= scale;
  76734. layer.scale[1] *= scale;
  76735. layer.dirty = true;
  76736. needsRefresh = true;
  76737. }
  76738. }
  76739. }
  76740. if (needsRefresh) {
  76741. this.painter.refresh();
  76742. }
  76743. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEWHEEL事件
  76744. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEWHEEL, event);
  76745. this._mousemoveHandler(event);
  76746. },
  76747. /**
  76748. * Method: mousemove
  76749. * 鼠标(手指)移动响应函数。
  76750. *
  76751. * Parameters:
  76752. * event - {Event} event。
  76753. *
  76754. */
  76755. mousemove: function mousemove(event) {
  76756. // 拖拽不触发click事件
  76757. this._clickThreshold++;
  76758. event = this._zrenderEventFixed(event);
  76759. this._lastX = this._mouseX;
  76760. this._lastY = this._mouseY;
  76761. this._mouseX = SUtil_SUtil.Util_event.getX(event);
  76762. this._mouseY = SUtil_SUtil.Util_event.getY(event);
  76763. var dx = this._mouseX - this._lastX;
  76764. var dy = this._mouseY - this._lastY;
  76765. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGSTART事件
  76766. // 避免手抖点击误认为拖拽
  76767. // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) {
  76768. this._processDragStart(event);
  76769. // }
  76770. this._hasfound = 0;
  76771. this._event = event;
  76772. this._iterateAndFindHover();
  76773. // 找到的在迭代函数里做了处理,没找到得在迭代完后处理
  76774. if (!this._hasfound) {
  76775. // 过滤首次拖拽产生的mouseout和dragLeave
  76776. if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) {
  76777. // 可能出现SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  76778. this._processOutShape(event);
  76779. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  76780. this._processDragLeave(event);
  76781. }
  76782. this._lastHover = null;
  76783. this.storage.delHover();
  76784. this.painter.clearHover();
  76785. }
  76786. // set cursor for root element
  76787. var cursor = '';
  76788. // 如果存在拖拽中元素,被拖拽的图形元素最后addHover
  76789. if (this._draggingTarget) {
  76790. this.storage.drift(this._draggingTarget.id, dx, dy);
  76791. this._draggingTarget.modSelf();
  76792. this.storage.addHover(this._draggingTarget);
  76793. } else if (this._isMouseDown) {
  76794. // Layer dragging
  76795. var layers = this.painter.getLayers();
  76796. var needsRefresh = false;
  76797. for (var z in layers) {
  76798. if (z !== 'hover') {
  76799. var layer = layers[z];
  76800. if (layer.panable) {
  76801. // PENDING
  76802. cursor = 'move';
  76803. // Keep the mouse center when scaling
  76804. layer.position[0] += dx;
  76805. layer.position[1] += dy;
  76806. needsRefresh = true;
  76807. layer.dirty = true;
  76808. }
  76809. }
  76810. }
  76811. if (needsRefresh) {
  76812. this.painter.refresh();
  76813. }
  76814. }
  76815. if (this._draggingTarget || this._hasfound && this._lastHover.draggable) {
  76816. cursor = 'move';
  76817. } else if (this._hasfound && this._lastHover.clickable) {
  76818. cursor = 'pointer';
  76819. }
  76820. this.root.style.cursor = cursor;
  76821. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEMOVE事件
  76822. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEMOVE, event);
  76823. if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) {
  76824. this.painter.refreshHover();
  76825. }
  76826. },
  76827. /**
  76828. * Method: mouseout
  76829. * 鼠标(手指)离开响应函数。
  76830. *
  76831. * Parameters:
  76832. * event - {Event} event。
  76833. *
  76834. */
  76835. mouseout: function mouseout(event) {
  76836. event = this._zrenderEventFixed(event);
  76837. var element = event.toElement || event.relatedTarget;
  76838. if (element != this.root) {
  76839. while (element && element.nodeType != 9) {
  76840. // 忽略包含在root中的dom引起的mouseOut
  76841. if (element == this.root) {
  76842. this._mousemoveHandler(event);
  76843. return;
  76844. }
  76845. element = element.parentNode;
  76846. }
  76847. }
  76848. event.zrenderX = this._lastX;
  76849. event.zrenderY = this._lastY;
  76850. this.root.style.cursor = '';
  76851. this._isMouseDown = 0;
  76852. this._processOutShape(event);
  76853. this._processDrop(event);
  76854. this._processDragEnd(event);
  76855. this.painter.refreshHover();
  76856. this.dispatch(Config.EVENT.GLOBALOUT, event);
  76857. },
  76858. /**
  76859. * Method: mousedown
  76860. * 鼠标(手指)按下响应函数。
  76861. *
  76862. * Parameters:
  76863. * event - {Event} event。
  76864. *
  76865. */
  76866. mousedown: function mousedown(event) {
  76867. // 重置 clickThreshold
  76868. this._clickThreshold = 0;
  76869. if (this._lastDownButton == 2) {
  76870. this._lastDownButton = event.button;
  76871. this._mouseDownTarget = null;
  76872. // 仅作为关闭右键菜单使用
  76873. return;
  76874. }
  76875. this._lastMouseDownMoment = new Date();
  76876. event = this._zrenderEventFixed(event);
  76877. this._isMouseDown = 1;
  76878. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEDOWN事件
  76879. this._mouseDownTarget = this._lastHover;
  76880. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEDOWN, event);
  76881. this._lastDownButton = event.button;
  76882. },
  76883. /**
  76884. * Method: mouseup
  76885. * 鼠标(手指)抬起响应函数。
  76886. *
  76887. * Parameters:
  76888. * event - {Event} event。
  76889. *
  76890. */
  76891. mouseup: function mouseup(event) {
  76892. event = this._zrenderEventFixed(event);
  76893. this.root.style.cursor = '';
  76894. this._isMouseDown = 0;
  76895. this._mouseDownTarget = null;
  76896. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEUP事件
  76897. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEUP, event);
  76898. this._processDrop(event);
  76899. this._processDragEnd(event);
  76900. },
  76901. /**
  76902. * Method: touchstart
  76903. * Touch 开始响应函数。
  76904. *
  76905. * Parameters:
  76906. * event - {Event} event。
  76907. *
  76908. */
  76909. touchstart: function touchstart(event) {
  76910. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  76911. event = this._zrenderEventFixed(event, true);
  76912. this._lastTouchMoment = new Date();
  76913. // 平板补充一次findHover
  76914. this._mobildFindFixed(event);
  76915. this._mousedownHandler(event);
  76916. },
  76917. /**
  76918. * Method: touchmove
  76919. * Touch 移动响应函数。
  76920. *
  76921. * Parameters:
  76922. * event - {Event} event。
  76923. *
  76924. */
  76925. touchmove: function touchmove(event) {
  76926. event = this._zrenderEventFixed(event, true);
  76927. this._mousemoveHandler(event);
  76928. if (this._isDragging) {
  76929. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  76930. }
  76931. },
  76932. /**
  76933. * Method: touchend
  76934. * Touch 结束响应函数。
  76935. *
  76936. * Parameters:
  76937. * event - {Event} event。
  76938. *
  76939. */
  76940. touchend: function touchend(event) {
  76941. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  76942. event = this._zrenderEventFixed(event, true);
  76943. this._mouseupHandler(event);
  76944. var now = new Date();
  76945. if (now - this._lastTouchMoment < Config.EVENT.touchClickDelay) {
  76946. this._mobildFindFixed(event);
  76947. this._clickHandler(event);
  76948. if (now - this._lastClickMoment < Config.EVENT.touchClickDelay / 2) {
  76949. this._dblclickHandler(event);
  76950. if (this._lastHover && this._lastHover.clickable) {
  76951. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  76952. }
  76953. }
  76954. this._lastClickMoment = now;
  76955. }
  76956. this.painter.clearHover();
  76957. }
  76958. };
  76959. initDomHandler(Handler_assertThisInitialized(_this));
  76960. // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来
  76961. if (window.addEventListener) {
  76962. window.addEventListener('resize', _this._resizeHandler);
  76963. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  76964. // mobile支持
  76965. root.addEventListener('touchstart', _this._touchstartHandler);
  76966. root.addEventListener('touchmove', _this._touchmoveHandler);
  76967. root.addEventListener('touchend', _this._touchendHandler);
  76968. } else {
  76969. // mobile的click/move/up/down自己模拟
  76970. root.addEventListener('click', _this._clickHandler);
  76971. root.addEventListener('dblclick', _this._dblclickHandler);
  76972. root.addEventListener('mousewheel', _this._mousewheelHandler);
  76973. root.addEventListener('mousemove', _this._mousemoveHandler);
  76974. root.addEventListener('mousedown', _this._mousedownHandler);
  76975. root.addEventListener('mouseup', _this._mouseupHandler);
  76976. }
  76977. root.addEventListener('DOMMouseScroll', _this._mousewheelHandler);
  76978. root.addEventListener('mouseout', _this._mouseoutHandler);
  76979. } else {
  76980. window.attachEvent('onresize', _this._resizeHandler);
  76981. root.attachEvent('onclick', _this._clickHandler);
  76982. //root.attachEvent('ondblclick ', this._dblclickHandler);
  76983. root.ondblclick = _this._dblclickHandler;
  76984. root.attachEvent('onmousewheel', _this._mousewheelHandler);
  76985. root.attachEvent('onmousemove', _this._mousemoveHandler);
  76986. root.attachEvent('onmouseout', _this._mouseoutHandler);
  76987. root.attachEvent('onmousedown', _this._mousedownHandler);
  76988. root.attachEvent('onmouseup', _this._mouseupHandler);
  76989. }
  76990. // 辅助函数 start
  76991. /**
  76992. * Method: bind1Arg
  76993. * bind 一个参数的 function。
  76994. *
  76995. * Parameters:
  76996. * handler - {function} 要 bind 的 function。
  76997. * context - {Object} 运行时 this 环境。
  76998. *
  76999. * Returns:
  77000. * {function}
  77001. */
  77002. function bind1Arg(handler, context) {
  77003. return function (e) {
  77004. return handler.call(context, e);
  77005. };
  77006. }
  77007. /*
  77008. // bind 两个参数的 function
  77009. function bind2Arg(handler, context) {
  77010. return function (arg1, arg2) {
  77011. return handler.call(context, arg1, arg2);
  77012. };
  77013. }
  77014. */
  77015. // bind 三个参数的 function
  77016. function bind3Arg(handler, context) {
  77017. return function (arg1, arg2, arg3) {
  77018. return handler.call(context, arg1, arg2, arg3);
  77019. };
  77020. }
  77021. /**
  77022. * Method: initDomHandler
  77023. * 为控制类实例初始化 dom 事件处理函数。
  77024. *
  77025. * Parameters:
  77026. * instance - {<LevelRenderer.Handler>} 控制类实例 。
  77027. *
  77028. * Returns:
  77029. * {function}
  77030. */
  77031. function initDomHandler(instance) {
  77032. var domHandlerNames = ['resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove'];
  77033. var len = domHandlerNames.length;
  77034. while (len--) {
  77035. var name = domHandlerNames[len];
  77036. instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance);
  77037. }
  77038. }
  77039. /**
  77040. * Method: findHover
  77041. * 迭代函数,查找 hover 到的图形元素并即时做些事件分发。
  77042. *
  77043. * Parameters:
  77044. * shape - {Object} 图形。
  77045. * x - {number} 鼠标 x。
  77046. * y - {number} 鼠标 y。
  77047. *
  77048. * Returns:
  77049. * {boolean} 是否找到图形。
  77050. *
  77051. */
  77052. function findHover(shape, x, y) {
  77053. var me = this;
  77054. if (me._draggingTarget && me._draggingTarget.id == shape.id // 迭代到当前拖拽的图形上
  77055. || shape.isSilent() // 打酱油的路过,啥都不响应的shape~
  77056. ) {
  77057. return false;
  77058. }
  77059. var event = me._event;
  77060. if (shape.isCover(x, y)) {
  77061. if (shape.hoverable) {
  77062. // SMIC-修改 - start
  77063. if (shape.isHoverByRefDataID && shape.isHoverByRefDataID === true) {
  77064. if (shape.refDataID) {
  77065. var fid = shape.refDataID;
  77066. //me.painter.clearHover();
  77067. //me.storage.delHover();
  77068. var hoverGroup = null;
  77069. if (shape.refDataHoverGroup) {
  77070. hoverGroup = shape.refDataHoverGroup;
  77071. }
  77072. //查找同一个用户数据 feature 的所有图形
  77073. var shapeList = me.storage._shapeList;
  77074. for (var i = 0, len = shapeList.length; i < len; i++) {
  77075. var si = shapeList[i];
  77076. if (si.refDataID && fid === si.refDataID) {
  77077. if (hoverGroup) {
  77078. if (si.refDataHoverGroup && hoverGroup === si.refDataHoverGroup) {
  77079. me.storage.addHover(si);
  77080. }
  77081. } else {
  77082. me.storage.addHover(si);
  77083. }
  77084. }
  77085. }
  77086. }
  77087. } else {
  77088. me.storage.addHover(shape);
  77089. }
  77090. //初始代码:
  77091. // me.storage.addHover(shape);
  77092. // SMIC-修改 - end
  77093. }
  77094. // 查找是否在 clipShape 中
  77095. var p = shape.parent;
  77096. while (p) {
  77097. if (p.clipShape && !p.clipShape.isCover(me._mouseX, me._mouseY)) {
  77098. // 已经被祖先 clip 掉了
  77099. return false;
  77100. }
  77101. p = p.parent;
  77102. }
  77103. if (me._lastHover != shape) {
  77104. me._processOutShape(event);
  77105. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  77106. me._processDragLeave(event);
  77107. me._lastHover = shape;
  77108. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  77109. me._processDragEnter(event);
  77110. }
  77111. me._processOverShape(event);
  77112. // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGOVER
  77113. me._processDragOver(event);
  77114. me._hasfound = 1;
  77115. return true; // 找到则中断迭代查找
  77116. }
  77117. return false;
  77118. }
  77119. // 辅助函数 end
  77120. return _this;
  77121. }
  77122. /**
  77123. * @function LevelRenderer.Handler.prototype.destroy
  77124. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  77125. */
  77126. Handler_createClass(Handler, [{
  77127. key: "destroy",
  77128. value: function destroy() {
  77129. this.dispose();
  77130. this._lastX = null;
  77131. this._lastY = null;
  77132. this._mouseX = null;
  77133. this._mouseY = null;
  77134. this._findHover = null;
  77135. Eventful.prototype.destroy.apply(this, arguments);
  77136. }
  77137. /**
  77138. * @function LevelRenderer.Handler.prototype.on
  77139. * @description 自定义事件绑定。
  77140. * @param {string} eventName - 事件名称,resize、hover、drag等。
  77141. * @param {function} handler - 响应函数。
  77142. * @returns {LevelRenderer.Handler} this。
  77143. */
  77144. }, {
  77145. key: "on",
  77146. value: function on(eventName, handler) {
  77147. this.bind(eventName, handler);
  77148. return this;
  77149. }
  77150. /**
  77151. * @function LevelRenderer.Handler.prototype.un
  77152. * @description 自定义事件解除绑定。
  77153. * @param {string} eventName - 事件名称,resize、hover、drag等。
  77154. * @param {function} handler - 响应函数。
  77155. * @returns {LevelRenderer.Handler} this。
  77156. */
  77157. }, {
  77158. key: "un",
  77159. value: function un(eventName, handler) {
  77160. this.unbind(eventName, handler);
  77161. return this;
  77162. }
  77163. /**
  77164. * @function LevelRenderer.Handler.prototype.trigger
  77165. * @description 事件触发。
  77166. * @param {string} eventName - 事件名称,resize、hover、drag等。
  77167. * @param {event} eventArgs - dom事件对象。
  77168. */
  77169. }, {
  77170. key: "trigger",
  77171. value: function trigger(eventName, eventArgs) {
  77172. var EVENT = Config.EVENT;
  77173. switch (eventName) {
  77174. case EVENT.RESIZE:
  77175. case EVENT.CLICK:
  77176. case EVENT.DBLCLICK:
  77177. case EVENT.MOUSEWHEEL:
  77178. case EVENT.MOUSEMOVE:
  77179. case EVENT.MOUSEDOWN:
  77180. case EVENT.MOUSEUP:
  77181. case EVENT.MOUSEOUT:
  77182. this['_' + eventName + 'Handler'](eventArgs);
  77183. break;
  77184. }
  77185. }
  77186. /**
  77187. * @function LevelRenderer.Handler.prototype.dispose
  77188. * @description 释放,解绑所有事件。
  77189. */
  77190. }, {
  77191. key: "dispose",
  77192. value: function dispose() {
  77193. var root = this.root;
  77194. if (window.removeEventListener) {
  77195. window.removeEventListener('resize', this._resizeHandler);
  77196. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  77197. // mobile支持
  77198. root.removeEventListener('touchstart', this._touchstartHandler);
  77199. root.removeEventListener('touchmove', this._touchmoveHandler);
  77200. root.removeEventListener('touchend', this._touchendHandler);
  77201. } else {
  77202. // mobile的click自己模拟
  77203. root.removeEventListener('click', this._clickHandler);
  77204. root.removeEventListener('dblclick', this._dblclickHandler);
  77205. root.removeEventListener('mousewheel', this._mousewheelHandler);
  77206. root.removeEventListener('mousemove', this._mousemoveHandler);
  77207. root.removeEventListener('mousedown', this._mousedownHandler);
  77208. root.removeEventListener('mouseup', this._mouseupHandler);
  77209. }
  77210. root.removeEventListener('DOMMouseScroll', this._mousewheelHandler);
  77211. root.removeEventListener('mouseout', this._mouseoutHandler);
  77212. } else {
  77213. window.detachEvent('onresize', this._resizeHandler);
  77214. root.detachEvent('onclick', this._clickHandler);
  77215. root.detachEvent('dblclick', this._dblclickHandler);
  77216. root.detachEvent('onmousewheel', this._mousewheelHandler);
  77217. root.detachEvent('onmousemove', this._mousemoveHandler);
  77218. root.detachEvent('onmouseout', this._mouseoutHandler);
  77219. root.detachEvent('onmousedown', this._mousedownHandler);
  77220. root.detachEvent('onmouseup', this._mouseupHandler);
  77221. }
  77222. this.root = null;
  77223. this._domHover = null;
  77224. this.storage = null;
  77225. this.painter = null;
  77226. this.un();
  77227. }
  77228. /**
  77229. * Method: _processDragStart
  77230. * 拖拽开始。
  77231. *
  77232. * Parameters:
  77233. * event - {Object} 事件对象。
  77234. *
  77235. */
  77236. }, {
  77237. key: "_processDragStart",
  77238. value: function _processDragStart(event) {
  77239. var _lastHover = this._lastHover;
  77240. if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) {
  77241. // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度
  77242. if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) {
  77243. return;
  77244. }
  77245. var _draggingTarget = _lastHover;
  77246. this._draggingTarget = _draggingTarget;
  77247. this._isDragging = 1;
  77248. _draggingTarget.invisible = true;
  77249. this.storage.mod(_draggingTarget.id);
  77250. // 分发 Config.EVENT.DRAGSTART事件
  77251. this._dispatchAgency(_draggingTarget, Config.EVENT.DRAGSTART, event);
  77252. this.painter.refresh();
  77253. }
  77254. }
  77255. /**
  77256. * Method: _processDragEnter
  77257. * 拖拽进入目标元素。
  77258. *
  77259. * Parameters:
  77260. * event - {Object} 事件对象。
  77261. *
  77262. */
  77263. }, {
  77264. key: "_processDragEnter",
  77265. value: function _processDragEnter(event) {
  77266. if (this._draggingTarget) {
  77267. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  77268. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGENTER, event, this._draggingTarget);
  77269. }
  77270. }
  77271. /**
  77272. * Method: _processDragOver
  77273. * 拖拽在目标元素上移动。
  77274. *
  77275. * Parameters:
  77276. * event - {Object} 事件对象。
  77277. *
  77278. */
  77279. }, {
  77280. key: "_processDragOver",
  77281. value: function _processDragOver(event) {
  77282. if (this._draggingTarget) {
  77283. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGOVER事件
  77284. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGOVER, event, this._draggingTarget);
  77285. }
  77286. }
  77287. /**
  77288. * Method: _processDragLeave
  77289. * 拖拽离开目标元素。
  77290. *
  77291. * Parameters:
  77292. * event - {Object} 事件对象。
  77293. *
  77294. */
  77295. }, {
  77296. key: "_processDragLeave",
  77297. value: function _processDragLeave(event) {
  77298. if (this._draggingTarget) {
  77299. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  77300. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGLEAVE, event, this._draggingTarget);
  77301. }
  77302. }
  77303. /**
  77304. * Method: _processDrop
  77305. * 拖拽在目标元素上完成。
  77306. *
  77307. * Parameters:
  77308. * event - {Object} 事件对象。
  77309. *
  77310. */
  77311. }, {
  77312. key: "_processDrop",
  77313. value: function _processDrop(event) {
  77314. if (this._draggingTarget) {
  77315. this._draggingTarget.invisible = false;
  77316. this.storage.mod(this._draggingTarget.id);
  77317. this.painter.refresh();
  77318. // 分发SuperMap.LevelRenderer.Config.EVENT.DROP事件
  77319. this._dispatchAgency(this._lastHover, Config.EVENT.DROP, event, this._draggingTarget);
  77320. }
  77321. }
  77322. /**
  77323. * Method: _processDragEnd
  77324. * 拖拽结束。
  77325. *
  77326. * Parameters:
  77327. * event - {Object} 事件对象。
  77328. *
  77329. */
  77330. }, {
  77331. key: "_processDragEnd",
  77332. value: function _processDragEnd(event) {
  77333. if (this._draggingTarget) {
  77334. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGEND事件
  77335. this._dispatchAgency(this._draggingTarget, Config.EVENT.DRAGEND, event);
  77336. this._lastHover = null;
  77337. }
  77338. this._isDragging = 0;
  77339. this._draggingTarget = null;
  77340. }
  77341. /**
  77342. * Method: _processOverShape
  77343. * 鼠标在某个图形元素上移动。
  77344. *
  77345. * Parameters:
  77346. * event - {Object} 事件对象。
  77347. *
  77348. */
  77349. }, {
  77350. key: "_processOverShape",
  77351. value: function _processOverShape(event) {
  77352. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOVER事件
  77353. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOVER, event);
  77354. }
  77355. /**
  77356. * Method: _processOutShape
  77357. * 鼠标离开某个图形元素。
  77358. *
  77359. * Parameters:
  77360. * event - {Object} 事件对象。
  77361. *
  77362. */
  77363. }, {
  77364. key: "_processOutShape",
  77365. value: function _processOutShape(event) {
  77366. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  77367. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOUT, event);
  77368. }
  77369. /**
  77370. * Method: _dispatchAgency
  77371. * 鼠标离开某个图形元素。
  77372. *
  77373. * Parameters:
  77374. * targetShape - {Object} 目标图形元素。
  77375. * eventName - {Object} 事件名称。
  77376. * event - {Object} 事件对象。
  77377. * draggedShape - {Object} 拖拽事件特有,当前被拖拽图形元素。
  77378. *
  77379. */
  77380. }, {
  77381. key: "_dispatchAgency",
  77382. value: function _dispatchAgency(targetShape, eventName, event, draggedShape) {
  77383. var eventHandler = 'on' + eventName;
  77384. var eventPacket = {
  77385. type: eventName,
  77386. event: event,
  77387. target: targetShape,
  77388. cancelBubble: false
  77389. };
  77390. var el = targetShape;
  77391. if (draggedShape) {
  77392. eventPacket.dragged = draggedShape;
  77393. }
  77394. while (el) {
  77395. el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket));
  77396. el.dispatch(eventName, eventPacket);
  77397. el = el.parent;
  77398. if (eventPacket.cancelBubble) {
  77399. break;
  77400. }
  77401. }
  77402. if (targetShape) {
  77403. // 冒泡到顶级 zrender 对象
  77404. if (!eventPacket.cancelBubble) {
  77405. this.dispatch(eventName, eventPacket);
  77406. }
  77407. } else if (!draggedShape) {
  77408. // 无hover目标,无拖拽对象,原生事件分发
  77409. this.dispatch(eventName, {
  77410. type: eventName,
  77411. event: event
  77412. });
  77413. }
  77414. }
  77415. /**
  77416. * Method: _iterateAndFindHover
  77417. * 迭代寻找 hover shape。
  77418. *
  77419. */
  77420. }, {
  77421. key: "_iterateAndFindHover",
  77422. value: function _iterateAndFindHover() {
  77423. var invTransform = SUtil_SUtil.Util_matrix.create();
  77424. var list = this.storage.getShapeList();
  77425. var currentZLevel;
  77426. var currentLayer;
  77427. var tmp = [0, 0];
  77428. for (var i = list.length - 1; i >= 0; i--) {
  77429. var shape = list[i];
  77430. if (currentZLevel !== shape.zlevel) {
  77431. currentLayer = this.painter.getLayer(shape.zlevel, currentLayer);
  77432. tmp[0] = this._mouseX;
  77433. tmp[1] = this._mouseY;
  77434. if (currentLayer.needTransform) {
  77435. SUtil_SUtil.Util_matrix.invert(invTransform, currentLayer.transform);
  77436. SUtil_SUtil.Util_vector.applyTransform(tmp, tmp, invTransform);
  77437. }
  77438. }
  77439. if (this._findHover(shape, tmp[0], tmp[1])) {
  77440. break;
  77441. }
  77442. }
  77443. }
  77444. /**
  77445. * Method: _mobildFindFixed
  77446. * touch 有指尖错觉,四向尝试,让touch上的点击更好触发事件。
  77447. *
  77448. * Parameters:
  77449. * event - {Object} 事件对象。
  77450. *
  77451. */
  77452. }, {
  77453. key: "_mobildFindFixed",
  77454. value: function _mobildFindFixed(event) {
  77455. // touch指尖错觉的尝试偏移量配置
  77456. var MOBILE_TOUCH_OFFSETS = [{
  77457. x: 10
  77458. }, {
  77459. x: -20
  77460. }, {
  77461. x: 10,
  77462. y: 10
  77463. }, {
  77464. y: -20
  77465. }];
  77466. this._lastHover = null;
  77467. this._mouseX = event.zrenderX;
  77468. this._mouseY = event.zrenderY;
  77469. this._event = event;
  77470. this._iterateAndFindHover();
  77471. for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) {
  77472. var offset = MOBILE_TOUCH_OFFSETS[i];
  77473. offset.x && (this._mouseX += offset.x);
  77474. offset.y && (this._mouseX += offset.y);
  77475. this._iterateAndFindHover();
  77476. }
  77477. if (this._lastHover) {
  77478. event.zrenderX = this._mouseX;
  77479. event.zrenderY = this._mouseY;
  77480. }
  77481. }
  77482. /**
  77483. * Method: _zrenderEventFixed
  77484. * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 。
  77485. *
  77486. * Parameters:
  77487. * event - {Object} 事件。
  77488. * isTouch - {boolean} 是否触摸。
  77489. *
  77490. */
  77491. }, {
  77492. key: "_zrenderEventFixed",
  77493. value: function _zrenderEventFixed(event, isTouch) {
  77494. if (event.zrenderFixed) {
  77495. return event;
  77496. }
  77497. if (!isTouch) {
  77498. event = event || window.event;
  77499. // 进入对象优先~
  77500. var target = event.toElement || event.relatedTarget || event.srcElement || event.target;
  77501. if (target && target != this._domHover) {
  77502. event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft;
  77503. event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop;
  77504. }
  77505. } else {
  77506. var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0];
  77507. if (touch) {
  77508. var rBounding = this.root.getBoundingClientRect();
  77509. // touch事件坐标是全屏的~
  77510. event.zrenderX = touch.clientX - rBounding.left;
  77511. event.zrenderY = touch.clientY - rBounding.top;
  77512. }
  77513. }
  77514. event.zrenderFixed = 1;
  77515. return event;
  77516. }
  77517. // SMIC-方法扩展 - start
  77518. /**
  77519. * @function LevelRenderer.Handler.prototype.getLastHoverOne
  77520. * @description 获取单个高亮图形
  77521. */
  77522. }, {
  77523. key: "getLastHoverOne",
  77524. value: function getLastHoverOne() {
  77525. if (this._lastHover) {
  77526. return this._lastHover;
  77527. }
  77528. return null;
  77529. }
  77530. // SMIC-方法扩展 - end
  77531. }]);
  77532. return Handler;
  77533. }(Eventful);
  77534. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Easing.js
  77535. function Easing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77536. 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); } }
  77537. 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; }
  77538. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  77539. * This program are made available under the terms of the Apache License, Version 2.0
  77540. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77541. /**
  77542. * @class LevelRenderer.Animation.easing
  77543. * @category Visualization Theme
  77544. * @classdesc 缓动
  77545. * @private
  77546. */
  77547. // 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
  77548. // http://sole.github.io/tween.js/examples/03_graphs.html
  77549. var Easing = /*#__PURE__*/function () {
  77550. function Easing() {
  77551. Easing_classCallCheck(this, Easing);
  77552. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.easing";
  77553. }
  77554. /**
  77555. * @function LevelRenderer.Animation.easing.destroy
  77556. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  77557. */
  77558. Easing_createClass(Easing, [{
  77559. key: "destroy",
  77560. value: function destroy() {}
  77561. /**
  77562. * @function LevelRenderer.Animation.easing.Linear
  77563. * @description 线性缓动
  77564. * @param {number} k - 参数
  77565. * @return {number} 输入值
  77566. */
  77567. }, {
  77568. key: "Linear",
  77569. value: function Linear(k) {
  77570. return k;
  77571. }
  77572. /**
  77573. * @function LevelRenderer.Animation.easing.QuadraticIn
  77574. * @description 二次方的缓动(t^2)
  77575. * @param {number} k - 参数
  77576. * @return {number} 二次方的缓动的值
  77577. */
  77578. }, {
  77579. key: "QuadraticIn",
  77580. value: function QuadraticIn(k) {
  77581. return k * k;
  77582. }
  77583. /**
  77584. * @function LevelRenderer.Animation.easing.QuadraticOut
  77585. * @description 返回按二次方缓动退出的值
  77586. * @param {number} k - 参数
  77587. * @return {number} 按二次方缓动退出的值
  77588. */
  77589. }, {
  77590. key: "QuadraticOut",
  77591. value: function QuadraticOut(k) {
  77592. return k * (2 - k);
  77593. }
  77594. /**
  77595. * @function LevelRenderer.Animation.easing.QuadraticInOut
  77596. * @description 返回按二次方缓动进入和退出的值
  77597. * @param {number} k - 参数
  77598. * @return {number} 按二次方缓动进入和退出的值
  77599. */
  77600. }, {
  77601. key: "QuadraticInOut",
  77602. value: function QuadraticInOut(k) {
  77603. if ((k *= 2) < 1) {
  77604. return 0.5 * k * k;
  77605. }
  77606. return -0.5 * (--k * (k - 2) - 1);
  77607. }
  77608. /**
  77609. * @function LevelRenderer.Animation.easing.CubicIn
  77610. * @description 三次方的缓动(t^3)
  77611. * @param {number} k - 参数
  77612. * @return {number} 按三次方缓动的值
  77613. */
  77614. }, {
  77615. key: "CubicIn",
  77616. value: function CubicIn(k) {
  77617. return k * k * k;
  77618. }
  77619. /**
  77620. * @function LevelRenderer.Animation.easing.CubicOut
  77621. * @description 返回按三次方缓动退出的值
  77622. * @param {number} k - 参数
  77623. * @return {number} 按三次方缓动退出的值
  77624. */
  77625. }, {
  77626. key: "CubicOut",
  77627. value: function CubicOut(k) {
  77628. return --k * k * k + 1;
  77629. }
  77630. /**
  77631. * @function LevelRenderer.Animation.easing.CubicInOut
  77632. * @description 返回按三次方缓动进入退出的值
  77633. * @param {number} k - 参数
  77634. * @return {number} 按三次方缓动进入退出的值
  77635. */
  77636. }, {
  77637. key: "CubicInOut",
  77638. value: function CubicInOut(k) {
  77639. if ((k *= 2) < 1) {
  77640. return 0.5 * k * k * k;
  77641. }
  77642. return 0.5 * ((k -= 2) * k * k + 2);
  77643. }
  77644. /**
  77645. * @function LevelRenderer.Animation.easing.QuarticIn
  77646. * @description 返回按四次方缓动进入的值
  77647. * @param {number} k - 参数
  77648. * @return {number} 按四次方缓动进入的值
  77649. */
  77650. }, {
  77651. key: "QuarticIn",
  77652. value: function QuarticIn(k) {
  77653. return k * k * k * k;
  77654. }
  77655. /**
  77656. * @function LevelRenderer.Animation.easing.QuarticOut
  77657. * @description 返回按四次方缓动退出的值
  77658. * @param {number} k - 参数
  77659. * @return {number} 按四次方缓动退出的值
  77660. */
  77661. }, {
  77662. key: "QuarticOut",
  77663. value: function QuarticOut(k) {
  77664. return 1 - --k * k * k * k;
  77665. }
  77666. /**
  77667. * @function LevelRenderer.Animation.easing.QuarticInOut
  77668. * @description 返回按四次方缓动进入退出的值
  77669. * @param {number} k - 参数
  77670. * @return {number} 按四次方缓动进入退出的值
  77671. */
  77672. }, {
  77673. key: "QuarticInOut",
  77674. value: function QuarticInOut(k) {
  77675. if ((k *= 2) < 1) {
  77676. return 0.5 * k * k * k * k;
  77677. }
  77678. return -0.5 * ((k -= 2) * k * k * k - 2);
  77679. }
  77680. // 五次方的缓动(t^5)
  77681. /**
  77682. * @function LevelRenderer.Animation.easing.QuinticIn
  77683. * @description 返回按五次方缓动的值
  77684. * @param {number} k - 参数
  77685. * @return {number} 按五次方缓动的值
  77686. */
  77687. }, {
  77688. key: "QuinticIn",
  77689. value: function QuinticIn(k) {
  77690. return k * k * k * k * k;
  77691. }
  77692. /**
  77693. * @function LevelRenderer.Animation.easing.QuinticOut
  77694. * @description 返回按五次方缓动退出的值
  77695. * @param {number} k - 参数
  77696. * @return {number} 按五次方缓动退出的值
  77697. */
  77698. }, {
  77699. key: "QuinticOut",
  77700. value: function QuinticOut(k) {
  77701. return --k * k * k * k * k + 1;
  77702. }
  77703. /**
  77704. * @function LevelRenderer.Animation.easing.QuinticInOut
  77705. * @description 返回按五次方缓动进入退出的值
  77706. * @param {number} k - 参数
  77707. * @return {number} 按五次方缓动进入退出的值
  77708. */
  77709. }, {
  77710. key: "QuinticInOut",
  77711. value: function QuinticInOut(k) {
  77712. if ((k *= 2) < 1) {
  77713. return 0.5 * k * k * k * k * k;
  77714. }
  77715. return 0.5 * ((k -= 2) * k * k * k * k + 2);
  77716. }
  77717. // 正弦曲线的缓动(sin(t))
  77718. /**
  77719. * @function LevelRenderer.Animation.easing.SinusoidalIn
  77720. * @description 返回按正弦曲线的缓动进入的值
  77721. * @param {number} k - 参数
  77722. * @return {number} 按正弦曲线的缓动进入的值
  77723. */
  77724. }, {
  77725. key: "SinusoidalIn",
  77726. value: function SinusoidalIn(k) {
  77727. return 1 - Math.cos(k * Math.PI / 2);
  77728. }
  77729. /**
  77730. * @function LevelRenderer.Animation.easing.SinusoidalOut
  77731. * @description 返回按正弦曲线的缓动退出的值
  77732. * @param {number} k - 参数
  77733. * @return {number} 按正弦曲线的缓动退出的值
  77734. */
  77735. }, {
  77736. key: "SinusoidalOut",
  77737. value: function SinusoidalOut(k) {
  77738. return Math.sin(k * Math.PI / 2);
  77739. }
  77740. /**
  77741. * @function LevelRenderer.Animation.easing.SinusoidalInOut
  77742. * @description 返回按正弦曲线的缓动进入退出的值
  77743. * @param {number} k - 参数
  77744. * @return {number} 按正弦曲线的缓动进入退出的值
  77745. */
  77746. }, {
  77747. key: "SinusoidalInOut",
  77748. value: function SinusoidalInOut(k) {
  77749. return 0.5 * (1 - Math.cos(Math.PI * k));
  77750. }
  77751. // 指数曲线的缓动(2^t)
  77752. /**
  77753. * @function LevelRenderer.Animation.easing.ExponentialIn
  77754. * @description 返回按指数曲线的缓动进入的值
  77755. * @param {number} k - 参数
  77756. * @return {number} 按指数曲线的缓动进入的值
  77757. */
  77758. }, {
  77759. key: "ExponentialIn",
  77760. value: function ExponentialIn(k) {
  77761. return k === 0 ? 0 : Math.pow(1024, k - 1);
  77762. }
  77763. /**
  77764. * @function LevelRenderer.Animation.easing.ExponentialOut
  77765. * @description 返回按指数曲线的缓动退出的值
  77766. * @param {number} k - 参数
  77767. * @return {number} 按指数曲线的缓动退出的值
  77768. */
  77769. }, {
  77770. key: "ExponentialOut",
  77771. value: function ExponentialOut(k) {
  77772. return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
  77773. }
  77774. /**
  77775. * @function LevelRenderer.Animation.easing.ExponentialInOut
  77776. * @description 返回按指数曲线的缓动进入退出的值
  77777. * @param {number} k - 参数
  77778. * @return {number} 按指数曲线的缓动进入退出的值
  77779. */
  77780. }, {
  77781. key: "ExponentialInOut",
  77782. value: function ExponentialInOut(k) {
  77783. if (k === 0) {
  77784. return 0;
  77785. }
  77786. if (k === 1) {
  77787. return 1;
  77788. }
  77789. if ((k *= 2) < 1) {
  77790. return 0.5 * Math.pow(1024, k - 1);
  77791. }
  77792. return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
  77793. }
  77794. // 圆形曲线的缓动(sqrt(1-t^2))
  77795. /**
  77796. * @function LevelRenderer.Animation.easing.CircularIn
  77797. * @description 返回按圆形曲线的缓动进入的值
  77798. * @param {number} k - 参数
  77799. * @return {number} 按圆形曲线的缓动进入的值
  77800. */
  77801. }, {
  77802. key: "CircularIn",
  77803. value: function CircularIn(k) {
  77804. return 1 - Math.sqrt(1 - k * k);
  77805. }
  77806. /**
  77807. * @function LevelRenderer.Animation.easing.CircularOut
  77808. * @description 返回按圆形曲线的缓动退出的值
  77809. * @param {number} k - 参数
  77810. * @return {number} 按圆形曲线的缓动退出的值
  77811. */
  77812. }, {
  77813. key: "CircularOut",
  77814. value: function CircularOut(k) {
  77815. return Math.sqrt(1 - --k * k);
  77816. }
  77817. /**
  77818. * @function LevelRenderer.Animation.easing.CircularInOut
  77819. * @description 返回按圆形曲线的缓动进入退出的值
  77820. * @param {number} k - 参数
  77821. * @return {number} 按圆形曲线的缓动进入退出的值
  77822. */
  77823. }, {
  77824. key: "CircularInOut",
  77825. value: function CircularInOut(k) {
  77826. if ((k *= 2) < 1) {
  77827. return -0.5 * (Math.sqrt(1 - k * k) - 1);
  77828. }
  77829. return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
  77830. }
  77831. // 创建类似于弹簧在停止前来回振荡的动画
  77832. /**
  77833. * @function LevelRenderer.Animation.easing.ElasticIn
  77834. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  77835. * @param {number} k - 参数
  77836. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  77837. */
  77838. }, {
  77839. key: "ElasticIn",
  77840. value: function ElasticIn(k) {
  77841. var s;
  77842. var a = 0.1;
  77843. var p = 0.4;
  77844. if (k === 0) {
  77845. return 0;
  77846. }
  77847. if (k === 1) {
  77848. return 1;
  77849. }
  77850. if (a < 1) {
  77851. a = 1;
  77852. s = p / 4;
  77853. } else {
  77854. s = p * Math.asin(1 / a) / (2 * Math.PI);
  77855. }
  77856. return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  77857. }
  77858. /**
  77859. * @function LevelRenderer.Animation.easing.ElasticOut
  77860. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  77861. * @param {number} k - 参数
  77862. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  77863. */
  77864. }, {
  77865. key: "ElasticOut",
  77866. value: function ElasticOut(k) {
  77867. var s;
  77868. var a = 0.1;
  77869. var p = 0.4;
  77870. if (k === 0) {
  77871. return 0;
  77872. }
  77873. if (k === 1) {
  77874. return 1;
  77875. }
  77876. if (a < 1) {
  77877. a = 1;
  77878. s = p / 4;
  77879. } else {
  77880. s = p * Math.asin(1 / a) / (2 * Math.PI);
  77881. }
  77882. return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
  77883. }
  77884. /**
  77885. * @function LevelRenderer.Animation.easing.ElasticInOut
  77886. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  77887. * @param {number} k - 参数
  77888. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  77889. */
  77890. }, {
  77891. key: "ElasticInOut",
  77892. value: function ElasticInOut(k) {
  77893. var s;
  77894. var a = 0.1;
  77895. var p = 0.4;
  77896. if (k === 0) {
  77897. return 0;
  77898. }
  77899. if (k === 1) {
  77900. return 1;
  77901. }
  77902. if (a < 1) {
  77903. a = 1;
  77904. s = p / 4;
  77905. } else {
  77906. s = p * Math.asin(1 / a) / (2 * Math.PI);
  77907. }
  77908. if ((k *= 2) < 1) {
  77909. return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  77910. }
  77911. return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
  77912. }
  77913. // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动
  77914. /**
  77915. * @function LevelRenderer.Animation.easing.BackIn
  77916. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  77917. * @param {number} k - 参数
  77918. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  77919. */
  77920. }, {
  77921. key: "BackIn",
  77922. value: function BackIn(k) {
  77923. var s = 1.70158;
  77924. return k * k * ((s + 1) * k - s);
  77925. }
  77926. /**
  77927. * @function LevelRenderer.Animation.easing.BackOut
  77928. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  77929. * @param {number} k - 参数
  77930. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  77931. */
  77932. }, {
  77933. key: "BackOut",
  77934. value: function BackOut(k) {
  77935. var s = 1.70158;
  77936. return --k * k * ((s + 1) * k + s) + 1;
  77937. }
  77938. /**
  77939. * @function LevelRenderer.Animation.easing.BackInOut
  77940. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  77941. * @param {number} k - 参数
  77942. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  77943. */
  77944. }, {
  77945. key: "BackInOut",
  77946. value: function BackInOut(k) {
  77947. var s = 1.70158 * 1.525;
  77948. if ((k *= 2) < 1) {
  77949. return 0.5 * (k * k * ((s + 1) * k - s));
  77950. }
  77951. return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
  77952. }
  77953. // 创建弹跳效果
  77954. /**
  77955. * @function LevelRenderer.Animation.easing.BounceIn
  77956. * @description 返回按弹跳效果的缓动进入的值
  77957. * @param {number} k - 参数
  77958. * @return {number} 按弹跳效果的缓动进入的值
  77959. */
  77960. }, {
  77961. key: "BounceIn",
  77962. value: function BounceIn(k) {
  77963. return 1 - this.BounceOut(1 - k);
  77964. }
  77965. /**
  77966. * @function LevelRenderer.Animation.easing.BounceOut
  77967. * @description 返回按弹跳效果的缓动退出的值
  77968. * @param {number} k - 参数
  77969. * @return {number} 按弹跳效果的缓动退出的值
  77970. */
  77971. }, {
  77972. key: "BounceOut",
  77973. value: function BounceOut(k) {
  77974. if (k < 1 / 2.75) {
  77975. return 7.5625 * k * k;
  77976. } else if (k < 2 / 2.75) {
  77977. return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
  77978. } else if (k < 2.5 / 2.75) {
  77979. return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
  77980. } else {
  77981. return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
  77982. }
  77983. }
  77984. /**
  77985. * @function LevelRenderer.Animation.easing.BounceInOut
  77986. * @description 返回按弹跳效果的缓动进入退出的值
  77987. * @param {number} k - 参数
  77988. * @return {number} 按弹跳效果的缓动进入退出的值
  77989. */
  77990. }, {
  77991. key: "BounceInOut",
  77992. value: function BounceInOut(k) {
  77993. if (k < 0.5) {
  77994. return this.BounceIn(k * 2) * 0.5;
  77995. }
  77996. return this.BounceOut(k * 2 - 1) * 0.5 + 0.5;
  77997. }
  77998. }]);
  77999. return Easing;
  78000. }();
  78001. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Clip.js
  78002. function Clip_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78003. 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); } }
  78004. 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; }
  78005. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  78006. * This program are made available under the terms of the Apache License, Version 2.0
  78007. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78008. /**
  78009. * @class LevelRenderer.Animation.Clip
  78010. * @category Visualization Theme
  78011. * @classdesc 动画片段
  78012. * @param {Object} options - 参数。
  78013. * @param {Object} options.target - 动画对象,可以是数组,如果是数组的话会批量分发 onframe 等事件。
  78014. * @param {number} [options.life=1000] - 动画时长。
  78015. * @param {number} [options.delay=0] - 动画延迟时间。
  78016. * @param {boolean} [options.loop=true] - 是否循环。
  78017. * @param {number} [options.gap=0] - 循环的间隔时间。
  78018. * @param {Object} options.onframe - 帧。
  78019. * @param {boolean} options.easing - 是否消除。
  78020. * @param {boolean} options.ondestroy - 是否销毁。
  78021. * @param {boolean} options.onrestart - 是否重播。
  78022. * @private
  78023. */
  78024. var Clip = /*#__PURE__*/function () {
  78025. function Clip(options) {
  78026. Clip_classCallCheck(this, Clip);
  78027. this._targetPool = options.target || {};
  78028. if (!(this._targetPool instanceof Array)) {
  78029. this._targetPool = [this._targetPool];
  78030. }
  78031. // 生命周期
  78032. this._life = options.life || 1000;
  78033. // 延时
  78034. this._delay = options.delay || 0;
  78035. // 开始时间
  78036. this._startTime = new Date().getTime() + this._delay; // 单位毫秒
  78037. // 结束时间
  78038. this._endTime = this._startTime + this._life * 1000;
  78039. // 是否循环
  78040. this.loop = typeof options.loop == 'undefined' ? false : options.loop;
  78041. this.gap = options.gap || 0;
  78042. this.easing = options.easing || 'Linear';
  78043. this.onframe = options.onframe;
  78044. this.ondestroy = options.ondestroy;
  78045. this.onrestart = options.onrestart;
  78046. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Clip";
  78047. }
  78048. /**
  78049. * @function LevelRenderer.Animation.Clip.prototype.destroy
  78050. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  78051. */
  78052. Clip_createClass(Clip, [{
  78053. key: "destroy",
  78054. value: function destroy() {}
  78055. }, {
  78056. key: "step",
  78057. value: function step(time) {
  78058. var easing = new Easing();
  78059. var percent = (time - this._startTime) / this._life;
  78060. // 还没开始
  78061. if (percent < 0) {
  78062. return;
  78063. }
  78064. percent = Math.min(percent, 1);
  78065. var easingFunc = typeof this.easing == 'string' ? easing[this.easing] : this.easing;
  78066. var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;
  78067. this.fire('frame', schedule);
  78068. // 结束
  78069. if (percent == 1) {
  78070. if (this.loop) {
  78071. this.restart();
  78072. // 重新开始周期
  78073. // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
  78074. return 'restart';
  78075. }
  78076. // 动画完成将这个控制器标识为待删除
  78077. // 在Animation.update中进行批量删除
  78078. this._needsRemove = true;
  78079. return 'destroy';
  78080. }
  78081. return null;
  78082. }
  78083. }, {
  78084. key: "restart",
  78085. value: function restart() {
  78086. var time = new Date().getTime();
  78087. var remainder = (time - this._startTime) % this._life;
  78088. this._startTime = new Date().getTime() - remainder + this.gap;
  78089. }
  78090. }, {
  78091. key: "fire",
  78092. value: function fire(eventType, arg) {
  78093. for (var i = 0, len = this._targetPool.length; i < len; i++) {
  78094. if (this['on' + eventType]) {
  78095. this['on' + eventType](this._targetPool[i], arg);
  78096. }
  78097. }
  78098. }
  78099. }]);
  78100. return Clip;
  78101. }();
  78102. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Animation.js
  78103. 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); }
  78104. function Animation_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78105. 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); } }
  78106. 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; }
  78107. 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); }
  78108. 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); }
  78109. 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); }; }
  78110. 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); }
  78111. function Animation_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  78112. 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; } }
  78113. function Animation_getPrototypeOf(o) { Animation_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Animation_getPrototypeOf(o); }
  78114. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  78115. * This program are made available under the terms of the Apache License, Version 2.0
  78116. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78117. /**
  78118. * @class LevelRenderer.Animation
  78119. * @classdesc 动画主类, 调度和管理所有动画控制器
  78120. * @category Visualization Theme
  78121. * @extends {LevelRenderer.Eventful}
  78122. * @param {Object} options - 动画参数。
  78123. * @param {Object} options.onframe - onframe。
  78124. * @param {Object} options.stage - stage。
  78125. * @example 例如:
  78126. * (start code)
  78127. * var animation = new LevelRenderer.Animation();
  78128. * var obj = {
  78129. * x: 100,
  78130. * y: 100
  78131. * };
  78132. * animation.animate(node.position)
  78133. * .when(1000, {
  78134. * x: 500,
  78135. * y: 500
  78136. * })
  78137. * .when(2000, {
  78138. * x: 100,
  78139. * y: 100
  78140. * })
  78141. * .start('spline');
  78142. * (end)
  78143. * @private
  78144. */
  78145. var Animation = /*#__PURE__*/function (_Eventful) {
  78146. Animation_inherits(Animation, _Eventful);
  78147. var _super = Animation_createSuper(Animation);
  78148. function Animation(options) {
  78149. var _this;
  78150. Animation_classCallCheck(this, Animation);
  78151. _this = _super.call(this, options);
  78152. options = options || {};
  78153. /**
  78154. * @member {Object} LevelRenderer.Animation.prototype.stage
  78155. * @description stage。
  78156. */
  78157. _this.stage = {};
  78158. /**
  78159. * @member {Object} LevelRenderer.Animation.prototype.onframe
  78160. * @description onframe。
  78161. */
  78162. _this.onframe = function () {};
  78163. /**
  78164. * @member {Array} LevelRenderer.Animation.prototype._clips
  78165. * @description _clips。
  78166. */
  78167. _this._clips = [];
  78168. /**
  78169. * @member {boolean} LevelRenderer.Animation.prototype._running
  78170. * @description _running。
  78171. */
  78172. _this._running = false;
  78173. /**
  78174. * @member {number} LevelRenderer.Animation.prototype._time
  78175. * @description _time。
  78176. */
  78177. _this._time = 0;
  78178. Util_Util.extend(Animation_assertThisInitialized(_this), options);
  78179. _this.CLASS_NAME = "SuperMap.LevelRenderer.Animation";
  78180. return _this;
  78181. }
  78182. /**
  78183. * @function LevelRenderer.Animation.prototype.add
  78184. * @description 添加动画片段。
  78185. * @param {LevelRenderer.Animation.Clip} clip - 动画片段。
  78186. */
  78187. Animation_createClass(Animation, [{
  78188. key: "add",
  78189. value: function add(clip) {
  78190. this._clips.push(clip);
  78191. }
  78192. /**
  78193. * @function LevelRenderer.Animation.prototype.remove
  78194. * @description 删除动画片段。
  78195. * @param {LevelRenderer.Animation.Clip} clip - 动画片段。
  78196. */
  78197. }, {
  78198. key: "remove",
  78199. value: function remove(clip) {
  78200. var idx = new levelRenderer_Util_Util().indexOf(this._clips, clip);
  78201. if (idx >= 0) {
  78202. this._clips.splice(idx, 1);
  78203. }
  78204. }
  78205. /**
  78206. * @function LevelRenderer.Animation.prototype.update
  78207. * @description 更新动画片段。
  78208. */
  78209. }, {
  78210. key: "_update",
  78211. value: function _update() {
  78212. var time = new Date().getTime();
  78213. var delta = time - this._time;
  78214. var clips = this._clips;
  78215. var len = clips.length;
  78216. var deferredEvents = [];
  78217. var deferredClips = [];
  78218. for (var i = 0; i < len; i++) {
  78219. var clip = clips[i];
  78220. var e = clip.step(time);
  78221. // Throw out the events need to be called after
  78222. // stage.update, like destroy
  78223. if (e) {
  78224. deferredEvents.push(e);
  78225. deferredClips.push(clip);
  78226. }
  78227. }
  78228. if (this.stage.update) {
  78229. this.stage.update();
  78230. }
  78231. // Remove the finished clip
  78232. for (var _i2 = 0; _i2 < len;) {
  78233. if (clips[_i2]._needsRemove) {
  78234. clips[_i2] = clips[len - 1];
  78235. clips.pop();
  78236. len--;
  78237. } else {
  78238. _i2++;
  78239. }
  78240. }
  78241. len = deferredEvents.length;
  78242. for (var _i4 = 0; _i4 < len; _i4++) {
  78243. deferredClips[_i4].fire(deferredEvents[_i4]);
  78244. }
  78245. this._time = time;
  78246. this.onframe(delta);
  78247. this.dispatch('frame', delta);
  78248. }
  78249. /**
  78250. * @function LevelRenderer.Animation.prototype.start
  78251. * @description 开始运行动画。
  78252. */
  78253. }, {
  78254. key: "start",
  78255. value: function start() {
  78256. var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) {
  78257. setTimeout(func, 16);
  78258. };
  78259. var self = this;
  78260. this._running = true;
  78261. function step() {
  78262. if (self._running) {
  78263. self._update();
  78264. requestAnimationFrame(step);
  78265. }
  78266. }
  78267. this._time = new Date().getTime();
  78268. requestAnimationFrame(step);
  78269. }
  78270. /**
  78271. * @function LevelRenderer.Animation.prototype.stop
  78272. * @description 停止运行动画。
  78273. */
  78274. }, {
  78275. key: "stop",
  78276. value: function stop() {
  78277. this._running = false;
  78278. }
  78279. /**
  78280. * @function LevelRenderer.Animation.prototype.clear
  78281. * @description 清除所有动画片段。
  78282. */
  78283. }, {
  78284. key: "clear",
  78285. value: function clear() {
  78286. this._clips = [];
  78287. }
  78288. /**
  78289. * @function LevelRenderer.Animation.prototype.animate
  78290. * @description 对一个目标创建一个animator对象,可以指定目标中的属性使用动画。
  78291. * @param {Object} target - 目标对象。
  78292. * @param {Object} options - 动画参数选项。
  78293. * @param {boolean} [options.loop=false] - 是否循环播放动画。
  78294. * @param {function} [options.getter] - 如果指定getter函数,会通过getter函数取属性值。
  78295. * @param {function} [options.setter] - 如果指定setter函数,会通过setter函数设置属性值。
  78296. * @returns {LevelRenderer.Animation.Animator} Animator。
  78297. */
  78298. }, {
  78299. key: "animate",
  78300. value: function animate(target, options) {
  78301. options = options || {};
  78302. var deferred = new Animator(target, options.loop, options.getter, options.setter);
  78303. deferred.animation = this;
  78304. return deferred;
  78305. }
  78306. }], [{
  78307. key: "_interpolateNumber",
  78308. value: function _interpolateNumber(p0, p1, percent) {
  78309. return (p1 - p0) * percent + p0;
  78310. }
  78311. }, {
  78312. key: "_interpolateArray",
  78313. value: function _interpolateArray(p0, p1, percent, out, arrDim) {
  78314. var len = p0.length;
  78315. if (arrDim == 1) {
  78316. for (var i = 0; i < len; i++) {
  78317. out[i] = Animation._interpolateNumber(p0[i], p1[i], percent);
  78318. }
  78319. } else {
  78320. var len2 = p0[0].length;
  78321. for (var _i6 = 0; _i6 < len; _i6++) {
  78322. for (var j = 0; j < len2; j++) {
  78323. out[_i6][j] = Animation._interpolateNumber(p0[_i6][j], p1[_i6][j], percent);
  78324. }
  78325. }
  78326. }
  78327. }
  78328. }, {
  78329. key: "_isArrayLike",
  78330. value: function _isArrayLike(data) {
  78331. switch (Animation_typeof(data)) {
  78332. case 'undefined':
  78333. case 'string':
  78334. return false;
  78335. }
  78336. return typeof data.length !== 'undefined';
  78337. }
  78338. }, {
  78339. key: "_catmullRomInterpolateArray",
  78340. value: function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {
  78341. var len = p0.length;
  78342. if (arrDim == 1) {
  78343. for (var i = 0; i < len; i++) {
  78344. out[i] = Animation._catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);
  78345. }
  78346. } else {
  78347. var len2 = p0[0].length;
  78348. for (var _i8 = 0; _i8 < len; _i8++) {
  78349. for (var j = 0; j < len2; j++) {
  78350. out[_i8][j] = Animation._catmullRomInterpolate(p0[_i8][j], p1[_i8][j], p2[_i8][j], p3[_i8][j], t, t2, t3);
  78351. }
  78352. }
  78353. }
  78354. }
  78355. }, {
  78356. key: "_catmullRomInterpolate",
  78357. value: function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
  78358. var v0 = (p2 - p0) * 0.5;
  78359. var v1 = (p3 - p1) * 0.5;
  78360. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  78361. }
  78362. }, {
  78363. key: "_cloneValue",
  78364. value: function _cloneValue(value) {
  78365. var arraySlice = Array.prototype.slice;
  78366. if (Animation._isArrayLike(value)) {
  78367. var len = value.length;
  78368. if (Animation._isArrayLike(value[0])) {
  78369. var ret = [];
  78370. for (var i = 0; i < len; i++) {
  78371. ret.push(arraySlice.call(value[i]));
  78372. }
  78373. return ret;
  78374. } else {
  78375. return arraySlice.call(value);
  78376. }
  78377. } else {
  78378. return value;
  78379. }
  78380. }
  78381. }, {
  78382. key: "rgba2String",
  78383. value: function rgba2String(rgba) {
  78384. rgba[0] = Math.floor(rgba[0]);
  78385. rgba[1] = Math.floor(rgba[1]);
  78386. rgba[2] = Math.floor(rgba[2]);
  78387. return 'rgba(' + rgba.join(',') + ')';
  78388. }
  78389. }]);
  78390. return Animation;
  78391. }(Eventful);
  78392. /**
  78393. * @class LevelRenderer.Animation.Animator
  78394. */
  78395. var Animator = /*#__PURE__*/function () {
  78396. /**
  78397. * @function LevelRenderer.Animation.Animator.prototype.animate
  78398. * @description 构造函数
  78399. * @param {Object} target - 目标对象。
  78400. * @param {Object} options - 动画参数选项。
  78401. * @param {boolean} [loop=false] - 是否循环播放动画。
  78402. * @param {function} [getterl] - 如果指定getter函数,会通过getter函数取属性值。
  78403. * @param {function} [setter] - 如果指定setter函数,会通过setter函数设置属性值。
  78404. */
  78405. function Animator(target, loop, getter, setter) {
  78406. Animation_classCallCheck(this, Animator);
  78407. /**
  78408. * @member {Object} LevelRenderer.Animation.Animator.prototype._tracks
  78409. * @description _tracks。
  78410. */
  78411. this._tracks = {};
  78412. /**
  78413. * @member {Object} LevelRenderer.Animation.Animator.prototype._target
  78414. * @description _target。
  78415. */
  78416. this._target = target;
  78417. /**
  78418. * @member {boolean} LevelRenderer.Animation.Animator.prototype._loop
  78419. * @description _loop。
  78420. */
  78421. this._loop = loop || false;
  78422. /**
  78423. * @member {function} LevelRenderer.Animation.Animator.prototype._getter
  78424. * @description _getter。
  78425. */
  78426. this._getter = getter || _defaultGetter;
  78427. /**
  78428. * @member {function} LevelRenderer.Animation.Animator.prototype._setter
  78429. * @description _setter。
  78430. */
  78431. this._setter = setter || _defaultSetter;
  78432. /**
  78433. * @member {number} LevelRenderer.Animation.Animator.prototype._clipCount
  78434. * @description _clipCount。
  78435. */
  78436. this._clipCount = 0;
  78437. /**
  78438. * @member {number} LevelRenderer.Animation.Animator.prototype._delay
  78439. * @description _delay。
  78440. */
  78441. this._delay = 0;
  78442. /**
  78443. * @member {Array} LevelRenderer.Animation.Animator.prototype._doneList
  78444. * @description _doneList。
  78445. */
  78446. this._doneList = [];
  78447. /**
  78448. * @member {Array} LevelRenderer.Animation.Animator.prototype._onframeList
  78449. * @description _onframeList。
  78450. */
  78451. this._onframeList = [];
  78452. /**
  78453. * @member {Array} LevelRenderer.Animation.Animator.prototype._clipList
  78454. * @description _clipList。
  78455. */
  78456. this._clipList = [];
  78457. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Animator";
  78458. //Function
  78459. function _defaultGetter(target, key) {
  78460. return target[key];
  78461. }
  78462. function _defaultSetter(target, key, value) {
  78463. target[key] = value;
  78464. }
  78465. }
  78466. /**
  78467. * @function LevelRenderer.Animation.Animator.prototype.when
  78468. * @description 设置动画关键帧
  78469. * @param {number} time - 关键帧时间,单位是ms
  78470. * @param {Object} props - 关键帧的属性值,key-value表示
  78471. * @returns {LevelRenderer.Animation.Animator} Animator
  78472. */
  78473. Animation_createClass(Animator, [{
  78474. key: "when",
  78475. value: function when(time /* ms */, props) {
  78476. for (var propName in props) {
  78477. if (!this._tracks[propName]) {
  78478. this._tracks[propName] = [];
  78479. // If time is 0
  78480. // Then props is given initialize value
  78481. // Else
  78482. // Initialize value from current prop value
  78483. if (time !== 0) {
  78484. this._tracks[propName].push({
  78485. time: 0,
  78486. value: Animation._cloneValue(this._getter(this._target, propName))
  78487. });
  78488. }
  78489. }
  78490. this._tracks[propName].push({
  78491. time: parseInt(time, 10),
  78492. value: props[propName]
  78493. });
  78494. }
  78495. return this;
  78496. }
  78497. /**
  78498. * @function LevelRenderer.Animation.Animator.prototype.during
  78499. * @description 添加动画每一帧的回调函数
  78500. * @param {RequestCallback} callback - 回调函数
  78501. * @returns {LevelRenderer.Animation.Animator} Animator
  78502. */
  78503. }, {
  78504. key: "during",
  78505. value: function during(callback) {
  78506. this._onframeList.push(callback);
  78507. return this;
  78508. }
  78509. /**
  78510. * @function LevelRenderer.Animation.Animator.prototype.start
  78511. * @description 开始执行动画
  78512. * @param {(string|function)} easing - 动画缓动函数。详见:<{@link LevelRenderer.Animation.easing}>。
  78513. * @returns {LevelRenderer.Animation.Animator} Animator
  78514. */
  78515. }, {
  78516. key: "start",
  78517. value: function start(easing) {
  78518. var self = this;
  78519. var setter = this._setter;
  78520. var getter = this._getter;
  78521. var onFrameListLen = self._onframeList.length;
  78522. var useSpline = easing === 'spline';
  78523. var ondestroy = function ondestroy() {
  78524. self._clipCount--;
  78525. if (self._clipCount === 0) {
  78526. // Clear all tracks
  78527. self._tracks = {};
  78528. var len = self._doneList.length;
  78529. for (var i = 0; i < len; i++) {
  78530. self._doneList[i].call(self);
  78531. }
  78532. }
  78533. };
  78534. var createTrackClip = function createTrackClip(keyframes, propName) {
  78535. var trackLen = keyframes.length;
  78536. if (!trackLen) {
  78537. return;
  78538. }
  78539. // Guess data type
  78540. var firstVal = keyframes[0].value;
  78541. var isValueArray = Animation._isArrayLike(firstVal);
  78542. var isValueColor = false;
  78543. // For vertices morphing
  78544. var arrDim = isValueArray && Animation._isArrayLike(firstVal[0]) ? 2 : 1;
  78545. // Sort keyframe as ascending
  78546. keyframes.sort(function (a, b) {
  78547. return a.time - b.time;
  78548. });
  78549. var trackMaxTime = keyframes[trackLen - 1].time;
  78550. // Percents of each keyframe
  78551. var kfPercents = [];
  78552. // Value of each keyframe
  78553. var kfValues = [];
  78554. for (var _i10 = 0; _i10 < trackLen; _i10++) {
  78555. kfPercents.push(keyframes[_i10].time / trackMaxTime);
  78556. // Assume value is a color when it is a string
  78557. var value = keyframes[_i10].value;
  78558. if (typeof value == 'string') {
  78559. value = SUtil_SUtil.Util_color.toArray(value);
  78560. if (value.length === 0) {
  78561. // Invalid color
  78562. value[0] = value[1] = value[2] = 0;
  78563. value[3] = 1;
  78564. }
  78565. isValueColor = true;
  78566. }
  78567. kfValues.push(value);
  78568. }
  78569. // Cache the key of last frame to speed up when
  78570. // animation playback is sequency
  78571. var cacheKey = 0;
  78572. var cachePercent = 0;
  78573. var start;
  78574. var i;
  78575. var w;
  78576. var p0;
  78577. var p1;
  78578. var p2;
  78579. var p3;
  78580. if (isValueColor) {
  78581. var rgba = [0, 0, 0, 0];
  78582. }
  78583. var onframe = function onframe(target, percent) {
  78584. // Find the range keyframes
  78585. // kf1-----kf2---------current--------kf3
  78586. // find kf2 and kf3 and do interpolation
  78587. if (percent < cachePercent) {
  78588. // Start from next key
  78589. start = Math.min(cacheKey + 1, trackLen - 1);
  78590. for (i = start; i >= 0; i--) {
  78591. if (kfPercents[i] <= percent) {
  78592. break;
  78593. }
  78594. }
  78595. i = Math.min(i, trackLen - 2);
  78596. } else {
  78597. for (i = cacheKey; i < trackLen; i++) {
  78598. if (kfPercents[i] > percent) {
  78599. break;
  78600. }
  78601. }
  78602. i = Math.min(i - 1, trackLen - 2);
  78603. }
  78604. cacheKey = i;
  78605. cachePercent = percent;
  78606. var range = kfPercents[i + 1] - kfPercents[i];
  78607. if (range === 0) {
  78608. return;
  78609. } else {
  78610. w = (percent - kfPercents[i]) / range;
  78611. }
  78612. if (useSpline) {
  78613. p1 = kfValues[i];
  78614. p0 = kfValues[i === 0 ? i : i - 1];
  78615. p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1];
  78616. p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2];
  78617. if (isValueArray) {
  78618. Animation._catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);
  78619. } else {
  78620. var _value;
  78621. if (isValueColor) {
  78622. // value = LevelRenderer.Animation._catmullRomInterpolateArray(
  78623. // p0, p1, p2, p3, w, w * w, w * w * w,
  78624. // rgba, 1
  78625. // );
  78626. _value = Animation.rgba2String(rgba);
  78627. } else {
  78628. _value = Animation._catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);
  78629. }
  78630. setter(target, propName, _value);
  78631. }
  78632. } else {
  78633. if (isValueArray) {
  78634. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim);
  78635. } else {
  78636. var _value2;
  78637. if (isValueColor) {
  78638. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1);
  78639. _value2 = Animation.rgba2String(rgba);
  78640. } else {
  78641. _value2 = Animation._interpolateNumber(kfValues[i], kfValues[i + 1], w);
  78642. }
  78643. setter(target, propName, _value2);
  78644. }
  78645. }
  78646. for (i = 0; i < onFrameListLen; i++) {
  78647. self._onframeList[i](target, percent);
  78648. }
  78649. };
  78650. var clip = new Clip({
  78651. target: self._target,
  78652. life: trackMaxTime,
  78653. loop: self._loop,
  78654. delay: self._delay,
  78655. onframe: onframe,
  78656. ondestroy: ondestroy
  78657. });
  78658. if (easing && easing !== 'spline') {
  78659. clip.easing = easing;
  78660. }
  78661. self._clipList.push(clip);
  78662. self._clipCount++;
  78663. self.animation.add(clip);
  78664. };
  78665. for (var propName in this._tracks) {
  78666. createTrackClip(this._tracks[propName], propName);
  78667. }
  78668. return this;
  78669. }
  78670. /**
  78671. * @function LevelRenderer.Animation.Animator.prototype.stop
  78672. * @description 停止动画
  78673. */
  78674. }, {
  78675. key: "stop",
  78676. value: function stop() {
  78677. for (var i = 0; i < this._clipList.length; i++) {
  78678. var clip = this._clipList[i];
  78679. this.animation.remove(clip);
  78680. }
  78681. this._clipList = [];
  78682. }
  78683. /**
  78684. * @function LevelRenderer.Animation.Animator.prototype.delay
  78685. * @description 设置动画延迟开始的时间
  78686. * @param {number} time - 时间,单位ms
  78687. * @returns {LevelRenderer.Animation.Animator} Animator
  78688. */
  78689. }, {
  78690. key: "delay",
  78691. value: function delay(time) {
  78692. this._delay = time;
  78693. return this;
  78694. }
  78695. /**
  78696. * @function LevelRenderer.Animation.Animator.prototype.done
  78697. * @description 添加动画结束的回调
  78698. * @param {function} cb - Function
  78699. * @returns {LevelRenderer.Animation.Animator} Animator
  78700. */
  78701. }, {
  78702. key: "done",
  78703. value: function done(cb) {
  78704. if (cb) {
  78705. this._doneList.push(cb);
  78706. }
  78707. return this;
  78708. }
  78709. }]);
  78710. return Animator;
  78711. }();
  78712. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Render.js
  78713. function Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  78714. 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); } }
  78715. 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; }
  78716. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  78717. * This program are made available under the terms of the Apache License, Version 2.0
  78718. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  78719. /**
  78720. * @private
  78721. * @class LevelRenderer.Render
  78722. * @category Visualization Theme
  78723. * @classdesc Render 接口类,对外可用的所有接口都在这里。内部使用非 get 接口统一返回 this 对象,支持链式调用。
  78724. * @param {string} id - 唯一标识。
  78725. * @param {HTMLElement} dom - Dom 对象。
  78726. */
  78727. var Render = /*#__PURE__*/function () {
  78728. function Render(id, dom) {
  78729. Render_classCallCheck(this, Render);
  78730. /**
  78731. * @member {string} LevelRenderer.Render.prototype.id
  78732. * @description 唯一标识。
  78733. */
  78734. this.id = id;
  78735. /**
  78736. * @member {LevelRenderer.Storage} LevelRenderer.Render.prototype.storage
  78737. * @description 图形仓库对象。
  78738. */
  78739. this.storage = new Storage();
  78740. /**
  78741. * @member {LevelRenderer.Painter} LevelRenderer.Render.prototype.painter
  78742. * @description 绘制器对象。
  78743. *
  78744. */
  78745. this.painter = new Painter(dom, this.storage);
  78746. /**
  78747. * @member {LevelRenderer.Handler} LevelRenderer.Render.prototype.handler
  78748. * @description 事件处理对象。
  78749. *
  78750. */
  78751. this.handler = new Handler(dom, this.storage, this.painter);
  78752. /**
  78753. * @member {Array} LevelRenderer.Render.prototype.animatingElements
  78754. * @description 动画控制数组。
  78755. *
  78756. */
  78757. this.animatingElements = [];
  78758. /**
  78759. * @member {LevelRenderer.animation.Animation} LevelRenderer.Render.prototype.animation
  78760. * @description 动画对象。
  78761. *
  78762. */
  78763. this.animation = new Animation({
  78764. stage: {
  78765. update: Render.getFrameCallback(this)
  78766. }
  78767. });
  78768. /**
  78769. * @member {boolean} LevelRenderer.Render.prototype._needsRefreshNextFrame
  78770. * @description 是否需要刷新下一帧。
  78771. *
  78772. */
  78773. this._needsRefreshNextFrame = false;
  78774. this.animation.start();
  78775. this.CLASS_NAME = "SuperMap.LevelRenderer.Render";
  78776. }
  78777. /**
  78778. * @function LevelRenderer.Render.prototype.destory
  78779. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  78780. */
  78781. Render_createClass(Render, [{
  78782. key: "destroy",
  78783. value: function destroy() {
  78784. this.id = null;
  78785. this.storage = null;
  78786. this.painter = null;
  78787. this.handler = null;
  78788. this.animatingElements = null;
  78789. this.animation = null;
  78790. this._needsRefreshNextFrame = null;
  78791. }
  78792. /**
  78793. * @function LevelRenderer.Render.prototype.getId
  78794. * @description 获取实例唯一标识。
  78795. * @return {string} 实例唯一标识。
  78796. */
  78797. }, {
  78798. key: "getId",
  78799. value: function getId() {
  78800. return this.id;
  78801. }
  78802. /**
  78803. * @function LevelRenderer.Render.prototype.addShape
  78804. * @description 添加图形形状到根节点。
  78805. *
  78806. * @param {LevelRenderer.Shape} shape - 图形对象,可用属性全集,详见各 shape。
  78807. * @return {LevelRenderer.Render} this。
  78808. */
  78809. }, {
  78810. key: "addShape",
  78811. value: function addShape(shape) {
  78812. this.storage.addRoot(shape);
  78813. return this;
  78814. }
  78815. /**
  78816. * @function LevelRenderer.Render.prototype.addGroup
  78817. * @description 添加组到根节点。
  78818. *
  78819. * (code)
  78820. * //添加组到根节点例子
  78821. * var render = new LevelRenderer.Render("Render",document.getElementById('lRendertest'));
  78822. * render.clear();
  78823. * var g = new LevelRenderer.Group();
  78824. * g.addChild(new LevelRenderer.Shape.Circle({
  78825. * style: {
  78826. * x: 100,
  78827. * y: 100,
  78828. * r: 20,
  78829. * brushType: 'fill'
  78830. * }
  78831. * }));
  78832. * render.addGroup(g);
  78833. * render.render();
  78834. * (end)
  78835. *
  78836. * @param {LevelRenderer.Group} group - 组对象。
  78837. * @return {LevelRenderer.Render} this。
  78838. */
  78839. }, {
  78840. key: "addGroup",
  78841. value: function addGroup(group) {
  78842. this.storage.addRoot(group);
  78843. return this;
  78844. }
  78845. /**
  78846. * @function LevelRenderer.Render.prototype.delShape
  78847. * @description 从根节点删除图形形状。
  78848. *
  78849. * @param {string} shapeId - 图形对象唯一标识。
  78850. * @return {LevelRenderer.Render} this。
  78851. */
  78852. }, {
  78853. key: "delShape",
  78854. value: function delShape(shapeId) {
  78855. this.storage.delRoot(shapeId);
  78856. return this;
  78857. }
  78858. /**
  78859. * @function LevelRenderer.Render.prototype.delGroup
  78860. * @description 从根节点删除组。
  78861. *
  78862. * @param {string} groupId - 组对象唯一标识。
  78863. * @return {LevelRenderer.Render} this。
  78864. */
  78865. }, {
  78866. key: "delGroup",
  78867. value: function delGroup(groupId) {
  78868. this.storage.delRoot(groupId);
  78869. return this;
  78870. }
  78871. /**
  78872. * @function LevelRenderer.Render.prototype.modShape
  78873. * @description 修改图形形状。
  78874. *
  78875. * @param {string} shapeId - 图形对象唯一标识。
  78876. * @param {LevelRenderer.Shape} shape - 图形对象。
  78877. * @return {LevelRenderer.Render} this。
  78878. */
  78879. }, {
  78880. key: "modShape",
  78881. value: function modShape(shapeId, shape) {
  78882. this.storage.mod(shapeId, shape);
  78883. return this;
  78884. }
  78885. /**
  78886. * @function LevelRenderer.Render.prototype.modGroup
  78887. * @description 修改组。
  78888. *
  78889. * @param {string} groupId - 组对象唯一标识。
  78890. * @param {LevelRenderer.Group} group - 组对象。
  78891. * @return {LevelRenderer.Render} this。
  78892. */
  78893. }, {
  78894. key: "modGroup",
  78895. value: function modGroup(groupId, group) {
  78896. this.storage.mod(groupId, group);
  78897. return this;
  78898. }
  78899. /**
  78900. * @function LevelRenderer.Render.prototype.modLayer
  78901. * @description 修改指定 zlevel 的绘制配置项。
  78902. *
  78903. * @param {string} zLevel - 组对象唯一标识。
  78904. * @param {Object} config - 配置对象。
  78905. * @param {string} clearColor - 每次清空画布的颜色。默认值:0。
  78906. * @param {noolean} motionBlur - 是否开启动态模糊。默认值:false。
  78907. * @param {number} lastFrameAlpha - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  78908. * @param {Array.<number>} position - 层的平移。
  78909. * @param {Array.<number>} rotation - 层的旋转。
  78910. * @param {Array.<number>} scale - 层的缩放。
  78911. * @param {boolean} zoomable - 层是否支持鼠标缩放操作。默认值:false。
  78912. * @param {boolean} panable - 层是否支持鼠标平移操作。默认值:false。
  78913. * @return {LevelRenderer.Render} this。
  78914. */
  78915. }, {
  78916. key: "modLayer",
  78917. value: function modLayer(zLevel, config) {
  78918. this.painter.modLayer(zLevel, config);
  78919. return this;
  78920. }
  78921. /**
  78922. * @function LevelRenderer.Render.prototype.addHoverShape
  78923. * @description 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空。
  78924. *
  78925. * @param {LevelRenderer.Shape} shape - 图形对象。
  78926. * @return {LevelRenderer.Render} this。
  78927. */
  78928. }, {
  78929. key: "addHoverShape",
  78930. value: function addHoverShape(shape) {
  78931. this.storage.addHover(shape);
  78932. return this;
  78933. }
  78934. /**
  78935. * @function LevelRenderer.Render.prototype.render
  78936. * @description 渲染。
  78937. *
  78938. * @callback {function} callback - 渲染结束后回调函数。
  78939. * @return {LevelRenderer.Render} this。
  78940. */
  78941. }, {
  78942. key: "render",
  78943. value: function render(callback) {
  78944. this.painter.render(callback);
  78945. this._needsRefreshNextFrame = false;
  78946. return this;
  78947. }
  78948. /**
  78949. * @function LevelRenderer.Render.prototype.refresh
  78950. * @description 视图更新。
  78951. *
  78952. * @callback {function} callback - 视图更新后回调函数。
  78953. * @return {LevelRenderer.Render} this。
  78954. */
  78955. }, {
  78956. key: "refresh",
  78957. value: function refresh(callback) {
  78958. this.painter.refresh(callback);
  78959. this._needsRefreshNextFrame = false;
  78960. return this;
  78961. }
  78962. /**
  78963. * @function LevelRenderer.Render.prototype.refreshNextFrame
  78964. * @description 标记视图在浏览器下一帧需要绘制。
  78965. * @return {LevelRenderer.Render} this。
  78966. */
  78967. }, {
  78968. key: "refreshNextFrame",
  78969. value: function refreshNextFrame() {
  78970. this._needsRefreshNextFrame = true;
  78971. return this;
  78972. }
  78973. /**
  78974. * @function LevelRenderer.Render.prototype.refreshHover
  78975. * @description 绘制(视图更新)高亮层。
  78976. * @callback {function} callback - 视图更新后回调函数。
  78977. * @return {LevelRenderer.Render} this。
  78978. */
  78979. }, {
  78980. key: "refreshHover",
  78981. value: function refreshHover(callback) {
  78982. this.painter.refreshHover(callback);
  78983. return this;
  78984. }
  78985. /**
  78986. * @function LevelRenderer.Render.prototype.refreshShapes
  78987. * @description 视图更新。
  78988. *
  78989. * @param {Array.<LevelRenderer.Shape>} shapeList - 需要更新的图形列表。
  78990. * @callback {function} callback - 视图更新后回调函数。
  78991. * @return {LevelRenderer.Render} this。
  78992. */
  78993. }, {
  78994. key: "refreshShapes",
  78995. value: function refreshShapes(shapeList, callback) {
  78996. this.painter.refreshShapes(shapeList, callback);
  78997. return this;
  78998. }
  78999. /**
  79000. * @function LevelRenderer.Render.prototype.resize
  79001. * @description 调整视图大小。
  79002. * @return {LevelRenderer.Render} this。
  79003. */
  79004. }, {
  79005. key: "resize",
  79006. value: function resize() {
  79007. this.painter.resize();
  79008. return this;
  79009. }
  79010. /**
  79011. * @function LevelRenderer.Render.prototype.animate
  79012. * @description 动画。
  79013. *
  79014. * @example
  79015. * zr.animate(circle.id, 'style', false)
  79016. * .when(1000, {x: 10} )
  79017. * .done(function(){ // Animation done })
  79018. * .start()
  79019. *
  79020. *
  79021. * @param {Array.<(LevelRenderer.Shape/LevelRenderer.Group)>} el - 动画对象。
  79022. * @param {string} path - 需要添加动画的属性获取路径,可以通过 a.b.c 来获取深层的属性。若传入对象为<LevelRenderer.Group>,path需为空字符串。
  79023. * @param {function} loop - 动画是否循环。
  79024. * @return {LevelRenderer.animation.Animator} Animator。
  79025. */
  79026. }, {
  79027. key: "animate",
  79028. value: function animate(el, path, loop) {
  79029. if (typeof el === 'string') {
  79030. el = this.storage.get(el);
  79031. }
  79032. if (el) {
  79033. var target;
  79034. if (path) {
  79035. var pathSplitted = path.split('.');
  79036. var prop = el;
  79037. for (var i = 0, l = pathSplitted.length; i < l; i++) {
  79038. if (!prop) {
  79039. continue;
  79040. }
  79041. prop = prop[pathSplitted[i]];
  79042. }
  79043. if (prop) {
  79044. target = prop;
  79045. }
  79046. } else {
  79047. target = el;
  79048. }
  79049. if (!target) {
  79050. SUtil_SUtil.Util_log('Property "' + path + '" is not existed in element ' + el.id);
  79051. return;
  79052. }
  79053. var animatingElements = this.animatingElements;
  79054. if (typeof el.__aniCount === 'undefined') {
  79055. // 正在进行的动画记数
  79056. el.__aniCount = 0;
  79057. }
  79058. if (el.__aniCount === 0) {
  79059. animatingElements.push(el);
  79060. }
  79061. el.__aniCount++;
  79062. return this.animation.animate(target, {
  79063. loop: loop
  79064. }).done(function () {
  79065. el.__aniCount--;
  79066. if (el.__aniCount === 0) {
  79067. // 从animatingElements里移除
  79068. var idx = new levelRenderer_Util_Util().indexOf(animatingElements, el);
  79069. animatingElements.splice(idx, 1);
  79070. }
  79071. });
  79072. } else {
  79073. SUtil_SUtil.Util_log('Element not existed');
  79074. }
  79075. }
  79076. /**
  79077. * @function LevelRenderer.Render.prototype.clearAnimation
  79078. * @description 停止所有动画。
  79079. *
  79080. */
  79081. }, {
  79082. key: "clearAnimation",
  79083. value: function clearAnimation() {
  79084. this.animation.clear();
  79085. }
  79086. /**
  79087. * @function LevelRenderer.Render.prototype.getWidth
  79088. * @description 获取视图宽度。
  79089. * @return {number} 视图宽度。
  79090. */
  79091. }, {
  79092. key: "getWidth",
  79093. value: function getWidth() {
  79094. return this.painter.getWidth();
  79095. }
  79096. /**
  79097. * @function LevelRenderer.Render.prototype.getHeight
  79098. * @description 获取视图高度。
  79099. * @return {number} 视图高度。
  79100. */
  79101. }, {
  79102. key: "getHeight",
  79103. value: function getHeight() {
  79104. return this.painter.getHeight();
  79105. }
  79106. /**
  79107. * @function LevelRenderer.Render.prototype.toDataURL
  79108. * @description 图像导出。
  79109. *
  79110. * @param {string} type - 类型。
  79111. * @param {string} backgroundColor - 背景色,默认值:"#FFFFFF"。
  79112. * @param {string} args - 参数。
  79113. * @return {string} 图片的 Base64 url。
  79114. */
  79115. }, {
  79116. key: "toDataURL",
  79117. value: function toDataURL(type, backgroundColor, args) {
  79118. return this.painter.toDataURL(type, backgroundColor, args);
  79119. }
  79120. /**
  79121. * @function LevelRenderer.Render.prototype.shapeToImage
  79122. * @description 将常规 shape 转成 image shape。
  79123. *
  79124. * @param {LevelRenderer.Shape} e - 图形。
  79125. * @param {number} width - 宽度。
  79126. * @param {number} height - 高度。
  79127. * @return {Object} image shape。
  79128. */
  79129. }, {
  79130. key: "shapeToImage",
  79131. value: function shapeToImage(e, width, height) {
  79132. var id = Util_Util.createUniqueID("SuperMap.LevelRenderer.ToImage_");
  79133. return this.painter.shapeToImage(id, e, width, height);
  79134. }
  79135. /**
  79136. * @function LevelRenderer.Render.prototype.on
  79137. * @description 事件绑定。
  79138. *
  79139. * @param {string} eventName - 事件名称。
  79140. * @param {function} eventHandler - 响应函数。
  79141. * @return {LevelRenderer.Render} this。
  79142. */
  79143. }, {
  79144. key: "on",
  79145. value: function on(eventName, eventHandler) {
  79146. this.handler.on(eventName, eventHandler);
  79147. return this;
  79148. }
  79149. /**
  79150. * @function LevelRenderer.Render.prototype.un
  79151. * @description 事件解绑定,参数为空则解绑所有自定义事件。
  79152. *
  79153. * @param {string} eventName - 事件名称。
  79154. * @param {function} eventHandler - 响应函数。
  79155. * @return {LevelRenderer.Render} this。
  79156. */
  79157. }, {
  79158. key: "un",
  79159. value: function un(eventName, eventHandler) {
  79160. this.handler.un(eventName, eventHandler);
  79161. return this;
  79162. }
  79163. /**
  79164. * @function LevelRenderer.Render.prototype.trigger
  79165. * @description 事件触发。
  79166. *
  79167. * @param {string} eventName - 事件名称,resize,hover,drag,etc。
  79168. * @param {event} event - event dom事件对象。
  79169. * @return {LevelRenderer.Render} this。
  79170. */
  79171. }, {
  79172. key: "trigger",
  79173. value: function trigger(eventName, event) {
  79174. this.handler.trigger(eventName, event);
  79175. this.handler.dispatch(eventName, event);
  79176. return this;
  79177. }
  79178. /**
  79179. * @function LevelRenderer.Render.prototype.clear
  79180. * @description 清除当前 Render 下所有类图的数据和显示,clear 后 MVC 和已绑定事件均还存在在,Render 可用。
  79181. * @return {LevelRenderer.Render} this。
  79182. */
  79183. }, {
  79184. key: "clear",
  79185. value: function clear() {
  79186. this.storage.delRoot();
  79187. this.painter.clear();
  79188. return this;
  79189. }
  79190. /**
  79191. * @function LevelRenderer.Render.prototype.dispose
  79192. * @description 释放当前 Render 实例(删除包括 dom,数据、显示和事件绑定),dispose后 Render 不可用。
  79193. */
  79194. }, {
  79195. key: "dispose",
  79196. value: function dispose() {
  79197. this.animation.stop();
  79198. this.clear();
  79199. this.storage.dispose();
  79200. this.painter.dispose();
  79201. this.handler.dispose();
  79202. this.animation = null;
  79203. this.animatingElements = null;
  79204. this.storage = null;
  79205. this.painter = null;
  79206. this.handler = null;
  79207. // 释放后告诉全局删除对自己的索引,没想到啥好方法
  79208. // zrender.delInstance(this.id);
  79209. }
  79210. // SMIC-方法扩展 - start
  79211. /**
  79212. * @function LevelRenderer.Render.prototype.updateHoverShapes
  79213. * @description 更新设置显示高亮图层。
  79214. *
  79215. * @param {Array.<LevelRenderer.Shape>} shapes - 图形数组。
  79216. * @return {LevelRenderer.Render} this。
  79217. */
  79218. }, {
  79219. key: "updateHoverShapes",
  79220. value: function updateHoverShapes(shapes) {
  79221. this.painter.updateHoverLayer(shapes);
  79222. return this;
  79223. }
  79224. /**
  79225. * @function LevelRenderer.Render.prototype.getAllShapes
  79226. * @description 获取所有图形。
  79227. * @return {Array.<LevelRenderer.Shape>} 图形数组。
  79228. */
  79229. }, {
  79230. key: "getAllShapes",
  79231. value: function getAllShapes() {
  79232. return this.storage._shapeList;
  79233. }
  79234. /**
  79235. * @function LevelRenderer.Render.prototype.clearAll
  79236. * @description 清除高亮和图形图层。
  79237. * @return {LevelRenderer.Render} this。
  79238. */
  79239. }, {
  79240. key: "clearAll",
  79241. value: function clearAll() {
  79242. this.clear();
  79243. this.painter.clearHover();
  79244. return this;
  79245. }
  79246. /**
  79247. * @function LevelRenderer.Render.prototype.getHoverOne
  79248. * @description 获取单个高亮图形,当前鼠标对应。
  79249. * @return {LevelRenderer.Shape} 高亮图形。
  79250. */
  79251. }, {
  79252. key: "getHoverOne",
  79253. value: function getHoverOne() {
  79254. return this.handler.getLastHoverOne();
  79255. }
  79256. }], [{
  79257. key: "getFrameCallback",
  79258. value: function getFrameCallback(renderInstance) {
  79259. return function () {
  79260. var animatingElements = renderInstance.animatingElements;
  79261. //animatingElements instanceof Array 临时解决 destory 报错
  79262. if (animatingElements instanceof Array) {
  79263. for (var i = 0, l = animatingElements.length; i < l; i++) {
  79264. renderInstance.storage.mod(animatingElements[i].id);
  79265. }
  79266. if (animatingElements.length || renderInstance._needsRefreshNextFrame) {
  79267. renderInstance.refresh();
  79268. }
  79269. }
  79270. };
  79271. }
  79272. // SMIC-方法扩展 - end
  79273. }]);
  79274. return Render;
  79275. }();
  79276. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/LevelRenderer.js
  79277. function LevelRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79278. 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); } }
  79279. 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; }
  79280. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79281. * This program are made available under the terms of the Apache License, Version 2.0
  79282. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79283. /**
  79284. * @class LevelRenderer
  79285. * @deprecatedclass SuperMap.LevelRenderer
  79286. * @category Visualization Theme
  79287. * @classdesc LevelRenderer 渲染器
  79288. * @example
  79289. * //在渲染器上加上图形
  79290. * var levelRenderer = new LevelRenderer();
  79291. * var zr = levelRenderer.init(document.getElementById('lRendertest'));
  79292. * zr.clear();
  79293. * zr.addShape(new LevelRenderer.Shape.Circle({
  79294. * style:{
  79295. * x : 100,
  79296. * y : 100,
  79297. * r : 50,
  79298. * brushType: 'fill'
  79299. * }
  79300. * }));
  79301. * zr.render();
  79302. * @private
  79303. */
  79304. var LevelRenderer = /*#__PURE__*/function () {
  79305. function LevelRenderer() {
  79306. LevelRenderer_classCallCheck(this, LevelRenderer);
  79307. /**
  79308. * @member {Object} LevelRenderer.prototype._instances
  79309. * @description LevelRenderer 实例 map 索引
  79310. */
  79311. LevelRenderer._instances = {};
  79312. // 工具
  79313. LevelRenderer.Tool = {};
  79314. /**
  79315. * @member {string} LevelRenderer.prototype.version
  79316. * @description 版本。zRender(Baidu)的版本号
  79317. * 记录当前 LevelRenderer 是在 zRender 的那个版本上构建而来。
  79318. * 在每次完整评判和实施由 zRender(Baidu)升级带来的 LevelRenderer 升级后修改。
  79319. */
  79320. this.version = '2.0.4';
  79321. this.CLASS_NAME = "SuperMap.LevelRenderer";
  79322. }
  79323. /**
  79324. * @function LevelRenderer.prototype.destroy
  79325. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  79326. */
  79327. LevelRenderer_createClass(LevelRenderer, [{
  79328. key: "destroy",
  79329. value: function destroy() {
  79330. this.dispose();
  79331. this.version = null;
  79332. }
  79333. /**
  79334. * @function LevelRenderer.prototype.init
  79335. * @description 创建 LevelRenderer 实例。
  79336. * @param {HTMLElement} dom - 绘图容器。
  79337. * @returns {LevelRenderer} LevelRenderer 实例。
  79338. */
  79339. }, {
  79340. key: "init",
  79341. value: function init(dom) {
  79342. var zr = new Render(Util_Util.createUniqueID("LRenderer_"), dom);
  79343. LevelRenderer._instances[zr.id] = zr;
  79344. return zr;
  79345. }
  79346. /**
  79347. * @function LevelRenderer.prototype.dispose
  79348. * @description LevelRenderer 实例销毁。
  79349. * 可以通过 zrender.dispose(zr) 销毁指定 LevelRenderer.Render 实例。
  79350. * 也可以通过 zr.dispose() 直接销毁
  79351. * @param {LevelRenderer.Render} zr - ZRender对象,不传此参数则销毁全部。
  79352. * @returns {LevelRenderer} this。
  79353. */
  79354. }, {
  79355. key: "dispose",
  79356. value: function dispose(zr) {
  79357. if (zr) {
  79358. zr.dispose();
  79359. this.delInstance(zr.id);
  79360. } else {
  79361. for (var key in LevelRenderer._instances) {
  79362. LevelRenderer._instances[key].dispose();
  79363. }
  79364. LevelRenderer._instances = {};
  79365. }
  79366. return this;
  79367. }
  79368. /**
  79369. * @function LevelRenderer.prototype.getInstance
  79370. * @description 获取 LevelRenderer.Render 实例。
  79371. * @param {string} id - ZRender对象索引。
  79372. * @returns {LevelRenderer.Render} LevelRenderer.Render 实例。
  79373. */
  79374. }, {
  79375. key: "getInstance",
  79376. value: function getInstance(id) {
  79377. return LevelRenderer._instances[id];
  79378. }
  79379. /**
  79380. * @function LevelRenderer.prototype.delInstance
  79381. * @description 删除 zrender 实例,LevelRenderer.Render 实例 dispose 时会调用,删除后 getInstance 则返回 undefined
  79382. * @param {string} id - ZRender对象索引。
  79383. * @param {string} id - LevelRenderer.Render 对象索引。
  79384. * @returns {LevelRenderer} this。
  79385. */
  79386. }, {
  79387. key: "delInstance",
  79388. value: function delInstance(id) {
  79389. delete LevelRenderer._instances[id];
  79390. return this;
  79391. }
  79392. }]);
  79393. return LevelRenderer;
  79394. }();
  79395. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicEllipse.js
  79396. 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); }
  79397. function SmicEllipse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79398. 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); } }
  79399. 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; }
  79400. 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); }
  79401. function SmicEllipse_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicEllipse_getPrototypeOf(object); if (object === null) break; } return object; }
  79402. 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); }
  79403. 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); }
  79404. 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); }; }
  79405. 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); }
  79406. function SmicEllipse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79407. 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; } }
  79408. function SmicEllipse_getPrototypeOf(o) { SmicEllipse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicEllipse_getPrototypeOf(o); }
  79409. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79410. * This program are made available under the terms of the Apache License, Version 2.0
  79411. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79412. /**
  79413. * @private
  79414. * @class LevelRenderer.Shape.SmicEllipse
  79415. * @category Visualization Theme
  79416. * @classdesc 椭圆。
  79417. * @extends LevelRenderer.Shape
  79418. * @example
  79419. * var shape = new LevelRenderer.Shape.SmicEllipse({
  79420. * style: {
  79421. * x: 100,
  79422. * y: 100,
  79423. * a: 40,
  79424. * b: 20,
  79425. * brushType: 'both',
  79426. * color: 'blue',
  79427. * strokeColor: 'red',
  79428. * lineWidth: 3,
  79429. * text: 'SmicEllipse'
  79430. * }
  79431. * });
  79432. * levelRenderer.addShape(shape);
  79433. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  79434. *
  79435. */
  79436. var SmicEllipse = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  79437. SmicEllipse_inherits(SmicEllipse, _Shape);
  79438. var _super = SmicEllipse_createSuper(SmicEllipse);
  79439. function SmicEllipse(options) {
  79440. var _this;
  79441. SmicEllipse_classCallCheck(this, SmicEllipse);
  79442. _this = _super.call(this, options);
  79443. /**
  79444. * @member {string} LevelRenderer.Shape.SmicEllipse.prototype.type
  79445. * @description 图形类型。
  79446. */
  79447. _this.type = 'smicellipse';
  79448. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  79449. _this.refOriginalPosition = [0, 0];
  79450. }
  79451. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicEllipse";
  79452. return _this;
  79453. }
  79454. /**
  79455. * @function LevelRenderer.Shape.SmicEllipse.prototype.destroy
  79456. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79457. */
  79458. SmicEllipse_createClass(SmicEllipse, [{
  79459. key: "destroy",
  79460. value: function destroy() {
  79461. this.type = null;
  79462. SmicEllipse_get(SmicEllipse_getPrototypeOf(SmicEllipse.prototype), "destroy", this).call(this);
  79463. }
  79464. /**
  79465. * @function LevelRenderer.Shape.SmicEllipse.prototype.buildPath
  79466. * @description 构建椭圆的 Path。
  79467. *
  79468. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79469. * @param {Object} style - style。
  79470. *
  79471. */
  79472. }, {
  79473. key: "buildPath",
  79474. value: function buildPath(ctx, style) {
  79475. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79476. this.refOriginalPosition = [0, 0];
  79477. }
  79478. var __OP = this.refOriginalPosition;
  79479. var k = 0.5522848;
  79480. var x = style.x + __OP[0];
  79481. var y = style.y + __OP[1];
  79482. var a = style.a;
  79483. var b = style.b;
  79484. var ox = a * k; // 水平控制点偏移量
  79485. var oy = b * k; // 垂直控制点偏移量
  79486. // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线
  79487. ctx.moveTo(x - a, y);
  79488. ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);
  79489. ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);
  79490. ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);
  79491. ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);
  79492. ctx.closePath();
  79493. }
  79494. /**
  79495. * @function LevelRenderer.Shape.SmicEllipse.prototype.getRect
  79496. * @description 计算返回椭圆包围盒矩形
  79497. *
  79498. * @param {Object} style - style
  79499. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79500. *
  79501. */
  79502. }, {
  79503. key: "getRect",
  79504. value: function getRect(style) {
  79505. if (style.__rect) {
  79506. return style.__rect;
  79507. }
  79508. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79509. this.refOriginalPosition = [0, 0];
  79510. }
  79511. var __OP = this.refOriginalPosition;
  79512. var lineWidth;
  79513. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  79514. lineWidth = style.lineWidth || 1;
  79515. } else {
  79516. lineWidth = 0;
  79517. }
  79518. style.__rect = {
  79519. x: Math.round(style.x + __OP[0] - style.a - lineWidth / 2),
  79520. y: Math.round(style.x + __OP[1] - style.b - lineWidth / 2),
  79521. width: style.a * 2 + lineWidth,
  79522. height: style.b * 2 + lineWidth
  79523. };
  79524. return style.__rect;
  79525. }
  79526. }]);
  79527. return SmicEllipse;
  79528. }(Shape)));
  79529. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicIsogon.js
  79530. 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); }
  79531. function SmicIsogon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79532. 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); } }
  79533. 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; }
  79534. 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); }
  79535. function SmicIsogon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicIsogon_getPrototypeOf(object); if (object === null) break; } return object; }
  79536. 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); }
  79537. 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); }
  79538. 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); }; }
  79539. 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); }
  79540. function SmicIsogon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79541. 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; } }
  79542. function SmicIsogon_getPrototypeOf(o) { SmicIsogon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicIsogon_getPrototypeOf(o); }
  79543. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79544. * This program are made available under the terms of the Apache License, Version 2.0
  79545. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79546. /**
  79547. * @private
  79548. * @class LevelRenderer.Shape.SmicIsogon
  79549. * @category Visualization Theme
  79550. * @classdesc 正多边形。
  79551. * @extends LevelRenderer.Shape
  79552. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  79553. */
  79554. var SmicIsogon = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  79555. SmicIsogon_inherits(SmicIsogon, _Shape);
  79556. var _super = SmicIsogon_createSuper(SmicIsogon);
  79557. function SmicIsogon(options) {
  79558. var _this;
  79559. SmicIsogon_classCallCheck(this, SmicIsogon);
  79560. _this = _super.call(this, options);
  79561. /**
  79562. * @member {string} LevelRenderer.Shape.SmicIsogon.prototype.type
  79563. * @description 图形类型。
  79564. */
  79565. _this.type = 'smicisogon';
  79566. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  79567. _this.refOriginalPosition = [0, 0];
  79568. }
  79569. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicIsogon";
  79570. return _this;
  79571. }
  79572. /**
  79573. * @function LevelRenderer.Shape.SmicIsogon.prototype.destroy
  79574. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79575. */
  79576. SmicIsogon_createClass(SmicIsogon, [{
  79577. key: "destroy",
  79578. value: function destroy() {
  79579. this.type = null;
  79580. SmicIsogon_get(SmicIsogon_getPrototypeOf(SmicIsogon.prototype), "destroy", this).call(this);
  79581. }
  79582. /**
  79583. * @function LevelRenderer.Shape.SmicIsogon.prototype.buildPath
  79584. * @description 创建n角星(n>=3)路径。
  79585. *
  79586. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79587. * @param {Object} style - style。
  79588. *
  79589. */
  79590. }, {
  79591. key: "buildPath",
  79592. value: function buildPath(ctx, style) {
  79593. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79594. this.refOriginalPosition = [0, 0];
  79595. }
  79596. var __OP = this.refOriginalPosition;
  79597. var sin = SUtil.Util_math.sin;
  79598. var cos = SUtil.Util_math.cos;
  79599. var PI = Math.PI;
  79600. var n = style.n;
  79601. if (!n || n < 2) {
  79602. return;
  79603. }
  79604. var x = style.x + __OP[0];
  79605. var y = style.y + __OP[1];
  79606. var r = style.r;
  79607. var dStep = 2 * PI / n;
  79608. var deg = -PI / 2;
  79609. var xStart = x + r * cos(deg);
  79610. var yStart = y + r * sin(deg);
  79611. deg += dStep;
  79612. // 记录边界点,用于判断insight
  79613. var pointList = style.pointList = [];
  79614. pointList.push([xStart, yStart]);
  79615. for (var i = 0, end = n - 1; i < end; i++) {
  79616. pointList.push([x + r * cos(deg), y + r * sin(deg)]);
  79617. deg += dStep;
  79618. }
  79619. pointList.push([xStart, yStart]);
  79620. // 绘制
  79621. ctx.moveTo(pointList[0][0], pointList[0][1]);
  79622. for (var _i2 = 0; _i2 < pointList.length; _i2++) {
  79623. ctx.lineTo(pointList[_i2][0], pointList[_i2][1]);
  79624. }
  79625. ctx.closePath();
  79626. return;
  79627. }
  79628. /**
  79629. * @function LevelRenderer.Shape.SmicIsogon.prototype.getRect
  79630. * @description 计算返回正多边形的包围盒矩形。
  79631. *
  79632. * @param {Object} style - style
  79633. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79634. */
  79635. }, {
  79636. key: "getRect",
  79637. value: function getRect(style) {
  79638. if (style.__rect) {
  79639. return style.__rect;
  79640. }
  79641. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79642. this.refOriginalPosition = [0, 0];
  79643. }
  79644. var __OP = this.refOriginalPosition;
  79645. var lineWidth;
  79646. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  79647. lineWidth = style.lineWidth || 1;
  79648. } else {
  79649. lineWidth = 0;
  79650. }
  79651. style.__rect = {
  79652. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  79653. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  79654. width: style.r * 2 + lineWidth,
  79655. height: style.r * 2 + lineWidth
  79656. };
  79657. return style.__rect;
  79658. }
  79659. }]);
  79660. return SmicIsogon;
  79661. }(Shape)));
  79662. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRing.js
  79663. 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); }
  79664. function SmicRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79665. 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); } }
  79666. 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; }
  79667. 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); }
  79668. function SmicRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRing_getPrototypeOf(object); if (object === null) break; } return object; }
  79669. 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); }
  79670. 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); }
  79671. 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); }; }
  79672. 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); }
  79673. function SmicRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79674. 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; } }
  79675. function SmicRing_getPrototypeOf(o) { SmicRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRing_getPrototypeOf(o); }
  79676. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79677. * This program are made available under the terms of the Apache License, Version 2.0
  79678. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79679. /**
  79680. * @private
  79681. * @class LevelRenderer.Shape.SmicRing
  79682. * @category Visualization Theme
  79683. * @classdesc 圆环。
  79684. * @extends LevelRenderer.Shape
  79685. * @example
  79686. * var shape = new LevelRenderer.Shape.SmicRing({
  79687. * style: {
  79688. * x: 100,
  79689. * y: 100,
  79690. * r0: 30,
  79691. * r: 50
  79692. * }
  79693. * });
  79694. * levelRenderer.addShape(shape);
  79695. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  79696. */
  79697. var SmicRing = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  79698. SmicRing_inherits(SmicRing, _Shape);
  79699. var _super = SmicRing_createSuper(SmicRing);
  79700. function SmicRing(options) {
  79701. var _this;
  79702. SmicRing_classCallCheck(this, SmicRing);
  79703. _this = _super.call(this, options);
  79704. /**
  79705. * @member {string} LevelRenderer.Shape.SmicRing.prototype.type
  79706. * @description 图形类型。
  79707. */
  79708. _this.type = 'smicring';
  79709. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  79710. _this.refOriginalPosition = [0, 0];
  79711. }
  79712. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRing";
  79713. return _this;
  79714. }
  79715. /**
  79716. * @function LevelRenderer.Shape.SmicRing.prototype.destroy
  79717. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79718. */
  79719. SmicRing_createClass(SmicRing, [{
  79720. key: "destroy",
  79721. value: function destroy() {
  79722. this.type = null;
  79723. SmicRing_get(SmicRing_getPrototypeOf(SmicRing.prototype), "destroy", this).call(this);
  79724. }
  79725. /**
  79726. * @function LevelRenderer.Shape.SmicRing.prototype.buildPath
  79727. * @description 创建圆环路径。
  79728. *
  79729. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79730. * @param {Object} style - style。
  79731. *
  79732. */
  79733. }, {
  79734. key: "buildPath",
  79735. value: function buildPath(ctx, style) {
  79736. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79737. this.refOriginalPosition = [0, 0];
  79738. }
  79739. var __OP = this.refOriginalPosition;
  79740. // 非零环绕填充优化
  79741. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, false);
  79742. ctx.moveTo(style.x + __OP[0] + style.r0, style.y + __OP[1]);
  79743. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r0, 0, Math.PI * 2, true);
  79744. return;
  79745. }
  79746. /**
  79747. * @function LevelRenderer.Shape.SmicRing.prototype.getRect
  79748. * @description 计算返回圆环包围盒矩阵
  79749. *
  79750. * @param {Object} style - style
  79751. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79752. */
  79753. }, {
  79754. key: "getRect",
  79755. value: function getRect(style) {
  79756. if (style.__rect) {
  79757. return style.__rect;
  79758. }
  79759. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79760. this.refOriginalPosition = [0, 0];
  79761. }
  79762. var __OP = this.refOriginalPosition;
  79763. var lineWidth;
  79764. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  79765. lineWidth = style.lineWidth || 1;
  79766. } else {
  79767. lineWidth = 0;
  79768. }
  79769. style.__rect = {
  79770. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  79771. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  79772. width: style.r * 2 + lineWidth,
  79773. height: style.r * 2 + lineWidth
  79774. };
  79775. return style.__rect;
  79776. }
  79777. }]);
  79778. return SmicRing;
  79779. }(Shape)));
  79780. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicStar.js
  79781. 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); }
  79782. function SmicStar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  79783. 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); } }
  79784. 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; }
  79785. 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); }
  79786. function SmicStar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicStar_getPrototypeOf(object); if (object === null) break; } return object; }
  79787. 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); }
  79788. 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); }
  79789. 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); }; }
  79790. 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); }
  79791. function SmicStar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  79792. 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; } }
  79793. function SmicStar_getPrototypeOf(o) { SmicStar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicStar_getPrototypeOf(o); }
  79794. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79795. * This program are made available under the terms of the Apache License, Version 2.0
  79796. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79797. /**
  79798. * @private
  79799. * @class LevelRenderer.Shape.SmicStar
  79800. * @category Visualization Theme
  79801. * @classdesc n 角星(n>3)。
  79802. * @extends LevelRenderer.Shape
  79803. * @example
  79804. * var shape = new LevelRenderer.Shape.SmicStar({
  79805. * style: {
  79806. * x: 200,
  79807. * y: 100,
  79808. * r: 150,
  79809. * n: 5,
  79810. * text: '五角星'
  79811. * }
  79812. * });
  79813. * levelRenderer.addShape(shape);
  79814. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  79815. *
  79816. */
  79817. var SmicStar = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  79818. SmicStar_inherits(SmicStar, _Shape);
  79819. var _super = SmicStar_createSuper(SmicStar);
  79820. function SmicStar(options) {
  79821. var _this;
  79822. SmicStar_classCallCheck(this, SmicStar);
  79823. _this = _super.call(this, options);
  79824. /**
  79825. * @member {string} LevelRenderer.Shape.SmicStar.prototype.type
  79826. * @description 图形类型。
  79827. */
  79828. _this.type = 'smicstar';
  79829. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  79830. _this.refOriginalPosition = [0, 0];
  79831. }
  79832. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicStar";
  79833. return _this;
  79834. }
  79835. /**
  79836. * @function LevelRenderer.Shape.SmicStar.prototype.destroy
  79837. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  79838. */
  79839. SmicStar_createClass(SmicStar, [{
  79840. key: "destroy",
  79841. value: function destroy() {
  79842. this.type = null;
  79843. SmicStar_get(SmicStar_getPrototypeOf(SmicStar.prototype), "destroy", this).call(this);
  79844. }
  79845. /**
  79846. * @function LevelRenderer.Shape.SmicStar.prototype.buildPath
  79847. * @description 创建n 角星(n>3)路径。
  79848. *
  79849. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  79850. * @param {Object} style - style。
  79851. *
  79852. */
  79853. }, {
  79854. key: "buildPath",
  79855. value: function buildPath(ctx, style) {
  79856. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79857. this.refOriginalPosition = [0, 0];
  79858. }
  79859. var __OP = this.refOriginalPosition;
  79860. var n = style.n;
  79861. if (!n || n < 2) {
  79862. return;
  79863. }
  79864. var sin = SUtil.Util_math.sin;
  79865. var cos = SUtil.Util_math.cos;
  79866. var PI = Math.PI;
  79867. var x = style.x + __OP[0];
  79868. var y = style.y + __OP[1];
  79869. var r = style.r;
  79870. var r0 = style.r0;
  79871. // 如果未指定内部顶点外接圆半径,则自动计算
  79872. if (r0 == null) {
  79873. r0 = n > 4
  79874. // 相隔的外部顶点的连线的交点,
  79875. // 被取为内部交点,以此计算r0
  79876. ? r * cos(2 * PI / n) / cos(PI / n)
  79877. // 二三四角星的特殊处理
  79878. : r / 3;
  79879. }
  79880. var dStep = PI / n;
  79881. var deg = -PI / 2;
  79882. var xStart = x + r * cos(deg);
  79883. var yStart = y + r * sin(deg);
  79884. deg += dStep;
  79885. // 记录边界点,用于判断inside
  79886. var pointList = style.pointList = [];
  79887. pointList.push([xStart, yStart]);
  79888. for (var i = 0, end = n * 2 - 1, ri; i < end; i++) {
  79889. ri = i % 2 === 0 ? r0 : r;
  79890. pointList.push([x + ri * cos(deg), y + ri * sin(deg)]);
  79891. deg += dStep;
  79892. }
  79893. pointList.push([xStart, yStart]);
  79894. // 绘制
  79895. ctx.moveTo(pointList[0][0], pointList[0][1]);
  79896. for (var _i2 = 0; _i2 < pointList.length; _i2++) {
  79897. ctx.lineTo(pointList[_i2][0], pointList[_i2][1]);
  79898. }
  79899. ctx.closePath();
  79900. return;
  79901. }
  79902. /**
  79903. * @function LevelRenderer.Shape.SmicStar.prototype.getRect
  79904. * @description 返回 n 角星包围盒矩形。
  79905. *
  79906. * @param {Object} style - style
  79907. * @return {Object} 边框对象。包含属性:x,y,width,height。
  79908. */
  79909. }, {
  79910. key: "getRect",
  79911. value: function getRect(style) {
  79912. if (style.__rect) {
  79913. return style.__rect;
  79914. }
  79915. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  79916. this.refOriginalPosition = [0, 0];
  79917. }
  79918. var __OP = this.refOriginalPosition;
  79919. var lineWidth;
  79920. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  79921. lineWidth = style.lineWidth || 1;
  79922. } else {
  79923. lineWidth = 0;
  79924. }
  79925. style.__rect = {
  79926. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  79927. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  79928. width: style.r * 2 + lineWidth,
  79929. height: style.r * 2 + lineWidth
  79930. };
  79931. return style.__rect;
  79932. }
  79933. }]);
  79934. return SmicStar;
  79935. }(Shape)));
  79936. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/index.js
  79937. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79938. * This program are made available under the terms of the Apache License, Version 2.0
  79939. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79940. ;// CONCATENATED MODULE: ./src/common/overlay/threejs/Transform.js
  79941. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  79942. * This program are made available under the terms of the Apache License, Version 2.0
  79943. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79944. function wrap(source, min, max) {
  79945. if (source === max || source === min) {
  79946. return source;
  79947. }
  79948. var len = max - min;
  79949. return ((source - min) % len + len) % len + min;
  79950. }
  79951. function rad(angle) {
  79952. return angle * Math.PI / 180;
  79953. }
  79954. var Projection = {
  79955. R: 6378137,
  79956. minZoom: 0,
  79957. maxZoom: 22,
  79958. nativeMaxZoom: 19,
  79959. RAD: Math.PI / 180,
  79960. METERS_PER_DEGREE: 6378137 * Math.PI / 180,
  79961. MAX_LATITUDE: 85.0511287798,
  79962. project: function project(lngLat) {
  79963. var rad = this.RAD,
  79964. metersPerDegree = this.METERS_PER_DEGREE,
  79965. max = this.MAX_LATITUDE;
  79966. var ll = lngLat instanceof Array ? {
  79967. lng: lngLat[0],
  79968. lat: lngLat[1]
  79969. } : {
  79970. lng: lngLat.lng,
  79971. lat: lngLat.lat
  79972. };
  79973. var lng = ll.lng,
  79974. lat = Math.max(Math.min(max, ll.lat), -max);
  79975. var c;
  79976. if (lat === 0) {
  79977. c = 0;
  79978. } else {
  79979. c = Math.log(Math.tan((90 + lat) * rad / 2)) / rad;
  79980. }
  79981. return {
  79982. x: lng * metersPerDegree,
  79983. y: c * metersPerDegree
  79984. };
  79985. },
  79986. unproject: function unproject(point) {
  79987. var x = point.x,
  79988. y = point.y;
  79989. var rad = this.RAD,
  79990. metersPerDegree = this.METERS_PER_DEGREE;
  79991. var c;
  79992. if (y === 0) {
  79993. c = 0;
  79994. } else {
  79995. c = y / metersPerDegree;
  79996. c = (2 * Math.atan(Math.exp(c * rad)) - Math.PI / 2) / rad;
  79997. }
  79998. return {
  79999. lng: wrap(x / metersPerDegree, -180, 180),
  80000. lat: wrap(c, -this.MAX_LATITUDE, this.MAX_LATITUDE)
  80001. };
  80002. },
  80003. locate: function locate(lngLat, dx, dy) {
  80004. if (!lngLat) {
  80005. return null;
  80006. }
  80007. dx = !dx ? 0 : dx;
  80008. dy = !dy ? 0 : dy;
  80009. if (!dx && !dy) {
  80010. return lngLat;
  80011. }
  80012. var lng = lngLat.lng;
  80013. if (dx !== 0) {
  80014. var ndx = Math.abs(dx),
  80015. radLng = rad(lngLat.lng);
  80016. var sLng = 2 * Math.sqrt(Math.pow(Math.sin(ndx / (2 * this.R)), 2) / Math.pow(Math.cos(radLng), 2));
  80017. radLng = radLng + sLng * (ndx > 0 ? 1 : -1);
  80018. lng = wrap(radLng * 180 / Math.PI, -180, 180);
  80019. }
  80020. var lat = lngLat.lat;
  80021. if (dy !== 0) {
  80022. var ndy = Math.abs(dy),
  80023. radLat = rad(lngLat.lat);
  80024. var sLat = Math.sin(ndy / (2 * this.R)) * 2;
  80025. radLat = radLat + sLat * (ndy > 0 ? 1 : -1);
  80026. lat = wrap(radLat * 180 / Math.PI, -90, 90);
  80027. }
  80028. return {
  80029. lng: lng,
  80030. lat: lat
  80031. };
  80032. },
  80033. getResolution: function getResolution(zoom) {
  80034. if (!this.resolutions) {
  80035. var resolutions = [];
  80036. var d = 2 * 6378137 * Math.PI;
  80037. for (var i = 0; i <= this.maxZoom; i++) {
  80038. resolutions[i] = d / (256 * Math.pow(2, i));
  80039. }
  80040. this.resolutions = resolutions;
  80041. }
  80042. var z = zoom | 0,
  80043. length = this.resolutions.length;
  80044. z = z < 0 ? 0 : z > length - 1 ? length - 1 : z;
  80045. var res = this.resolutions[z];
  80046. if ((zoom | 0) !== zoom && z !== length - 1) {
  80047. var next = this.resolutions[z + 1];
  80048. return res + (next - res) * (zoom - z);
  80049. }
  80050. return res;
  80051. }
  80052. };
  80053. var Transform = {
  80054. matrix: [1, -1, 0, 0],
  80055. projection: Projection,
  80056. project: function project(lngLat) {
  80057. return this.projection.project(lngLat);
  80058. },
  80059. unproject: function unproject(point) {
  80060. return this.projection.unproject(point);
  80061. },
  80062. lngLatToPoint: function lngLatToPoint(lngLat, zoom) {
  80063. var pt = this.project(lngLat);
  80064. return this.transform(pt, this.projection.getResolution(zoom));
  80065. },
  80066. locate: function locate(lngLat, dx, dy) {
  80067. return this.projection.locate(lngLat, dx, dy);
  80068. },
  80069. transform: function transform(point, scale) {
  80070. return {
  80071. x: this.matrix[0] * (point.x - this.matrix[2]) / scale,
  80072. y: this.matrix[1] * (point.y - this.matrix[3]) / scale
  80073. };
  80074. }
  80075. };
  80076. ;// CONCATENATED MODULE: ./src/common/overlay/index.js
  80077. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80078. * This program are made available under the terms of the Apache License, Version 2.0
  80079. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80080. ;// CONCATENATED MODULE: ./src/common/components/CommonTypes.js
  80081. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80082. * This program are made available under the terms of the Apache License, Version 2.0
  80083. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80084. /**
  80085. * @description 该文件用于存储一些公用常量
  80086. * @private
  80087. */
  80088. var FileTypes = {
  80089. EXCEL: "EXCEL",
  80090. CSV: "CSV",
  80091. ISERVER: "ISERVER",
  80092. GEOJSON: "GEOJSON",
  80093. JSON: 'JSON'
  80094. };
  80095. var FileConfig = {
  80096. fileMaxSize: 10 * 1024 * 1024
  80097. };
  80098. ;// CONCATENATED MODULE: ./src/common/components/openfile/FileModel.js
  80099. function FileModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80100. 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); } }
  80101. 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; }
  80102. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80103. * This program are made available under the terms of the Apache License, Version 2.0
  80104. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80105. /**
  80106. * @class FileModel
  80107. * @deprecatedclass SuperMap.FileModel
  80108. * @description 文件数据组件数据模型,用于存储一些文件数据或状态,todo 结构待完善
  80109. * @category Components OpenFile
  80110. * @private
  80111. */
  80112. var FileModel = /*#__PURE__*/function () {
  80113. function FileModel(options) {
  80114. FileModel_classCallCheck(this, FileModel);
  80115. this.FileTypes = FileTypes;
  80116. this.FileConfig = FileConfig;
  80117. this.loadFileObject = options && options.loadFileObject ? options.loadFileObject : [];
  80118. }
  80119. /**
  80120. * @function FileModel.prototype.set
  80121. * @description 设置属性值
  80122. * @param {string} key - 属性名称
  80123. * @param {string|Object} value - 属性值
  80124. */
  80125. FileModel_createClass(FileModel, [{
  80126. key: "set",
  80127. value: function set(key, value) {
  80128. this[key] = value;
  80129. }
  80130. /**
  80131. * @function FileModel.prototype.get
  80132. * @description 获取数据值
  80133. * @param {string} key - 属性名称
  80134. * @returns {string|Object} value - 返回属性值
  80135. */
  80136. }, {
  80137. key: "get",
  80138. value: function get(key) {
  80139. return this[key];
  80140. }
  80141. }]);
  80142. return FileModel;
  80143. }();
  80144. ;// CONCATENATED MODULE: ./src/common/components/messagebox/MessageBox.js
  80145. function MessageBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80146. 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); } }
  80147. 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; }
  80148. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80149. * This program are made available under the terms of the Apache License, Version 2.0
  80150. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80151. /**
  80152. * @class MessageBox
  80153. * @aliasclass Components.MessageBox
  80154. * @deprecatedclass SuperMap.Components.MessageBox
  80155. * @version 9.1.1
  80156. * @classdesc 组件信息提示框。
  80157. * @category Components Common
  80158. * @usage
  80159. */
  80160. var MessageBox = /*#__PURE__*/function () {
  80161. function MessageBox() {
  80162. MessageBox_classCallCheck(this, MessageBox);
  80163. this._initView();
  80164. }
  80165. MessageBox_createClass(MessageBox, [{
  80166. key: "_initView",
  80167. value: function _initView() {
  80168. //原生js形式
  80169. var messageBoxContainer = document.createElement("div");
  80170. messageBoxContainer.hidden = true;
  80171. messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  80172. //图标
  80173. var iconContainer = document.createElement("div");
  80174. iconContainer.setAttribute("class", "icon");
  80175. this.icon = document.createElement("span");
  80176. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  80177. iconContainer.appendChild(this.icon);
  80178. messageBoxContainer.appendChild(iconContainer);
  80179. //内容:
  80180. var messageBox = document.createElement("div");
  80181. messageBox.setAttribute("class", "component-messagebox");
  80182. messageBox.innerHTML = "";
  80183. messageBoxContainer.appendChild(messageBox);
  80184. this.messageBox = messageBox;
  80185. //关闭按钮
  80186. var cancelContainer = document.createElement("div");
  80187. cancelContainer.setAttribute("class", "component-messagebox__cancelbtncontainer");
  80188. var cancelBtn = document.createElement("button");
  80189. cancelBtn.setAttribute("class", "component-messagebox__cancelBtn");
  80190. cancelBtn.innerHTML = "x";
  80191. cancelBtn.onclick = this.closeView.bind(this);
  80192. cancelContainer.appendChild(cancelBtn);
  80193. messageBoxContainer.appendChild(cancelContainer);
  80194. this.messageBoxContainer = messageBoxContainer;
  80195. document.body.appendChild(this.messageBoxContainer);
  80196. }
  80197. /**
  80198. * @function MessageBox.prototype.closeView
  80199. * @description 关闭提示框。
  80200. */
  80201. }, {
  80202. key: "closeView",
  80203. value: function closeView() {
  80204. this.messageBoxContainer.hidden = true;
  80205. }
  80206. /**
  80207. * @function MessageBox.prototype.showView
  80208. * @description 显示提示框。
  80209. * @param {string} message - 提示框显示内容。
  80210. * @param {string}[type="warring"] 提示框类型,如 "warring", "failure", "success"。
  80211. */
  80212. }, {
  80213. key: "showView",
  80214. value: function showView(message) {
  80215. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warring';
  80216. //设置提示框的样式:
  80217. if (type === "success") {
  80218. this.icon.setAttribute("class", "supermapol-icons-message-success");
  80219. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-green");
  80220. } else if (type === "failure") {
  80221. this.icon.setAttribute("class", "supermapol-icons-message-failure");
  80222. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-red");
  80223. } else if (type === "warring") {
  80224. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  80225. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  80226. }
  80227. this.messageBox.innerHTML = message;
  80228. this.messageBoxContainer.hidden = false;
  80229. }
  80230. }]);
  80231. return MessageBox;
  80232. }();
  80233. ;// CONCATENATED MODULE: external "function(){try{return echarts}catch(e){return {}}}()"
  80234. var external_function_try_return_echarts_catch_e_return_namespaceObject = function(){try{return echarts}catch(e){return {}}}();
  80235. ;// CONCATENATED MODULE: ./src/common/lang/locales/en-US.js
  80236. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80237. * This program are made available under the terms of the Apache License, Version 2.0
  80238. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80239. /**
  80240. * Namespace: SuperMap.Lang["en"]
  80241. * Dictionary for English. Keys for entries are used in calls to
  80242. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  80243. * strings formatted for use with <SuperMap.String.format> calls.
  80244. */
  80245. var en = {
  80246. 'title_dataFlowService': 'Data Flow Service',
  80247. 'title_distributedAnalysis': 'Distributed Analysis',
  80248. 'title_clientComputing': 'Client Computing',
  80249. 'title_dataServiceQuery': 'Data Service Query',
  80250. 'title_searchCity': 'Search city',
  80251. 'title_searchLayer': ' Search layer',
  80252. 'text_input_value_inputDataFlowUrl': 'Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  80253. 'text_displayFeaturesInfo': 'Display feature information',
  80254. 'text_subscribe': 'subscribe',
  80255. 'text_cancelSubscribe': 'unsubscribe',
  80256. 'text_densityAnalysis': 'Density Analysis',
  80257. 'text_CalculateTheValuePerUnitArea': 'Calculate the value per unit area within the neighborhood shape',
  80258. 'text_option_selectDataset': 'Please select a dataset',
  80259. 'text_label_dataset': 'Dataset',
  80260. 'text_option_simplePointDensityAnalysis': 'Simple point density analysis',
  80261. 'text_option_nuclearDensityAnalysis': 'Nuclear density analysis',
  80262. 'text_label_analyticalMethod': 'Analytical method',
  80263. 'text_option_quadrilateral': 'Quadrilateral',
  80264. 'text_option_hexagon': 'hexagon',
  80265. 'text_label_meshType': 'Mesh type',
  80266. 'text_option_notSet': 'Not set',
  80267. 'text_label_weightField': 'Weight field',
  80268. 'text_label_gridSizeInMeters': 'Grid size',
  80269. 'text_label_searchRadius': 'Search radius',
  80270. 'text_label_queryRange': 'Scope of analysis',
  80271. 'text_label_areaUnit': 'Area unit',
  80272. 'text_option_equidistantSegmentation': 'Equidistant segmentation',
  80273. 'text_option_logarithm': 'Logarithm',
  80274. 'text_option_equalCountingSegment': 'Equal counting segment',
  80275. 'text_option_squareRootSegmentation': 'Square root segmentation',
  80276. 'text_label_thematicMapSegmentationMode': 'Thematic map segmentation mode',
  80277. 'text_label_thematicMapSegmentationParameters': 'Thematic map segmentation parameters',
  80278. 'text_option_greenOrangePurpleGradient': 'Green orange purple gradient',
  80279. 'text_option_greenOrangeRedGradient': 'Green orange red gradient',
  80280. 'text_option_rainbowGradient': 'Rainbow gradient',
  80281. 'text_option_spectralGradient': 'Spectral gradient',
  80282. 'text_option_terrainGradient': 'Terrain gradient',
  80283. 'text_label_thematicMapColorGradientMode': 'Thematic map color gradient mode',
  80284. 'text_label_resultLayerName': 'Result layer name',
  80285. 'text_chooseFile': 'Open File',
  80286. 'text_isoline': 'Isoline',
  80287. 'text_extractDiscreteValue': 'Extract discrete value generation curve',
  80288. 'text_buffer': 'Buffer',
  80289. 'text_specifyTheDistance': 'Specify the distance to create the surrounding area',
  80290. 'text_label_analysisLayer': 'Analysis layer',
  80291. 'text_label_extractField': 'Extract field',
  80292. 'text_label_extractedValue': 'Extracted value',
  80293. 'text_label_distanceAttenuation': 'Distance attenuation',
  80294. 'text_label_gridSize': 'gridSize',
  80295. 'text_label_bufferRadius': 'Buffer radius',
  80296. 'text_label_defaultkilometers': 'Default 10 kilometers',
  80297. 'text_label_kilometer': 'kilometer',
  80298. 'text_label_unit': 'unit',
  80299. 'text_retainOriginal': 'Retain original object field',
  80300. 'text_mergeBuffer': 'Merge buffer',
  80301. 'text_label_color': 'Color',
  80302. 'text_label_buffer': '[Buffer]',
  80303. 'text_label_isolines': '[Isolines]',
  80304. 'text_label_queryRangeTips': 'The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850',
  80305. 'text_label_queryModel': 'Query mode',
  80306. 'text_label_IDArrayOfFeatures': 'ID array of features',
  80307. 'text_label_maxFeatures': 'The maximum number of features that can be returned',
  80308. 'text_label_bufferDistance': 'Buffer distance',
  80309. 'text_label_queryRange1': 'Query range',
  80310. 'text_label_spatialQueryMode': 'Spatial query mode',
  80311. 'text_label_featureFilter': 'Feature filter',
  80312. 'text_label_geometricObject': 'Geometric object',
  80313. 'text_label_queryMode': 'Query mode',
  80314. 'text_label_searchTips': 'Search for city locations or layer features',
  80315. 'text_label_chooseSearchLayers': 'Select a query layer',
  80316. 'text_loadSearchCriteria': 'Load search criteria',
  80317. 'text_saveSearchCriteria': 'Save search criteria',
  80318. "btn_analyze": "Analyze",
  80319. "btn_analyzing": "Analyzing",
  80320. "btn_emptyTheAnalysisLayer": "Empty the analysis layer",
  80321. "btn_cancelAnalysis": "Cancel",
  80322. "btn_query": "Query",
  80323. "btn_querying": "Querying",
  80324. "btn_emptyTheRresultLayer": "Clear all result layers",
  80325. 'msg_dataReturnedIsEmpty.': 'The request is successful and the data returned by the query is empty.',
  80326. 'msg_dataFlowServiceHasBeenSubscribed': 'The data stream service has been subscribed to.',
  80327. 'msg_inputDataFlowUrlFirst': 'Please enter the data stream service address first.',
  80328. 'msg_datasetOrMethodUnsupport': 'This dataset does not support this analysis type. Please reselect the dataset.',
  80329. 'msg_selectDataset': 'Please select a data set!',
  80330. 'msg_setTheWeightField': 'Please set the weight field!',
  80331. 'msg_theFieldNotSupportAnalysis': 'The field you currently select does not support analysis!',
  80332. 'msg_resultIsEmpty': 'The result of the analysis is empty!',
  80333. 'msg_openFileFail': 'Failed to open file!',
  80334. 'msg_fileTypeUnsupported': 'File format is not supported!',
  80335. 'msg_fileSizeExceeded': 'File size exceeded! The file size should not exceed 10M!',
  80336. 'msg_dataInWrongGeoJSONFormat': 'Wrong data format! Non standard GEOJSON format data!',
  80337. 'msg_dataInWrongFormat': 'Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!',
  80338. 'msg_searchKeywords': "Search keywords cannot be empty. Please enter your search criteria.",
  80339. 'msg_searchGeocodeField': "Did not match the address matching service data!",
  80340. 'msg_cityGeocodeField': "The address matching service of the current city is not configured.",
  80341. 'msg_getFeatureField': "No related vector features found!",
  80342. 'msg_dataflowservicesubscribed': 'The data stream service has been subscribed to.',
  80343. 'msg_subscribesucceeded': 'The data stream service subscription was successful.',
  80344. 'msg_crsunsupport': 'Does not support the coordinate system of the current map',
  80345. 'msg_tilematrixsetunsupport': 'Incoming TileMatrixSet is not supported',
  80346. 'msg_jsonResolveFiled': 'JSON format parsing failure!',
  80347. 'msg_requestContentFiled': 'Failed to request data through iportal!',
  80348. 'msg_getdatafailed': 'Failed to get data!'
  80349. };
  80350. ;// CONCATENATED MODULE: ./src/common/lang/locales/zh-CN.js
  80351. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80352. * This program are made available under the terms of the Apache License, Version 2.0
  80353. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80354. /**
  80355. * Namespace: SuperMap.Lang["zh-CN"]
  80356. * Dictionary for Simplified Chinese. Keys for entries are used in calls to
  80357. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  80358. * strings formatted for use with <SuperMap.String.format> calls.
  80359. */
  80360. var zh = {
  80361. 'title_dataFlowService': '数据流服务',
  80362. 'title_distributedAnalysis': '分布式分析',
  80363. 'title_clientComputing': '客户端计算',
  80364. 'title_dataServiceQuery': '数据服务查询',
  80365. 'title_searchCity': '搜索城市',
  80366. 'title_searchLayer': '搜索图层',
  80367. 'text_input_value_inputDataFlowUrl': '请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  80368. 'text_displayFeaturesInfo': '显示要素信息',
  80369. 'text_subscribe': '订阅',
  80370. 'text_cancelSubscribe': '取消订阅',
  80371. 'text_densityAnalysis': '密度分析',
  80372. 'text_CalculateTheValuePerUnitArea': '计算点指定邻域形状内的每单位面积量值',
  80373. 'text_option_selectDataset': '请选择数据集',
  80374. 'text_label_dataset': '数据集',
  80375. 'text_option_simplePointDensityAnalysis': '简单点密度分析',
  80376. 'text_option_nuclearDensityAnalysis': '核密度分析',
  80377. 'text_label_analyticalMethod': '分析方法',
  80378. 'text_option_quadrilateral': '四边形',
  80379. 'text_option_hexagon': '六边形',
  80380. 'text_label_meshType': '网格面类型',
  80381. 'text_option_notSet': '未设置',
  80382. 'text_label_weightField': '权重字段',
  80383. 'text_label_gridSizeInMeters': '网格大小',
  80384. 'text_label_searchRadius': '搜索半径',
  80385. 'text_label_queryRange': '分析范围',
  80386. 'text_label_areaUnit': '面积单位',
  80387. 'text_option_equidistantSegmentation': '等距离分段',
  80388. 'text_option_logarithm': '对数',
  80389. 'text_option_equalCountingSegment': '等计数分段',
  80390. 'text_option_squareRootSegmentation': '平方根分段',
  80391. 'text_label_thematicMapSegmentationMode': '专题图分段模式',
  80392. 'text_label_thematicMapSegmentationParameters': '专题图分段参数',
  80393. 'text_option_greenOrangePurpleGradient': '绿橙紫渐变',
  80394. 'text_option_greenOrangeRedGradient': '绿橙红渐变',
  80395. 'text_option_rainbowGradient': '彩虹渐变',
  80396. 'text_option_spectralGradient': '光谱渐变',
  80397. 'text_option_terrainGradient': '地形渐变',
  80398. 'text_label_thematicMapColorGradientMode': '专题图颜色渐变模式',
  80399. 'text_label_resultLayerName': '结果图层名称',
  80400. 'text_chooseFile': '选择文件',
  80401. 'text_isoline': '等值线',
  80402. 'text_extractDiscreteValue': '提取离散值生成曲线',
  80403. 'text_buffer': '缓冲区',
  80404. 'text_specifyTheDistance': '指定距离创建周边区域',
  80405. 'text_label_analysisLayer': '分析图层',
  80406. 'text_label_extractField': '提取字段',
  80407. 'text_label_extractedValue': '提取值',
  80408. 'text_label_distanceAttenuation': '距离衰减',
  80409. 'text_label_gridSize': '栅格大小',
  80410. 'text_label_bufferRadius': '缓冲半径',
  80411. 'text_label_defaultkilometers': '默认10千米',
  80412. 'text_option_kilometer': '千米',
  80413. 'text_label_unit': '单位',
  80414. 'text_retainOriginal': '保留原对象字段属性',
  80415. 'text_mergeBuffer': '合并缓冲区',
  80416. 'text_label_color': '颜色',
  80417. 'text_label_buffer': '[缓冲区]',
  80418. 'text_label_isolines': '[等值线]',
  80419. 'text_label_queryRangeTips': '默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850',
  80420. 'text_label_IDArrayOfFeatures': '要素 ID 数组',
  80421. 'text_label_maxFeatures': '最多可返回的要素数量',
  80422. 'text_label_bufferDistance': '缓冲区距离',
  80423. 'text_label_queryRange1': '查询范围',
  80424. 'text_label_spatialQueryMode': '空间查询模式',
  80425. 'text_label_featureFilter': '要素过滤器',
  80426. 'text_label_geometricObject': '几何对象',
  80427. 'text_label_queryMode': '查询模式',
  80428. 'text_label_searchTips': '搜索城市地点或图层要素',
  80429. 'text_label_chooseSearchLayers': '选择查询图层',
  80430. 'text_loadSearchCriteria': '加载搜索条件',
  80431. 'text_saveSearchCriteria': '保存搜索条件',
  80432. "btn_analyze": "分析",
  80433. "btn_analyzing": "分析中",
  80434. "btn_emptyTheAnalysisLayer": "清空分析图层",
  80435. "btn_cancelAnalysis": "取消",
  80436. "btn_query": "查询",
  80437. "btn_querying": "查询中",
  80438. "btn_emptyTheRresultLayer": "清除所有结果图层",
  80439. 'msg_dataFlowServiceHasBeenSubscribed': '已订阅该数据流服务。',
  80440. 'msg_inputDataFlowUrlFirst': '请先输入数据流服务地址。',
  80441. 'msg_datasetOrMethodUnsupport': '该数据集不支持本分析类型,请重新选择数据集',
  80442. 'msg_selectDataset': '请选择数据集!',
  80443. 'msg_setTheWeightField': '请设置权重字段!',
  80444. 'msg_theFieldNotSupportAnalysis': '您当前选择的字段不支持分析!',
  80445. 'msg_resultIsEmpty': '分析的结果为空!',
  80446. 'msg_dataReturnedIsEmpty': '请求成功,查询返回的数据为空。',
  80447. 'msg_openFileFail': '打开文件失败!',
  80448. 'msg_fileTypeUnsupported': '不支持该文件格式!',
  80449. 'msg_fileSizeExceeded': '文件大小超限!文件大小不得超过 10M!',
  80450. 'msg_dataInWrongGeoJSONFormat': '数据格式错误!非标准的 GEOJSON 格式数据!',
  80451. 'msg_dataInWrongFormat': '数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!',
  80452. 'msg_searchKeywords': "搜索关键字不能为空,请输入搜索条件。",
  80453. 'msg_searchGeocodeField': "未匹配到地址匹配服务数据!",
  80454. 'msg_cityGeocodeField': "未配置当前城市的地址匹配服务。",
  80455. 'msg_getFeatureField': "未查找到相关矢量要素!",
  80456. 'msg_dataflowservicesubscribed': '已订阅该数据流服务。',
  80457. 'msg_subscribesucceeded': '数据流服务订阅成功。',
  80458. 'msg_crsunsupport': '不支持当前地图的坐标系',
  80459. 'msg_tilematrixsetunsupport': '不支持传入的TileMatrixSet',
  80460. 'msg_jsonResolveFiled': 'json格式解析失败!',
  80461. 'msg_requestContentFiled': '通过iportal请求数据失败!',
  80462. 'msg_getdatafailed': '获取数据失败!'
  80463. };
  80464. ;// CONCATENATED MODULE: ./src/common/lang/Lang.js
  80465. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80466. * This program are made available under the terms of the Apache License, Version 2.0
  80467. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80468. /**
  80469. * @name Lang
  80470. * @namespace
  80471. * @category BaseTypes Internationalization
  80472. * @description 国际化的命名空间,包含多种语言和方法库来设置和获取当前的语言。
  80473. * @usage
  80474. * ```
  80475. * // 浏览器
  80476. * <script type="text/javascript" src="{cdn}"></script>
  80477. * <script>
  80478. * const result = {namespace}.Lang.getCode();
  80479. *
  80480. * // 弃用的写法
  80481. * const result = SuperMap.Lang.getCode();
  80482. *
  80483. * </script>
  80484. *
  80485. * // ES6 Import
  80486. * import { Lang } from '{npm}';
  80487. *
  80488. * const result = Lang.getCode();
  80489. *
  80490. * ```
  80491. */
  80492. var Lang = {
  80493. 'en-US': en,
  80494. "zh-CN": zh,
  80495. /**
  80496. * @member {string} Lang.code
  80497. * @description 当前所使用的语言类型。
  80498. */
  80499. code: null,
  80500. /**
  80501. * @member {string} [Lang.defaultCode='en-US']
  80502. * @description 默认使用的语言类型。
  80503. */
  80504. defaultCode: "en-US",
  80505. /**
  80506. * @function Lang.getCode
  80507. * @description 获取当前的语言代码。
  80508. * @returns {string} 当前的语言代码。
  80509. */
  80510. getCode: function getCode() {
  80511. if (!Lang.code) {
  80512. Lang.setCode();
  80513. }
  80514. return Lang.code;
  80515. },
  80516. /**
  80517. * @function Lang.setCode
  80518. * @description 设置语言代码。
  80519. * @param {string} code - 此参数遵循IETF规范。
  80520. */
  80521. setCode: function setCode() {
  80522. var lang = this.getLanguageFromCookie();
  80523. if (!lang) {
  80524. lang = Lang.defaultCode;
  80525. if (navigator.appName === 'Netscape') {
  80526. lang = navigator.language;
  80527. } else {
  80528. lang = navigator.browserLanguage;
  80529. }
  80530. }
  80531. if (lang.indexOf('zh') === 0) {
  80532. lang = 'zh-CN';
  80533. }
  80534. if (lang.indexOf('en') === 0) {
  80535. lang = 'en-US';
  80536. }
  80537. Lang.code = lang;
  80538. },
  80539. /**
  80540. * @function Lang.getLanguageFromCookie
  80541. * @description 从 cookie 中获取语言类型。
  80542. */
  80543. getLanguageFromCookie: function getLanguageFromCookie() {
  80544. var name = 'language=';
  80545. var ca = document.cookie.split(';');
  80546. for (var i = 0; i < ca.length; i++) {
  80547. var c = ca[i];
  80548. while (c.charAt(0) === ' ') {
  80549. c = c.substring(1);
  80550. }
  80551. if (c.indexOf(name) !== -1) {
  80552. return c.substring(name.length, c.length);
  80553. }
  80554. }
  80555. return "";
  80556. },
  80557. /**
  80558. * @function Lang.i18n
  80559. * @description 从当前语言字符串的字典查找 key。
  80560. * @param {string} key - 字典中 i18n 字符串值的关键字。
  80561. * @returns {string} 国际化的字符串。
  80562. */
  80563. i18n: function i18n(key) {
  80564. var dictionary = Lang[Lang.getCode()];
  80565. var message = dictionary && dictionary[key];
  80566. if (!message) {
  80567. // Message not found, fall back to message key
  80568. message = key;
  80569. }
  80570. return message;
  80571. }
  80572. };
  80573. ;// CONCATENATED MODULE: external "function(){try{return XLSX}catch(e){return {}}}()"
  80574. var external_function_try_return_XLSX_catch_e_return_namespaceObject = function(){try{return XLSX}catch(e){return {}}}();
  80575. ;// CONCATENATED MODULE: ./src/common/components/util/FileReaderUtil.js
  80576. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80577. * This program are made available under the terms of the Apache License, Version 2.0
  80578. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80579. /**
  80580. * @name FileReaderUtil
  80581. * @namespace
  80582. * @category Components OpenFile
  80583. * @description 组件读取文件工具类。
  80584. * @version 9.1.1
  80585. * @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(*, *=))}}
  80586. * @usage
  80587. * ```
  80588. * // 浏览器
  80589. * <script type="text/javascript" src="{cdn}"></script>
  80590. * <script>
  80591. * const result = {namespace}.Components.FileReaderUtil.isXField(data);
  80592. *
  80593. * // 弃用的写法
  80594. * const result = SuperMap.Components.FileReaderUtil.isXField(data);
  80595. *
  80596. * </script>
  80597. *
  80598. * // ES6 Import
  80599. * import { FileReaderUtil } from '{npm}';
  80600. *
  80601. * const result = FileReaderUtil.isXField(data);
  80602. * ```
  80603. */
  80604. var FileReaderUtil = {
  80605. rABS: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsBinaryString,
  80606. rABF: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsArrayBuffer,
  80607. rAT: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsText,
  80608. /**
  80609. * @function FileReaderUtil.prototype.readFile
  80610. * @description 读取文件。
  80611. * @param {string} fileType - 当前读取的文件类型。
  80612. *
  80613. * @param {Object} file - 读取回来的文件内容对象。
  80614. * @param {function} success - 读取文件成功回调函数。
  80615. * @param {function} failed - 读取文件失败回调函数。
  80616. * @param {Object} context - 回调重定向对象。
  80617. */
  80618. readFile: function readFile(fileType, file, success, failed, context) {
  80619. if (FileTypes.JSON === fileType || FileTypes.GEOJSON === fileType) {
  80620. this.readTextFile(file, success, failed, context);
  80621. } else if (FileTypes.EXCEL === fileType || FileTypes.CSV === fileType) {
  80622. this.readXLSXFile(file, success, failed, context);
  80623. }
  80624. },
  80625. /**
  80626. * @description 读取文本文件。
  80627. * @param {Object} file 文件内容对象。
  80628. * @param {function} success 读取文件成功回调函数。
  80629. * @param {function} failed 读取文件失败回调函数。
  80630. * @param {Object} context - 回调重定向对象。
  80631. */
  80632. readTextFile: function readTextFile(file, success, failed, context) {
  80633. var reader = new FileReader();
  80634. reader.onloadend = function (evt) {
  80635. success && success.call(context, evt.target.result);
  80636. };
  80637. reader.onerror = function (error) {
  80638. failed && failed.call(context, error);
  80639. };
  80640. this.rAT ? reader.readAsText(file.file, 'utf-8') : reader.readAsBinaryString(file.file);
  80641. },
  80642. /**
  80643. * @description 读取excel或csv文件。
  80644. * @param {Object} file 文件内容对象。
  80645. * @param {function} success 读取文件成功回调函数。
  80646. * @param {function} failed 读取文件失败回调函数。
  80647. * @param {Object} context - 回调重定向对象。
  80648. */
  80649. readXLSXFile: function readXLSXFile(file, success, failed, context) {
  80650. var reader = new FileReader();
  80651. reader.onloadend = function (evt) {
  80652. var xLSXData = new Uint8Array(evt.target.result);
  80653. var workbook = external_function_try_return_XLSX_catch_e_return_namespaceObject.read(xLSXData, {
  80654. type: "array"
  80655. });
  80656. try {
  80657. if (workbook && workbook.SheetNames && workbook.SheetNames.length > 0) {
  80658. //暂时只读取第一个sheets的内容
  80659. var sheetName = workbook.SheetNames[0];
  80660. var xLSXCSVString = external_function_try_return_XLSX_catch_e_return_namespaceObject.utils.sheet_to_csv(workbook.Sheets[sheetName]);
  80661. success && success.call(context, xLSXCSVString);
  80662. }
  80663. } catch (error) {
  80664. failed && failed.call(context, error);
  80665. }
  80666. };
  80667. reader.onerror = function (error) {
  80668. failed && failed.call(context, error);
  80669. };
  80670. this.rABF && reader.readAsArrayBuffer(file.file);
  80671. },
  80672. /**
  80673. * @function FileReaderUtil.prototype.processDataToGeoJson
  80674. * @description 将读取回来得数据统一处理为 GeoJSON 格式。
  80675. * @param {string} type - 文件类型。
  80676. * @param {Object} data - 读取返回的数据对象。
  80677. * @param {function} success - 数据处理成功的回调。
  80678. * @param {function} failed - 数据处理失败的回调。
  80679. * @param {Object} context - 回调重定向对象。
  80680. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据。
  80681. * @private
  80682. */
  80683. processDataToGeoJson: function processDataToGeoJson(type, data, success, failed, context) {
  80684. var geojson = null;
  80685. if (type === "EXCEL" || type === "CSV") {
  80686. geojson = this.processExcelDataToGeoJson(data);
  80687. success && success.call(context, geojson);
  80688. } else if (type === 'JSON' || type === 'GEOJSON') {
  80689. var result = data;
  80690. //geojson、json未知,通过类容来判断
  80691. if (typeof result === "string") {
  80692. result = JSON.parse(result);
  80693. }
  80694. if (result.type === 'ISERVER') {
  80695. geojson = result.data.recordsets[0].features;
  80696. } else if (result.type === 'FeatureCollection') {
  80697. //geojson
  80698. geojson = result;
  80699. } else {
  80700. //不支持数据
  80701. failed && failed.call(context, Lang.i18n('msg_dataInWrongGeoJSONFormat'));
  80702. }
  80703. success && success.call(context, geojson);
  80704. } else {
  80705. failed && failed.call(context, Lang.i18n('msg_dataInWrongFormat'));
  80706. }
  80707. },
  80708. /**
  80709. * @function FileReaderUtil.prototype.processExcelDataToGeoJson
  80710. * @description 表格文件数据处理。
  80711. * @param {Object} data - 读取的表格文件数据。
  80712. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据。
  80713. * @private
  80714. */
  80715. processExcelDataToGeoJson: function processExcelDataToGeoJson(data) {
  80716. //处理为对象格式转化
  80717. var dataContent = this.string2Csv(data);
  80718. var fieldCaptions = dataContent.colTitles;
  80719. //位置属性处理
  80720. var xfieldIndex = -1,
  80721. yfieldIndex = -1;
  80722. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  80723. if (this.isXField(fieldCaptions[i])) {
  80724. xfieldIndex = i;
  80725. }
  80726. if (this.isYField(fieldCaptions[i])) {
  80727. yfieldIndex = i;
  80728. }
  80729. }
  80730. // feature 构建后期支持坐标系 4326/3857
  80731. var features = [];
  80732. for (var _i2 = 0, _len2 = dataContent.rows.length; _i2 < _len2; _i2++) {
  80733. var row = dataContent.rows[_i2];
  80734. //if (featureFrom === "LonLat") {
  80735. var x = Number(row[xfieldIndex]),
  80736. y = Number(row[yfieldIndex]);
  80737. //属性信息
  80738. var attributes = {};
  80739. for (var index in dataContent.colTitles) {
  80740. var key = dataContent.colTitles[index];
  80741. attributes[key] = dataContent.rows[_i2][index];
  80742. }
  80743. //目前csv 只支持处理点,所以先生成点类型的 geojson
  80744. var feature = {
  80745. "type": "Feature",
  80746. "geometry": {
  80747. "type": "Point",
  80748. "coordinates": [x, y]
  80749. },
  80750. "properties": attributes
  80751. };
  80752. features.push(feature);
  80753. }
  80754. return features;
  80755. },
  80756. /**
  80757. * @description 判断是否地理X坐标。
  80758. * @param {string} data 字段名。
  80759. */
  80760. isXField: function isXField(data) {
  80761. var lowerdata = data.toLowerCase();
  80762. return lowerdata === "x" || lowerdata === "smx" || lowerdata === "jd" || lowerdata === "经度" || lowerdata === "东经" || lowerdata === "longitude" || lowerdata === "lot" || lowerdata === "lon" || lowerdata === "lng" || lowerdata === "x坐标";
  80763. },
  80764. /**
  80765. * @description 判断是否地理Y坐标。
  80766. * @param {string} data 字段名。
  80767. */
  80768. isYField: function isYField(data) {
  80769. var lowerdata = data.toLowerCase();
  80770. return lowerdata === "y" || lowerdata === "smy" || lowerdata === "wd" || lowerdata === "纬度" || lowerdata === "北纬" || lowerdata === "latitude" || lowerdata === "lat" || lowerdata === "y坐标";
  80771. },
  80772. /**
  80773. * @description 字符串转为dataEditor 支持的csv格式数据。
  80774. * @param {string} string 待转化的字符串。
  80775. * @param {boolean} withoutTitle 是否需要列标题。
  80776. */
  80777. string2Csv: function string2Csv(string, withoutTitle) {
  80778. // let rows = string.split('\r\n');
  80779. var rows = string.split('\n');
  80780. var result = {};
  80781. if (!withoutTitle) {
  80782. result["colTitles"] = rows[0].split(',');
  80783. } else {
  80784. result["colTitles"] = [];
  80785. }
  80786. result['rows'] = [];
  80787. for (var i = withoutTitle ? 0 : 1; i < rows.length; i++) {
  80788. rows[i] && result['rows'].push(rows[i].split(','));
  80789. }
  80790. return result;
  80791. }
  80792. };
  80793. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartModel.js
  80794. function ChartModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  80795. 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); } }
  80796. 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; }
  80797. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  80798. * This program are made available under the terms of the Apache License, Version 2.0
  80799. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  80800. /**
  80801. * @class ChartModel
  80802. * @classdesc 图表组件数据模型
  80803. * @private
  80804. * @param {Object} datasets - 数据来源。
  80805. * @category Components Chart
  80806. * @fires ChartModel#getdatafailed
  80807. */
  80808. var ChartModel = /*#__PURE__*/function () {
  80809. function ChartModel(datasets) {
  80810. ChartModel_classCallCheck(this, ChartModel);
  80811. this.datasets = datasets;
  80812. this.EVENT_TYPES = ['getdatafailed'];
  80813. this.events = new Events(this, null, this.EVENT_TYPES);
  80814. }
  80815. /**
  80816. * @private
  80817. * @function ChartModel.prototype.getDatasetInfo
  80818. * @description 获得数据集数据。
  80819. * @param {string} datasetUrl - 数据集资源地址。
  80820. */
  80821. ChartModel_createClass(ChartModel, [{
  80822. key: "getDatasetInfo",
  80823. value: function getDatasetInfo(success) {
  80824. var datasetUrl = this.datasets.url;
  80825. var me = this;
  80826. FetchRequest.get(datasetUrl).then(function (response) {
  80827. return response.json();
  80828. }).then(function (results) {
  80829. if (results.datasetInfo) {
  80830. var datasetInfo = results.datasetInfo;
  80831. me.datasetsInfo = {
  80832. dataSourceName: datasetInfo.dataSourceName,
  80833. datasetName: datasetInfo.name,
  80834. mapName: results.name
  80835. };
  80836. success({
  80837. result: me.datasetsInfo
  80838. });
  80839. }
  80840. })["catch"](function (error) {
  80841. console.log(error);
  80842. me._fireFailedEvent(error);
  80843. });
  80844. }
  80845. /**
  80846. * @private
  80847. * @function ChartModel.prototype.getDataFeatures
  80848. * @description 请求数据集的数据信息
  80849. * @param {Object} results - 数据集信息。
  80850. * @param {function} success - 成功回调函数。
  80851. */
  80852. }, {
  80853. key: "getDataFeatures",
  80854. value: function getDataFeatures(results, success) {
  80855. var datasetsInfo = results.result;
  80856. var getFeatureParam, getFeatureBySQLParams, getFeatureBySQLService;
  80857. var params = {
  80858. name: datasetsInfo.datasetName + '@' + datasetsInfo.dataSourceName
  80859. };
  80860. Object.assign(params, this.datasets.queryInfo);
  80861. getFeatureParam = new FilterParameter(params);
  80862. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  80863. queryParameter: getFeatureParam,
  80864. datasetNames: [datasetsInfo.dataSourceName + ':' + datasetsInfo.datasetName],
  80865. fromIndex: 0,
  80866. toIndex: 100000
  80867. });
  80868. getFeatureBySQLService = new GetFeaturesBySQLService(datasetsInfo.dataUrl, {
  80869. eventListeners: {
  80870. processCompleted: success,
  80871. processFailed: function processFailed() {}
  80872. }
  80873. });
  80874. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  80875. }
  80876. /**
  80877. * @private
  80878. * @function ChartModel.prototype.getLayerFeatures
  80879. * @description 请求图层要素的数据信息
  80880. * @param {Object} results - 数据集信息。
  80881. * @param {Callbacks} success - 成功回调函数。
  80882. */
  80883. }, {
  80884. key: "getLayerFeatures",
  80885. value: function getLayerFeatures(results, success) {
  80886. var datasetsInfo = results.result;
  80887. var queryParam, queryBySQLParams, queryBySQLService;
  80888. var params = {
  80889. name: datasetsInfo.mapName
  80890. };
  80891. Object.assign(params, this.datasets.queryInfo);
  80892. queryParam = new FilterParameter(params);
  80893. queryBySQLParams = new QueryBySQLParameters({
  80894. queryParams: [queryParam],
  80895. expectCount: 100000
  80896. });
  80897. queryBySQLService = new QueryBySQLService(datasetsInfo.dataUrl, {
  80898. eventListeners: {
  80899. processCompleted: success,
  80900. processFailed: function processFailed() {}
  80901. }
  80902. });
  80903. queryBySQLService.processAsync(queryBySQLParams);
  80904. }
  80905. /**
  80906. * @private
  80907. * @function ChartModel.prototype.getDataInfoByIptl
  80908. * @description 用dataId获取iportal的数据。
  80909. * @param {Callbacks} success - 成功回调函数。
  80910. *
  80911. */
  80912. }, {
  80913. key: "getDataInfoByIptl",
  80914. value: function getDataInfoByIptl(success) {
  80915. // success是chart的回调
  80916. this.getServiceInfo(this.datasets.url, success);
  80917. }
  80918. /**
  80919. * @private
  80920. * @function ChartModel.prototype.getServiceInfo
  80921. * @description 用iportal获取dataItemServices。
  80922. * @param {string} url
  80923. * @param {Callbacks} success - 成功回调函数。
  80924. * */
  80925. }, {
  80926. key: "getServiceInfo",
  80927. value: function getServiceInfo(url, success) {
  80928. var me = this;
  80929. FetchRequest.get(url, null, {
  80930. withCredentials: this.datasets.withCredentials
  80931. }).then(function (response) {
  80932. return response.json();
  80933. }).then(function (data) {
  80934. if (data.succeed === false) {
  80935. //请求失败
  80936. me._fireFailedEvent(data);
  80937. return;
  80938. }
  80939. // 是否有rest服务
  80940. if (data.dataItemServices && data.dataItemServices.length > 0) {
  80941. var dataItemServices = data.dataItemServices,
  80942. resultData;
  80943. dataItemServices.forEach(function (item) {
  80944. // 如果有restdata并且发布成功,就请求restdata服务
  80945. // 如果有restmap并且发布成功,就请求restmap服务
  80946. // 其他情况就请求iportal/content.json
  80947. if (item.serviceType === 'RESTDATA' && item.serviceStatus === 'PUBLISHED') {
  80948. resultData = item;
  80949. } else if (item.serviceType === 'RESTMAP' && item.serviceStatus === 'PUBLISHED') {
  80950. resultData = item;
  80951. } else {
  80952. me.getDatafromContent(url, success);
  80953. return;
  80954. }
  80955. });
  80956. // 如果有服务,获取数据源和数据集, 然后请求rest服务
  80957. resultData && me.getDatafromRest(resultData.serviceType, resultData.address, success);
  80958. } else {
  80959. me.getDatafromContent(url, success);
  80960. return;
  80961. }
  80962. })["catch"](function (error) {
  80963. console.log(error);
  80964. me._fireFailedEvent(error);
  80965. });
  80966. }
  80967. /**
  80968. * @private
  80969. * @function ChartModel.prototype.getDatafromURL
  80970. * @description 用iportal获取数据。(通过固定的url来请求,但是不能请求工作空间的数据)
  80971. * @param {string} url
  80972. * @param {Callbacks} success - 成功回调函数。
  80973. */
  80974. }, {
  80975. key: "getDatafromContent",
  80976. value: function getDatafromContent(url, success) {
  80977. var _this = this;
  80978. // 成功回调传入的results
  80979. var results = {
  80980. result: {}
  80981. },
  80982. me = this;
  80983. url += '/content.json?pageSize=9999999&currentPage=1';
  80984. // 获取图层数据
  80985. FetchRequest.get(url, null, {
  80986. withCredentials: this.datasets.withCredentials
  80987. }).then(function (response) {
  80988. return response.json();
  80989. }).then(function (data) {
  80990. if (data.succeed === false) {
  80991. //请求失败
  80992. me._fireFailedEvent(data);
  80993. return;
  80994. }
  80995. if (data.type) {
  80996. if (data.type === 'JSON' || data.type === 'GEOJSON') {
  80997. // 将字符串转换成json
  80998. data.content = JSON.parse(data.content.trim());
  80999. // 如果是json文件 data.content = {type:'fco', features},格式不固定
  81000. if (!data.content.features) {
  81001. //json格式解析失败
  81002. console.log(Lang.i18n('msg_jsonResolveFiled'));
  81003. return;
  81004. }
  81005. var features = _this._formatGeoJSON(data.content);
  81006. results.result.features = {
  81007. type: data.content.type,
  81008. features: features
  81009. };
  81010. } else if (data.type === 'EXCEL' || data.type === 'CSV') {
  81011. var _features = _this._excelData2Feature(data.content);
  81012. results.result.features = {
  81013. type: 'FeatureCollection',
  81014. features: _features
  81015. };
  81016. }
  81017. success(results, 'content');
  81018. }
  81019. }, this)["catch"](function (error) {
  81020. console.log(error);
  81021. me._fireFailedEvent(error);
  81022. });
  81023. }
  81024. /**
  81025. * @private
  81026. * @function ChartModel.prototype._getDataSource
  81027. * @description 获取数据源名和数据集名。
  81028. * @param {string} serviceType 服务类型
  81029. * @param {string} address 地址
  81030. * @param {Callbacks} success - 成功回调函数。
  81031. * @return {Array.<string>} ["数据源名:数据集名"]
  81032. * @return {string} 图层名
  81033. */
  81034. }, {
  81035. key: "getDatafromRest",
  81036. value: function getDatafromRest(serviceType, address, success) {
  81037. var me = this,
  81038. withCredentials = this.datasets.withCredentials;
  81039. if (serviceType === 'RESTDATA') {
  81040. var url = "".concat(address, "/data/datasources"),
  81041. sourceName,
  81042. datasetName;
  81043. // 请求获取数据源名
  81044. FetchRequest.get(url, null, {
  81045. withCredentials: withCredentials
  81046. }).then(function (response) {
  81047. return response.json();
  81048. }).then(function (data) {
  81049. sourceName = data.datasourceNames[0];
  81050. url = "".concat(address, "/data/datasources/").concat(sourceName, "/datasets");
  81051. // 请求获取数据集名
  81052. FetchRequest.get(url, null, {
  81053. withCredentials: withCredentials
  81054. }).then(function (response) {
  81055. return response.json();
  81056. }).then(function (data) {
  81057. datasetName = data.datasetNames[0];
  81058. // 请求restdata服务
  81059. me.getDatafromRestData("".concat(address, "/data"), [sourceName + ':' + datasetName], success);
  81060. return [sourceName + ':' + datasetName];
  81061. })["catch"](function (error) {
  81062. me._fireFailedEvent(error);
  81063. });
  81064. })["catch"](function (error) {
  81065. me._fireFailedEvent(error);
  81066. });
  81067. } else {
  81068. // 如果是地图服务
  81069. var _url = "".concat(address, "/maps"),
  81070. mapName,
  81071. layerName,
  81072. path;
  81073. // 请求获取地图名
  81074. FetchRequest.get(_url, null, {
  81075. withCredentials: withCredentials
  81076. }).then(function (response) {
  81077. return response.json();
  81078. }).then(function (data) {
  81079. mapName = data[0].name;
  81080. path = data[0].path;
  81081. _url = _url = "".concat(address, "/maps/").concat(mapName, "/layers");
  81082. // 请求获取图层名
  81083. FetchRequest.get(_url, null, {
  81084. withCredentials: withCredentials
  81085. }).then(function (response) {
  81086. return response.json();
  81087. }).then(function (data) {
  81088. layerName = data[0].subLayers.layers[0].caption;
  81089. // 请求restmap服务
  81090. me.getDatafromRestMap(layerName, path, success);
  81091. return layerName;
  81092. })["catch"](function (error) {
  81093. me._fireFailedEvent(error);
  81094. });
  81095. })["catch"](function (error) {
  81096. me._fireFailedEvent(error);
  81097. });
  81098. }
  81099. }
  81100. /**
  81101. * @private
  81102. * @function ChartModel.prototype.getDatafromRestData
  81103. * @description 请求restdata服务
  81104. * @param {string} url
  81105. * @param {Array<string>} dataSource [数据源名:数据集名]
  81106. * @param {Callbacks} success - 成功回调函数。
  81107. */
  81108. }, {
  81109. key: "getDatafromRestData",
  81110. value: function getDatafromRestData(url, dataSource, success) {
  81111. var me = this;
  81112. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'SmID>0';
  81113. this._getFeatureBySQL(url, dataSource, this.datasets.queryInfo, function (results) {
  81114. // 此时的features已经处理成geojson了
  81115. success(results, 'RESTDATA');
  81116. }, function (error) {
  81117. console.log(error);
  81118. me._fireFailedEvent(error);
  81119. });
  81120. }
  81121. /**
  81122. * @private
  81123. * @function ChartModel.prototype.getDatafromRestMap
  81124. * @description 请求restmap服务
  81125. * @param {string} dataSource layerName
  81126. * @param {string} path - map服务地址。
  81127. * @param {Callbacks} success - 成功回调函数。
  81128. */
  81129. }, {
  81130. key: "getDatafromRestMap",
  81131. value: function getDatafromRestMap(dataSource, path, success) {
  81132. var me = this;
  81133. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'smid=1';
  81134. this._queryFeatureBySQL(path, dataSource, this.datasets.queryInfo, null, null, function (results) {
  81135. // let features = result.result.recordsets[0].features;
  81136. success(results, 'RESTMAP');
  81137. }, function (error) {
  81138. console.log(error);
  81139. me._fireFailedEvent(error);
  81140. });
  81141. }
  81142. /**
  81143. * @private
  81144. * @function ChartModel.prototype._getFeatureBySQL
  81145. * @description 通过 sql 方式查询数据。
  81146. */
  81147. }, {
  81148. key: "_getFeatureBySQL",
  81149. value: function _getFeatureBySQL(url, datasetNames, queryInfo, _processCompleted, processFaild) {
  81150. var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
  81151. var params = {
  81152. name: datasetNames.join().replace(':', '@')
  81153. };
  81154. Object.assign(params, queryInfo);
  81155. getFeatureParam = new FilterParameter(params);
  81156. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  81157. queryParameter: getFeatureParam,
  81158. datasetNames: datasetNames,
  81159. fromIndex: 0,
  81160. toIndex: 100000,
  81161. returnContent: true
  81162. });
  81163. var options = {
  81164. eventListeners: {
  81165. processCompleted: function processCompleted(getFeaturesEventArgs) {
  81166. _processCompleted && _processCompleted(getFeaturesEventArgs);
  81167. },
  81168. processFailed: function processFailed(e) {
  81169. processFaild && processFaild(e);
  81170. }
  81171. }
  81172. };
  81173. getFeatureBySQLService = new GetFeaturesBySQLService(url, options);
  81174. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  81175. }
  81176. /**
  81177. * @private
  81178. * @function ChartModel.prototype._queryFeatureBySQL
  81179. * @description 通过 sql 方式查询数据。
  81180. */
  81181. }, {
  81182. key: "_queryFeatureBySQL",
  81183. value: function _queryFeatureBySQL(url, layerName, queryInfo, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  81184. var queryParam, queryBySQLParams;
  81185. var filterParams = {
  81186. name: layerName
  81187. };
  81188. Object.assign(filterParams, queryInfo);
  81189. queryParam = new FilterParameter(filterParams);
  81190. if (fields) {
  81191. queryParam.fields = fields;
  81192. }
  81193. var params = {
  81194. queryParams: [queryParam]
  81195. };
  81196. if (onlyAttribute) {
  81197. params.queryOption = QueryOption.ATTRIBUTE;
  81198. }
  81199. startRecord && (params.startRecord = startRecord);
  81200. recordLength && (params.expectCount = recordLength);
  81201. if (epsgCode) {
  81202. params.prjCoordSys = {
  81203. epsgCode: epsgCode
  81204. };
  81205. }
  81206. queryBySQLParams = new QueryBySQLParameters(params);
  81207. this._queryBySQL(url, queryBySQLParams, function (data) {
  81208. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  81209. });
  81210. }
  81211. /**
  81212. * @function ChartModel.prototype._queryBySQL
  81213. * @description SQL 查询服务。
  81214. * @param {QueryBySQLParameters} params - SQL 查询相关参数类。
  81215. * @param {RequestCallback} callback - 回调函数。
  81216. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 结果类型。
  81217. */
  81218. }, {
  81219. key: "_queryBySQL",
  81220. value: function _queryBySQL(url, params, callback, resultFormat) {
  81221. var me = this;
  81222. var queryBySQLService = new QueryBySQLService(url, {
  81223. eventListeners: {
  81224. scope: me,
  81225. processCompleted: callback,
  81226. processFailed: callback
  81227. },
  81228. format: me._processFormat(resultFormat)
  81229. });
  81230. queryBySQLService.processAsync(params);
  81231. }
  81232. /**
  81233. * @function ChartModel.prototype._processFormat
  81234. * @description 将数据转换成geojson。
  81235. * @param {Object} resultFormat - 返回结果集。
  81236. * @return {Object} [resultFormat=DataFormat.GEOJSON] - 结果类型。
  81237. */
  81238. }, {
  81239. key: "_processFormat",
  81240. value: function _processFormat(resultFormat) {
  81241. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  81242. }
  81243. /**
  81244. * @private
  81245. * @function ChartModel.prototype._formatGeoJSON
  81246. * @description 格式 GeoJSON。
  81247. * @param {GeoJSON} data - GeoJSON 数据。
  81248. */
  81249. }, {
  81250. key: "_formatGeoJSON",
  81251. value: function _formatGeoJSON(data) {
  81252. var features = data.features;
  81253. features.forEach(function (row, index) {
  81254. row.properties['index'] = index;
  81255. });
  81256. return features;
  81257. }
  81258. /**
  81259. * @private
  81260. * @description 将 csv 和 xls 文件内容转换成 geojson
  81261. * @function ChartModel.prototype._excelData2Feature
  81262. * @param content 文件内容
  81263. * @param layerInfo 图层信息
  81264. * @returns {Array} feature的数组集合
  81265. */
  81266. }, {
  81267. key: "_excelData2Feature",
  81268. value: function _excelData2Feature(dataContent) {
  81269. var fieldCaptions = dataContent.colTitles;
  81270. //位置属性处理
  81271. var xfieldIndex = -1,
  81272. yfieldIndex = -1;
  81273. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  81274. if (FileReaderUtil.isXField(fieldCaptions[i])) {
  81275. xfieldIndex = i;
  81276. }
  81277. if (FileReaderUtil.isYField(fieldCaptions[i])) {
  81278. yfieldIndex = i;
  81279. }
  81280. }
  81281. // feature 构建后期支持坐标系 4326/3857
  81282. var features = [];
  81283. for (var _i2 = 0, _len2 = dataContent.rows.length; _i2 < _len2; _i2++) {
  81284. var row = dataContent.rows[_i2];
  81285. var x = Number(row[xfieldIndex]),
  81286. y = Number(row[yfieldIndex]);
  81287. //属性信息
  81288. var attributes = {};
  81289. for (var index in dataContent.colTitles) {
  81290. var key = dataContent.colTitles[index];
  81291. attributes[key] = dataContent.rows[_i2][index];
  81292. }
  81293. attributes['index'] = _i2 + '';
  81294. //目前csv 只支持处理点,所以先生成点类型的 geojson
  81295. var feature = {
  81296. type: 'Feature',
  81297. geometry: {
  81298. type: 'Point',
  81299. coordinates: [x, y]
  81300. },
  81301. properties: attributes
  81302. };
  81303. features.push(feature);
  81304. }
  81305. return features;
  81306. }
  81307. /**
  81308. * @private
  81309. * @description 请求数据失败的事件
  81310. * @function ChartModel.prototype._fireFailedEvent
  81311. * @param {Object} error 错误信息
  81312. */
  81313. }, {
  81314. key: "_fireFailedEvent",
  81315. value: function _fireFailedEvent(error) {
  81316. var errorData = error ? {
  81317. error: error,
  81318. message: Lang.i18n('msg_getdatafailed')
  81319. } : {
  81320. message: Lang.i18n('msg_getdatafailed')
  81321. };
  81322. /**
  81323. * @event ChartModel#getdatafailed
  81324. * @description 监听到获取数据失败事件后触发
  81325. * @property {Object} error - 事件对象。
  81326. */
  81327. this.events.triggerEvent('getdatafailed', errorData);
  81328. }
  81329. }]);
  81330. return ChartModel;
  81331. }();
  81332. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartViewModel.js
  81333. function _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; } } }; }
  81334. 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); }
  81335. 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; }
  81336. function ChartViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81337. 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); } }
  81338. 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; }
  81339. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81340. * This program are made available under the terms of the Apache License, Version 2.0
  81341. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81342. /**
  81343. * @class ChartViewModel
  81344. * @aliasclass Components.ChartViewModel
  81345. * @deprecatedclass SuperMap.Components.ChartViewModel
  81346. * @classdesc 图表组件功能类。
  81347. * @category Components Chart
  81348. * @version 10.0.0
  81349. * @param {Object} options - 可选参数。
  81350. * @param {string} options.type - 图表类型。
  81351. * @param {ChartView.Datasets} options.datasets - 数据来源。
  81352. * @param {Array.<Object>} options.chartOptions - 图表可选配置。
  81353. * @param {Array.<Object>} options.chartOptions.xAxis - X轴可选参数。
  81354. * @param {string} options.chartOptions.xAxis.field - X轴字段名。
  81355. * @param {string} options.chartOptions.xAxis.name - X轴名称。
  81356. * @param {Array.<Object>} options.chartOptions.yAxis - Y轴可选参数。
  81357. * @param {string} options.chartOptions.yAxis.field - Y轴字段名。
  81358. * @param {string} options.chartOptions.yAxis.name - Y轴名称。
  81359. * @fires ChartViewModel#getdatafailed
  81360. * @usage
  81361. */
  81362. var ChartViewModel = /*#__PURE__*/function () {
  81363. function ChartViewModel(options) {
  81364. ChartViewModel_classCallCheck(this, ChartViewModel);
  81365. this.datasets = options.datasets;
  81366. this.xField = [];
  81367. this.yField = [];
  81368. this.grid = {
  81369. top: "50px",
  81370. bottom: "50px",
  81371. left: "50px",
  81372. right: "60px"
  81373. };
  81374. this.chartType = options.type || "bar";
  81375. this._initXYField(options.chartOptions);
  81376. this.EVENT_TYPES = ["getdatafailed"];
  81377. this.events = new Events(this, null, this.EVENT_TYPES);
  81378. }
  81379. /**
  81380. * @function ChartViewModel.prototype._initXYField
  81381. * @description 初始化XY字段。
  81382. * @private
  81383. * @param {Object} chartOptions - options里的图表参数。
  81384. */
  81385. ChartViewModel_createClass(ChartViewModel, [{
  81386. key: "_initXYField",
  81387. value: function _initXYField(chartOptions) {
  81388. var me = this;
  81389. if (chartOptions && chartOptions.length > 0) {
  81390. chartOptions.forEach(function (option) {
  81391. if (option.xAxis) {
  81392. me.xField.push({
  81393. field: option.xAxis.field,
  81394. name: option.xAxis.name
  81395. });
  81396. }
  81397. if (option.yAxis) {
  81398. me.yField.push({
  81399. field: option.yAxis.field,
  81400. name: option.yAxis.name
  81401. });
  81402. }
  81403. });
  81404. }
  81405. }
  81406. /**
  81407. * @function ChartViewModel.prototype.getDatasetInfo
  81408. * @description 获得数据集数据。
  81409. * @param {function} success - 成功回调函数。
  81410. */
  81411. }, {
  81412. key: "getDatasetInfo",
  81413. value: function getDatasetInfo(success) {
  81414. var _this = this;
  81415. this.createChart = success;
  81416. if (this.datasets && this._checkUrl(this.datasets.url)) {
  81417. this.chartModel = new ChartModel(this.datasets);
  81418. if (this.datasets.type === 'iServer') {
  81419. this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this));
  81420. } else if (this.datasets.type === 'iPortal') {
  81421. this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this));
  81422. }
  81423. /**
  81424. * @event ChartViewModel#getdatafailed
  81425. * @description 监听到获取数据失败事件后触发。
  81426. * @property {Object} error - 事件对象。
  81427. */
  81428. this.chartModel.events.on({
  81429. "getdatafailed": function getdatafailed(error) {
  81430. _this.events.triggerEvent("getdatafailed", error);
  81431. }
  81432. });
  81433. }
  81434. }
  81435. /**
  81436. * @function ChartViewModel.prototype._getDatasetInfoSuccess
  81437. * @description 成功回调函数。
  81438. * @private
  81439. * @param {Object} results - 数据集信息。
  81440. */
  81441. }, {
  81442. key: "_getDatasetInfoSuccess",
  81443. value: function _getDatasetInfoSuccess(results) {
  81444. var datasetUrl = this.datasets.url;
  81445. //判断服务为地图服务 或者 数据服务
  81446. var restIndex = datasetUrl.indexOf("rest");
  81447. if (restIndex > 0) {
  81448. var index = datasetUrl.indexOf("/", restIndex + 5);
  81449. var type = datasetUrl.substring(restIndex + 5, index);
  81450. var dataUrl = datasetUrl.substring(0, restIndex + 4) + "/data";
  81451. if (type === "maps") {
  81452. var mapIndex = datasetUrl.indexOf("/", index + 1);
  81453. var mapName = datasetUrl.substring(index + 1, mapIndex);
  81454. dataUrl = datasetUrl.substring(0, restIndex + 4) + "/maps/" + mapName;
  81455. results.result.dataUrl = dataUrl;
  81456. this._getLayerFeatures(results);
  81457. } else if (type === "data") {
  81458. results.result.dataUrl = dataUrl;
  81459. this._getDataFeatures(results);
  81460. }
  81461. }
  81462. }
  81463. /**
  81464. * @function ChartViewModel.prototype._getDataInfoSuccess
  81465. * @description 请求iportal数据成功之后的回调。
  81466. * @private
  81467. */
  81468. }, {
  81469. key: "_getDataInfoSuccess",
  81470. value: function _getDataInfoSuccess(results, type) {
  81471. var me = this;
  81472. if (type === 'RESTMAP') {
  81473. me._getChartDatasFromLayer(results);
  81474. } else {
  81475. me._getChartDatas(results);
  81476. }
  81477. }
  81478. /**
  81479. * @function ChartViewModel.prototype._getDataFeatures
  81480. * @description 请求数据集的数据信息
  81481. * @private
  81482. * @param {Object} results - 数据集信息
  81483. */
  81484. }, {
  81485. key: "_getDataFeatures",
  81486. value: function _getDataFeatures(results) {
  81487. this.chartModel.getDataFeatures(results, this._getChartDatas.bind(this));
  81488. }
  81489. /**
  81490. * @function ChartViewModel.prototype._getLayerFeatures
  81491. * @description 请求图层的数据信息。
  81492. * @private
  81493. * @param {Object} results - 数据集信息。
  81494. */
  81495. }, {
  81496. key: "_getLayerFeatures",
  81497. value: function _getLayerFeatures(results) {
  81498. this.chartModel.getLayerFeatures(results, this._getChartDatasFromLayer.bind(this));
  81499. }
  81500. /**
  81501. * @function ChartViewModel.prototype._getChartDatas
  81502. * @description 将请求回来的数据转换为图表所需的数据格式。
  81503. * @private
  81504. * @param {Object} results - 数据要素信息。
  81505. */
  81506. }, {
  81507. key: "_getChartDatas",
  81508. value: function _getChartDatas(results) {
  81509. if (results) {
  81510. // 数据来自restdata---results.result.features
  81511. this.features = results.result.features;
  81512. var features = this.features.features;
  81513. var data = {};
  81514. if (features.length) {
  81515. var feature = features[0];
  81516. var attrFields = [],
  81517. itemTypes = [];
  81518. for (var attr in feature.properties) {
  81519. attrFields.push(attr);
  81520. itemTypes.push(this._getDataType(feature.properties[attr]));
  81521. }
  81522. data = {
  81523. features: features,
  81524. fieldCaptions: attrFields,
  81525. fieldTypes: itemTypes,
  81526. fieldValues: []
  81527. };
  81528. for (var m in itemTypes) {
  81529. var fieldValue = [];
  81530. for (var j in features) {
  81531. var _feature = features[j];
  81532. var caption = data.fieldCaptions[m];
  81533. var value = _feature.properties[caption];
  81534. fieldValue.push(value);
  81535. }
  81536. data.fieldValues.push(fieldValue);
  81537. }
  81538. this.createChart(data);
  81539. }
  81540. }
  81541. }
  81542. /**
  81543. * @function ChartViewModel.prototype._getChartDatasFromLayer
  81544. * @description 将请求回来的数据转换为图表所需的数据格式。
  81545. * @private
  81546. * @param {Object} results - 图层数据要素信息。
  81547. */
  81548. }, {
  81549. key: "_getChartDatasFromLayer",
  81550. value: function _getChartDatasFromLayer(results) {
  81551. if (results.result.recordsets) {
  81552. var recordsets = results.result.recordsets[0];
  81553. var features = recordsets.features.features;
  81554. this.features = recordsets.features;
  81555. var data = {};
  81556. if (features.length) {
  81557. data = {
  81558. features: recordsets.features,
  81559. fieldCaptions: recordsets.fieldCaptions,
  81560. fieldTypes: recordsets.fieldTypes,
  81561. fieldValues: []
  81562. };
  81563. for (var m in data.fieldCaptions) {
  81564. var fieldValue = [];
  81565. for (var j in features) {
  81566. var feature = features[j];
  81567. var caption = data.fieldCaptions[m];
  81568. var value = feature.properties[caption];
  81569. fieldValue.push(value);
  81570. }
  81571. data.fieldValues.push(fieldValue);
  81572. }
  81573. this.createChart(data);
  81574. }
  81575. }
  81576. }
  81577. /**
  81578. * @function ChartViewModel.prototype._createChartOptions
  81579. * @description 创建图表所需参数。
  81580. * @private
  81581. * @param {Object} data - 图表数据。
  81582. */
  81583. }, {
  81584. key: "_createChartOptions",
  81585. value: function _createChartOptions(data) {
  81586. this.calculatedData = this._createChartDatas(data);
  81587. return this.updateChartOptions(this.chartType);
  81588. }
  81589. /**
  81590. * @function ChartViewModel.prototype.changeType
  81591. * @description 改变图表类型。
  81592. * @param {string} type - 图表类型。
  81593. */
  81594. }, {
  81595. key: "changeType",
  81596. value: function changeType(type) {
  81597. if (type !== this.chartType) {
  81598. this.chartType = type;
  81599. return this.updateChartOptions(this.chartType);
  81600. }
  81601. }
  81602. /**
  81603. * @function ChartViewModel.prototype.updateData
  81604. * @description 改变图表类型。
  81605. * @param {ChartView.Datasets} datasets - 数据来源。
  81606. * @param {function} success 成功回调函数。
  81607. */
  81608. }, {
  81609. key: "updateData",
  81610. value: function updateData(datasets, chartOption, success) {
  81611. this.updateChart = success;
  81612. this.xField = [];
  81613. this.yField = [];
  81614. this._initXYField(chartOption);
  81615. // type的设置默认值
  81616. datasets.type = datasets.type || 'iServer';
  81617. // withCredentials的设置默认值
  81618. datasets.withCredentials = datasets.withCredentials || false;
  81619. this.datasets = datasets;
  81620. this.getDatasetInfo(this._updateDataSuccess.bind(this));
  81621. }
  81622. /**
  81623. * @function ChartViewModel.prototype._updateDataSuccess
  81624. * @description 改变图表类型。
  81625. * @private
  81626. * @param {Object} data - 图表数据。
  81627. */
  81628. }, {
  81629. key: "_updateDataSuccess",
  81630. value: function _updateDataSuccess(data) {
  81631. var options = this._createChartOptions(data);
  81632. this.updateChart(options);
  81633. }
  81634. /**
  81635. * @function ChartViewModel.prototype.updateChartOptions
  81636. * @description 更新图表所需参数。
  81637. * @param {string} type - 图表类型。
  81638. * @param {Object} style - 图表样式。
  81639. */
  81640. }, {
  81641. key: "updateChartOptions",
  81642. value: function updateChartOptions(type, style) {
  81643. if (this.calculatedData) {
  81644. var grid = this.grid;
  81645. var series = this._createChartSeries(this.calculatedData, type);
  81646. var datas = [];
  81647. for (var i in this.calculatedData.XData) {
  81648. datas.push({
  81649. value: this.calculatedData.XData[i].fieldsData
  81650. });
  81651. }
  81652. var xAxis = {
  81653. type: "category",
  81654. name: this.xField[0].name || "X",
  81655. data: datas,
  81656. nameTextStyle: {
  81657. color: '#fff',
  81658. fontSize: 14
  81659. },
  81660. splitLine: {
  81661. show: false
  81662. },
  81663. axisLine: {
  81664. lineStyle: {
  81665. color: '#eee'
  81666. }
  81667. }
  81668. };
  81669. var yAxis = {
  81670. type: "value",
  81671. name: this.yFieldName || "Y",
  81672. data: {},
  81673. nameTextStyle: {
  81674. color: '#fff',
  81675. fontSize: 14
  81676. },
  81677. splitLine: {
  81678. show: false
  81679. },
  81680. axisLine: {
  81681. lineStyle: {
  81682. color: '#eee'
  81683. }
  81684. }
  81685. };
  81686. var tooltip = {
  81687. formatter: '{b0}: {c0}'
  81688. };
  81689. var backgroundColor = '#404a59';
  81690. if (style) {
  81691. if (style.grid) {
  81692. grid = style.grid;
  81693. }
  81694. if (style.tooltip) {
  81695. tooltip = style.tooltip;
  81696. }
  81697. if (style.backgroundColor) {
  81698. backgroundColor = style.backgroundColor;
  81699. }
  81700. }
  81701. return {
  81702. backgroundColor: backgroundColor,
  81703. grid: grid,
  81704. series: series,
  81705. xAxis: xAxis,
  81706. yAxis: yAxis,
  81707. tooltip: tooltip
  81708. };
  81709. }
  81710. }
  81711. /**
  81712. * @function ChartViewModel.prototype._createChartDatas
  81713. * @description 构建图表数据。
  81714. * @private
  81715. * @param {Object} data - 源数据。
  81716. */
  81717. }, {
  81718. key: "_createChartDatas",
  81719. value: function _createChartDatas(data) {
  81720. var fieldIndex = 0,
  81721. yfieldIndexs = [];
  81722. var fieldCaptions = data.fieldCaptions;
  81723. var me = this;
  81724. //X
  81725. fieldCaptions.forEach(function (field, index) {
  81726. if (me.xField[0] && field === me.xField[0].field) {
  81727. fieldIndex = index;
  81728. }
  81729. });
  81730. //Y
  81731. this.yFieldName = "";
  81732. this.yField.forEach(function (value, index) {
  81733. if (index !== 0) {
  81734. me.yFieldName = me.yFieldName + ",";
  81735. }
  81736. me.yFieldName = me.yFieldName + value.name;
  81737. fieldCaptions.forEach(function (field, index) {
  81738. if (field === value.field) {
  81739. yfieldIndexs.push(index);
  81740. }
  81741. });
  81742. });
  81743. var datas = this._getAttrData(data, fieldIndex);
  81744. var yDatas = [];
  81745. if (yfieldIndexs.length > 0) {
  81746. yfieldIndexs.forEach(function (yfieldIndex) {
  81747. var yData = [];
  81748. for (var i in data.fieldValues[yfieldIndex]) {
  81749. yData.push({
  81750. value: data.fieldValues[yfieldIndex][i]
  81751. });
  81752. }
  81753. yDatas.push(yData);
  81754. });
  81755. } else {
  81756. //未指定Y字段时,y轴计数
  81757. var YData = [],
  81758. XData = [],
  81759. len = datas.length;
  81760. //计算X轴,Y轴数据,并去重
  81761. for (var i = 0; i < len; i++) {
  81762. var isSame = false;
  81763. for (var j = 0, leng = XData.length; j < leng; j++) {
  81764. if (datas[i].fieldsData === XData[j].fieldsData) {
  81765. YData[j].value++;
  81766. XData[j].recordIndexs.push(i);
  81767. isSame = true;
  81768. break;
  81769. }
  81770. }
  81771. if (!isSame) {
  81772. if (datas[i].fieldsData) {
  81773. XData.push({
  81774. fieldsData: datas[i].fieldsData,
  81775. recordIndexs: [i]
  81776. });
  81777. YData.push({
  81778. value: 1
  81779. });
  81780. }
  81781. }
  81782. }
  81783. datas = XData;
  81784. yDatas = [YData];
  81785. }
  81786. return {
  81787. XData: datas,
  81788. YData: yDatas
  81789. };
  81790. }
  81791. /**
  81792. * @function ChartViewModel.prototype._getAttrData
  81793. * @description 选中字段数据。
  81794. * @private
  81795. * @param {Object} datacontent - 图表数据。
  81796. * @param {number} index - 字段索引。
  81797. */
  81798. }, {
  81799. key: "_getAttrData",
  81800. value: function _getAttrData(datacontent, index) {
  81801. if (index === 0) {
  81802. this.xField = [{
  81803. field: datacontent.fieldCaptions[index],
  81804. name: datacontent.fieldCaptions[index]
  81805. }];
  81806. }
  81807. var fieldsDatas = [];
  81808. for (var i = 0, len = datacontent.fieldValues[index].length; i < len; i++) {
  81809. var value = datacontent.fieldValues[index][i];
  81810. fieldsDatas.push({
  81811. recordIndexs: i,
  81812. fieldsData: value
  81813. });
  81814. }
  81815. return fieldsDatas;
  81816. }
  81817. /**
  81818. * @function ChartViewModel.prototype._createChartSeries
  81819. * @description 图表数据。
  81820. * @private
  81821. * @param {Object} calculatedData - 图表数据。
  81822. * @param {string} chartType - 图表类型。
  81823. */
  81824. }, {
  81825. key: "_createChartSeries",
  81826. value: function _createChartSeries(calculatedData, chartType) {
  81827. var series = [];
  81828. var yDatas = calculatedData.YData;
  81829. yDatas.forEach(function (yData) {
  81830. var value = 0;
  81831. var serieData = [];
  81832. var _iterator = _createForOfIteratorHelper(yData),
  81833. _step;
  81834. try {
  81835. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  81836. var data = _step.value;
  81837. value = data.value;
  81838. serieData.push({
  81839. value: value
  81840. });
  81841. }
  81842. } catch (err) {
  81843. _iterator.e(err);
  81844. } finally {
  81845. _iterator.f();
  81846. }
  81847. var serie = {
  81848. type: chartType,
  81849. data: serieData,
  81850. name: "y"
  81851. };
  81852. series.push(serie);
  81853. });
  81854. return series;
  81855. }
  81856. /**
  81857. * @function ChartViewModel.prototype._isDate
  81858. * @description 判断是否为日期。
  81859. * @private
  81860. * @param {string} data - 字符串。
  81861. */
  81862. }, {
  81863. key: "_isDate",
  81864. value: function _isDate(data) {
  81865. 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;
  81866. return reg.test(data);
  81867. }
  81868. /**
  81869. * @function ChartViewModel.prototype._isNumber
  81870. * @description 判断是否为数值。
  81871. * @private
  81872. * @param {string} data - 字符串。
  81873. */
  81874. }, {
  81875. key: "_isNumber",
  81876. value: function _isNumber(data) {
  81877. var mdata = Number(data);
  81878. if (mdata === 0) {
  81879. return true;
  81880. }
  81881. return !isNaN(mdata);
  81882. }
  81883. /**
  81884. * @function ChartViewModel.prototype._getDataType
  81885. * @description 判断数据的类型。
  81886. * @private
  81887. * @param {string} data - 字符串。
  81888. */
  81889. }, {
  81890. key: "_getDataType",
  81891. value: function _getDataType(data) {
  81892. if (data !== null && data !== undefined && data !== '') {
  81893. if (this._isDate(data)) {
  81894. return "DATE";
  81895. }
  81896. if (this._isNumber(data)) {
  81897. return "NUMBER";
  81898. }
  81899. }
  81900. return "STRING";
  81901. }
  81902. /**
  81903. * @function ChartViewModel.prototype._checkUrl
  81904. * @description 检查url是否符合要求。
  81905. * @private
  81906. * @param {string} url。
  81907. */
  81908. }, {
  81909. key: "_checkUrl",
  81910. value: function _checkUrl(url) {
  81911. var match;
  81912. if (url === '' || !this._isMatchUrl(url)) {
  81913. match = false;
  81914. } else if (/^http[s]?:\/\/localhost/.test(url) || /^http[s]?:\/\/127.0.0.1/.test(url)) {
  81915. //不是实际域名
  81916. match = false;
  81917. } else {
  81918. match = true;
  81919. }
  81920. return match;
  81921. }
  81922. /**
  81923. * @function ChartViewModel.prototype._isMatchUrl
  81924. * @description 判断输入的地址是否符合地址格式。
  81925. * @private
  81926. * @param {string} str - url。
  81927. */
  81928. }, {
  81929. key: "_isMatchUrl",
  81930. value: function _isMatchUrl(str) {
  81931. var reg = new RegExp('(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
  81932. return reg.test(str);
  81933. }
  81934. /**
  81935. * @function ChartViewModel.prototype.getStyle
  81936. * @description 获取图表样式。
  81937. */
  81938. }, {
  81939. key: "getStyle",
  81940. value: function getStyle() {
  81941. var style = {
  81942. grid: this.grid,
  81943. tooltip: this.tooltip,
  81944. backgroundColor: this.backgroundColor
  81945. };
  81946. return style;
  81947. }
  81948. /**
  81949. * @function ChartViewModel.prototype.getFeatures
  81950. * @description 获取地图服务,数据服务请求返回的数据。
  81951. */
  81952. }, {
  81953. key: "getFeatures",
  81954. value: function getFeatures() {
  81955. return this.features;
  81956. }
  81957. /**
  81958. * @function ChartViewModel.prototype.setStyle
  81959. * @description 设置图表样式。
  81960. * @param {Object} style - 图表样式
  81961. */
  81962. }, {
  81963. key: "setStyle",
  81964. value: function setStyle(style) {
  81965. return this.updateChartOptions(this.chartType, style);
  81966. }
  81967. }]);
  81968. return ChartViewModel;
  81969. }();
  81970. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartView.js
  81971. function ChartView_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  81972. 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); } }
  81973. 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; }
  81974. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  81975. * This program are made available under the terms of the Apache License, Version 2.0
  81976. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  81977. /**
  81978. * @class ChartView
  81979. * @aliasclass Components.ChartView
  81980. * @deprecatedclass SuperMap.Components.Chart
  81981. * @classdesc 图表组件。
  81982. * @modulecategory Components
  81983. * @version 9.1.2
  81984. * @param {string} domID - 图表dom元素ID。
  81985. * @param {Object} options - 可选参数。
  81986. * @param {string} options.type - 图表类型。
  81987. * @param {ChartView.Datasets} options.datasets - 数据来源。
  81988. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  81989. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  81990. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  81991. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  81992. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  81993. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  81994. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  81995. * @category Components Chart
  81996. * @usage
  81997. */
  81998. /**
  81999. * @typedef {Object} ChartView.Datasets - 数据来源。
  82000. * @property {string} [type = 'iServer'] - 服务类型 iServer, iPortal。
  82001. * @property {string} url - 服务地址。
  82002. * @property {boolean} [withCredentials = false] - 设置请求是否带cookie。
  82003. * @property {FilterParameter} queryInfo - 查询条件。
  82004. */
  82005. var ChartView = /*#__PURE__*/function () {
  82006. function ChartView(domID, options) {
  82007. ChartView_classCallCheck(this, ChartView);
  82008. this.domID = domID;
  82009. this.chartType = options.type || "bar";
  82010. // 设置options.datasets.type的默认值是iServer
  82011. options.datasets.type = options.datasets.type || 'iServer';
  82012. // 设置withCredentials的默认值为false
  82013. options.datasets.withCredentials = options.datasets.withCredentials || false;
  82014. this.viewModel = new ChartViewModel(options);
  82015. //添加控件。
  82016. this._fillDataToView();
  82017. }
  82018. /**
  82019. * @function ChartView.prototype.onAdd
  82020. * @description 创建图表之后成功回调。
  82021. * @param {function} addChart - 回调函数。
  82022. */
  82023. ChartView_createClass(ChartView, [{
  82024. key: "onAdd",
  82025. value: function onAdd(addChart) {
  82026. this.addChart = addChart;
  82027. }
  82028. /**
  82029. * @function ChartView.prototype._fillDataToView
  82030. * @description 填充数据到 view。
  82031. * @private
  82032. */
  82033. }, {
  82034. key: "_fillDataToView",
  82035. value: function _fillDataToView() {
  82036. var messageboxs = new MessageBox();
  82037. //iclient 绑定createChart事件成功回调
  82038. this.viewModel.getDatasetInfo(this._createChart.bind(this));
  82039. this.viewModel.events.on({
  82040. "getdatafailed": function getdatafailed(error) {
  82041. messageboxs.showView(error.message);
  82042. }
  82043. });
  82044. }
  82045. /**
  82046. * @function ChartView.prototype.getStyle
  82047. * @description 获取图表样式。
  82048. */
  82049. }, {
  82050. key: "getStyle",
  82051. value: function getStyle() {
  82052. return this.viewModel.getStyle();
  82053. }
  82054. /**
  82055. * @function ChartView.prototype.getFeatures
  82056. * @description 获取地图服务,数据服务请求返回的数据。
  82057. */
  82058. }, {
  82059. key: "getFeatures",
  82060. value: function getFeatures() {
  82061. return this.viewModel.getFeatures();
  82062. }
  82063. /**
  82064. * @function ChartView.prototype.setStyle
  82065. * @description 设置图表样式。
  82066. * @param {Object} style - 图表样式,参考Echarts-options样式设置。
  82067. */
  82068. }, {
  82069. key: "setStyle",
  82070. value: function setStyle(style) {
  82071. var newOptions = this.viewModel.setStyle(style);
  82072. this._updateChart(newOptions);
  82073. }
  82074. /**
  82075. * @function ChartView.prototype.changeType
  82076. * @description 改变图表类型。
  82077. * @param {string} type - 图表类型。
  82078. */
  82079. }, {
  82080. key: "changeType",
  82081. value: function changeType(type) {
  82082. if (this.chartType !== type) {
  82083. this.chartType = type;
  82084. var newOptions = this.viewModel.changeType(type);
  82085. this._updateChart(newOptions);
  82086. }
  82087. }
  82088. /**
  82089. * @function ChartView.prototype.updateData
  82090. * @description 更新图表数据。
  82091. * @param {ChartView.Datasets} datasets - 数据来源。
  82092. * @param {Object} chartOption - X,Y轴信息。
  82093. */
  82094. }, {
  82095. key: "updateData",
  82096. value: function updateData(datasets, chartOption) {
  82097. var me = this;
  82098. this.viewModel.updateData(datasets, chartOption, function (options) {
  82099. me._updateChart(options);
  82100. if (me.addChart) {
  82101. me.addChart();
  82102. }
  82103. });
  82104. }
  82105. /**
  82106. * @function ChartView.prototype._createChart
  82107. * @description 创建图表。
  82108. * @private
  82109. * @param {Object} data - 图表数据。
  82110. */
  82111. }, {
  82112. key: "_createChart",
  82113. value: function _createChart(data) {
  82114. this.echart = external_function_try_return_echarts_catch_e_return_namespaceObject.init(document.getElementById(this.domID), null, {
  82115. renderer: "canvas"
  82116. });
  82117. var options = this.viewModel._createChartOptions(data);
  82118. this.echart.setOption(options);
  82119. if (this.addChart) {
  82120. this.addChart();
  82121. }
  82122. }
  82123. /**
  82124. * @function ChartView.prototype._updateChart
  82125. * @description 更新图表。
  82126. * @private
  82127. * @param {Object} options - 图表参数。
  82128. */
  82129. }, {
  82130. key: "_updateChart",
  82131. value: function _updateChart(options) {
  82132. if (this.echart) {
  82133. this.echart.clear();
  82134. this.echart.setOption(options);
  82135. }
  82136. }
  82137. }]);
  82138. return ChartView;
  82139. }();
  82140. ;// CONCATENATED MODULE: ./src/common/components/templates/TemplateBase.js
  82141. function TemplateBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82142. 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); } }
  82143. 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; }
  82144. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82145. * This program are made available under the terms of the Apache License, Version 2.0
  82146. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82147. /**
  82148. * @class TemplateBase
  82149. * @aliasclass Components.TemplateBase
  82150. * @deprecatedclass SuperMap.Components.TemplateBase
  82151. * @classdesc 组件公用组件父类,用于约束统一封装的公用组件结构。
  82152. * @version 9.1.1
  82153. * @param {Object} options - 组件配置参数。
  82154. * @param {string} options.id - 组件 dom 元素 id。
  82155. * @category Components Common
  82156. * @usage
  82157. */
  82158. var TemplateBase = /*#__PURE__*/function () {
  82159. function TemplateBase(options) {
  82160. TemplateBase_classCallCheck(this, TemplateBase);
  82161. options = options ? options : {};
  82162. /**
  82163. * @member {string} [TemplateBase.prototype.id=null]
  82164. * @description 组件 dom 元素 id。
  82165. */
  82166. this.id = options.id ? options.id : null;
  82167. /**
  82168. * @member {HTMLElement} [TemplateBase.prototype.rootContainer=null]
  82169. * @description 组件 dom 元素对象。
  82170. */
  82171. this.rootContainer = null;
  82172. }
  82173. /**
  82174. * @function TemplateBase.prototype.getElement
  82175. * @description 获取当前组件元素对象。
  82176. * @return {HTMLElement} 组件 dom 元素对象
  82177. */
  82178. TemplateBase_createClass(TemplateBase, [{
  82179. key: "getElement",
  82180. value: function getElement() {
  82181. //todo 其实感觉再这里给组件设置不太合理
  82182. if (this.id) {
  82183. this.rootContainer.id = this.id;
  82184. }
  82185. return this.rootContainer;
  82186. }
  82187. /**
  82188. * @function TemplateBase.prototype._initView
  82189. * @private
  82190. * @description 初始化模板。
  82191. */
  82192. }, {
  82193. key: "_initView",
  82194. value: function _initView() {
  82195. //子类实现此方法
  82196. }
  82197. /**
  82198. * @function TemplateBase.prototype.showView
  82199. * @description 显示组件。
  82200. */
  82201. }, {
  82202. key: "showView",
  82203. value: function showView() {
  82204. this.rootContainer.hidden = false;
  82205. }
  82206. /**
  82207. * @function TemplateBase.prototype.closeView
  82208. * @description 隐藏组件。
  82209. */
  82210. }, {
  82211. key: "closeView",
  82212. value: function closeView() {
  82213. this.rootContainer.hidden = true;
  82214. }
  82215. }]);
  82216. return TemplateBase;
  82217. }();
  82218. ;// CONCATENATED MODULE: ./src/common/components/templates/CommonContainer.js
  82219. 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); }
  82220. function CommonContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82221. 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); } }
  82222. 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; }
  82223. 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); }
  82224. 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); }
  82225. 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); }; }
  82226. 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); }
  82227. function CommonContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82228. 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; } }
  82229. function CommonContainer_getPrototypeOf(o) { CommonContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CommonContainer_getPrototypeOf(o); }
  82230. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82231. * This program are made available under the terms of the Apache License, Version 2.0
  82232. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82233. /**
  82234. * @class CommonContainer
  82235. * @aliasclass Components.CommonContainer
  82236. * @deprecatedclass SuperMap.Components.CommonContainer
  82237. * @classdesc 组件统一外框。
  82238. * @version 9.1.1
  82239. * @param {Object} options - 组件配置参数。
  82240. * @param {string} options.id - 组件 dom 元素 id。
  82241. * @param {string} options.title - 标题。
  82242. * @category Components Common
  82243. * @extends {TemplateBase}
  82244. * @usage
  82245. */
  82246. var CommonContainer = /*#__PURE__*/function (_TemplateBase) {
  82247. CommonContainer_inherits(CommonContainer, _TemplateBase);
  82248. var _super = CommonContainer_createSuper(CommonContainer);
  82249. function CommonContainer(options) {
  82250. var _this;
  82251. CommonContainer_classCallCheck(this, CommonContainer);
  82252. _this = _super.call(this, options);
  82253. var title = options.title ? options.title : "";
  82254. _this._initView(title);
  82255. return _this;
  82256. }
  82257. /**
  82258. * @private
  82259. * @override
  82260. */
  82261. CommonContainer_createClass(CommonContainer, [{
  82262. key: "_initView",
  82263. value: function _initView(title) {
  82264. var container = document.createElement("div");
  82265. container.setAttribute("class", "component-container");
  82266. //title
  82267. var titleContainer = document.createElement("div");
  82268. titleContainer.setAttribute("class", "component-title");
  82269. var titleContent = document.createElement("div");
  82270. titleContent.innerHTML = title;
  82271. titleContainer.appendChild(titleContent);
  82272. container.appendChild(titleContainer);
  82273. //container
  82274. var componentContent = document.createElement("div");
  82275. componentContent.setAttribute("class", "component-content");
  82276. container.appendChild(componentContent);
  82277. this.content = componentContent;
  82278. this.rootContainer = container;
  82279. return container;
  82280. }
  82281. /**
  82282. * @function CommonContainer.prototype.getContentElement
  82283. * @description 获取内容元素容器。
  82284. */
  82285. }, {
  82286. key: "getContentElement",
  82287. value: function getContentElement() {
  82288. return this.content;
  82289. }
  82290. /**
  82291. * @function CommonContainer.prototype.appendContent
  82292. * @description 填充内容元素。
  82293. */
  82294. }, {
  82295. key: "appendContent",
  82296. value: function appendContent(element) {
  82297. this.content.appendChild(element);
  82298. }
  82299. }]);
  82300. return CommonContainer;
  82301. }(TemplateBase);
  82302. ;// CONCATENATED MODULE: ./src/common/components/templates/Select.js
  82303. 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); }
  82304. function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82305. 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); } }
  82306. 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; }
  82307. 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); }
  82308. 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); }
  82309. 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); }; }
  82310. 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); }
  82311. function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82312. 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; } }
  82313. function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
  82314. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82315. * This program are made available under the terms of the Apache License, Version 2.0
  82316. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82317. /**
  82318. * @class Select
  82319. * @aliasclass Components.Select
  82320. * @deprecatedclass SuperMap.Components.Select
  82321. * @classdesc 组件统一的文字下拉框。
  82322. * @version 9.1.1
  82323. * @param {Array.<string|Array>} options - 组件配置参数数组。
  82324. * @param {string} options.id - 组件 dom 元素 id。
  82325. * @param {string} [options.labelName] - label 名称。
  82326. * @param {Array.<string>} options.optionsArr - 需要创建的 option 数据数组。
  82327. * @param {function} [options.optionsClickCb] - option 点击事件回调函数。
  82328. * @extends {TemplateBase}
  82329. * @category Components Common
  82330. * @usage
  82331. */
  82332. var Select = /*#__PURE__*/function (_TemplateBase) {
  82333. Select_inherits(Select, _TemplateBase);
  82334. var _super = Select_createSuper(Select);
  82335. function Select(options) {
  82336. var _this;
  82337. Select_classCallCheck(this, Select);
  82338. _this = _super.call(this, options);
  82339. _this._initView(options);
  82340. return _this;
  82341. }
  82342. Select_createClass(Select, [{
  82343. key: "_initView",
  82344. value: function _initView(options) {
  82345. var selectTool = this._createElement('div', "component-selecttool");
  82346. if (options.labelName) {
  82347. var label = this._createElement('label', 'component-selecttool__lable--describe', selectTool);
  82348. label.innerHTML = options.labelName;
  82349. }
  82350. var chartSelect = this._createElement('div', 'component-selecttool--chart', selectTool);
  82351. chartSelect.setAttribute('tabindex', '1');
  82352. var selectName = this._createElement('div', "component-selecttool__name", chartSelect);
  82353. selectName.title = options.optionsArr[0];
  82354. selectName.innerHTML = options.optionsArr[0];
  82355. var chartTriangleBtn = this._createElement('div', 'component-selecttool__trianglebtn--chart', chartSelect);
  82356. var triangleBtn = this._createElement('div', 'component-triangle-down-img', chartTriangleBtn);
  82357. var selectContent = this._createElement('div', 'component-selecttool__content', chartSelect);
  82358. var scrollarea = this._createElement('div', 'component-selecttool__content--chart', selectContent);
  82359. var scrollareaContent = this._createElement('div', 'component-selecttool__scrollarea__content', scrollarea);
  82360. scrollareaContent.setAttribute('tabindex', '1');
  82361. this.createOptions(scrollareaContent, options.optionsArr);
  82362. this.optionClickEvent(scrollareaContent, selectName, options.optionsClickCb);
  82363. // 下拉框显示 & 隐藏事件
  82364. this._selectClickEvent(chartSelect, selectContent, triangleBtn);
  82365. this.rootContainer = selectTool;
  82366. }
  82367. /**
  82368. * @function Select.prototype.createOptions
  82369. * @description 创建所属下拉框选项。
  82370. */
  82371. }, {
  82372. key: "createOptions",
  82373. value: function createOptions(container, optionsArr) {
  82374. for (var i in optionsArr) {
  82375. var option = this._createElement('div', 'component-selecttool__option', container);
  82376. option.title = optionsArr[i];
  82377. option.innerHTML = optionsArr[i];
  82378. }
  82379. }
  82380. /**
  82381. * @function Select.prototype._selectClickEvent
  82382. * @description select 点击显示&隐藏事件。
  82383. * @private
  82384. */
  82385. }, {
  82386. key: "_selectClickEvent",
  82387. value: function _selectClickEvent(eventElement, contentElement, triangleBtn) {
  82388. eventElement.onclick = function (e) {
  82389. if (contentElement.style.display === "block") {
  82390. contentElement.style.display = "none";
  82391. triangleBtn.className = "component-triangle-down-img";
  82392. } else {
  82393. contentElement.style.display = "block";
  82394. triangleBtn.className = "triangle-up-img";
  82395. }
  82396. e.preventDefault();
  82397. e.stopPropagation();
  82398. };
  82399. eventElement.onmousedown = function (evt) {
  82400. //console.log('dropdownbox onmousedown '+evt.target.className);
  82401. if (evt.target !== this) {
  82402. this.focus();
  82403. evt.preventDefault();
  82404. evt.stopPropagation();
  82405. }
  82406. };
  82407. eventElement.onblur = function () {
  82408. contentElement.style.display = "none";
  82409. triangleBtn.className = "component-triangle-down-img";
  82410. };
  82411. }
  82412. /**
  82413. * @function Select.prototype._createElement
  82414. * @description 通用创建元素。
  82415. * @private
  82416. */
  82417. }, {
  82418. key: "_createElement",
  82419. value: function _createElement(tagName, className, parentEle) {
  82420. var ele = document.createElement(tagName || 'div');
  82421. className && (ele.className = className);
  82422. parentEle && parentEle.appendChild(ele);
  82423. return ele;
  82424. }
  82425. /**
  82426. * @function Select.prototype.optionClickEvent
  82427. * @description 下拉框的 option 的点击事件。
  82428. */
  82429. }, {
  82430. key: "optionClickEvent",
  82431. value: function optionClickEvent(optionEleArr, selectNameEle, optionsClickCb) {
  82432. var _loop = function _loop() {
  82433. var childEle = optionEleArr.children[i];
  82434. childEle.onclick = function () {
  82435. selectNameEle.innerHTML = childEle.innerHTML;
  82436. selectNameEle.title = childEle.title;
  82437. if (childEle.getAttribute('data-value')) {
  82438. selectNameEle.setAttribute('data-value', childEle.getAttribute('data-value'));
  82439. }
  82440. optionsClickCb && optionsClickCb(childEle);
  82441. };
  82442. };
  82443. for (var i = 0; i < optionEleArr.children.length; i++) {
  82444. _loop();
  82445. }
  82446. }
  82447. }]);
  82448. return Select;
  82449. }(TemplateBase);
  82450. ;// CONCATENATED MODULE: ./src/common/components/templates/DropDownBox.js
  82451. 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); }
  82452. function DropDownBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82453. 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); } }
  82454. 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; }
  82455. 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); }
  82456. 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); }
  82457. 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); }; }
  82458. 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); }
  82459. function DropDownBox_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82460. 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; } }
  82461. function DropDownBox_getPrototypeOf(o) { DropDownBox_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DropDownBox_getPrototypeOf(o); }
  82462. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82463. * This program are made available under the terms of the Apache License, Version 2.0
  82464. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82465. /**
  82466. * @class DropDownBox
  82467. * @aliasclass Components.DropDownBox
  82468. * @deprecatedclass SuperMap.Components.DropDownBox
  82469. * @classdesc 组件统一的图片下拉框。
  82470. * @version 9.1.1
  82471. * @param {Array.<Object>} options - 组件配置参数数组。
  82472. * @param {string} options.id - 组件 dom 元素 id。
  82473. * @param {string} options.title - 下拉框 title。
  82474. * @param {string} options.remark - 下拉框解释标记文本。
  82475. * @param {string} [options.dataValue] - 下拉框 attribute 名为 data-value 的值 。
  82476. * @param {string} [options.icon] - 下拉框图标。
  82477. * @param {string} [options.icon.className] - 下拉框图标类名。
  82478. * @param {string} [options.icon.background] - 下拉框图标背景 url。
  82479. * @category Components Common
  82480. * @extends {TemplateBase}
  82481. * @usage
  82482. */
  82483. var DropDownBox = /*#__PURE__*/function (_TemplateBase) {
  82484. DropDownBox_inherits(DropDownBox, _TemplateBase);
  82485. var _super = DropDownBox_createSuper(DropDownBox);
  82486. function DropDownBox(optionsArr) {
  82487. var _this;
  82488. DropDownBox_classCallCheck(this, DropDownBox);
  82489. _this = _super.call(this, optionsArr);
  82490. _this._initView(optionsArr);
  82491. return _this;
  82492. }
  82493. /**
  82494. * @function DropDownBox.prototype._initView
  82495. * @description 初始化下拉框。
  82496. * @private
  82497. * @override
  82498. */
  82499. DropDownBox_createClass(DropDownBox, [{
  82500. key: "_initView",
  82501. value: function _initView(optionsArr) {
  82502. var dropDownContainer = document.createElement('div');
  82503. dropDownContainer.className = 'component-dropdownbox--container';
  82504. var dropDownBox = document.createElement('div');
  82505. dropDownBox.setAttribute('tabindex', '1');
  82506. dropDownBox.className = "component-dropdownbox";
  82507. dropDownContainer.appendChild(dropDownBox);
  82508. var dropDownTopContainer = document.createElement('div');
  82509. dropDownBox.appendChild(dropDownTopContainer);
  82510. this._createDropDownOption(optionsArr[0], dropDownTopContainer);
  82511. var triangleBtnContainer = document.createElement('div');
  82512. triangleBtnContainer.className = 'component-dropdownbox__triangle-btn';
  82513. dropDownBox.appendChild(triangleBtnContainer);
  82514. var triangleBtn = document.createElement('div');
  82515. triangleBtn.className = 'component-triangle-down-img';
  82516. triangleBtnContainer.appendChild(triangleBtn);
  82517. var createDropDownBoxParam = {
  82518. "parentEle": dropDownBox,
  82519. "dropDownContent": ['component-dropdownbox__content component-dropdownbox__content--chart', 'dropDownContent'],
  82520. "scrollareaContent": 'component-selecttool__scrollarea__content',
  82521. "optionsArr": optionsArr,
  82522. "triangleBtn": triangleBtn,
  82523. "dropDownTopContainer": dropDownTopContainer
  82524. };
  82525. this._createDropDownBox(createDropDownBoxParam);
  82526. this.rootContainer = dropDownContainer;
  82527. }
  82528. /**
  82529. * @function DropDownBox.prototype._createDropDownBox
  82530. * @description 创建下拉框。
  82531. * @private
  82532. */
  82533. }, {
  82534. key: "_createDropDownBox",
  82535. value: function _createDropDownBox(createDropDownBoxParam) {
  82536. var dropDownBox = createDropDownBoxParam.parentEle;
  82537. var dropDownTopContainer = createDropDownBoxParam.dropDownTopContainer;
  82538. var dropDownContent = document.createElement('div');
  82539. dropDownContent.className = createDropDownBoxParam.dropDownContent[0];
  82540. dropDownBox.appendChild(dropDownContent);
  82541. var scrollareaContent = document.createElement('div');
  82542. scrollareaContent.className = createDropDownBoxParam.scrollareaContent;
  82543. dropDownContent.appendChild(scrollareaContent);
  82544. var optionsArr = createDropDownBoxParam.optionsArr;
  82545. for (var i = 0; i < optionsArr.length; i++) {
  82546. this._createDropDownOption(optionsArr[i], scrollareaContent);
  82547. }
  82548. // 下拉框显示 & 隐藏事件
  82549. var triangleBtn = createDropDownBoxParam.triangleBtn;
  82550. this._dropDownClickEvent(dropDownBox, dropDownContent, triangleBtn);
  82551. this._eleOnblur(dropDownBox, dropDownContent, triangleBtn);
  82552. // 下拉框 options 点击事件
  82553. var scrollareaOptions = scrollareaContent.children;
  82554. var _loop = function _loop(_i) {
  82555. scrollareaOptions[_i].onclick = function () {
  82556. dropDownTopContainer.innerHTML = scrollareaOptions[_i].outerHTML;
  82557. //evt.stopPropagation();
  82558. };
  82559. };
  82560. for (var _i2 = 0; _i2 < scrollareaOptions.length; _i2++) {
  82561. _loop(_i2);
  82562. }
  82563. }
  82564. /**
  82565. * @function DropDownBox.prototype._createDropDownOption
  82566. * @description 创建下拉框子元素。
  82567. * @private
  82568. */
  82569. }, {
  82570. key: "_createDropDownOption",
  82571. value: function _createDropDownOption(data, parentElement) {
  82572. var ele = document.createElement('div');
  82573. ele.className = 'component-dropdownbox__item';
  82574. var dataItem = data;
  82575. if (dataItem['dataValue']) {
  82576. ele.setAttribute('data-value', dataItem['dataValue']);
  82577. }
  82578. parentElement.appendChild(ele);
  82579. var imgContainer = document.createElement('div');
  82580. imgContainer.className = 'component-dropdownbox__item__img';
  82581. ele.appendChild(imgContainer);
  82582. var img = document.createElement('div');
  82583. if (dataItem.icon.className) {
  82584. img.className = dataItem.icon.className;
  82585. }
  82586. if (dataItem.icon.background) {
  82587. img.style.background = dataItem.icon.background;
  82588. }
  82589. imgContainer.appendChild(img);
  82590. var title = document.createElement('div');
  82591. title.className = 'component-dropdownbox__item__title';
  82592. title.title = dataItem.title;
  82593. title.innerHTML = dataItem.title;
  82594. ele.appendChild(title);
  82595. var remark = document.createElement('div');
  82596. remark.className = 'component-dropdownbox__item__remark';
  82597. remark.title = dataItem.remark;
  82598. remark.innerHTML = dataItem.remark;
  82599. ele.appendChild(remark);
  82600. }
  82601. /**
  82602. * @function DropDownBox.prototype._dropDownClickEvent
  82603. * @description 下拉框点击事件。
  82604. * @private
  82605. */
  82606. }, {
  82607. key: "_dropDownClickEvent",
  82608. value: function _dropDownClickEvent(eventElement, contentElement, triangleBtn) {
  82609. eventElement.onclick = function (e) {
  82610. if (contentElement.style.display === "block") {
  82611. contentElement.style.display = "none";
  82612. triangleBtn.className = "component-triangle-down-img";
  82613. } else {
  82614. contentElement.style.display = "block";
  82615. triangleBtn.className = "triangle-up-img";
  82616. }
  82617. e.preventDefault();
  82618. e.stopPropagation();
  82619. };
  82620. eventElement.onmousedown = function (evt) {
  82621. //console.log('dropdownbox onmousedown '+evt.target.className);
  82622. if (evt.target !== this) {
  82623. this.focus();
  82624. evt.preventDefault();
  82625. evt.stopPropagation();
  82626. }
  82627. };
  82628. }
  82629. /**
  82630. * @function DropDownBox.prototype._eleOnblur
  82631. * @description 下拉框失焦事件。
  82632. * @private
  82633. */
  82634. }, {
  82635. key: "_eleOnblur",
  82636. value: function _eleOnblur(eventElement, contentElement, triangleBtn) {
  82637. eventElement.onblur = function () {
  82638. contentElement.style.display = "none";
  82639. triangleBtn.className = "component-triangle-down-img";
  82640. };
  82641. }
  82642. /**
  82643. * @function DropDownBox.prototype._createElement
  82644. * @description 通用创建元素。
  82645. * @private
  82646. */
  82647. }, {
  82648. key: "_createElement",
  82649. value: function _createElement(tagName, className, parentEle) {
  82650. var ele = document.createElement(tagName || 'div');
  82651. className && (ele.className = className);
  82652. parentEle && parentEle.appendChild(ele);
  82653. return ele;
  82654. }
  82655. }]);
  82656. return DropDownBox;
  82657. }(TemplateBase);
  82658. ;// CONCATENATED MODULE: ./src/common/components/templates/PopContainer.js
  82659. 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); }
  82660. function PopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82661. 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); } }
  82662. 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; }
  82663. 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); }
  82664. 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); }
  82665. 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); }; }
  82666. 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); }
  82667. function PopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82668. 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; } }
  82669. function PopContainer_getPrototypeOf(o) { PopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PopContainer_getPrototypeOf(o); }
  82670. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82671. * This program are made available under the terms of the Apache License, Version 2.0
  82672. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82673. /**
  82674. * @class PopContainer
  82675. * @aliasclass Components.PopContainer
  82676. * @deprecatedclass SuperMap.Components.PopContainer
  82677. * @classdesc 弹框组件。
  82678. * @version 9.1.1
  82679. * @param {Object} options - 组件配置参数。
  82680. * @param {string} options.id - 组件 dom 元素 id。
  82681. * @param {string} options.title - 弹框组件名称。
  82682. * @extends {TemplateBase}
  82683. * @category Components Common
  82684. * @usage
  82685. */
  82686. var PopContainer = /*#__PURE__*/function (_TemplateBase) {
  82687. PopContainer_inherits(PopContainer, _TemplateBase);
  82688. var _super = PopContainer_createSuper(PopContainer);
  82689. function PopContainer(options) {
  82690. var _this;
  82691. PopContainer_classCallCheck(this, PopContainer);
  82692. options = options ? options : {};
  82693. _this = _super.call(this, options);
  82694. options.title = options.title ? options.title : "";
  82695. _this._initView(options.title);
  82696. return _this;
  82697. }
  82698. /**
  82699. * @private
  82700. * @override
  82701. */
  82702. PopContainer_createClass(PopContainer, [{
  82703. key: "_initView",
  82704. value: function _initView(titile) {
  82705. var container = document.createElement("div");
  82706. container.setAttribute("class", "component-popcontainer");
  82707. //header
  82708. var header = document.createElement("div");
  82709. header.setAttribute("class", "component-popcontainer__header");
  82710. var title = document.createElement("label");
  82711. title.setAttribute("class", "component-popcontainer__header__title");
  82712. title.innerHTML = titile;
  82713. header.appendChild(title);
  82714. var closeBtn = document.createElement("span");
  82715. closeBtn.setAttribute("class", "supermapol-icons-clear component-popcontainer__header__close");
  82716. closeBtn.onclick = this.closeView.bind(this);
  82717. container.appendChild(closeBtn);
  82718. container.appendChild(header);
  82719. //content
  82720. var content = document.createElement("div");
  82721. content.setAttribute("class", "component-popcontainer__content");
  82722. this.content = content;
  82723. container.appendChild(content);
  82724. this.rootContainer = container;
  82725. }
  82726. /**
  82727. * @function PopContainer.prototype.appendContent
  82728. * @description 追加内容。
  82729. * @param {HTMLElement} dom - 内容元素。
  82730. */
  82731. }, {
  82732. key: "appendContent",
  82733. value: function appendContent(dom) {
  82734. this.content.appendChild(dom);
  82735. }
  82736. }]);
  82737. return PopContainer;
  82738. }(TemplateBase);
  82739. ;// CONCATENATED MODULE: ./src/common/components/templates/AttributesPopContainer.js
  82740. 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); }
  82741. function AttributesPopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82742. 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); } }
  82743. 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; }
  82744. 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); }
  82745. 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); }
  82746. 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); }; }
  82747. 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); }
  82748. function AttributesPopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82749. 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; } }
  82750. function AttributesPopContainer_getPrototypeOf(o) { AttributesPopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AttributesPopContainer_getPrototypeOf(o); }
  82751. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82752. * This program are made available under the terms of the Apache License, Version 2.0
  82753. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82754. /**
  82755. * @class AttributesPopContainer
  82756. * @aliasclass Components.AttributesPopContainer
  82757. * @deprecatedclass SuperMap.Components.AttributesPopContainer
  82758. * @classdesc 属性弹框组件
  82759. * @version 9.1.1
  82760. * @param {Object} options - 组件配置参数。
  82761. * @param {string} options.id - 组件 dom 元素 id。
  82762. * @param {Object} options.title - 属性弹框组件名称。
  82763. * @param {Object} options.attributes - 组件需要显示的属性内容。
  82764. * @extends {PopContainer}
  82765. * @category Components Common
  82766. * @usage
  82767. */
  82768. var AttributesPopContainer = /*#__PURE__*/function (_PopContainer) {
  82769. AttributesPopContainer_inherits(AttributesPopContainer, _PopContainer);
  82770. var _super = AttributesPopContainer_createSuper(AttributesPopContainer);
  82771. function AttributesPopContainer(options) {
  82772. var _this;
  82773. AttributesPopContainer_classCallCheck(this, AttributesPopContainer);
  82774. //默认为属性:
  82775. options.title = options.title ? options.title : "属性";
  82776. _this = _super.call(this, options);
  82777. _this.rootContainer.firstChild.hidden = true;
  82778. options.attributes = options.attributes ? options.attributes : [];
  82779. _this._createAttributesTable(options.attributes);
  82780. return _this;
  82781. }
  82782. AttributesPopContainer_createClass(AttributesPopContainer, [{
  82783. key: "_createAttributesTable",
  82784. value: function _createAttributesTable(attributes) {
  82785. var table = document.createElement("table");
  82786. table.setAttribute("class", "component-popcontainer__content__table");
  82787. var tbody = document.createElement("tbody");
  82788. var single = true;
  82789. for (var name in attributes) {
  82790. var tr = document.createElement("tr");
  82791. if (single) {
  82792. tr.setAttribute("class", "component-popcontainer__content__td--color");
  82793. }
  82794. var title = document.createElement("td");
  82795. var titleSpan = document.createElement("Span");
  82796. titleSpan.innerHTML = name;
  82797. title.appendChild(titleSpan);
  82798. var value = document.createElement("td");
  82799. value.innerHTML = attributes[name];
  82800. tr.appendChild(title);
  82801. tr.appendChild(value);
  82802. tbody.appendChild(tr);
  82803. single = !single;
  82804. }
  82805. table.appendChild(tbody);
  82806. this.appendContent(table);
  82807. }
  82808. }]);
  82809. return AttributesPopContainer;
  82810. }(PopContainer);
  82811. ;// CONCATENATED MODULE: ./src/common/components/templates/IndexTabsPageContainer.js
  82812. 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); }
  82813. function IndexTabsPageContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82814. 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); } }
  82815. 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; }
  82816. 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); }
  82817. 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); }
  82818. 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); }; }
  82819. 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); }
  82820. function IndexTabsPageContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82821. 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; } }
  82822. function IndexTabsPageContainer_getPrototypeOf(o) { IndexTabsPageContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return IndexTabsPageContainer_getPrototypeOf(o); }
  82823. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82824. * This program are made available under the terms of the Apache License, Version 2.0
  82825. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82826. /**
  82827. * @class IndexTabsPageContainer
  82828. * @aliasclass Components.IndexTabsPageContainer
  82829. * @deprecatedclass SuperMap.Components.IndexTabsPageContainer
  82830. * @classdesc 标签索引组件。
  82831. * @version 9.1.1
  82832. * @param {Object} options - 组件配置参数。
  82833. * @param {string} options.id - 组件 dom 元素 id。
  82834. * @category Components Common
  82835. * @extends {TemplateBase}
  82836. * @usage
  82837. */
  82838. var IndexTabsPageContainer = /*#__PURE__*/function (_TemplateBase) {
  82839. IndexTabsPageContainer_inherits(IndexTabsPageContainer, _TemplateBase);
  82840. var _super = IndexTabsPageContainer_createSuper(IndexTabsPageContainer);
  82841. function IndexTabsPageContainer(options) {
  82842. var _this;
  82843. IndexTabsPageContainer_classCallCheck(this, IndexTabsPageContainer);
  82844. _this = _super.call(this, options);
  82845. _this._initView();
  82846. return _this;
  82847. }
  82848. /**
  82849. * @private
  82850. * @override
  82851. */
  82852. IndexTabsPageContainer_createClass(IndexTabsPageContainer, [{
  82853. key: "_initView",
  82854. value: function _initView() {
  82855. var container = document.createElement("div");
  82856. container.setAttribute("class", "component-tabpage");
  82857. var header = document.createElement("ul");
  82858. this.header = header;
  82859. var content = document.createElement("div");
  82860. content.setAttribute("class", "component-tabpage__content");
  82861. this.content = content;
  82862. container.appendChild(header);
  82863. container.appendChild(content);
  82864. this.rootContainer = container;
  82865. }
  82866. /**
  82867. * @function IndexTabsPageContainer.prototype.setTabs
  82868. * @description 设置标签元素。
  82869. * @param {Array.<HTMLElement>} tabs
  82870. */
  82871. }, {
  82872. key: "setTabs",
  82873. value: function setTabs(tabs) {
  82874. this.removeAllTabs();
  82875. this.appendTabs(tabs);
  82876. }
  82877. /**
  82878. * @function IndexTabsPageContainer.prototype.appendTabs
  82879. * @description 追加标签元素。
  82880. * @param {Array.<HTMLElement>} tabs
  82881. */
  82882. }, {
  82883. key: "appendTabs",
  82884. value: function appendTabs(tabs) {
  82885. for (var i = 0; i < tabs.length; i++) {
  82886. var title = document.createElement("span");
  82887. title.index = i;
  82888. title.appendChild(document.createTextNode(tabs[i].title));
  82889. //绑定标签切换对应页面:
  82890. title.onclick = this._changeTabsPage.bind(this);
  82891. var content = tabs[i].content;
  82892. content.index = i;
  82893. content.hidden = true;
  82894. this.header.appendChild(title);
  82895. this.content.appendChild(content);
  82896. }
  82897. //todo 确认是否两个子元素的 index 相互对应
  82898. //默认显示第一个标签对象
  82899. this.header.firstChild.setAttribute("class", "on");
  82900. this.content.firstChild.hidden = false;
  82901. }
  82902. /**
  82903. * @function IndexTabsPageContainer.prototype.removeTab
  82904. * @description 删除某个标签页面。
  82905. * @param {number} index - 标签索引号。
  82906. */
  82907. }, {
  82908. key: "removeTab",
  82909. value: function removeTab(index) {
  82910. this.header.removeChild(this.header.children[index]);
  82911. this.content.removeChild(this.content.children[index]);
  82912. }
  82913. /**
  82914. * @function IndexTabsPageContainer.prototype.removeAllTabs
  82915. * @description 删除所有标签。
  82916. */
  82917. }, {
  82918. key: "removeAllTabs",
  82919. value: function removeAllTabs() {
  82920. for (var i = this.header.children.length; i > 0; i--) {
  82921. this.header.removeChild(this.header.children[i]);
  82922. this.content.removeChild(this.content.children[i]);
  82923. }
  82924. }
  82925. }, {
  82926. key: "_changeTabsPage",
  82927. value: function _changeTabsPage(e) {
  82928. var index = e.target.index;
  82929. for (var i = 0; i < this.header.children.length; i++) {
  82930. this.header.children[i].setAttribute("class", "");
  82931. this.content.children[i].hidden = true;
  82932. if (i === index) {
  82933. this.header.children[i].setAttribute("class", "on");
  82934. this.content.children[i].hidden = false;
  82935. }
  82936. }
  82937. }
  82938. }]);
  82939. return IndexTabsPageContainer;
  82940. }(TemplateBase);
  82941. ;// CONCATENATED MODULE: ./src/common/components/templates/CityTabsPage.js
  82942. 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); }
  82943. function CityTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  82944. 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); } }
  82945. 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; }
  82946. 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); }
  82947. 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); }
  82948. 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); }; }
  82949. 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); }
  82950. function CityTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  82951. 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; } }
  82952. function CityTabsPage_getPrototypeOf(o) { CityTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CityTabsPage_getPrototypeOf(o); }
  82953. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  82954. * This program are made available under the terms of the Apache License, Version 2.0
  82955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  82956. /**
  82957. * @class CityTabsPage
  82958. * @aliasclass Components.CityTabsPage
  82959. * @deprecatedclass SuperMap.Components.CityTabsPage
  82960. * @classdesc 城市地址匹配组件模板
  82961. * @version 9.1.1
  82962. * @param {Object} options - 组件配置参数。
  82963. * @param {string} options.id - 组件 dom 元素 id。
  82964. * @param {Object|Array.<string>} options.config - 城市名称配置列表,支持两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或
  82965. * ["成都市","北京市"],用户可根据自己的项目需求进行配置
  82966. * @extends {IndexTabsPageContainer}
  82967. * @category Components Common
  82968. * @usage
  82969. */
  82970. var CityTabsPage = /*#__PURE__*/function (_IndexTabsPageContain) {
  82971. CityTabsPage_inherits(CityTabsPage, _IndexTabsPageContain);
  82972. var _super = CityTabsPage_createSuper(CityTabsPage);
  82973. function CityTabsPage(options) {
  82974. var _this;
  82975. CityTabsPage_classCallCheck(this, CityTabsPage);
  82976. _this = _super.call(this, options);
  82977. //去掉默认的边框阴影样式:
  82978. _this.rootContainer.classList.add("component-citytabpage--noneBoxShadow");
  82979. _this.config = options.config;
  82980. //header,若 config为城市名称数组,则直接加载内容
  82981. if (Util_Util.isArray(_this.config)) {
  82982. _this.header.hidden = true;
  82983. _this._createCityItem("城市", _this.config);
  82984. _this.content.style.border = "none";
  82985. } else {
  82986. _this._createTabs();
  82987. _this.header.onclick = function (e) {
  82988. //关闭所有元素 是否有更简化的写法?
  82989. for (var i = 0; i < _this.header.children.length; i++) {
  82990. _this.header.children[i].setAttribute("class", "");
  82991. }
  82992. //打开点击内容元素
  82993. e.target.setAttribute("class", "on");
  82994. _this._createCityContent(e.target.innerHTML);
  82995. };
  82996. }
  82997. return _this;
  82998. }
  82999. /**
  83000. * @function CityTabsPage.prototype._createTabs
  83001. * @description 创建 Tabs
  83002. * @private
  83003. */
  83004. CityTabsPage_createClass(CityTabsPage, [{
  83005. key: "_createTabs",
  83006. value: function _createTabs() {
  83007. //header
  83008. if (Util_Util.isArray(this.config)) {
  83009. for (var i = 0; i < this.config.length; i++) {
  83010. var innerHTML = "";
  83011. for (var key in this.config[i]) {
  83012. innerHTML += key;
  83013. }
  83014. var li = document.createElement("li");
  83015. li.innerHTML = innerHTML;
  83016. this.header.appendChild(li);
  83017. }
  83018. } else {
  83019. for (var _key2 in this.config) {
  83020. var _li = document.createElement("li");
  83021. _li.innerHTML = _key2;
  83022. this.header.appendChild(_li);
  83023. }
  83024. }
  83025. this.header.firstChild.setAttribute("class", "on");
  83026. this._createCityContent(this.header.firstChild.innerHTML);
  83027. }
  83028. /**
  83029. * @function CityTabsPage.prototype._createCityContent
  83030. * @description 创建列表容器
  83031. * @private
  83032. */
  83033. }, {
  83034. key: "_createCityContent",
  83035. value: function _createCityContent(keyName) {
  83036. //清除元素:
  83037. for (var i = this.content.children.length; i > 0; i--) {
  83038. this.content.removeChild(this.content.children[i - 1]);
  83039. }
  83040. //创建对应元素
  83041. var cities = this.config[keyName];
  83042. for (var key in cities) {
  83043. this._createCityItem(key, cities[key]);
  83044. }
  83045. }
  83046. /**
  83047. * @function CityTabsPage.prototype._createCityContent
  83048. * @description 创建列表容器
  83049. * @private
  83050. */
  83051. }, {
  83052. key: "_createCityItem",
  83053. value: function _createCityItem(key, cities) {
  83054. var city = document.createElement("div");
  83055. var cityClass = document.createElement("div");
  83056. cityClass.setAttribute("class", "component-citytabpag__py-key");
  83057. cityClass.innerHTML = key;
  83058. city.appendChild(cityClass);
  83059. var cityContent = document.createElement("div");
  83060. cityContent.setAttribute("class", "component-citytabpag__content");
  83061. for (var i = 0; i < cities.length; i++) {
  83062. var span = document.createElement("span");
  83063. span.innerHTML = cities[i];
  83064. cityContent.appendChild(span);
  83065. }
  83066. //HOT 元素长度单独微调:
  83067. if (key === "HOT") {
  83068. cityContent.style.width = "428px";
  83069. }
  83070. city.appendChild(cityContent);
  83071. this.content.appendChild(city);
  83072. }
  83073. }]);
  83074. return CityTabsPage;
  83075. }(IndexTabsPageContainer);
  83076. ;// CONCATENATED MODULE: ./src/common/components/templates/NavTabsPage.js
  83077. 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); }
  83078. function NavTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83079. 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); } }
  83080. 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; }
  83081. 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); }
  83082. 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); }
  83083. 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); }; }
  83084. 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); }
  83085. function NavTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83086. 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; } }
  83087. function NavTabsPage_getPrototypeOf(o) { NavTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NavTabsPage_getPrototypeOf(o); }
  83088. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83089. * This program are made available under the terms of the Apache License, Version 2.0
  83090. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83091. /**
  83092. * @class NavTabsPage
  83093. * @aliasclass Components.NavTabsPage
  83094. * @deprecatedclass SuperMap.Components.NavTabsPage
  83095. * @classdesc 标签页面组件。
  83096. * @version 9.1.1
  83097. * @param {Object} options - 组件配置参数。
  83098. * @param {string} options.id - 组件 dom 元素 id。
  83099. * @param {Array.<Object>} [options.tabs=[]] - 标签对象数组,形如:[{title: "",content: HTMLElement}],初始时,传入则创建页面。
  83100. * @extends {TemplateBase}
  83101. * @category Components Common
  83102. * @usage
  83103. */
  83104. // todo 思考拆分的控件应该以哪种方式使用
  83105. var NavTabsPage = /*#__PURE__*/function (_TemplateBase) {
  83106. NavTabsPage_inherits(NavTabsPage, _TemplateBase);
  83107. var _super = NavTabsPage_createSuper(NavTabsPage);
  83108. function NavTabsPage(options) {
  83109. var _this;
  83110. NavTabsPage_classCallCheck(this, NavTabsPage);
  83111. _this = _super.call(this, options);
  83112. _this.navTabsTitle = null;
  83113. _this.navTabsContent = null;
  83114. options.tabs = options.tabs ? options.tabs : [];
  83115. _this._initView(options.tabs);
  83116. return _this;
  83117. }
  83118. /**
  83119. * @override
  83120. * @private
  83121. */
  83122. NavTabsPage_createClass(NavTabsPage, [{
  83123. key: "_initView",
  83124. value: function _initView(tabs) {
  83125. var navTabsPage = document.createElement("div");
  83126. navTabsPage.setAttribute("class", "component-navtabspage");
  83127. //关闭按钮
  83128. var closeBtn = document.createElement("span");
  83129. closeBtn.setAttribute("class", "supermapol-icons-close");
  83130. closeBtn.onclick = this.closeView.bind(this);
  83131. navTabsPage.appendChild(closeBtn);
  83132. //标签
  83133. var navTabsTitle = document.createElement("div");
  83134. this.navTabsTitle = navTabsTitle;
  83135. navTabsTitle.setAttribute("class", "component-navtabspage__title");
  83136. navTabsPage.appendChild(navTabsTitle);
  83137. //内容
  83138. var navTabsContent = document.createElement("div");
  83139. this.navTabsContent = navTabsContent;
  83140. navTabsContent.setAttribute("class", "component-navtabspage__content");
  83141. navTabsPage.appendChild(navTabsContent);
  83142. //若 tabs 初始传入值,则
  83143. if (tabs.length > 0) {
  83144. this.appendTabs(tabs);
  83145. }
  83146. this.rootContainer = navTabsPage;
  83147. }
  83148. /**
  83149. * @function NavTabsPage.prototype.setTabs
  83150. * @description 设置标签。
  83151. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  83152. */
  83153. }, {
  83154. key: "setTabs",
  83155. value: function setTabs(tabs) {
  83156. this.removeAllTabs();
  83157. this.appendTabs(tabs);
  83158. }
  83159. /**
  83160. * @function NavTabsPage.prototype.appendTabs
  83161. * @description 添加标签页面。
  83162. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  83163. */
  83164. }, {
  83165. key: "appendTabs",
  83166. value: function appendTabs(tabs) {
  83167. for (var i = 0; i < tabs.length; i++) {
  83168. var title = document.createElement("span");
  83169. title.index = i;
  83170. title.appendChild(document.createTextNode(tabs[i].title));
  83171. //绑定标签切换对应页面:
  83172. title.onclick = this._changeTabsPage.bind(this);
  83173. var content = tabs[i].content;
  83174. content.index = i;
  83175. content.hidden = true;
  83176. this.navTabsTitle.appendChild(title);
  83177. this.navTabsContent.appendChild(content);
  83178. }
  83179. //todo 确认是否两个子元素的 index 相互对应
  83180. //默认显示第一个标签对象
  83181. this.navTabsTitle.firstChild.setAttribute("class", "component-navtabspage__tabs--select");
  83182. this.navTabsContent.firstChild.hidden = false;
  83183. }
  83184. /**
  83185. * @function NavTabsPage.prototype.removeTab
  83186. * @description 删除某个标签页面。
  83187. * @param {number} index - 标签索引号。
  83188. */
  83189. }, {
  83190. key: "removeTab",
  83191. value: function removeTab(index) {
  83192. this.navTabsTitle.removeChild(this.navTabsTitle.children[index]);
  83193. this.navTabsContent.removeChild(this.navTabsContent.children[index]);
  83194. }
  83195. /**
  83196. * @function NavTabsPage.prototype.removeAllTabs
  83197. * @description 删除所有标签。
  83198. */
  83199. }, {
  83200. key: "removeAllTabs",
  83201. value: function removeAllTabs() {
  83202. for (var i = this.navTabsTitle.children.length; i > 0; i--) {
  83203. this.navTabsTitle.removeChild(this.navTabsTitle.children[i]);
  83204. this.navTabsContent.removeChild(this.navTabsContent.children[i]);
  83205. }
  83206. }
  83207. }, {
  83208. key: "_changeTabsPage",
  83209. value: function _changeTabsPage(e) {
  83210. var index = e.target.index;
  83211. for (var i = 0; i < this.navTabsTitle.children.length; i++) {
  83212. this.navTabsTitle.children[i].setAttribute("class", "");
  83213. this.navTabsContent.children[i].hidden = true;
  83214. if (i === index) {
  83215. this.navTabsTitle.children[i].setAttribute("class", "component-navtabspage__tabs--select");
  83216. this.navTabsContent.children[i].hidden = false;
  83217. }
  83218. }
  83219. }
  83220. }]);
  83221. return NavTabsPage;
  83222. }(TemplateBase);
  83223. ;// CONCATENATED MODULE: ./src/common/components/templates/PaginationContainer.js
  83224. 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); }
  83225. function PaginationContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83226. 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); } }
  83227. 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; }
  83228. 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); }
  83229. 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); }
  83230. 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); }; }
  83231. 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); }
  83232. function PaginationContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  83233. 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; } }
  83234. function PaginationContainer_getPrototypeOf(o) { PaginationContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PaginationContainer_getPrototypeOf(o); }
  83235. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83236. * This program are made available under the terms of the Apache License, Version 2.0
  83237. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83238. /**
  83239. * @class PaginationContainer
  83240. * @aliasclass Components.PaginationContainer
  83241. * @deprecatedclass SuperMap.Components.PaginationContainer
  83242. * @classdesc 分页组件模板。
  83243. * @version 9.1.1
  83244. * @param {Object} options - 组件配置参数。
  83245. * @param {string} options.id - 组件 dom 元素 id。
  83246. * @param {HTMLElement} options.contents - 页面填充的 DOM 元素对象。
  83247. * @param {number} options.pageCounts - 页数。
  83248. * @extends {TemplateBase}
  83249. * @category Components Common
  83250. * @usage
  83251. */
  83252. var PaginationContainer = /*#__PURE__*/function (_TemplateBase) {
  83253. PaginationContainer_inherits(PaginationContainer, _TemplateBase);
  83254. var _super = PaginationContainer_createSuper(PaginationContainer);
  83255. function PaginationContainer(options) {
  83256. var _this;
  83257. PaginationContainer_classCallCheck(this, PaginationContainer);
  83258. options = options ? options : {};
  83259. _this = _super.call(this, options);
  83260. _this.currentPage = 0;
  83261. _this.pageNumberLis = [];
  83262. _this.currentPageNumberLis = [];
  83263. _this.linkageEvent = null;
  83264. options.contents = options.contents ? options.contents : null;
  83265. options.pageCounts = options.pageCounts ? options.pageCounts : 0;
  83266. _this._initView(options.contents, options.pageCounts);
  83267. return _this;
  83268. }
  83269. /**
  83270. * @function PaginationContainer.prototype.setLinkageEvent
  83271. * @description 设置页面联动方法。
  83272. * @param {function} linkageEvent - 联动方法,实现指定功能。
  83273. */
  83274. PaginationContainer_createClass(PaginationContainer, [{
  83275. key: "setLinkageEvent",
  83276. value: function setLinkageEvent(linkageEvent) {
  83277. this.linkageEvent = linkageEvent;
  83278. }
  83279. /**
  83280. * @private
  83281. * @override
  83282. */
  83283. }, {
  83284. key: "_initView",
  83285. value: function _initView(contents, pageCounts) {
  83286. var container = document.createElement("div");
  83287. container.setAttribute("class", "component-pagination");
  83288. //content
  83289. var content = document.createElement("div");
  83290. content.setAttribute("class", "component-pagination__content");
  83291. container.appendChild(content);
  83292. this.content = content;
  83293. //link
  83294. var link = document.createElement("ul");
  83295. link.setAttribute("class", "component-pagination__link");
  83296. link.onclick = this._changePageEvent.bind(this);
  83297. container.appendChild(link);
  83298. this._createLink(link);
  83299. this.link = link;
  83300. //填充内容:
  83301. if (contents) {
  83302. this.setContent(contents);
  83303. }
  83304. if (pageCounts !== 0) {
  83305. this.setPageLink(pageCounts);
  83306. }
  83307. this.rootContainer = container;
  83308. }
  83309. /**---------以下是页面相关操作 **/
  83310. /**
  83311. * @function PaginationContainer.prototype.setContent
  83312. * @description 设置页面内容。
  83313. * @param {HTMLElement} element - 页面内容元素。
  83314. */
  83315. }, {
  83316. key: "setContent",
  83317. value: function setContent(element) {
  83318. this.clearContent();
  83319. this.appendContent(element);
  83320. }
  83321. /**
  83322. * @function PaginationContainer.prototype.appendContent
  83323. * @description 追加内容。
  83324. * @param {HTMLElement} element - 页面内容元素。
  83325. */
  83326. }, {
  83327. key: "appendContent",
  83328. value: function appendContent(element) {
  83329. this.content.appendChild(element);
  83330. }
  83331. /**
  83332. * @function PaginationContainer.prototype.clearContent
  83333. * @description 清空内容元素。
  83334. */
  83335. }, {
  83336. key: "clearContent",
  83337. value: function clearContent() {
  83338. for (var i = this.content.children.length - 1; i >= 0; i--) {
  83339. this.content.removeChild(this.content.children[i]);
  83340. }
  83341. }
  83342. /** -----以下是页码相关的操作:**/
  83343. /**
  83344. * @function PaginationContainer.prototype.setPageLink
  83345. * @description 设置页码数。
  83346. * @param {number} pageNumber - 页码数。
  83347. */
  83348. }, {
  83349. key: "setPageLink",
  83350. value: function setPageLink(pageNumber) {
  83351. //清空当前页码
  83352. this.pageNumberLis = [];
  83353. this.currentPageNumberLis = [];
  83354. this.clearPageLink();
  83355. //创建页码
  83356. this._createPageLi(pageNumber);
  83357. //添加页码到页码列表
  83358. this._appendPageLink();
  83359. }
  83360. /**
  83361. * @description 创建页码。
  83362. * @param pageNumber
  83363. * @private
  83364. */
  83365. }, {
  83366. key: "_createPageLi",
  83367. value: function _createPageLi(pageNumber) {
  83368. for (var i = 0; i < pageNumber; i++) {
  83369. var pageLi = document.createElement("li");
  83370. pageLi.innerHTML = i + 1;
  83371. /*const liContent = document.createElement("span");
  83372. liContent.innerHTML = i + 1;*/
  83373. // pageLi.appendChild(liContent);
  83374. this.pageNumberLis.push(pageLi);
  83375. }
  83376. this.pageNumberLis[0].setAttribute("class", "active");
  83377. this.currentPage = 1;
  83378. if (pageNumber < 5) {
  83379. this.currentPageNumberLis = this.pageNumberLis;
  83380. } else {
  83381. for (var _i2 = 0; _i2 < 5; _i2++) {
  83382. this.currentPageNumberLis.push(this.pageNumberLis[_i2]);
  83383. }
  83384. }
  83385. }
  83386. /**
  83387. * @description 添加页码到页码列表。
  83388. * @private
  83389. */
  83390. }, {
  83391. key: "_appendPageLink",
  83392. value: function _appendPageLink() {
  83393. //todo 如何插入中间
  83394. for (var i = 0; i < this.currentPageNumberLis.length; i++) {
  83395. this.link.insertBefore(this.currentPageNumberLis[i], this.link.childNodes[this.link.children.length - 2]);
  83396. }
  83397. for (var _i4 = 0; _i4 < this.currentPageNumberLis.length; _i4++) {
  83398. //清空 active 状态
  83399. this.currentPageNumberLis[_i4].setAttribute("class", "");
  83400. //给当前选中的 li 赋值 active 状态
  83401. if (Number(this.currentPageNumberLis[_i4].innerHTML) === this.currentPage) {
  83402. this.currentPageNumberLis[_i4].setAttribute("class", "active");
  83403. }
  83404. }
  83405. //根据 currentPage 改变按钮状态
  83406. this._changeDisableState();
  83407. if (this.linkageEvent) {
  83408. this.linkageEvent(this.currentPage);
  83409. }
  83410. }
  83411. /**
  83412. * @function PaginationContainer.prototype.clearPageLink
  83413. * @description 清除页码列表。
  83414. */
  83415. }, {
  83416. key: "clearPageLink",
  83417. value: function clearPageLink() {
  83418. for (var i = this.link.children.length - 3; i > 1; i--) {
  83419. this.link.removeChild(this.link.children[i]);
  83420. }
  83421. }
  83422. /**
  83423. * @description 创建页码按钮。
  83424. * @param ul
  83425. * @private
  83426. */
  83427. }, {
  83428. key: "_createLink",
  83429. value: function _createLink(ul) {
  83430. for (var i = 0; i < 4; i++) {
  83431. var li = document.createElement("li");
  83432. li.setAttribute("class", "disable");
  83433. var liContent = document.createElement("span");
  83434. li.appendChild(liContent);
  83435. if (i === 0) {
  83436. liContent.id = "first";
  83437. liContent.setAttribute("class", "supermapol-icons-first");
  83438. } else if (i === 1) {
  83439. liContent.id = "prev";
  83440. liContent.setAttribute("class", "supermapol-icons-prev");
  83441. } else if (i === 2) {
  83442. liContent.id = "next";
  83443. liContent.setAttribute("class", "supermapol-icons-next");
  83444. } else if (i === 3) {
  83445. liContent.id = "last";
  83446. liContent.setAttribute("class", "supermapol-icons-last");
  83447. }
  83448. ul.appendChild(li);
  83449. }
  83450. }
  83451. /**
  83452. * @description 点击页码事件。
  83453. * @param e
  83454. * @private
  83455. */
  83456. }, {
  83457. key: "_changePageEvent",
  83458. value: function _changePageEvent(e) {
  83459. //todo
  83460. var trigger = e.target;
  83461. //若列表禁用,点击无效
  83462. if (trigger.parentElement.classList[0] === "disable") {
  83463. return;
  83464. }
  83465. var targetLi;
  83466. if (trigger.id) {
  83467. targetLi = trigger.id;
  83468. } else if (Number(trigger.innerHTML)) {
  83469. targetLi = Number(trigger.innerHTML);
  83470. } else {
  83471. return;
  83472. }
  83473. //页码预处理:
  83474. this._prePageNum(targetLi);
  83475. //根据 currentPageNumberLis 创建页码列表
  83476. this.clearPageLink();
  83477. this._appendPageLink();
  83478. }
  83479. /**
  83480. * @description 根据 currentPage 改变按钮状态。
  83481. * @private
  83482. */
  83483. }, {
  83484. key: "_changeDisableState",
  83485. value: function _changeDisableState() {
  83486. this.link.children[0].setAttribute("class", "");
  83487. this.link.children[1].setAttribute("class", "");
  83488. this.link.children[this.link.children.length - 1].setAttribute("class", "");
  83489. this.link.children[this.link.children.length - 2].setAttribute("class", "");
  83490. if (this.currentPage === 1) {
  83491. this.link.children[0].setAttribute("class", "disable");
  83492. this.link.children[1].setAttribute("class", "disable");
  83493. }
  83494. if (this.currentPage === this.pageNumberLis.length) {
  83495. this.link.children[this.link.children.length - 1].setAttribute("class", "disable");
  83496. this.link.children[this.link.children.length - 2].setAttribute("class", "disable");
  83497. }
  83498. }
  83499. /**
  83500. * @description 根据点击页码列表事件准备需展现的页码列表。
  83501. * @param {string|number} targetLi - 被点击的列表对象 id 或 被点击的页码值。
  83502. * @private
  83503. */
  83504. }, {
  83505. key: "_prePageNum",
  83506. value: function _prePageNum(targetLi) {
  83507. var currentPageNumberLis = [];
  83508. if (targetLi === "first") {
  83509. this.currentPage = 1;
  83510. } else if (targetLi === "last") {
  83511. this.currentPage = this.pageNumberLis.length;
  83512. } else if (targetLi === "prev") {
  83513. this.currentPage = this.currentPage - 1;
  83514. } else if (targetLi === "next") {
  83515. this.currentPage = this.currentPage + 1;
  83516. } else {
  83517. this.currentPage = targetLi;
  83518. }
  83519. if (this.pageNumberLis.length <= 5) {
  83520. for (var i = 0; i < this.pageNumberLis.length; i++) {
  83521. currentPageNumberLis.push(this.pageNumberLis[i]);
  83522. }
  83523. } else {
  83524. //当前点击前三,都取前五
  83525. if (this.currentPage <= 3) {
  83526. for (var _i6 = 0; _i6 < 5; _i6++) {
  83527. currentPageNumberLis.push(this.pageNumberLis[_i6]);
  83528. }
  83529. } else if (this.currentPage >= this.pageNumberLis.length - 3) {
  83530. //点击后三,都取后5
  83531. for (var _i8 = this.pageNumberLis.length - 5; _i8 < this.pageNumberLis.length; _i8++) {
  83532. currentPageNumberLis.push(this.pageNumberLis[_i8]);
  83533. }
  83534. } else {
  83535. //其他,取中间:
  83536. for (var _i10 = this.currentPage - 3; _i10 <= this.currentPage + 1; _i10++) {
  83537. currentPageNumberLis.push(this.pageNumberLis[_i10]);
  83538. }
  83539. }
  83540. }
  83541. if (currentPageNumberLis.length > 0) {
  83542. this.currentPageNumberLis = currentPageNumberLis;
  83543. }
  83544. }
  83545. }]);
  83546. return PaginationContainer;
  83547. }(TemplateBase);
  83548. ;// CONCATENATED MODULE: ./src/common/components/util/Util.js
  83549. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83550. * This program are made available under the terms of the Apache License, Version 2.0
  83551. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83552. /**
  83553. * @name ComponentsUtil
  83554. * @namespace
  83555. * @category BaseTypes Util
  83556. * @description 获取文件类型工具类。
  83557. * @usage
  83558. * ```
  83559. * // 浏览器
  83560. * <script type="text/javascript" src="{cdn}"></script>
  83561. * <script>
  83562. * const result = {namespace}.ComponentsUtil.getFileType(fileName);
  83563. *
  83564. * </script>
  83565. * // ES6 Import
  83566. * import { ComponentsUtil } from '{npm}';
  83567. *
  83568. * const result = ComponentsUtil.getFileType(fileName);
  83569. * ```
  83570. */
  83571. var ComponentsUtil = {
  83572. /**
  83573. * @function ComponentsUtil.getFileType
  83574. * @description 获取上传文件类型。
  83575. * @param {string} fileName - 文件名称。
  83576. */
  83577. getFileType: function getFileType(fileName) {
  83578. var regCSV = /^.*\.(?:csv)$/i;
  83579. var regExcel = /^.*\.(?:xls|xlsx)$/i; //文件名可以带空格
  83580. var regGeojson = /^.*\.(?:geojson|json)$/i;
  83581. if (regExcel.test(fileName)) {
  83582. //校验不通过
  83583. return FileTypes.EXCEL;
  83584. } else if (regCSV.test(fileName)) {
  83585. return FileTypes.CSV;
  83586. } else if (regGeojson.test(fileName)) {
  83587. return FileTypes.GEOJSON;
  83588. }
  83589. return null;
  83590. }
  83591. };
  83592. ;// CONCATENATED MODULE: ./src/common/components/util/index.js
  83593. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83594. * This program are made available under the terms of the Apache License, Version 2.0
  83595. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83596. ;// CONCATENATED MODULE: ./src/common/components/index.js
  83597. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83598. * This program are made available under the terms of the Apache License, Version 2.0
  83599. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83600. //数据
  83601. //组件
  83602. //提示框组件
  83603. //图表组件
  83604. //公用模板:
  83605. //工具类
  83606. ;// CONCATENATED MODULE: ./src/common/lang/index.js
  83607. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  83608. * This program are made available under the terms of the Apache License, Version 2.0
  83609. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  83610. // EXTERNAL MODULE: ./node_modules/lodash.uniqby/index.js
  83611. var lodash_uniqby = __webpack_require__(9819);
  83612. var lodash_uniqby_default = /*#__PURE__*/__webpack_require__.n(lodash_uniqby);
  83613. ;// CONCATENATED MODULE: ./src/common/overlay/knowledge-graph/format.js
  83614. 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; }
  83615. 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; }
  83616. 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; }
  83617. function format_toConsumableArray(arr) { return format_arrayWithoutHoles(arr) || format_iterableToArray(arr) || format_unsupportedIterableToArray(arr) || format_nonIterableSpread(); }
  83618. 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."); }
  83619. 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); }
  83620. function format_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  83621. function format_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return format_arrayLikeToArray(arr); }
  83622. 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; }
  83623. function transformGraphMap(data, graphMap) {
  83624. var style = graphMap && graphMap.styles && graphMap.styles.style;
  83625. var captionField = graphMap && graphMap.captionFields && graphMap.captionFields.captionField;
  83626. var rst = {
  83627. nodes: [],
  83628. edges: []
  83629. };
  83630. data.forEach(function (item) {
  83631. var pathData = item.path;
  83632. if (pathData) {
  83633. var _rst$nodes, _rst$edges;
  83634. var _transformPath2 = transformPath(pathData, style, captionField),
  83635. nodes = _transformPath2.nodes,
  83636. edges = _transformPath2.edges;
  83637. (_rst$nodes = rst.nodes).push.apply(_rst$nodes, format_toConsumableArray(nodes));
  83638. (_rst$edges = rst.edges).push.apply(_rst$edges, format_toConsumableArray(edges));
  83639. } else if (isEdge(item)) {
  83640. var edge = edgeFromGraphMap(item, style);
  83641. rst.edges.push(edge);
  83642. } else {
  83643. var node = nodeFromGraphMap(item, style, captionField);
  83644. rst.nodes.push(node);
  83645. }
  83646. });
  83647. return {
  83648. nodes: uniqData(rst.nodes),
  83649. edges: uniqData(rst.edges, 'edgeId')
  83650. };
  83651. }
  83652. function uniqData(data) {
  83653. var paramName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
  83654. return lodash_uniqby_default()(data, paramName);
  83655. }
  83656. function isEdge(entity) {
  83657. return entity.hasOwnProperty('start') && entity.hasOwnProperty('end');
  83658. }
  83659. function transformPath(pathData, style, captionField) {
  83660. var rst = {
  83661. nodes: [],
  83662. edges: []
  83663. };
  83664. pathData.forEach(function (item) {
  83665. if (isEdge(item)) {
  83666. var edge = edgeFromGraphMap(item, style);
  83667. rst.edges.push(edge);
  83668. } else {
  83669. var node = nodeFromGraphMap(item, style, captionField);
  83670. rst.nodes.push(node);
  83671. }
  83672. });
  83673. return rst;
  83674. }
  83675. function nodeFromGraphMap(entity, style, captionField) {
  83676. var id = entity.id,
  83677. properties = entity.properties,
  83678. lables = entity.lables;
  83679. var styleData = style ? getNodeStyle(entity, style) : {};
  83680. var label = getNodeLabel(entity, captionField);
  83681. var fillColor = styleData.fillColor || '';
  83682. var node = {
  83683. id: id + '',
  83684. label: label,
  83685. properties: properties,
  83686. lables: lables
  83687. };
  83688. if (styleData.size) {
  83689. node.size = styleData.size;
  83690. delete styleData.size;
  83691. }
  83692. if (styleData.fillColor) {
  83693. node.style = {
  83694. fill: fillColor,
  83695. stroke: fillColor
  83696. };
  83697. delete styleData.fillColor;
  83698. }
  83699. if (Object.keys(styleData).length !== 0) {
  83700. node.labelCfg = {
  83701. style: styleData
  83702. };
  83703. }
  83704. return node;
  83705. }
  83706. function edgeFromGraphMap(entity, style) {
  83707. var start = entity.start,
  83708. end = entity.end,
  83709. id = entity.id,
  83710. type = entity.type,
  83711. properties = entity.properties;
  83712. var styleData = style ? getEdgeStyle(entity, style) : {};
  83713. return {
  83714. source: start + '',
  83715. target: end + '',
  83716. edgeId: id + '',
  83717. label: type,
  83718. labelCfg: {
  83719. style: styleData
  83720. },
  83721. properties: properties
  83722. };
  83723. }
  83724. function getEdgeStyle(entity, style) {
  83725. if (!style) {
  83726. return {};
  83727. }
  83728. var id = entity.id,
  83729. type = entity.type;
  83730. var data = style.filter(function (item) {
  83731. return item.type === 'relationShip';
  83732. });
  83733. for (var i = 0; i < data.length; i++) {
  83734. var _data$i2 = data[i],
  83735. textColor = _data$i2.textColor,
  83736. font = _data$i2.font,
  83737. relationTypes = _data$i2.relationTypes,
  83738. relationIds = _data$i2.relationIds;
  83739. var ids = JSON.parse(relationIds || '[]');
  83740. var types = JSON.parse(relationTypes || '[]');
  83741. if (ids.includes(id) || types.includes(type)) {
  83742. return format_objectSpread({
  83743. fontSize: compileFontSize(font.fontSize),
  83744. fontFamily: font.fontName,
  83745. fill: textColor
  83746. }, formatFontStyle(font.fontStyle));
  83747. }
  83748. }
  83749. return {};
  83750. }
  83751. function getNodeStyle(entity, style) {
  83752. if (!style) {
  83753. return {};
  83754. }
  83755. var id = entity.id,
  83756. labels = entity.labels;
  83757. var data = style.filter(function (item) {
  83758. return item.type === 'entity';
  83759. });
  83760. for (var i = 0; i < data.length; i++) {
  83761. var _data$i4 = data[i],
  83762. color = _data$i4.color,
  83763. textColor = _data$i4.textColor,
  83764. font = _data$i4.font,
  83765. size = _data$i4.size,
  83766. entityTypes = _data$i4.entityTypes,
  83767. entityIds = _data$i4.entityIds;
  83768. var ids = JSON.parse(entityIds || '[]');
  83769. var types = JSON.parse(entityTypes || '[]');
  83770. if (ids.includes(id) || types.includes(labels[0])) {
  83771. return format_objectSpread({
  83772. fillColor: color,
  83773. fontSize: compileFontSize(font.fontSize),
  83774. fontFamily: font.fontName,
  83775. fill: textColor,
  83776. size: size
  83777. }, formatFontStyle(font.fontStyle));
  83778. }
  83779. }
  83780. return {};
  83781. }
  83782. function getNodeLabel(entity, captionField) {
  83783. var id = entity.id,
  83784. labels = entity.labels,
  83785. properties = entity.properties;
  83786. if (captionField) {
  83787. var data = captionField instanceof Array ? captionField : [captionField];
  83788. for (var i = 0; i < data.length; i++) {
  83789. var _data$i6 = data[i],
  83790. name = _data$i6.name,
  83791. entityTypes = _data$i6.entityTypes,
  83792. entityIds = _data$i6.entityIds;
  83793. var ids = JSON.parse(entityIds || '[]');
  83794. var types = JSON.parse(entityTypes || '[]');
  83795. if (ids.includes(id) || types.includes(labels[0])) {
  83796. return properties[name] || '';
  83797. }
  83798. }
  83799. }
  83800. return properties[properties._labelfieldname] || '';
  83801. }
  83802. function formatFontStyle(fontStyle) {
  83803. if (fontStyle === 1) {
  83804. return {
  83805. fontWeight: 600
  83806. };
  83807. }
  83808. if (fontStyle === 2) {
  83809. return {
  83810. fontStyle: 'italic'
  83811. };
  83812. }
  83813. return {};
  83814. }
  83815. function compileFontSize(fontSize) {
  83816. return fontSize * 0.8;
  83817. }
  83818. // 处理graphMap数据的展开 折叠 隐藏的实体数据
  83819. function transformExpandCollapseHiddenData(graphMap) {
  83820. var _graphMap$dataContent = graphMap.dataContent,
  83821. expand = _graphMap$dataContent.expand,
  83822. collapse = _graphMap$dataContent.collapse,
  83823. hidden = _graphMap$dataContent.hidden;
  83824. return {
  83825. expand: expand && JSON.parse(expand),
  83826. collapse: collapse && JSON.parse(collapse),
  83827. hidden: hidden && JSON.parse(hidden)
  83828. };
  83829. }
  83830. ;// CONCATENATED MODULE: external "function(){try{return G6}catch(e){return {}}}()"
  83831. var external_function_try_return_G6_catch_e_return_namespaceObject = function(){try{return G6}catch(e){return {}}}();
  83832. var external_function_try_return_G6_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_G6_catch_e_return_namespaceObject);
  83833. // EXTERNAL MODULE: ./node_modules/insert-css/index.js
  83834. var insert_css = __webpack_require__(8813);
  83835. var insert_css_default = /*#__PURE__*/__webpack_require__.n(insert_css);
  83836. ;// CONCATENATED MODULE: ./src/common/overlay/knowledge-graph/G6Render.js
  83837. function G6Render_toConsumableArray(arr) { return G6Render_arrayWithoutHoles(arr) || G6Render_iterableToArray(arr) || G6Render_unsupportedIterableToArray(arr) || G6Render_nonIterableSpread(); }
  83838. 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."); }
  83839. 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); }
  83840. function G6Render_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  83841. function G6Render_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return G6Render_arrayLikeToArray(arr); }
  83842. 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; }
  83843. 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; }
  83844. 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; }
  83845. 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; }
  83846. function G6Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  83847. 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); } }
  83848. 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; }
  83849. /**
  83850. * @private
  83851. * @class G6Render
  83852. * @category iServer G6Render
  83853. * @classdesc G6Render
  83854. * @param {KnowledgeGraph.Data} data - 创建graph实例的数据项。
  83855. * @param {KnowledgeGraph.Config} [config] - 创建graph实例的配置项。
  83856. * @private
  83857. */
  83858. var G6Render = /*#__PURE__*/function () {
  83859. function G6Render() {
  83860. G6Render_classCallCheck(this, G6Render);
  83861. this.config = null;
  83862. this.graph = null;
  83863. this.data = null;
  83864. this.collpasedData = {};
  83865. this.importG6();
  83866. this.CLASS_NAME = 'SuperMap.G6Render';
  83867. }
  83868. G6Render_createClass(G6Render, [{
  83869. key: "importG6",
  83870. value: function importG6() {
  83871. if (!(external_function_try_return_G6_catch_e_return_default())) {
  83872. console.log('please import g6, eg:https://gw.alipayobjects.com/os/lib/antv/g6/4.3.2/dist/g6.min.js');
  83873. }
  83874. }
  83875. /**
  83876. * @function G6Render.prototype.initGraph
  83877. * @description 创建KnowledgeGraph实例
  83878. * @param {KnowledgeGraph.Config} config - graph配置项。
  83879. * @returns {Object} graph实例。
  83880. */
  83881. }, {
  83882. key: "initGraph",
  83883. value: function initGraph(config) {
  83884. var graph = new (external_function_try_return_G6_catch_e_return_default()).Graph(config);
  83885. this.graph = graph;
  83886. if (!config || config.highlightNode !== false) {
  83887. this.highlightNode(graph);
  83888. }
  83889. if (!config || config.highlightEdge !== false) {
  83890. this.highlightEdge(graph);
  83891. }
  83892. if (config.dragCanvas !== false || config.dragNode !== false) {
  83893. // 阻止事件冒泡
  83894. this.stopDefaultEventPropagation();
  83895. }
  83896. return graph;
  83897. }
  83898. }, {
  83899. key: "_getContextMenu",
  83900. value: function _getContextMenu() {
  83901. var _this = this;
  83902. var contextMenu = new (external_function_try_return_G6_catch_e_return_default()).Menu({
  83903. shouldBegin: function shouldBegin(evt) {
  83904. if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) {
  83905. return true;
  83906. }
  83907. if (evt.item) {
  83908. return true;
  83909. }
  83910. return false;
  83911. },
  83912. getContent: function getContent(evt) {
  83913. var item = evt.item;
  83914. if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) {
  83915. return;
  83916. }
  83917. if (!item) {
  83918. return;
  83919. }
  83920. var itemType = item.getType();
  83921. var model = item.getModel();
  83922. if (itemType && model) {
  83923. if (itemType === 'node') {
  83924. if (_this.isCollpased(model.id)) {
  83925. return "<ul>\n <li id='expand'>\u5C55\u5F00</li>\n <li id='hide'>\u9690\u85CF</li>\n </ul>";
  83926. } else {
  83927. return "<ul>\n <li id='collapse'>\u6298\u53E0</li>\n <li id='hide'>\u9690\u85CF</li>\n </ul>";
  83928. }
  83929. }
  83930. }
  83931. },
  83932. handleMenuClick: function handleMenuClick(target, item) {
  83933. var liIdStrs = target.id.split('-');
  83934. switch (liIdStrs[0]) {
  83935. case 'hide':
  83936. _this.hideItem(item);
  83937. break;
  83938. case 'expand':
  83939. _this.expandNode(item);
  83940. break;
  83941. case 'collapse':
  83942. _this.collapseNode(item);
  83943. break;
  83944. case 'show':
  83945. _this.showItem(item);
  83946. break;
  83947. default:
  83948. break;
  83949. }
  83950. },
  83951. // 需要加上父级容器的 padding-left 16 与自身偏移量 10
  83952. offsetX: 16 + 10,
  83953. // 需要加上父级容器的 padding-top 24 、画布兄弟元素高度、与自身偏移量 10
  83954. offsetY: 0,
  83955. // 在哪些类型的元素上响应
  83956. itemTypes: ['node', 'edge', 'canvas']
  83957. });
  83958. return contextMenu;
  83959. }
  83960. }, {
  83961. key: "_getGraphConfig",
  83962. value: function _getGraphConfig(config) {
  83963. var _this2 = this;
  83964. var animateConfig = {
  83965. speed: 120,
  83966. maxIteration: 83,
  83967. tick: function tick() {
  83968. _this2.refreshPositions();
  83969. }
  83970. };
  83971. var defaultLayout = {
  83972. type: 'fruchterman',
  83973. gravity: 5
  83974. };
  83975. var defaultNode = {};
  83976. var defaultEdge = {
  83977. type: 'line',
  83978. style: {
  83979. endArrow: {
  83980. path: 'M 0,0 L 2,1 L 2,-1 Z'
  83981. },
  83982. lineWidth: 0.5
  83983. },
  83984. labelCfg: {
  83985. autoRotate: true,
  83986. style: {
  83987. fontSize: 4,
  83988. fill: '#333'
  83989. }
  83990. }
  83991. };
  83992. var defaultMode = {
  83993. "default": ['drag-canvas', 'zoom-canvas', 'drag-node']
  83994. };
  83995. var contextMenu = this._getContextMenu();
  83996. var defaultPlugins = [new (external_function_try_return_G6_catch_e_return_default()).ToolBar(), contextMenu];
  83997. var hoverColor = '#b4d6ff';
  83998. var defaultNodeHighlightStyle = {
  83999. lineWidth: 3,
  84000. stroke: hoverColor
  84001. };
  84002. var defaultEdgeHighlightStyle = {
  84003. stroke: hoverColor,
  84004. lineWidth: 2,
  84005. endArrow: {
  84006. path: 'M 0,0 L 2,1 L 2,-1 Z',
  84007. fill: hoverColor
  84008. }
  84009. };
  84010. var defaultGraphConfig = function defaultGraphConfig() {
  84011. var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'knowledgeGraph';
  84012. var dom = document.querySelector("#".concat(container));
  84013. return {
  84014. container: container,
  84015. // String | HTMLElement,必须,在 Step 1 中创建的容器 id 或容器本身
  84016. width: dom.scrollWidth,
  84017. // Number,必须,图的宽度
  84018. height: dom.scrollHeight,
  84019. // Number,必须,图的高度
  84020. plugins: defaultPlugins,
  84021. modes: defaultMode,
  84022. layout: G6Render_objectSpread(G6Render_objectSpread({}, defaultLayout), animateConfig),
  84023. defaultNode: defaultNode,
  84024. defaultEdge: defaultEdge,
  84025. nodeStateStyles: {
  84026. hover: defaultNodeHighlightStyle
  84027. },
  84028. edgeStateStyles: {
  84029. hover: defaultEdgeHighlightStyle
  84030. }
  84031. };
  84032. };
  84033. if (!config) {
  84034. this._setToolBarStyle();
  84035. return defaultGraphConfig();
  84036. }
  84037. config.container = config.container || 'knowledgeGraph';
  84038. var dom = typeof config.container === 'string' ? document.querySelector("#".concat(config.container)) : config.container;
  84039. config.width = config.width || dom.scrollWidth;
  84040. config.height = config.height || dom.scrollHeight;
  84041. config.layout = G6Render_objectSpread(G6Render_objectSpread(G6Render_objectSpread({}, defaultLayout), config.layout || {}), config.animate !== false ? animateConfig : {});
  84042. config.defaultNode = G6Render_objectSpread(G6Render_objectSpread({}, defaultNode), config.defaultNode || {});
  84043. config.defaultEdge = G6Render_objectSpread(G6Render_objectSpread({}, defaultEdge), config.defaultEdge || {});
  84044. config.modes = {
  84045. "default": [config.dragCanvas !== false && 'drag-canvas', config.zoomCanvas !== false && 'zoom-canvas', config.dragNode !== false && 'drag-node']
  84046. };
  84047. config.nodeStateStyles = {
  84048. hover: G6Render_objectSpread(G6Render_objectSpread({}, defaultNodeHighlightStyle), config.nodeHighlightStyle || {})
  84049. };
  84050. config.edgeStateStyles = {
  84051. hover: G6Render_objectSpread(G6Render_objectSpread({}, defaultEdgeHighlightStyle), config.edgeHighlightStyle || {})
  84052. };
  84053. if (config.showToolBar !== false) {
  84054. config.plugins = [new (external_function_try_return_G6_catch_e_return_default()).ToolBar()];
  84055. this._setToolBarStyle();
  84056. }
  84057. if (config.showContextMenu !== false) {
  84058. config.plugins = [].concat(G6Render_toConsumableArray(config.plugins || []), [contextMenu]);
  84059. this._setToolBarStyle();
  84060. }
  84061. return config;
  84062. }
  84063. /**
  84064. * @function KnowledgeGraph.prototype.changeSize
  84065. * @description 当源数据中现有节点/边 的数据项发生配置的变更时,根据新数据刷新视图。
  84066. * @param {number} width - 宽度。
  84067. * @param {number} height - 高度。
  84068. */
  84069. }, {
  84070. key: "changeSize",
  84071. value: function changeSize(width, height) {
  84072. return this.graph.changeSize(width, height);
  84073. }
  84074. /**
  84075. * @function G6Render.prototype.autoResize
  84076. * @description 浏览器窗口大小发生改变时,重新渲染;
  84077. */
  84078. }, {
  84079. key: "autoResize",
  84080. value: function autoResize() {
  84081. var _this3 = this;
  84082. var dom = this.getContainer();
  84083. window.addEventListener('resize', function () {
  84084. var width = dom.scrollWidth;
  84085. var height = dom.scrollHeight;
  84086. _this3.graph.changeSize(width, height);
  84087. _this3.graph.refresh();
  84088. });
  84089. }
  84090. /**
  84091. * @function G6Render.prototype.zoom
  84092. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  84093. * @param {number} ratio 缩放比例。
  84094. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  84095. * @param {boolean} [animate] 是否开启动画。
  84096. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  84097. */
  84098. }, {
  84099. key: "zoom",
  84100. value: function zoom(ratio, center, animate, animateCfg) {
  84101. this.graph.zoom(ratio, center, animate, animateCfg);
  84102. }
  84103. /**
  84104. * @function G6Render.prototype.zoomTo
  84105. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  84106. * @param {number} ratio 缩放比例。
  84107. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  84108. * @param {boolean} [animate] 是否开启动画。
  84109. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  84110. */
  84111. }, {
  84112. key: "zoomTo",
  84113. value: function zoomTo(ratio, center, animate, animateCfg) {
  84114. this.graph.zoomTo(ratio, center, animate, animateCfg);
  84115. }
  84116. /**
  84117. * @function G6Render.prototype.fitView
  84118. * @description 让画布内容适应视口。
  84119. * @param {Array.<number>|number} [padding] [top, right, bottom, left] 四个方向上的间距值。
  84120. * @param {Object} [rules] fitView 的规则,参数如下:{ onlyOutOfViewPort?: boolean; direction?: 'x' / 'y' / 'both'; ratioRule?: 'max' / 'min}。
  84121. * @param {boolean} [animate] 是否开启动画。
  84122. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  84123. */
  84124. }, {
  84125. key: "fitView",
  84126. value: function fitView(padding, rules, animate, animateCfg) {
  84127. this.graph.fitView(padding, rules, animate, animateCfg);
  84128. }
  84129. /**
  84130. * @function G6Render.prototype.fitCenter
  84131. * @description 平移图到中心将对齐到画布中心,但不缩放。优先级低于 fitView。
  84132. * @param {boolean} [animate] 是否开启动画。
  84133. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画,参见基础动画教程。若未配置,则跟随 graph 的 animateCfg 参数。
  84134. */
  84135. }, {
  84136. key: "fitCenter",
  84137. value: function fitCenter(animate, animateCfg) {
  84138. this.graph.fitCenter(animate, animateCfg);
  84139. }
  84140. /**
  84141. * @function G6Render.prototype.getGraphCenterPoint
  84142. * @description 获取图内容的中心绘制坐标。
  84143. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  84144. */
  84145. }, {
  84146. key: "getGraphCenterPoint",
  84147. value: function getGraphCenterPoint() {
  84148. return this.graph.getGraphCenterPoint();
  84149. }
  84150. /**
  84151. * @function G6Render.prototype.getViewPortCenterPoint
  84152. * @description 获取视口中心绘制坐标。
  84153. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  84154. */
  84155. }, {
  84156. key: "getViewPortCenterPoint",
  84157. value: function getViewPortCenterPoint() {
  84158. return this.graph.getViewPortCenterPoint();
  84159. }
  84160. /**
  84161. * @function G6Render.prototype.getZoom
  84162. * @description 获取当前视口的缩放比例。
  84163. * @return {number} 返回值表示当前视口的缩放比例, 默认值为 1。
  84164. */
  84165. }, {
  84166. key: "getZoom",
  84167. value: function getZoom() {
  84168. return this.graph.getZoom();
  84169. }
  84170. /**
  84171. * @function G6Render.prototype.getMinZoom
  84172. * @description 获取 graph 当前允许的最小缩放比例。
  84173. * @return {number} 返回值表示当前视口的最小缩放比例。
  84174. */
  84175. }, {
  84176. key: "getMinZoom",
  84177. value: function getMinZoom() {
  84178. return this.graph.getMinZoom();
  84179. }
  84180. /**
  84181. * @function G6Render.prototype.setMinZoom
  84182. * @description 设置 graph 当前允许的最小缩放比例。
  84183. * @param {number} ratio 缩放比例。
  84184. */
  84185. }, {
  84186. key: "setMinZoom",
  84187. value: function setMinZoom(ratio) {
  84188. this.graph.setMinZoom(ratio);
  84189. }
  84190. /**
  84191. * @function G6Render.prototype.getMaxZoom
  84192. * @description 获取 graph 当前允许的最大缩放比例。
  84193. * @return {number} 返回值表示当前视口的最大缩放比例。
  84194. */
  84195. }, {
  84196. key: "getMaxZoom",
  84197. value: function getMaxZoom() {
  84198. return this.graph.getMaxZoom();
  84199. }
  84200. /**
  84201. * @function G6Render.prototype.setMaxZoom
  84202. * @description 设置 graph 当前允许的最大缩放比例。
  84203. * @param {number} ratio 缩放比例。
  84204. */
  84205. }, {
  84206. key: "setMaxZoom",
  84207. value: function setMaxZoom(ratio) {
  84208. this.graph.setMaxZoom(ratio);
  84209. }
  84210. /**
  84211. * @function G6Render.prototype.getWidth
  84212. * @description获取 graph 当前的宽度。
  84213. * @return {number} graph 当前的宽度。
  84214. */
  84215. }, {
  84216. key: "getWidth",
  84217. value: function getWidth() {
  84218. return this.graph.getWidth();
  84219. }
  84220. /**
  84221. * @function G6Render.prototype.getHeight
  84222. * @description 获取 graph 当前的高度。
  84223. * @return {number} graph 当前的高度。
  84224. */
  84225. }, {
  84226. key: "getHeight",
  84227. value: function getHeight() {
  84228. return this.graph.getHeight();
  84229. }
  84230. }, {
  84231. key: "setCenter",
  84232. value: function setCenter(centerDrawPoint) {
  84233. var centerCanvasPointX = this.graph.getWidth() / 2;
  84234. var centerCanvasPointY = this.graph.getHeight() / 2;
  84235. var centerCanvasPointNew = this.graph.getCanvasByPoint(centerDrawPoint.x, centerDrawPoint.y);
  84236. this.graph.translate(centerCanvasPointX - centerCanvasPointNew.x, centerCanvasPointY - centerCanvasPointNew.y);
  84237. }
  84238. /**
  84239. * @function G6Render.prototype._setToolBarStyle
  84240. * @description 隐藏工具栏的redo undo realZoom按钮
  84241. * @private
  84242. */
  84243. }, {
  84244. key: "_setToolBarStyle",
  84245. value: function _setToolBarStyle() {
  84246. 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 ");
  84247. }
  84248. /**
  84249. * @function G6Render.prototype.highlightNode
  84250. * @description 鼠标移入节点,节点高亮
  84251. * @param {Object} graph - graph实例。
  84252. */
  84253. }, {
  84254. key: "highlightNode",
  84255. value: function highlightNode() {
  84256. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84257. function clearAllStats() {
  84258. graph.setAutoPaint(false);
  84259. graph.getNodes().forEach(function (node) {
  84260. graph.clearItemStates(node);
  84261. });
  84262. graph.paint();
  84263. graph.setAutoPaint(true);
  84264. }
  84265. graph.on('node:mouseenter', function (e) {
  84266. var item = e.item;
  84267. graph.setAutoPaint(false);
  84268. graph.getNodes().forEach(function (node) {
  84269. graph.clearItemStates(node);
  84270. });
  84271. graph.setItemState(item, 'hover', true);
  84272. graph.paint();
  84273. graph.setAutoPaint(true);
  84274. });
  84275. graph.on('node:mouseleave', clearAllStats);
  84276. }
  84277. /**
  84278. * @function G6Render.prototype.highlightNode
  84279. * @description 鼠标移入节点,节点高亮
  84280. * @param {Object} graph - graph实例。
  84281. */
  84282. }, {
  84283. key: "highlightEdge",
  84284. value: function highlightEdge() {
  84285. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84286. function clearAllStats() {
  84287. graph.setAutoPaint(false);
  84288. graph.getEdges().forEach(function (edge) {
  84289. graph.clearItemStates(edge);
  84290. });
  84291. graph.paint();
  84292. graph.setAutoPaint(true);
  84293. }
  84294. graph.on('edge:mouseenter', function (e) {
  84295. var item = e.item;
  84296. graph.setAutoPaint(false);
  84297. graph.getNodes().forEach(function (node) {
  84298. graph.clearItemStates(node);
  84299. });
  84300. graph.setItemState(item, 'hover', true);
  84301. graph.paint();
  84302. graph.setAutoPaint(true);
  84303. });
  84304. graph.on('edge:mouseleave', clearAllStats);
  84305. }
  84306. /**
  84307. * @function G6Render.prototype.setData
  84308. * @description 设置数据
  84309. * @param {KnowledgeGraph.Data} data - graph数据。
  84310. * @param {Object} [graph] - graph实例。
  84311. */
  84312. }, {
  84313. key: "setData",
  84314. value: function setData(data) {
  84315. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  84316. if (!this.data) {
  84317. graph.data(data);
  84318. } else {
  84319. graph.changeData(data);
  84320. }
  84321. this.data = data;
  84322. }
  84323. /**
  84324. * @function G6Render.prototype.render
  84325. * @description 根据提供的数据渲染视图。
  84326. */
  84327. }, {
  84328. key: "render",
  84329. value: function render() {
  84330. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84331. return graph.render();
  84332. }
  84333. /**
  84334. * @function G6Render.prototype.updateGraph
  84335. * @description 更新数据
  84336. * @param {Object} graph - graph实例。
  84337. * @param {KnowledgeGraph.Data} data - graph数据。
  84338. */
  84339. }, {
  84340. key: "updateGraph",
  84341. value: function updateGraph(data) {
  84342. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  84343. this.data = data;
  84344. graph.changeData(data);
  84345. }
  84346. /**
  84347. * @function G6Render.prototype.refresh
  84348. * @description 当源数据中现有节点/边的数据项发生配置的变更时,根据新数据刷新视图。
  84349. * @param {Object} graph - graph实例。
  84350. */
  84351. }, {
  84352. key: "refresh",
  84353. value: function refresh() {
  84354. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84355. graph.refresh();
  84356. }
  84357. /**
  84358. * @function G6Render.prototype.getContainer
  84359. * @description 获取 Graph 的 DOM 容器。
  84360. * @param {Object} graph - graph实例。
  84361. * @return {HTMLElement} DOM 容器。
  84362. */
  84363. }, {
  84364. key: "getContainer",
  84365. value: function getContainer() {
  84366. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84367. return graph.getContainer();
  84368. }
  84369. /**
  84370. * @function G6Render.prototype.getCanvas
  84371. * @description 获取canvas。
  84372. * @param {Object} graph - graph实例。
  84373. * @return {HTMLElement} canvas。
  84374. */
  84375. }, {
  84376. key: "getCanvas",
  84377. value: function getCanvas() {
  84378. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84379. return graph.get('canvas');
  84380. }
  84381. /**
  84382. * @function G6Render.prototype.getNodes
  84383. * @description 获取图中所有节点的实例。
  84384. * @param {Object} graph - graph实例。
  84385. * @return {Array} 返回值表示图中所有节点的实例。
  84386. */
  84387. }, {
  84388. key: "getNodes",
  84389. value: function getNodes() {
  84390. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84391. return graph.getNodes();
  84392. }
  84393. /**
  84394. * @function G6Render.prototype.getEdges
  84395. * @description 获取图中所有节点的实例。这里返回的是边的实例,而不是边的数据项。
  84396. * @param {Object} graph - graph实例。
  84397. * @return {Array} 返回值表示图中所有边的实例。
  84398. */
  84399. }, {
  84400. key: "getEdges",
  84401. value: function getEdges() {
  84402. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84403. return graph.getEdges();
  84404. }
  84405. /**
  84406. * @function G6Render.prototype.getNeighbors
  84407. * @description 获取邻居节点数组。
  84408. * @param {Object} graph - graph实例。
  84409. * @param {string | INode} node - 节点 ID 或节点实例。
  84410. * @param {string|undefined} type -['source'| 'target' |undefined] 邻居类型, 'source' 只获取当前节点的源节点,'target' 只获取当前节点指向的目标节点, 若不指定则返回所有类型的邻居。
  84411. * @return {Array} 返回值符合要求的节点数组。
  84412. */
  84413. }, {
  84414. key: "getNeighbors",
  84415. value: function getNeighbors(node, type) {
  84416. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84417. return graph.getNeighbors(node, type);
  84418. }
  84419. /**
  84420. * @function G6Render.prototype.findById
  84421. * @description 根据 ID,查询对应的元素实例。
  84422. * @param {Object} graph - graph实例。
  84423. * @param {string} id - 元素 ID
  84424. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  84425. */
  84426. }, {
  84427. key: "findById",
  84428. value: function findById(id) {
  84429. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  84430. return graph.findById(id);
  84431. }
  84432. /**
  84433. * @function G6Render.prototype.find
  84434. * @description 获取邻居节点数组。
  84435. * @param {Object} graph - graph实例。
  84436. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  84437. * @param {Function} fn - 查找的规则。
  84438. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  84439. */
  84440. }, {
  84441. key: "find",
  84442. value: function find(type, fn) {
  84443. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84444. return graph.find(type, fn);
  84445. }
  84446. /**
  84447. * @function G6Render.prototype.findAll
  84448. * @description 获取邻居节点数组。
  84449. * @param {Object} graph - graph实例。
  84450. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  84451. * @param {Function} fn - 查找的规则。
  84452. * @return {Object} 如果有符合规则的元素实例,则返回所有元素实例,否则返回 undefined。
  84453. */
  84454. }, {
  84455. key: "findAll",
  84456. value: function findAll(type, fn) {
  84457. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84458. return graph.findAll(type, fn);
  84459. }
  84460. /**
  84461. * @function G6Render.prototype.getEdgesByNode
  84462. * @description 获取与当前节点有关联的所有边。
  84463. * @param {Object} node - node实例。
  84464. * @return {Array} edge实例数组。
  84465. */
  84466. }, {
  84467. key: "getEdgesByNode",
  84468. value: function getEdgesByNode(node) {
  84469. return node.getEdges();
  84470. }
  84471. /**
  84472. * @function G6Render.prototype.getEdgesByNode
  84473. * @description 获取与当前节点关联的所有入边。
  84474. * @param {Object} node - node实例。
  84475. * @return {Array} edge实例数组。
  84476. */
  84477. }, {
  84478. key: "getInEdges",
  84479. value: function getInEdges(node) {
  84480. return node.getInEdges();
  84481. }
  84482. /**
  84483. * @function G6Render.prototype.getEdgesByNode
  84484. * @description 获取与当前节点关联的所有出边。
  84485. * @param {Object} node - node实例。
  84486. * @return {Array} edge实例数组。
  84487. */
  84488. }, {
  84489. key: "getOutEdges",
  84490. value: function getOutEdges(node) {
  84491. return node.getOutEdges();
  84492. }
  84493. /**
  84494. * @function G6Render.prototype.getSourceByEdge
  84495. * @description 获取当前边的起始节点
  84496. * @param {Object} edge - node实例。
  84497. * @return {Object} 返回值为起始节点的实例。
  84498. */
  84499. }, {
  84500. key: "getSourceByEdge",
  84501. value: function getSourceByEdge(edge) {
  84502. return edge.getSource();
  84503. }
  84504. /**
  84505. * @function G6Render.prototype.getTargetByEdge
  84506. * @description 获取当前边的终止节点。
  84507. * @param {Object} edge - node实例。
  84508. * @return {Object} 终止节点的实例。
  84509. */
  84510. }, {
  84511. key: "getTargetByEdge",
  84512. value: function getTargetByEdge(edge) {
  84513. return edge.getTarget();
  84514. }
  84515. /**
  84516. * @function G6Render.prototype.expandNode
  84517. * @description 展开当前节点。
  84518. * @param {Object} item - 元素 ID 或元素实例。
  84519. */
  84520. }, {
  84521. key: "expandNode",
  84522. value: function expandNode(item) {
  84523. var id = item.getModel().id;
  84524. this._expandCollapseNode(this.collpasedData[id], 'show');
  84525. delete this.collpasedData[id];
  84526. }
  84527. /**
  84528. * @function G6Render.prototype.collapseNode
  84529. * @description 收起当前节点。
  84530. * @param {Object} item - 元素 ID 或元素实例。
  84531. * @param {Object} graph - graph实例。
  84532. */
  84533. }, {
  84534. key: "collapseNode",
  84535. value: function collapseNode(item) {
  84536. var id = item.getModel().id;
  84537. var result = [];
  84538. this._collapseFunc(item, result);
  84539. this.collpasedData[id] = result;
  84540. this._expandCollapseNode(result);
  84541. }
  84542. }, {
  84543. key: "isCollpased",
  84544. value: function isCollpased(id) {
  84545. return !!this.collpasedData[id];
  84546. }
  84547. }, {
  84548. key: "_collapseFunc",
  84549. value: function _collapseFunc(item) {
  84550. var res = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  84551. var sourceNodes = this.getNeighbors(item, 'target');
  84552. var targetNodes = this.getNeighbors(item, 'source');
  84553. // 指出节点, 如果没有其他链接,隐藏
  84554. for (var i = 0; i < sourceNodes.length; i++) {
  84555. var sourceNode = sourceNodes[i];
  84556. var model = sourceNode.getModel();
  84557. var nodes = this.getNeighbors(sourceNode);
  84558. // if (nodes && exceptNode) {
  84559. // nodes = nodes.filter((item) => item.id !== exceptNode);
  84560. // }
  84561. if (nodes.length === 1) {
  84562. res.push({
  84563. id: model.id
  84564. });
  84565. }
  84566. }
  84567. // 指入节点, 如果没有其他链接或者没有指入节点隐藏,隐藏
  84568. for (var _i2 = 0; _i2 < targetNodes.length; _i2++) {
  84569. var targetNode = targetNodes[_i2];
  84570. var _model = targetNode.getModel();
  84571. var _nodes = this.getNeighbors(targetNode);
  84572. var targetNodeNodes = this.getNeighbors(targetNode, 'source');
  84573. // if (nodes && exceptNode) {
  84574. // nodes = nodes.filter((item) => item.id !== exceptNode);
  84575. // }
  84576. // if (targetNodeNodes && exceptNode) {
  84577. // targetNodeNodes = targetNodeNodes.filter((item) => item.id !== exceptNode);
  84578. // }
  84579. if (_nodes.length === 1 || targetNodeNodes.length === 0) {
  84580. res.push({
  84581. id: _model.id
  84582. });
  84583. } else {
  84584. var result = [];
  84585. this._collapseFunc(targetNode, result);
  84586. res.push({
  84587. id: _model.id,
  84588. children: result
  84589. });
  84590. }
  84591. }
  84592. return res;
  84593. }
  84594. }, {
  84595. key: "_expandCollapseNode",
  84596. value: function _expandCollapseNode(data) {
  84597. var _this4 = this;
  84598. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hide';
  84599. if (!data) {
  84600. return;
  84601. }
  84602. data.forEach(function (item) {
  84603. if (type === 'hide') {
  84604. _this4.hideItem(item.id);
  84605. } else {
  84606. _this4.showItem(item.id);
  84607. // 如果是把之前的折叠也展开了, 就要把之前的折叠数据删除
  84608. if (_this4.isCollpased(item.id)) {
  84609. delete _this4.collpasedData[item.id];
  84610. }
  84611. }
  84612. if (item.children) {
  84613. _this4._expandCollapseNode(item.children, type);
  84614. }
  84615. });
  84616. }
  84617. /**
  84618. * @function G6Render.prototype.showItem
  84619. * @description 显示指定的元素。若 item 为节点,则相关边也会随之显示。而show() 则将只显示自身。
  84620. * @param {string|Object} item - 元素 ID 或元素实例。
  84621. * @param {boolean} [stack] - 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  84622. * @param {Object} graph - graph实例。
  84623. */
  84624. }, {
  84625. key: "showItem",
  84626. value: function showItem(item, stack) {
  84627. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84628. graph.showItem(item, stack);
  84629. }
  84630. /**
  84631. * @function G6Render.prototype.showItem
  84632. * @description 隐藏指定元素。若 item 为节点,则相关边也会随之隐藏。而 hide() 则将只隐藏自身。
  84633. * @param {string|Object} item - 元素 ID 或元素实例。
  84634. * @param {boolean} [stack] -操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  84635. * @param {Object} graph - graph实例。
  84636. */
  84637. }, {
  84638. key: "hideItem",
  84639. value: function hideItem(item, stack) {
  84640. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84641. graph.hideItem(item, stack);
  84642. }
  84643. /**
  84644. * @function G6Render.prototype.show
  84645. * @description 显示元素。只显示 item 自身,若需要在显示节点的同时显示相关边,应调用showItem(item)。
  84646. * @param {Object} item - 元素实例。
  84647. */
  84648. }, {
  84649. key: "show",
  84650. value: function show(item) {
  84651. item.show();
  84652. }
  84653. /**
  84654. * @function G6Render.prototype.hide
  84655. * @description 隐藏元素。只隐藏 item 自身,若需要在隐藏节点的同时隐藏相关边,应调用 hideItem(item)。
  84656. * @param {Object} item - 元素实例。
  84657. */
  84658. }, {
  84659. key: "hide",
  84660. value: function hide(item) {
  84661. item.hide();
  84662. }
  84663. /**
  84664. * @function G6Render.prototype.changeVisibility
  84665. * @description 更改元素是否显示。
  84666. * @param {Object} item - 元素实例。
  84667. * @param {boolean} visible - 是否显示元素,true 为显示,false 为隐藏。
  84668. */
  84669. }, {
  84670. key: "changeVisibility",
  84671. value: function changeVisibility(item, visible) {
  84672. item.changeVisibility(visible);
  84673. }
  84674. /**
  84675. * @function G6Render.prototype.isVisible
  84676. * @description 查询元素显示状态。
  84677. * @param {Object} item - 元素实例。
  84678. * @return {boolean} - 返回值为 true,则表示当前元素处于显示状态,否则处于隐藏状态。
  84679. */
  84680. }, {
  84681. key: "isVisible",
  84682. value: function isVisible(item) {
  84683. return item.isVisible();
  84684. }
  84685. /**
  84686. * @function G6Render.prototype.getModel
  84687. * @description 获取元素的数据模型。
  84688. * @param {Object} item - 元素实例。
  84689. * @return {KnowledgeGraph.Data} - 返回值为节点的数据模型。
  84690. */
  84691. }, {
  84692. key: "getModel",
  84693. value: function getModel(item) {
  84694. return item.getModel();
  84695. }
  84696. /**
  84697. * @function G6Render.prototype.addItem
  84698. * @description 新增元素(节点和边)。
  84699. * @param {Object} graph - graph实例。
  84700. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  84701. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  84702. */
  84703. }, {
  84704. key: "addItem",
  84705. value: function addItem(type, model) {
  84706. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84707. graph.addItem(type, model);
  84708. }
  84709. /**
  84710. * @function G6Render.prototype.addItem
  84711. * @description 删除元素。
  84712. * @param {string|Object} item - 元素 ID 或元素实例
  84713. * @param {Object} graph - graph实例。
  84714. */
  84715. }, {
  84716. key: "removeItem",
  84717. value: function removeItem(item) {
  84718. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  84719. graph.removeItem(item);
  84720. }
  84721. /**
  84722. * @function G6Render.prototype.updateItem
  84723. * @description 更新元素,包括更新数据、样式等。
  84724. * @param {Object} graph - graph实例。
  84725. * @param {string|Object} item - 元素 ID 或元素实例。
  84726. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  84727. */
  84728. }, {
  84729. key: "updateItem",
  84730. value: function updateItem(item, model) {
  84731. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84732. graph.updateItem(item, model);
  84733. }
  84734. /**
  84735. * @function G6Render.prototype.refreshItem
  84736. * @description 刷新指定元素。
  84737. * @param {Object} graph - graph实例。
  84738. * @param {string|Object} item - 元素 ID 或元素实例。
  84739. */
  84740. }, {
  84741. key: "refreshItem",
  84742. value: function refreshItem(item) {
  84743. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  84744. graph.refreshItem(item);
  84745. }
  84746. /**
  84747. * @function G6Render.prototype.refreshPositions
  84748. * @description 当节点位置发生变化时,刷新所有节点位置,并重计算边的位置。
  84749. * @param {Object} graph - graph实例。
  84750. */
  84751. }, {
  84752. key: "refreshPositions",
  84753. value: function refreshPositions() {
  84754. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84755. graph.refreshPositions();
  84756. }
  84757. /**
  84758. * @function G6Render.prototype.on
  84759. * @description graph监听事件
  84760. * @param {Object} graph - graph实例。
  84761. * @param {string} eventName - 事件名,可选事件名参见 Event。
  84762. * @param {Function} handler - 监听函数。
  84763. */
  84764. }, {
  84765. key: "on",
  84766. value: function on(eventName, handler) {
  84767. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84768. graph.on(eventName, handler);
  84769. }
  84770. /**
  84771. * @function G6Render.prototype.off
  84772. * @description graph关闭事件
  84773. * @param {Object} graph - graph实例。
  84774. * @param {string} eventName - 事件名,可选事件名参见 Event。
  84775. * @param {Function} handler - 监听函数。
  84776. */
  84777. }, {
  84778. key: "off",
  84779. value: function off(eventName, handler) {
  84780. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84781. graph.off(eventName, handler);
  84782. }
  84783. /**
  84784. * @function G6Render.prototype.toDataURL
  84785. * @description 转换成图片
  84786. * @param {Object} graph - graph实例。
  84787. * @param {string} type - 图片类型 'image/png' / 'image/jpeg' / 'image/webp' / 'image/bmp'。
  84788. * @param {string} [backgroundColor] - 图片的背景色,可选,不传值时将导出透明背景的图片。
  84789. * @return {string} 返回值表示生成的图片的 URL。
  84790. */
  84791. }, {
  84792. key: "toDataURL",
  84793. value: function toDataURL(type, backgroundColor) {
  84794. var graph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.graph;
  84795. graph.toDataURL(type, backgroundColor);
  84796. }
  84797. /**
  84798. * @function G6Render.prototype.bindNodeDefaultDragEvent
  84799. * @description 给graph的节点绑定默认的拖拽事件
  84800. *
  84801. * @param {Object} graph - graph实例。
  84802. */
  84803. }, {
  84804. key: "bindNodeDefaultDragEvent",
  84805. value: function bindNodeDefaultDragEvent() {
  84806. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84807. graph.on('node:dragstart', function (e) {
  84808. refreshDragedNodePosition(e);
  84809. });
  84810. graph.on('node:drag', function (e) {
  84811. refreshDragedNodePosition(e);
  84812. });
  84813. graph.on('node:dragend', function (e) {
  84814. e.item.get('model').fx = null;
  84815. e.item.get('model').fy = null;
  84816. });
  84817. }
  84818. /**
  84819. * @function G6Render.prototype.stopDefaultEventPropagation
  84820. * @description 阻止点击事件冒泡
  84821. * @param {Object} graph - graph实例。
  84822. */
  84823. }, {
  84824. key: "stopDefaultEventPropagation",
  84825. value: function stopDefaultEventPropagation() {
  84826. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84827. graph.on('click', function (e) {
  84828. e.stopPropagation();
  84829. });
  84830. graph.on('mousedown', function (e) {
  84831. e.stopPropagation();
  84832. });
  84833. graph.on('mouseover', function (e) {
  84834. e.stopPropagation();
  84835. });
  84836. graph.on('mouseout', function (e) {
  84837. e.stopPropagation();
  84838. });
  84839. }
  84840. /**
  84841. * @function G6Render.prototype.clear
  84842. * @description 清除画布元素
  84843. * @param {Object} graph - graph实例。
  84844. */
  84845. }, {
  84846. key: "clear",
  84847. value: function clear() {
  84848. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84849. graph.clear();
  84850. }
  84851. /**
  84852. * @function G6Render.prototype.destroy
  84853. * @description 销毁画布
  84854. * @param {Object} graph - graph实例。
  84855. */
  84856. }, {
  84857. key: "destroy",
  84858. value: function destroy() {
  84859. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  84860. graph.destroy();
  84861. }
  84862. }]);
  84863. return G6Render;
  84864. }();
  84865. /**
  84866. * @description 更新拖拽后节点的x ,y
  84867. */
  84868. function refreshDragedNodePosition(e) {
  84869. var model = e.item.get('model');
  84870. model.fx = e.x;
  84871. model.fy = e.y;
  84872. model.x = e.x;
  84873. model.y = e.y;
  84874. return model;
  84875. }
  84876. // EXTERNAL MODULE: ./node_modules/lodash.clonedeep/index.js
  84877. var lodash_clonedeep = __webpack_require__(2138);
  84878. var lodash_clonedeep_default = /*#__PURE__*/__webpack_require__.n(lodash_clonedeep);
  84879. ;// CONCATENATED MODULE: ./src/common/overlay/KnowledgeGraph.js
  84880. function KnowledgeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  84881. 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); } }
  84882. 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; }
  84883. /**
  84884. * @class KnowledgeGraph
  84885. * @category iServer KnowledgeGraph
  84886. * @classdesc KnowledgeGraph知识图谱
  84887. * @version 11.1.0
  84888. * @param { KnowledgeGraph.Config } config - 创建graph实例的配置项。
  84889. * @usage
  84890. */
  84891. /**
  84892. * @typedef {Object} KnowledgeGraph.Data - 创建graph实例的数据项。
  84893. * @property {Array.<KnowledgeGraph.Node>} data.nodes - 创建graph节点。
  84894. * @property {Array.<KnowledgeGraph.Edge>} data.edges - 创建graph边。
  84895. */
  84896. /**
  84897. * @typedef {Object} KnowledgeGraph.Config - 创建graph实例的配置项。
  84898. * @property {string | HTMLElement} container - 创建的容器 id 或容器本身, 默认是'knowledgeGraph'。
  84899. * @property {number} width - 图的宽度, 默认是container的width。
  84900. * @property {number} height - 图的高度,默认是container的height。
  84901. * @property {Array.<number>} [center] - 中心点的渲染坐标。可以通过KnowledgeGraph.prototype.getViewPortCenterPoint获取。
  84902. * @property {number} [zoom] - 缩放比例。
  84903. * @property {number} [minZoom] - 最小缩放比例。若 fitView、zoom、zoomTo 等操作导致图的缩放比例小于该值,则将使用该值进行缩放,并返回 false。
  84904. * @property {number} [maxZoom] - 最大缩放比例。若 fitView、zoom、zoomTo 等操作导致图的缩放比例大于该值,则将使用该值进行缩放,并返回 false。
  84905. * @property {KnowledgeGraph.Layout} [layout] - 布局。
  84906. * @property {boolean} [animate=true] - 是否开启动画。
  84907. * @property {boolean} [autoResize=true] - 当视口变换时,是否自动重绘。
  84908. * @property {KnowledgeGraph.NodeStyle} [defaultNode] - 默认状态下节点的配置,比如 type, size, color。会被写入的 data 覆盖。
  84909. * @property {KnowledgeGraph.EdgeStyle} [defaultEdge] - 默认状态下边的配置,比如 type, size, color。会被写入的 data 覆盖。
  84910. * @property {KnowledgeGraph.NodeStyle} [nodeHighlightStyle] - 鼠标移入节点高亮样式。默认样式:{strokeColor: 'blue',stroke: 10, opacity: 0.8}。
  84911. * @property {KnowledgeGraph.EdgeStyle} [edgeHighlightStyle] - 鼠标移入边高亮样式。默认样式:{strokeColor: 'blue',stroke: 10, opacity: 0.8}。
  84912. * @property {boolean} [highlightNode = true] - 鼠标移入是否高亮节点。
  84913. * @property {boolean} [highlightEdge = true] - 鼠标移入是否高亮边。
  84914. * @property {boolean} [showToolBar = true] - 是否打开工具条, 包含放大,缩小,切换到实际大小功能。
  84915. * @property {boolean} [showContextMenu = true] - 是否打开节点的右键菜单, 包含展开\折叠、隐藏功能。
  84916. * @property {boolean} [dragCanvas = true] - 是否可以拖拽canvas。
  84917. * @property {boolean} [zoomCanvas = true] - 是否可以缩放canvas。
  84918. * @property {boolean} [dragNode = true] - 是否可以拖拽node节点。
  84919. * @property {number} [nodeLabelMaxWidth] - node节点的标签开启省略号配置项,大于该宽度使用省略号。
  84920. */
  84921. /**
  84922. * @typedef {Object} KnowledgeGraph.Layout - 布局。
  84923. * @property {string} [type='fruchterman'] - 布局类型, 可选值:['fruchterman']。 默认'fruchterman'。
  84924. */
  84925. /**
  84926. * @typedef {Object} KnowledgeGraph.Node - node节点配置项。
  84927. * @property {string} id - 元素的标识 ID,必须是唯一的 string
  84928. * @property {string} [category] - 分类。
  84929. * @property {number} [x] - x坐标。
  84930. * @property {number} [y] - y坐标。
  84931. * @property {number} [size=20] - 节点的大小。
  84932. * @property {Array.<number>|number} [anchorPoints=20] - 指定边连入节点的连接点的位置(相对于该节点而言),可以为空。例如: [0, 0],代表节点左上角的锚点,[1, 1],代表节点右下角的锚点。
  84933. * @property {string} [type] - 元素的类型,不传则使用默认值,节点默认类型为 'circle'。可选值['circle','rect','ellipse','diamond', 'image']
  84934. * @property {string} [label] - 元素的文本标签,有该字段时默认会渲染 label 。
  84935. * @property {KnowledgeGraph.NodeLabelCfg} [labelCfg] - 元素文本标签的配置项,详见各子模块内容。
  84936. * @property {KnowledgeGraph.NodeStyle} [style] - 样式属性。
  84937. */
  84938. /**
  84939. * @typedef {Object} KnowledgeGraph.Edge - edge边配置项。
  84940. * @property {string} [source] -起始点 id 。
  84941. * @property {string} [target] - 结束点 id 。
  84942. * @property {number} [sourceAnchor] - 边的起始节点上的锚点的索引值。
  84943. * @property {number} [targetAnchor] - 边的终止节点上的锚点的索引值。
  84944. * @property {string} [type='line'] - 指定边的类型,可以是内置边的类型名称,也可以是自定义边的名称。默认为 'line'。可选值['line','arc','polyline','quadratic']。
  84945. * @property {string} [label] - 文本文字,如果没有则不会显示。
  84946. * @property {KnowledgeGraph.EdgeLabelCfg} [labelCfg] - 配置标签文本。
  84947. * @property {KnowledgeGraph.EdgeStyle} [style] - 通过 style 配置来修改边的填充色、边框颜色、阴影等属性,具体配置属性见:图形样式属性。
  84948. */
  84949. /**
  84950. * @typedef {Object} KnowledgeGraph.NodeLabelCfg - node节点配置项。
  84951. * @property {string} [position] - 文本相对于节点的位置,目前支持的位置有:'center','top','left','right','bottom'。默认为 'center'。modelRect 节点不支持该属性。
  84952. * @property {KnowledgeGraph.TextStyle} [style] - 标签的样式属性。
  84953. * @property {number} [offset] - 文本的偏移,position 为 'bottom' 时,文本的上方偏移量;position 为 'left' 时,文本的右方偏移量;以此类推在其他 position 时的情况。modelRect 节点的 offset 为左边距。
  84954. */
  84955. /**
  84956. * @typedef {Object} KnowledgeGraph.NodeStyle - 节点样式通用配置项。
  84957. * @property {string} [fill] - 节点填充色。
  84958. * @property {string} [stroke] - 节点的描边颜色。
  84959. * @property {number} [lineWidth] - 描边宽度。
  84960. * @property {Array.<number>} [lineDash] -描边虚线,数组代表实、虚长度。
  84961. * @property {number} [fillOpacity] - 设置填充的 alpha 或透明值。
  84962. * @property {string} [shadowColor] - 阴影颜色。
  84963. * @property {number} [shadowBlur] - 阴影范围。
  84964. * @property {number} [shadowOffsetX] - 阴影 x 方向偏移量。
  84965. * @property {number} [shadowOffsetY] - 阴影 y 方向偏移量。
  84966. * @property {number} [opacity] - 设置绘图的当前 alpha 或透明值。
  84967. * @property {string} [cursor] - 鼠标在该边上时的鼠标样式,CSS 的 cursor 选项都支持。
  84968. */
  84969. /**
  84970. * @typedef {Object} KnowledgeGraph.TextStyle - 文本样式。
  84971. * @property {string} [textAlign] - 设置文本内容的当前对齐方式。支持的属性:center / end / left / right / start,默认值为 start。
  84972. * @property {string} [textBaseline] - 设置在绘制文本时使用的当前文本基线。支持的属性:top / middle / bottom / alphabetic / hanging。默认值为 bottom。
  84973. * @property {string} [fontStyle] - 字体样式。对应 font-style。
  84974. * @property {string} [fontVariant] - 设置为小型大写字母字体。对应 font-variant。
  84975. * @property {number} [fontWeight] - 字体粗细。对应 font-weight。
  84976. * @property {number} [fontSize] - 字体大小。对应 font-size, 边标签文本默认大小是7。
  84977. * @property {string} [fontFamily] - 字体系列。对应 font-family。
  84978. * @property {number} [lineHeight] - 行高。对应 line-height。
  84979. */
  84980. /**
  84981. * @typedef {Object} KnowledgeGraph.EdgeLabelCfg - node节点配置项。
  84982. * @property {string} [position] - 文本相对于边的位置,目前支持的位置有:'start','middle','end'。默认为'middle'。
  84983. * @property {number} [refX] - 标签在 x 方向的偏移量。
  84984. * @property {number} [refY] -标签在 y 方向的偏移量。
  84985. * @property {boolean} [autoRotate=true] - 标签文字是否跟随边旋转,默认: true。
  84986. * @property { KnowledgeGraph.TextStyle} [style] - 标签的样式属性,默认: {fontSize: 3,fill: '#333'}。
  84987. */
  84988. /**
  84989. * @typedef {Object} KnowledgeGraph.EdgeStyle - 边样式通用配置项。
  84990. * @property {string} [stroke] - 边的颜色。
  84991. * @property {number} [lineWidth] - 边宽度。
  84992. * @property {number} [lineAppendWidth] -边响应鼠标事件时的检测宽度,当 lineWidth 太小而不易选中时,可以通过该参数提升击中范围。
  84993. * @property {boolean|Object} [endArrow=true] - 为 true 时在边的结束端绘制默认箭头,为 false 时不绘制结束端箭头, 默认值{path: 'M 0,0 L 2,1 L 2,-1 Z'}
  84994. * @property {boolean|Object} [startArrow] - 为 true 时在边的开始端绘制默认箭头,为 false 时不绘制结束端箭头。
  84995. * @property {number} [strokeOpacity] - 边透明度。
  84996. * @property {string} [shadowColor] - 阴影颜色。
  84997. * @property {number} [shadowBlur] - 阴影模糊程度。
  84998. * @property {number} [shadowOffsetX] - 阴影 x 方向偏移量。
  84999. * @property {number} [shadowOffsetY] - 阴影 y 方向偏移量。
  85000. * @property {Array.<number>} [lineDash] - 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。
  85001. * @property {string} [cursor] - 鼠标在该边上时的鼠标样式,CSS 的 cursor 选项都支持。
  85002. */
  85003. /**
  85004. * @typedef {Object} KnowledgeGraph.AnimateConfig - 动画配置项。
  85005. * @property {number} [duration= 500] - 一次动画的时长。
  85006. * @property {string} [easing='linearEasing'] - 动画函数。
  85007. * @property {number} [delay=0] - 是否重复执行动画。
  85008. * @property {boolean} [repeat=false] - 边透明度。
  85009. * @property {string} [shadowColor] - 阴影颜色。
  85010. */
  85011. var KnowledgeGraph = /*#__PURE__*/function () {
  85012. function KnowledgeGraph(config) {
  85013. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'G6';
  85014. KnowledgeGraph_classCallCheck(this, KnowledgeGraph);
  85015. /**
  85016. * @member {string} KnowledgeGraph.prototype.graph
  85017. * @description graph实例。
  85018. */
  85019. this.graph = null;
  85020. this.config = lodash_clonedeep_default()(config);
  85021. this.graphRender = null;
  85022. this.type = type;
  85023. this.createGraphRender(this.type);
  85024. this.config = this.graphRender._getGraphConfig(this.config);
  85025. this.createGraph(this.config);
  85026. this.CLASS_NAME = 'SuperMap.KnowledgeGraph';
  85027. }
  85028. /**
  85029. * @function KnowledgeGraph.dataFromGraphMap
  85030. * @description 将iServer GraphMap数据转换成KnowledgeGraph数据。
  85031. * @param {Object} queryResult - iServer知识图谱服务query数据。
  85032. * @param {Object} graphMap - iServer知识图谱服务GraphMap数据(data.graphMap)。
  85033. * @return {KnowledgeGraph.Data} 返回数据。
  85034. */
  85035. KnowledgeGraph_createClass(KnowledgeGraph, [{
  85036. key: "handleNodeStatus",
  85037. value:
  85038. /**
  85039. * @function KnowledgeGraph.prototype.handleNodeStatus
  85040. * @description 展开、折叠、隐藏节点
  85041. * @param {Object} data - 展开 折叠 隐藏的对象, eg: {expand:['id1'], collapse:['id2'], hidden:['id3']}
  85042. */
  85043. function handleNodeStatus(data) {
  85044. var expand = data.expand,
  85045. collapse = data.collapse,
  85046. hidden = data.hidden;
  85047. // 解析expand参数,里面的节点再执行一次查询显示出来
  85048. this.expandNodes(expand);
  85049. // 解析collapse参数,折叠这个里面的节点
  85050. this.collapseNodes(collapse);
  85051. // 解析hidden,隐藏这个里面额的节点
  85052. this.hideNodes(hidden);
  85053. }
  85054. /**
  85055. * @function KnowledgeGraph.prototype.expandNodes
  85056. * @description 展开节点。
  85057. * @param {Array.<string>} expandData - 元素 ID 数组。
  85058. */
  85059. }, {
  85060. key: "expandNodes",
  85061. value: function expandNodes(expandData) {
  85062. var _this = this;
  85063. if (!expandData) {
  85064. return;
  85065. }
  85066. expandData.forEach(function (item) {
  85067. _this.expandNode(item + '');
  85068. });
  85069. }
  85070. /**
  85071. * @function KnowledgeGraph.prototype.collapseNodes
  85072. * @description 折叠节点。
  85073. * @param {Array.<string>} collapseData - 元素 ID 数组。
  85074. */
  85075. }, {
  85076. key: "collapseNodes",
  85077. value: function collapseNodes(collapseData) {
  85078. var _this2 = this;
  85079. if (!collapseData) {
  85080. return;
  85081. }
  85082. collapseData.forEach(function (item) {
  85083. _this2.collapseNode(item + '');
  85084. });
  85085. }
  85086. /**
  85087. * @function KnowledgeGraph.prototype.hideNodes
  85088. * @description 隐藏节点。
  85089. * @param {Array.<string>} hiddenData - 元素 ID 数组。
  85090. */
  85091. }, {
  85092. key: "hideNodes",
  85093. value: function hideNodes(hiddenData) {
  85094. var _this3 = this;
  85095. if (!hiddenData) {
  85096. return;
  85097. }
  85098. hiddenData.forEach(function (item) {
  85099. _this3.hideItem(item + '');
  85100. });
  85101. }
  85102. /**
  85103. * @function KnowledgeGraph.prototype.createGraphRender
  85104. * @description 创建KnowledgeGraphRender
  85105. * @param {string} type -类型, 默认是G6。
  85106. * @private
  85107. */
  85108. }, {
  85109. key: "createGraphRender",
  85110. value: function createGraphRender(type) {
  85111. if (type === 'G6') {
  85112. this.graphRender = new G6Render();
  85113. }
  85114. }
  85115. /**
  85116. * @function KnowledgeGraph.prototype.createGraph
  85117. * @description 创建KnowledgeGraph的guaph实例。
  85118. * @param {Object} config - graph配置项。
  85119. * @returns {Object} graph实例。
  85120. */
  85121. }, {
  85122. key: "createGraph",
  85123. value: function createGraph(config) {
  85124. var graph = this.initGraph(config);
  85125. this.graph = graph;
  85126. this.autoResize();
  85127. return graph;
  85128. }
  85129. /**
  85130. * @function KnowledgeGraph.prototype.getGraph
  85131. * @description 获取KnowledgeGraph的guaph实例。
  85132. * @returns {Object} graph实例。
  85133. */
  85134. }, {
  85135. key: "getGraph",
  85136. value: function getGraph() {
  85137. return this.graph;
  85138. }
  85139. /**
  85140. * @function KnowledgeGraph.prototype.autoResize
  85141. * @description 浏览器窗口大小发生改变时,重新设置canvas画布的大小,重新渲染。
  85142. */
  85143. }, {
  85144. key: "autoResize",
  85145. value: function autoResize() {
  85146. if (this.config && this.config.autoResize !== false) {
  85147. this.graphRender.autoResize();
  85148. }
  85149. }
  85150. /**
  85151. * @function KnowledgeGraph.prototype.zoom
  85152. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  85153. * @param {number} ratio 缩放比例。
  85154. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  85155. * @param {boolean} [animate] 是否开启动画。
  85156. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  85157. */
  85158. }, {
  85159. key: "zoom",
  85160. value: function zoom(ratio, center, animate, animateCfg) {
  85161. this.graphRender.zoom(ratio, center, animate, animateCfg);
  85162. }
  85163. /**
  85164. * @function KnowledgeGraph.prototype.zoomTo
  85165. * @description 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。
  85166. * @param {number} ratio 缩放比例。
  85167. * @param {Object} [center] 以 center 的 x、y 坐标为中心缩放,如果省略了 center 参数,则以元素当前位置为中心缩放。
  85168. * @param {boolean} [animate] 是否开启动画。
  85169. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  85170. */
  85171. }, {
  85172. key: "zoomTo",
  85173. value: function zoomTo(ratio, center, animate, animateCfg) {
  85174. this.graphRender.zoomTo(ratio, center, animate, animateCfg);
  85175. }
  85176. /**
  85177. * @function KnowledgeGraph.prototype.fitView
  85178. * @description 让画布内容适应视口。
  85179. * @param {Array.<number>|number} [padding] [top, right, bottom, left] 四个方向上的间距值。
  85180. * @param {Object} [rules] fitView 的规则,参数如下:{ onlyOutOfViewPort?: boolean; direction?: 'x' / 'y' / 'both'; ratioRule?: 'max' / 'min}。
  85181. * @param {boolean} [animate] 是否开启动画。
  85182. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画。若未配置,则跟随 graph 的 animateCfg 参数。
  85183. */
  85184. }, {
  85185. key: "fitView",
  85186. value: function fitView(padding, rules, animate, animateCfg) {
  85187. this.graphRender.fitView(padding, rules, animate, animateCfg);
  85188. }
  85189. /**
  85190. * @function KnowledgeGraph.prototype.fitCenter
  85191. * @description 平移图到中心将对齐到画布中心,但不缩放。优先级低于 fitView。
  85192. * @param {boolean} [animate] 是否开启动画。
  85193. * @param {KnowledgeGraph.AnimateConfig} [animateCfg] 若带有动画,可配置动画,参见基础动画教程。若未配置,则跟随 graph 的 animateCfg 参数。
  85194. */
  85195. }, {
  85196. key: "fitCenter",
  85197. value: function fitCenter(animate, animateCfg) {
  85198. this.graphRender.fitCenter(animate, animateCfg);
  85199. }
  85200. /**
  85201. * @function KnowledgeGraph.prototype.getGraphCenterPoint
  85202. * @description 获取图内容的中心绘制坐标。
  85203. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  85204. */
  85205. }, {
  85206. key: "getGraphCenterPoint",
  85207. value: function getGraphCenterPoint() {
  85208. return this.graphRender.getGraphCenterPoint();
  85209. }
  85210. /**
  85211. * @function KnowledgeGraph.prototype.getViewPortCenterPoint
  85212. * @description 获取窗口的中心绘制坐标。
  85213. * @return {Object} 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。
  85214. */
  85215. }, {
  85216. key: "getViewPortCenterPoint",
  85217. value: function getViewPortCenterPoint() {
  85218. return this.graphRender.getViewPortCenterPoint();
  85219. }
  85220. /**
  85221. * @function KnowledgeGraph.prototype.getZoom
  85222. * @description 获取当前视口的缩放比例。
  85223. * @return {number} 返回值表示当前视口的缩放比例, 默认值为 1。
  85224. */
  85225. }, {
  85226. key: "getZoom",
  85227. value: function getZoom() {
  85228. return this.graphRender.getZoom();
  85229. }
  85230. /**
  85231. * @function KnowledgeGraph.prototype.getMinZoom
  85232. * @description 获取 graph 当前允许的最小缩放比例。
  85233. * @return {number} 返回值表示当前视口的最小缩放比例。
  85234. */
  85235. }, {
  85236. key: "getMinZoom",
  85237. value: function getMinZoom() {
  85238. return this.graphRender.getMinZoom();
  85239. }
  85240. /**
  85241. * @function KnowledgeGraph.prototype.setMinZoom
  85242. * @description 设置 graph 当前允许的最小缩放比例。
  85243. * @param {number} ratio 缩放比例。
  85244. */
  85245. }, {
  85246. key: "setMinZoom",
  85247. value: function setMinZoom(ratio) {
  85248. this.graphRender.setMinZoom(ratio);
  85249. }
  85250. /**
  85251. * @function KnowledgeGraph.prototype.getMaxZoom
  85252. * @description 获取 graph 当前允许的最大缩放比例。
  85253. * @return {number} 返回值表示当前视口的最大缩放比例。
  85254. */
  85255. }, {
  85256. key: "getMaxZoom",
  85257. value: function getMaxZoom() {
  85258. return this.graphRender.getMaxZoom();
  85259. }
  85260. /**
  85261. * @function KnowledgeGraph.prototype.setMaxZoom
  85262. * @description 设置 graph 当前允许的最大缩放比例。
  85263. * @param {number} ratio 缩放比例。
  85264. */
  85265. }, {
  85266. key: "setMaxZoom",
  85267. value: function setMaxZoom(ratio) {
  85268. this.graphRender.setMaxZoom(ratio);
  85269. }
  85270. /**
  85271. * @function KnowledgeGraph.prototype.getWidth
  85272. * @description获取 graph 当前的宽度。
  85273. * @return {number} graph 当前的宽度。
  85274. */
  85275. }, {
  85276. key: "getWidth",
  85277. value: function getWidth() {
  85278. return this.graphRender.getWidth();
  85279. }
  85280. /**
  85281. * @function KnowledgeGraph.prototype.getHeight
  85282. * @description 获取 graph 当前的高度。
  85283. * @return {number} graph 当前的高度。
  85284. */
  85285. }, {
  85286. key: "getHeight",
  85287. value: function getHeight() {
  85288. return this.graphRender.getHeight();
  85289. }
  85290. /**
  85291. * @function KnowledgeGraph.prototype.initGraph
  85292. * @description 创建KnowledgeGraph实例
  85293. * @param {Object} config - graph配置项。
  85294. * @returns {Object} graph实例。
  85295. */
  85296. }, {
  85297. key: "initGraph",
  85298. value: function initGraph(config) {
  85299. var _this4 = this;
  85300. var graph = this.graphRender.initGraph(config);
  85301. this.graph = graph;
  85302. var cb = function cb() {
  85303. if (_this4.config.zoom !== undefined) {
  85304. _this4.zoom(_this4.config.zoom);
  85305. }
  85306. if (_this4.config.center !== undefined) {
  85307. _this4.graphRender.setCenter({
  85308. x: _this4.config.center[0],
  85309. y: _this4.config.center[1]
  85310. });
  85311. }
  85312. };
  85313. this.graph.on('beforelayout', cb);
  85314. return graph;
  85315. }
  85316. /**
  85317. * @function KnowledgeGraph.prototype.setData
  85318. * @description 设置默认数据
  85319. * @param {KnowledgeGraph.Data} data - graph数据。
  85320. * @param {Object} [graph = this.graph] - graph实例。
  85321. */
  85322. }, {
  85323. key: "setData",
  85324. value: function setData(data) {
  85325. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  85326. data = data || {
  85327. nodes: [],
  85328. edges: []
  85329. };
  85330. if (this.config && this.config.nodeLabelMaxWidth) {
  85331. data.nodes = this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth, data.nodes);
  85332. }
  85333. this.graphRender.setData(data, graph);
  85334. this.render(graph); // 渲染图
  85335. this.data = data;
  85336. }
  85337. /**
  85338. * @function KnowledgeGraph.prototype.render
  85339. * @description 根据提供的数据渲染视图。
  85340. * @param {Object} [graph = this.graph] - graph实例。
  85341. */
  85342. }, {
  85343. key: "render",
  85344. value: function render() {
  85345. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85346. graph && this.graphRender.render(graph);
  85347. }
  85348. /**
  85349. * @function KnowledgeGraph.prototype.updateGraph
  85350. * @description 更新数据
  85351. * @param {KnowledgeGraph.Data} data - graph数据。
  85352. * @param {Object} [graph = this.graph] - graph实例。
  85353. */
  85354. }, {
  85355. key: "updateGraph",
  85356. value: function updateGraph(data) {
  85357. var graph = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.graph;
  85358. graph && this.graphRender.updateGraph(data, graph);
  85359. }
  85360. /**
  85361. * @function KnowledgeGraph.prototype.refresh
  85362. * @description 改变画布大小。
  85363. */
  85364. }, {
  85365. key: "refresh",
  85366. value: function refresh() {
  85367. return this.graphRender.refresh();
  85368. }
  85369. /**
  85370. * @function KnowledgeGraph.prototype.changeSize
  85371. * @description 改变画布大小。
  85372. * @param {number} width - 宽度。
  85373. * @param {number} height - 高度。
  85374. */
  85375. }, {
  85376. key: "changeSize",
  85377. value: function changeSize(width, height) {
  85378. return this.graphRender.changeSize(width, height);
  85379. }
  85380. /**
  85381. * @function KnowledgeGraph.prototype.resize
  85382. * @description 改变画布大小后,重新渲染。
  85383. * @param {number} width - 宽度。
  85384. * @param {number} height - 高度。
  85385. */
  85386. }, {
  85387. key: "resize",
  85388. value: function resize(width, height) {
  85389. this.graphRender.changeSize(width, height);
  85390. this.graphRender.refresh();
  85391. }
  85392. /**
  85393. * @function KnowledgeGraph.prototype.getContainer
  85394. * @description 获取 Graph 的 DOM 容器。
  85395. * @return {HTMLElement} DOM 容器。
  85396. */
  85397. }, {
  85398. key: "getContainer",
  85399. value: function getContainer() {
  85400. return this.graphRender.getContainer();
  85401. }
  85402. /**
  85403. * @function KnowledgeGraph.prototype.getCanvas
  85404. * @description 获取canvas。
  85405. * @return {HTMLElement} canvas。
  85406. */
  85407. }, {
  85408. key: "getCanvas",
  85409. value: function getCanvas() {
  85410. return this.graphRender.getCanvas();
  85411. }
  85412. /**
  85413. * @function KnowledgeGraph.prototype.getNodes
  85414. * @description 获取图中所有节点的实例。
  85415. * @return {Array} 返回值表示图中所有节点的实例。
  85416. */
  85417. }, {
  85418. key: "getNodes",
  85419. value: function getNodes() {
  85420. return this.graphRender.getNodes();
  85421. }
  85422. /**
  85423. * @function KnowledgeGraph.prototype.getEdges
  85424. * @description 获取图中所有节点的实例。这里返回的是边的实例,而不是边的数据项。
  85425. * @return {Array} 返回值表示图中所有边的实例。
  85426. */
  85427. }, {
  85428. key: "getEdges",
  85429. value: function getEdges() {
  85430. return this.graphRender.getEdges();
  85431. }
  85432. /**
  85433. * @function KnowledgeGraph.prototype.getNeighbors
  85434. * @description 获取邻居节点数组。
  85435. * @param {string | INode} node - 节点 ID 或节点实例。
  85436. * @param {string | undefined} type - ['source'| 'target' | undefined] 邻居类型, 'source' 只获取当前节点的源节点,'target' 只获取当前节点指向的目标节点, 若不指定则返回所有类型的邻居。
  85437. * @return {Array} 返回值符合要求的节点数组。
  85438. */
  85439. }, {
  85440. key: "getNeighbors",
  85441. value: function getNeighbors(node, type) {
  85442. return this.graphRender.getNeighbors(node, type);
  85443. }
  85444. /**
  85445. * @function KnowledgeGraph.prototype.findById
  85446. * @description 根据 ID,查询对应的元素实例。
  85447. * @param {string} id - 元素 ID。
  85448. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  85449. */
  85450. }, {
  85451. key: "findById",
  85452. value: function findById(id) {
  85453. return this.graphRender.findById(id);
  85454. }
  85455. /**
  85456. * @function KnowledgeGraph.prototype.find
  85457. * @description 获取邻居节点数组。
  85458. * @param {string} type - 元素类型,可选值为 'node'、'edge'
  85459. * @param {Function} fn - 查找的规则。
  85460. * @return {Object} 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 undefined 。
  85461. */
  85462. }, {
  85463. key: "find",
  85464. value: function find(type, fn) {
  85465. return this.graphRender.find(type, fn);
  85466. }
  85467. /**
  85468. * @function KnowledgeGraph.prototype.findAll
  85469. * @description 获取邻居节点数组。
  85470. * @param {string} type - 元素类型,可选值为 'node'、'edge'。
  85471. * @param {Function} fn - 查找的规则。
  85472. * @return {Object} 如果有符合规则的元素实例,则返回所有元素实例,否则返回 undefined。
  85473. */
  85474. }, {
  85475. key: "findAll",
  85476. value: function findAll(type, fn) {
  85477. return this.graphRender.findAll(type, fn);
  85478. }
  85479. /**
  85480. * @function KnowledgeGraph.prototype.getEdgesByNode
  85481. * @description 获取与当前节点有关联的所有边。
  85482. * @param {Object} node - node实例。
  85483. * @return {Array} edge实例数组。
  85484. */
  85485. }, {
  85486. key: "getEdgesByNode",
  85487. value: function getEdgesByNode(node) {
  85488. return this.graphRender.getEdgesByNode(node);
  85489. }
  85490. /**
  85491. * @function KnowledgeGraph.prototype.getInEdges
  85492. * @description 获取与当前节点关联的所有入边。
  85493. * @param {Object} node - node实例。
  85494. * @return {Array} edge实例数组。
  85495. */
  85496. }, {
  85497. key: "getInEdges",
  85498. value: function getInEdges(node) {
  85499. return this.graphRender.getInEdges(node);
  85500. }
  85501. /**
  85502. * @function KnowledgeGraph.prototype.getOutEdges
  85503. * @description 获取与当前节点关联的所有出边。
  85504. * @param {Object} node - node实例。
  85505. * @return {Array} edge实例数组。
  85506. */
  85507. }, {
  85508. key: "getOutEdges",
  85509. value: function getOutEdges(node) {
  85510. return this.graphRender.getOutEdges(node);
  85511. }
  85512. /**
  85513. * @function KnowledgeGraph.prototype.getSourceByEdge
  85514. * @description 获取当前边的起始节点
  85515. * @param {Object} edge - node实例。
  85516. * @return {Object} 返回值为起始节点的实例。
  85517. */
  85518. }, {
  85519. key: "getSourceByEdge",
  85520. value: function getSourceByEdge(edge) {
  85521. return this.graphRender.getSourceByEdge(edge);
  85522. }
  85523. /**
  85524. * @function KnowledgeGraph.prototype.getTargetByEdge
  85525. * @description 获取当前边的终止节点。
  85526. * @param {Object} edge - node实例。
  85527. * @return {Object} 终止节点的实例。
  85528. */
  85529. }, {
  85530. key: "getTargetByEdge",
  85531. value: function getTargetByEdge(edge) {
  85532. return this.graphRender.getTargetByEdge(edge);
  85533. }
  85534. /**
  85535. * @function KnowledgeGraph.prototype.expandNode
  85536. * @description 展开当前节点。
  85537. * @param {string} id - 元素 ID。
  85538. */
  85539. }, {
  85540. key: "expandNode",
  85541. value: function expandNode(id) {
  85542. var item = this.findById(id);
  85543. item && this.graphRender.expandNode(item);
  85544. }
  85545. /**
  85546. * @function KnowledgeGraph.prototype.collapseNode
  85547. * @description 收起当前节点。
  85548. * @param {string} id - 元素 ID。
  85549. */
  85550. }, {
  85551. key: "collapseNode",
  85552. value: function collapseNode(id) {
  85553. var item = this.findById(id);
  85554. item && this.graphRender.collapseNode(item);
  85555. }
  85556. /**
  85557. * @function KnowledgeGraph.prototype.showItem
  85558. * @description 显示指定的元素。若 item 为节点,则相关边也会随之显示。而show() 则将只显示自身。
  85559. * @param {string|Object} item - 元素 ID 或元素实例。
  85560. * @param {boolean} [stack] - 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  85561. */
  85562. }, {
  85563. key: "showItem",
  85564. value: function showItem(item, stack) {
  85565. this.graphRender.showItem(item, stack);
  85566. }
  85567. /**
  85568. * @function KnowledgeGraph.prototype.showItem
  85569. * @description 隐藏指定元素。若 item 为节点,则相关边也会随之隐藏。而 hide() 则将只隐藏自身。
  85570. * @param {string|Object} item - 元素 ID 或元素实例。
  85571. * @param {boolean} [stack] -操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可。
  85572. */
  85573. }, {
  85574. key: "hideItem",
  85575. value: function hideItem(item, stack) {
  85576. this.graphRender.hideItem(item, stack);
  85577. }
  85578. /**
  85579. * @function KnowledgeGraph.prototype.show
  85580. * @description 显示元素。只显示 item 自身,若需要在显示节点的同时显示相关边,应调用showItem(item)。
  85581. * @param {Object} item - 元素实例。
  85582. */
  85583. }, {
  85584. key: "show",
  85585. value: function show(item) {
  85586. this.graphRender.show(item);
  85587. }
  85588. /**
  85589. * @function KnowledgeGraph.prototype.hide
  85590. * @description 隐藏元素。只隐藏 item 自身,若需要在隐藏节点的同时隐藏相关边,应调用 hideItem(item)。
  85591. * @param {Object} item - 元素实例。
  85592. */
  85593. }, {
  85594. key: "hide",
  85595. value: function hide(item) {
  85596. this.graphRender.hide(item);
  85597. }
  85598. /**
  85599. * @function KnowledgeGraph.prototype.changeVisibility
  85600. * @description 更改元素是否显示。
  85601. * @param {Object} item - 元素实例。
  85602. * @param {boolean} visible - 是否显示元素,true 为显示,false 为隐藏。
  85603. */
  85604. }, {
  85605. key: "changeVisibility",
  85606. value: function changeVisibility(item, visible) {
  85607. this.graphRender.changeVisibility(item, visible);
  85608. }
  85609. /**
  85610. * @function KnowledgeGraph.prototype.isVisible
  85611. * @description 查询元素显示状态。
  85612. * @param {Object} item - 元素实例。
  85613. * @return {boolean} - 返回值为 true,则表示当前元素处于显示状态,否则处于隐藏状态。
  85614. */
  85615. }, {
  85616. key: "isVisible",
  85617. value: function isVisible(item) {
  85618. return this.graphRender.isVisible(item);
  85619. }
  85620. /**
  85621. * @function KnowledgeGraph.prototype.getModel
  85622. * @description 获取元素的数据模型。
  85623. * @param {Object} item - 元素实例。
  85624. * @return {Object} - 返回值为节点的数据模型。
  85625. */
  85626. }, {
  85627. key: "getModel",
  85628. value: function getModel(item) {
  85629. return this.graphRender.getModel(item);
  85630. }
  85631. /**
  85632. * @function KnowledgeGraph.prototype.addItem
  85633. * @description 新增元素(节点和边)。
  85634. * @param {string} type - 元素类型,可选值为 'node'、'edge'。
  85635. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  85636. */
  85637. }, {
  85638. key: "addItem",
  85639. value: function addItem(type, model) {
  85640. return this.graphRender.addItem(type, model);
  85641. }
  85642. /**
  85643. * @function KnowledgeGraph.prototype.removeItem
  85644. * @description 删除元素。
  85645. * @param {string|Object} item - 元素 ID 或元素实例。
  85646. */
  85647. }, {
  85648. key: "removeItem",
  85649. value: function removeItem(item) {
  85650. return this.graphRender.removeItem(item);
  85651. }
  85652. /**
  85653. * @function KnowledgeGraph.prototype.updateItem
  85654. * @description 更新元素,包括更新数据、样式等。
  85655. * @param {string|Object} item - 元素 ID 或元素实例。
  85656. * @param {Object} model - 元素的数据模型,具体内容参见元素配置项。
  85657. */
  85658. }, {
  85659. key: "updateItem",
  85660. value: function updateItem(item, model) {
  85661. return this.graphRender.updateItem(item, model);
  85662. }
  85663. /**
  85664. * @function KnowledgeGraph.prototype.refreshItem
  85665. * @description 刷新指定元素。
  85666. * @param {string|Object} item - 元素 ID 或元素实例。
  85667. */
  85668. }, {
  85669. key: "refreshItem",
  85670. value: function refreshItem(item) {
  85671. return this.graphRender.refreshItem(item);
  85672. }
  85673. /**
  85674. * @function KnowledgeGraph.prototype.refreshPositions
  85675. * @description 当节点位置发生变化时,刷新所有节点位置,并重计算边的位置。
  85676. */
  85677. }, {
  85678. key: "refreshPositions",
  85679. value: function refreshPositions() {
  85680. return this.graphRender.refreshPositions();
  85681. }
  85682. /**
  85683. * @function KnowledgeGraph.prototype.on
  85684. * @description graph监听事件
  85685. * @param {string} eventName - 事件名,可选事件名参见: Node交互事件名、Edge交互事件名、Canvas交互事件名 时机事件
  85686. * 通用事件名: click dbclick mouseenter mousemove mouseout mouseover mouseleave mousedown mouseup contextmenu dragstart drag dragend dragenter dragleave drop keydown keyup wheel touchstart touchmove touchend
  85687. * Node交互事件名: node:通用事件名, 例如 node:click
  85688. * Edge交互事件名: edge:通用事件名, 例如 edge:click
  85689. * Canvas交互事件名: canvas:通用事件名,例如 canvas:click
  85690. * 时机事件:用于监听图的某方法调用前后的时机。
  85691. * beforerender 调用 render 方法之前触发
  85692. * afterrender 调用 render 方法之后触发
  85693. * beforeadditem 调用 addItem 方法之前触发
  85694. * afteradditem 调用 addItem 方法之后触发
  85695. * beforeremoveitem 调用 removeItem 方法之前触发
  85696. * afterremoveitem 调用 removeItem 方法之后触发
  85697. * beforeupdateitem 调用 updateItem 方法之前触发
  85698. * afterupdateitem 调用 updateItem 方法之后触发
  85699. * beforegraphrefresh 调用 refresh 方法之前触发
  85700. * aftergraphrefresh 调用 refresh 方法之后触发
  85701. * beforelayout 布局前触发。调用 graph.render 时会进行布局,因此 render 时会触发。或用户主动调用图的 graph.layout 时触发
  85702. * afterlayout 布局完成后触发。调用 graph.render 时会进行布局,因此 render 时布局完成后会触发。或用户主动调用图的 graph.layout 时布局完成后触发
  85703. * viewportchange 调用 graph.moveTo 或 graph.zoom 均会触发该事件
  85704. * @param {Function} handler - 监听函数。
  85705. */
  85706. }, {
  85707. key: "on",
  85708. value: function on(eventName, handler) {
  85709. this.graphRender.on(eventName, handler);
  85710. }
  85711. /**
  85712. * @function KnowledgeGraph.prototype.off
  85713. * @description graph关闭事件。
  85714. * @param {string} eventName - 事件名,参考on方法的事件名。
  85715. * @param {Function} handler - 监听函数。
  85716. */
  85717. }, {
  85718. key: "off",
  85719. value: function off(eventName, handler) {
  85720. this.graphRender.off(eventName, handler);
  85721. }
  85722. /**
  85723. * @function KnowledgeGraph.prototype.toDataURL
  85724. * @description 转换成图片。
  85725. * @param {string} type - 图片类型 'image/png' / 'image/jpeg' / 'image/webp' / 'image/bmp'。
  85726. * @param {string} [backgroundColor] - 图片的背景色,可选,不传值时将导出透明背景的图片。
  85727. * @return {string} 返回值表示生成的图片的 URL。
  85728. */
  85729. }, {
  85730. key: "toDataURL",
  85731. value: function toDataURL(type, backgroundColor) {
  85732. this.graphRender.toDataURL(type, backgroundColor);
  85733. }
  85734. /**
  85735. * @function KnowledgeGraph.prototype.nodeLabelOpenEllipsis
  85736. * @description 转换label的省略号。
  85737. * @param {Object} nodeLabelMaxWidth - node节点标签是否开启省略号
  85738. * @param {Object} nodes - graph的nodes数据。
  85739. * @return {Array} nodes
  85740. */
  85741. }, {
  85742. key: "nodeLabelOpenEllipsis",
  85743. value: function nodeLabelOpenEllipsis(nodeLabelMaxWidth, nodes) {
  85744. var _this5 = this;
  85745. if (!nodes) {
  85746. return [];
  85747. }
  85748. if (!nodeLabelMaxWidth) {
  85749. return nodes;
  85750. }
  85751. return nodes.map(function (node) {
  85752. var fontSize = node.labelCfg && node.labelCfg.fontSize || _this5.defaultNode && _this5.defaultNode.labelCfg && _this5.defaultNode.labelCfg.fontSize || 14;
  85753. node.label = fittingStr(node.label, nodeLabelMaxWidth, fontSize);
  85754. return node;
  85755. });
  85756. }
  85757. /**
  85758. * @function KnowledgeGraph.prototype.clear
  85759. * @description 清除画布元素。
  85760. * @param {Object} [graph = this.graph] - graph实例。
  85761. */
  85762. }, {
  85763. key: "clear",
  85764. value: function clear() {
  85765. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85766. graph && graph.clear();
  85767. }
  85768. /**
  85769. * @function KnowledgeGraph.prototype.destroy
  85770. * @description 销毁画布。
  85771. * @param {Object} [graph = this.graph] - graph实例。
  85772. */
  85773. }, {
  85774. key: "destroy",
  85775. value: function destroy() {
  85776. var graph = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.graph;
  85777. graph && graph.destroy();
  85778. }
  85779. }], [{
  85780. key: "dataFromGraphMap",
  85781. value: function dataFromGraphMap(queryResult, graphMap) {
  85782. return transformGraphMap(queryResult, graphMap);
  85783. }
  85784. /**
  85785. * @function KnowledgeGraph.dataFromKnowledgeGraphQuery
  85786. * @description 将iServer KnowledgeGraphService query数据转换成KnowledgeGraph数据。
  85787. * @param {Object} queryResult - iServer知识图谱服务query数据。
  85788. * @return {KnowledgeGraph.Data} 返回数据。
  85789. */
  85790. }, {
  85791. key: "dataFromKnowledgeGraphQuery",
  85792. value: function dataFromKnowledgeGraphQuery(queryResult) {
  85793. return transformGraphMap(queryResult);
  85794. }
  85795. }]);
  85796. return KnowledgeGraph;
  85797. }();
  85798. /**
  85799. * @private
  85800. * @description 大于最大宽度的字符串会返回带有省略号的字符串 xxx...。
  85801. * @param {string} label - 需要处理的字符串。
  85802. * @param {number} maxWidth - 最大宽度。
  85803. * @param {number} fontSize - 字体大小。
  85804. * @returns {string} 处理之后的字符串。
  85805. */
  85806. function fittingStr(label, maxWidth, fontSize) {
  85807. var calcLabelLength = function calcLabelLength(label) {
  85808. var len = 0;
  85809. for (var i = 0; i < label.length; i++) {
  85810. if (label.charCodeAt(i) > 0 && label.charCodeAt(i) < 128) {
  85811. len++;
  85812. } else {
  85813. len += 2;
  85814. }
  85815. }
  85816. return len;
  85817. };
  85818. var fontWidth = fontSize * 1; //字号+边距
  85819. maxWidth = maxWidth * 1.6; // 需要根据自己项目调整
  85820. var width = calcLabelLength(label) * fontWidth;
  85821. var ellipsis = '…';
  85822. if (width > maxWidth) {
  85823. var len = Math.floor((maxWidth - 20) / fontWidth);
  85824. var result = label.substring(0, len);
  85825. if ((label.substring(len).length + ellipsis.length) * fontWidth > maxWidth) {
  85826. return result + '\n' + label.substring(len, len + len - 2) + ellipsis;
  85827. } else if (label.substring(len).length == 0) {
  85828. return result;
  85829. } else {
  85830. return result + '\n' + label.substring(len);
  85831. }
  85832. } else {
  85833. return label;
  85834. }
  85835. }
  85836. ;// CONCATENATED MODULE: ./src/common/index.common.js
  85837. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  85838. * This program are made available under the terms of the Apache License, Version 2.0
  85839. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85840. ;// CONCATENATED MODULE: ./src/common/index.all.js
  85841. ;// CONCATENATED MODULE: ./src/common/namespace.js
  85842. 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; }
  85843. 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; }
  85844. 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; }
  85845. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85846. * This program are made available under the terms of the Apache License, Version 2.0
  85847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85848. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  85849. * This program are made available under the terms of the Apache License, Version 2.0
  85850. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  85851. // Lang
  85852. SuperMap.Lang = Lang;
  85853. SuperMap.i18n = SuperMap.Lang.i18n;
  85854. // CommonUtil
  85855. SuperMap.Util = namespace_objectSpread(namespace_objectSpread({}, SuperMap.Util), Util_Util);
  85856. SuperMap.Browser = Browser;
  85857. SuperMap.INCHES_PER_UNIT = INCHES_PER_UNIT;
  85858. SuperMap.METERS_PER_INCH = METERS_PER_INCH;
  85859. SuperMap.DOTS_PER_INCH = DOTS_PER_INCH;
  85860. SuperMap.IS_GECKO = IS_GECKO;
  85861. // FetchRequest
  85862. SuperMap.setCORS = setCORS;
  85863. SuperMap.isCORS = isCORS;
  85864. SuperMap.setRequestTimeout = setRequestTimeout;
  85865. SuperMap.getRequestTimeout = getRequestTimeout;
  85866. SuperMap.FetchRequest = FetchRequest;
  85867. // commontypes
  85868. SuperMap.inherit = inheritExt;
  85869. SuperMap.mixin = mixinExt;
  85870. SuperMap.String = StringExt;
  85871. SuperMap.Number = NumberExt;
  85872. SuperMap.Function = FunctionExt;
  85873. SuperMap.Array = ArrayExt;
  85874. SuperMap.Date = DateExt;
  85875. SuperMap.Event = Event;
  85876. SuperMap.Bounds = Bounds;
  85877. SuperMap.Credential = Credential;
  85878. SuperMap.Events = Events;
  85879. SuperMap.Feature = Feature_Feature;
  85880. SuperMap.Geometry = Geometry_Geometry;
  85881. SuperMap.Pixel = Pixel;
  85882. SuperMap.Size = Size;
  85883. SuperMap.Feature.Vector = Vector;
  85884. SuperMap.Geometry.Collection = Collection;
  85885. SuperMap.Geometry.Curve = Curve;
  85886. SuperMap.Geometry.GeoText = GeoText;
  85887. SuperMap.Geometry.LinearRing = LinearRing_LinearRing;
  85888. SuperMap.Geometry.LineString = LineString;
  85889. SuperMap.Geometry.MultiLineString = MultiLineString;
  85890. SuperMap.Geometry.MultiPoint = MultiPoint;
  85891. SuperMap.Geometry.MultiPolygon = MultiPolygon;
  85892. SuperMap.Geometry.Point = Point;
  85893. SuperMap.Geometry.Polygon = Polygon_Polygon;
  85894. SuperMap.Geometry.Rectangle = Rectangle;
  85895. // Components
  85896. SuperMap.Components.Chart = ChartView;
  85897. SuperMap.Components.ChartViewModel = ChartViewModel;
  85898. SuperMap.Components.MessageBox = MessageBox;
  85899. SuperMap.Components.AttributesPopContainer = AttributesPopContainer;
  85900. SuperMap.Components.CityTabsPage = CityTabsPage;
  85901. SuperMap.Components.CommonContainer = CommonContainer;
  85902. SuperMap.Components.DropDownBox = DropDownBox;
  85903. SuperMap.Components.IndexTabsPageContainer = IndexTabsPageContainer;
  85904. SuperMap.Components.NavTabsPage = NavTabsPage;
  85905. SuperMap.Components.PaginationContainer = PaginationContainer;
  85906. SuperMap.Components.PopContainer = PopContainer;
  85907. SuperMap.Components.Select = Select;
  85908. SuperMap.Components.TemplateBase = TemplateBase;
  85909. SuperMap.Components.FileReaderUtil = FileReaderUtil;
  85910. // control
  85911. SuperMap.TimeControlBase = TimeControlBase;
  85912. SuperMap.TimeFlowControl = TimeFlowControl;
  85913. // Format
  85914. SuperMap.Format = SuperMap.Format || Format;
  85915. SuperMap.Format.GeoJSON = GeoJSON;
  85916. SuperMap.Format.JSON = JSONFormat;
  85917. SuperMap.Format.WKT = WKT;
  85918. // iManager
  85919. SuperMap.iManager = IManager;
  85920. SuperMap.iManagerCreateNodeParam = IManagerCreateNodeParam;
  85921. SuperMap.iManagerServiceBase = IManagerServiceBase;
  85922. // iPortal
  85923. SuperMap.iPortal = IPortal;
  85924. SuperMap.iPortalAddDataParam = IPortalAddDataParam;
  85925. SuperMap.iPortalAddResourceParam = IPortalAddResourceParam;
  85926. SuperMap.iPortalDataConnectionInfoParam = IPortalDataConnectionInfoParam;
  85927. SuperMap.iPortalDataMetaInfoParam = IPortalDataMetaInfoParam;
  85928. SuperMap.iPortalDataStoreInfoParam = IPortalDataStoreInfoParam;
  85929. SuperMap.iPortalQueryParam = IPortalQueryParam;
  85930. SuperMap.iPortalQueryResult = IPortalQueryResult;
  85931. SuperMap.iPortalRegisterServiceParam = IPortalRegisterServiceParam;
  85932. SuperMap.iPortalResource = IPortalResource;
  85933. SuperMap.iPortalServiceBase = IPortalServiceBase;
  85934. SuperMap.iPortalShareEntity = IPortalShareEntity;
  85935. SuperMap.iPortalShareParam = IPortalShareParam;
  85936. SuperMap.iPortalUser = IPortalUser;
  85937. // iServer
  85938. SuperMap.AddressMatchService = AddressMatchService;
  85939. SuperMap.AggregationParameter = AggregationParameter;
  85940. SuperMap.AreaSolarRadiationParameters = AreaSolarRadiationParameters;
  85941. SuperMap.AreaSolarRadiationService = AreaSolarRadiationService;
  85942. SuperMap.BucketAggParameter = BucketAggParameter;
  85943. SuperMap.BufferAnalystParameters = BufferAnalystParameters;
  85944. SuperMap.BufferAnalystService = BufferAnalystService;
  85945. SuperMap.BufferDistance = BufferDistance;
  85946. SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter;
  85947. SuperMap.BuffersAnalystJobsService = BuffersAnalystJobsService;
  85948. SuperMap.BufferSetting = BufferSetting;
  85949. SuperMap.BurstPipelineAnalystParameters = BurstPipelineAnalystParameters;
  85950. SuperMap.BurstPipelineAnalystService = BurstPipelineAnalystService;
  85951. SuperMap.ChartFeatureInfoSpecsService = ChartFeatureInfoSpecsService;
  85952. SuperMap.ChartQueryFilterParameter = ChartQueryFilterParameter;
  85953. SuperMap.ChartQueryParameters = ChartQueryParameters;
  85954. SuperMap.ChartQueryService = ChartQueryService;
  85955. SuperMap.ClipParameter = ClipParameter;
  85956. SuperMap.ColorDictionary = ColorDictionary;
  85957. SuperMap.CommonServiceBase = CommonServiceBase;
  85958. SuperMap.ComputeWeightMatrixParameters = ComputeWeightMatrixParameters;
  85959. SuperMap.ComputeWeightMatrixService = ComputeWeightMatrixService;
  85960. SuperMap.CreateDatasetParameters = CreateDatasetParameters;
  85961. SuperMap.DataFlowService = DataFlowService;
  85962. SuperMap.DataReturnOption = DataReturnOption;
  85963. SuperMap.DatasetBufferAnalystParameters = DatasetBufferAnalystParameters;
  85964. SuperMap.DatasetInfo = DatasetInfo;
  85965. SuperMap.DatasetOverlayAnalystParameters = DatasetOverlayAnalystParameters;
  85966. SuperMap.DatasetService = DatasetService;
  85967. SuperMap.DatasetSurfaceAnalystParameters = DatasetSurfaceAnalystParameters;
  85968. SuperMap.DatasetThiessenAnalystParameters = DatasetThiessenAnalystParameters;
  85969. SuperMap.DatasourceConnectionInfo = DatasourceConnectionInfo;
  85970. SuperMap.DatasourceService = DatasourceService;
  85971. SuperMap.DensityAnalystService = DensityAnalystService;
  85972. SuperMap.DensityKernelAnalystParameters = DensityKernelAnalystParameters;
  85973. SuperMap.EditFeaturesParameters = EditFeaturesParameters;
  85974. SuperMap.EditFeaturesService = EditFeaturesService;
  85975. SuperMap.FacilityAnalyst3DParameters = FacilityAnalyst3DParameters;
  85976. SuperMap.FacilityAnalystSinks3DParameters = FacilityAnalystSinks3DParameters;
  85977. SuperMap.FacilityAnalystSinks3DService = FacilityAnalystSinks3DService;
  85978. SuperMap.FacilityAnalystSources3DParameters = FacilityAnalystSources3DParameters;
  85979. SuperMap.FacilityAnalystSources3DService = FacilityAnalystSources3DService;
  85980. SuperMap.FacilityAnalystStreamParameters = FacilityAnalystStreamParameters;
  85981. SuperMap.FacilityAnalystStreamService = FacilityAnalystStreamService;
  85982. SuperMap.FacilityAnalystTracedown3DParameters = FacilityAnalystTracedown3DParameters;
  85983. SuperMap.FacilityAnalystTracedown3DService = FacilityAnalystTracedown3DService;
  85984. SuperMap.FacilityAnalystTraceup3DParameters = FacilityAnalystTraceup3DParameters;
  85985. SuperMap.FacilityAnalystTraceup3DService = FacilityAnalystTraceup3DService;
  85986. SuperMap.FacilityAnalystUpstream3DParameters = FacilityAnalystUpstream3DParameters;
  85987. SuperMap.FacilityAnalystUpstream3DService = FacilityAnalystUpstream3DService;
  85988. SuperMap.FieldParameters = FieldParameters;
  85989. SuperMap.FieldsFilter = FieldsFilter;
  85990. SuperMap.FieldStatisticService = FieldStatisticService;
  85991. SuperMap.FieldStatisticsParameters = FieldStatisticsParameters;
  85992. SuperMap.FilterParameter = FilterParameter;
  85993. SuperMap.FindClosestFacilitiesParameters = FindClosestFacilitiesParameters;
  85994. SuperMap.FindClosestFacilitiesService = FindClosestFacilitiesService;
  85995. SuperMap.FindLocationParameters = FindLocationParameters;
  85996. SuperMap.FindLocationService = FindLocationService;
  85997. SuperMap.FindMTSPPathsParameters = FindMTSPPathsParameters;
  85998. SuperMap.FindMTSPPathsService = FindMTSPPathsService;
  85999. SuperMap.FindPathParameters = FindPathParameters;
  86000. SuperMap.FindPathService = FindPathService;
  86001. SuperMap.FindServiceAreasParameters = FindServiceAreasParameters;
  86002. SuperMap.FindServiceAreasService = FindServiceAreasService;
  86003. SuperMap.FindTSPPathsParameters = FindTSPPathsParameters;
  86004. SuperMap.FindTSPPathsService = FindTSPPathsService;
  86005. SuperMap.GenerateSpatialDataParameters = GenerateSpatialDataParameters;
  86006. SuperMap.GenerateSpatialDataService = GenerateSpatialDataService;
  86007. SuperMap.GeoCodingParameter = GeoCodingParameter;
  86008. SuperMap.GeoDecodingParameter = GeoDecodingParameter;
  86009. SuperMap.GeoHashGridAggParameter = GeoHashGridAggParameter;
  86010. SuperMap.GeometryBatchAnalystService = GeometryBatchAnalystService;
  86011. SuperMap.GeometryBufferAnalystParameters = GeometryBufferAnalystParameters;
  86012. SuperMap.GeometryOverlayAnalystParameters = GeometryOverlayAnalystParameters;
  86013. SuperMap.GeometrySurfaceAnalystParameters = GeometrySurfaceAnalystParameters;
  86014. SuperMap.GeometryThiessenAnalystParameters = GeometryThiessenAnalystParameters;
  86015. SuperMap.GeoprocessingService = GeoprocessingService;
  86016. SuperMap.GeoRelationAnalystParameters = GeoRelationAnalystParameters;
  86017. SuperMap.GeoRelationAnalystService = GeoRelationAnalystService;
  86018. SuperMap.GetFeaturesByBoundsParameters = GetFeaturesByBoundsParameters;
  86019. SuperMap.GetFeaturesByBoundsService = GetFeaturesByBoundsService;
  86020. SuperMap.GetFeaturesByBufferParameters = GetFeaturesByBufferParameters;
  86021. SuperMap.GetFeaturesByBufferService = GetFeaturesByBufferService;
  86022. SuperMap.GetFeaturesByGeometryParameters = GetFeaturesByGeometryParameters;
  86023. SuperMap.GetFeaturesByGeometryService = GetFeaturesByGeometryService;
  86024. SuperMap.GetFeaturesByIDsParameters = GetFeaturesByIDsParameters;
  86025. SuperMap.GetFeaturesByIDsService = GetFeaturesByIDsService;
  86026. SuperMap.GetFeaturesBySQLParameters = GetFeaturesBySQLParameters;
  86027. SuperMap.GetFeaturesBySQLService = GetFeaturesBySQLService;
  86028. SuperMap.GetFeaturesParametersBase = GetFeaturesParametersBase;
  86029. SuperMap.GetFeaturesServiceBase = GetFeaturesServiceBase;
  86030. SuperMap.GetFieldsService = GetFieldsService;
  86031. SuperMap.GetGridCellInfosParameters = GetGridCellInfosParameters;
  86032. SuperMap.GetGridCellInfosService = GetGridCellInfosService;
  86033. SuperMap.GetLayersInfoService = GetLayersInfoService;
  86034. SuperMap.Grid = Grid;
  86035. SuperMap.HillshadeParameter = HillshadeParameter;
  86036. SuperMap.Image = UGCImage;
  86037. SuperMap.ImageCollectionService = ImageCollectionService;
  86038. SuperMap.ImageGFAspect = ImageGFAspect;
  86039. SuperMap.ImageGFHillShade = ImageGFHillShade;
  86040. SuperMap.ImageGFOrtho = ImageGFOrtho;
  86041. SuperMap.ImageGFSlope = ImageGFSlope;
  86042. SuperMap.ImageRenderingRule = ImageRenderingRule;
  86043. SuperMap.ImageSearchParameter = ImageSearchParameter;
  86044. SuperMap.ImageService = ImageService;
  86045. SuperMap.ImageStretchOption = ImageStretchOption;
  86046. SuperMap.InterpolationAnalystParameters = InterpolationAnalystParameters;
  86047. SuperMap.InterpolationAnalystService = InterpolationAnalystService;
  86048. SuperMap.InterpolationDensityAnalystParameters = InterpolationDensityAnalystParameters;
  86049. SuperMap.InterpolationIDWAnalystParameters = InterpolationIDWAnalystParameters;
  86050. SuperMap.InterpolationKrigingAnalystParameters = InterpolationKrigingAnalystParameters;
  86051. SuperMap.InterpolationRBFAnalystParameters = InterpolationRBFAnalystParameters;
  86052. SuperMap.JoinItem = JoinItem;
  86053. SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
  86054. SuperMap.KernelDensityJobsService = KernelDensityJobsService;
  86055. SuperMap.LabelImageCell = LabelImageCell;
  86056. SuperMap.LabelMatrixCell = LabelMatrixCell;
  86057. SuperMap.LabelMixedTextStyle = LabelMixedTextStyle;
  86058. SuperMap.LabelSymbolCell = LabelSymbolCell;
  86059. SuperMap.LabelThemeCell = LabelThemeCell;
  86060. SuperMap.LayerStatus = LayerStatus;
  86061. SuperMap.LinkItem = LinkItem;
  86062. SuperMap.MappingParameters = MappingParameters;
  86063. SuperMap.MapService = MapService;
  86064. SuperMap.MathExpressionAnalysisParameters = MathExpressionAnalysisParameters;
  86065. SuperMap.MathExpressionAnalysisService = MathExpressionAnalysisService;
  86066. SuperMap.MeasureParameters = MeasureParameters;
  86067. SuperMap.MeasureService = MeasureService;
  86068. SuperMap.MetricsAggParameter = MetricsAggParameter;
  86069. SuperMap.NDVIParameter = NDVIParameter;
  86070. SuperMap.NetworkAnalystServiceBase = NetworkAnalystServiceBase;
  86071. SuperMap.OutputSetting = OutputSetting;
  86072. SuperMap.OverlapDisplayedOptions = OverlapDisplayedOptions;
  86073. SuperMap.OverlayAnalystParameters = OverlayAnalystParameters;
  86074. SuperMap.OverlayAnalystService = OverlayAnalystService;
  86075. SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter;
  86076. SuperMap.OverlayGeoJobsService = OverlayGeoJobsService;
  86077. SuperMap.PointWithMeasure = PointWithMeasure;
  86078. SuperMap.ProcessingServiceBase = ProcessingServiceBase;
  86079. SuperMap.QueryByBoundsParameters = QueryByBoundsParameters;
  86080. SuperMap.QueryByBoundsService = QueryByBoundsService;
  86081. SuperMap.QueryByDistanceParameters = QueryByDistanceParameters;
  86082. SuperMap.QueryByDistanceService = QueryByDistanceService;
  86083. SuperMap.QueryByGeometryParameters = QueryByGeometryParameters;
  86084. SuperMap.QueryByGeometryService = QueryByGeometryService;
  86085. SuperMap.QueryBySQLParameters = QueryBySQLParameters;
  86086. SuperMap.QueryBySQLService = QueryBySQLService;
  86087. SuperMap.QueryParameters = QueryParameters;
  86088. SuperMap.QueryService = QueryService;
  86089. SuperMap.RasterFunctionParameter = RasterFunctionParameter;
  86090. SuperMap.Route = Route;
  86091. SuperMap.RouteCalculateMeasureParameters = RouteCalculateMeasureParameters;
  86092. SuperMap.RouteCalculateMeasureService = RouteCalculateMeasureService;
  86093. SuperMap.RouteLocatorParameters = RouteLocatorParameters;
  86094. SuperMap.RouteLocatorService = RouteLocatorService;
  86095. SuperMap.ServerColor = ServerColor;
  86096. SuperMap.ServerFeature = ServerFeature;
  86097. SuperMap.ServerGeometry = ServerGeometry;
  86098. SuperMap.ServerStyle = ServerStyle;
  86099. SuperMap.ServerTextStyle = ServerTextStyle;
  86100. SuperMap.ServerTheme = ServerTheme;
  86101. SuperMap.SetDatasourceParameters = SetDatasourceParameters;
  86102. SuperMap.SetLayerInfoParameters = SetLayerInfoParameters;
  86103. SuperMap.SetLayerInfoService = SetLayerInfoService;
  86104. SuperMap.SetLayersInfoParameters = SetLayersInfoParameters;
  86105. SuperMap.SetLayersInfoService = SetLayersInfoService;
  86106. SuperMap.SetLayerStatusParameters = SetLayerStatusParameters;
  86107. SuperMap.SetLayerStatusService = SetLayerStatusService;
  86108. SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
  86109. SuperMap.SingleObjectQueryJobsService = SingleObjectQueryJobsService;
  86110. SuperMap.Sortby = Sortby;
  86111. SuperMap.SpatialAnalystBase = SpatialAnalystBase;
  86112. SuperMap.StopQueryParameters = StopQueryParameters;
  86113. SuperMap.StopQueryService = StopQueryService;
  86114. SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
  86115. SuperMap.SummaryAttributesJobsService = SummaryAttributesJobsService;
  86116. SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter;
  86117. SuperMap.SummaryMeshJobsService = SummaryMeshJobsService;
  86118. SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter;
  86119. SuperMap.SummaryRegionJobsService = SummaryRegionJobsService;
  86120. SuperMap.SupplyCenter = SupplyCenter;
  86121. SuperMap.SurfaceAnalystParameters = SurfaceAnalystParameters;
  86122. SuperMap.SurfaceAnalystParametersSetting = SurfaceAnalystParametersSetting;
  86123. SuperMap.SurfaceAnalystService = SurfaceAnalystService;
  86124. SuperMap.TerrainCurvatureCalculationParameters = TerrainCurvatureCalculationParameters;
  86125. SuperMap.TerrainCurvatureCalculationService = TerrainCurvatureCalculationService;
  86126. SuperMap.Theme = Theme;
  86127. SuperMap.ThemeDotDensity = ThemeDotDensity;
  86128. SuperMap.ThemeFlow = ThemeFlow;
  86129. SuperMap.ThemeGraduatedSymbol = ThemeGraduatedSymbol;
  86130. SuperMap.ThemeGraduatedSymbolStyle = ThemeGraduatedSymbolStyle;
  86131. SuperMap.ThemeGraph = ThemeGraph;
  86132. SuperMap.ThemeGraphAxes = ThemeGraphAxes;
  86133. SuperMap.ThemeGraphItem = ThemeGraphItem;
  86134. SuperMap.ThemeGraphSize = ThemeGraphSize;
  86135. SuperMap.ThemeGraphText = ThemeGraphText;
  86136. SuperMap.ThemeGridRange = ThemeGridRange;
  86137. SuperMap.ThemeGridRangeItem = ThemeGridRangeItem;
  86138. SuperMap.ThemeGridUnique = ThemeGridUnique;
  86139. SuperMap.ThemeGridUniqueItem = ThemeGridUniqueItem;
  86140. SuperMap.ThemeLabel = ThemeLabel;
  86141. SuperMap.ThemeLabelAlongLine = ThemeLabelAlongLine;
  86142. SuperMap.ThemeLabelBackground = ThemeLabelBackground;
  86143. SuperMap.ThemeLabelItem = ThemeLabelItem;
  86144. SuperMap.ThemeLabelText = ThemeLabelText;
  86145. SuperMap.ThemeLabelUniqueItem = ThemeLabelUniqueItem;
  86146. SuperMap.ThemeMemoryData = ThemeMemoryData;
  86147. SuperMap.ThemeOffset = ThemeOffset;
  86148. SuperMap.ThemeParameters = ThemeParameters;
  86149. SuperMap.ThemeRange = ThemeRange;
  86150. SuperMap.ThemeRangeItem = ThemeRangeItem;
  86151. SuperMap.ThemeService = ThemeService;
  86152. SuperMap.ThemeUnique = ThemeUnique;
  86153. SuperMap.ThemeUniqueItem = ThemeUniqueItem;
  86154. SuperMap.ThiessenAnalystParameters = ThiessenAnalystParameters;
  86155. SuperMap.ThiessenAnalystService = ThiessenAnalystService;
  86156. SuperMap.TilesetsService = TilesetsService;
  86157. SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter;
  86158. SuperMap.TopologyValidatorJobsService = TopologyValidatorJobsService;
  86159. SuperMap.TransferLine = TransferLine;
  86160. SuperMap.TransferPathParameters = TransferPathParameters;
  86161. SuperMap.TransferPathService = TransferPathService;
  86162. SuperMap.TransferSolutionParameters = TransferSolutionParameters;
  86163. SuperMap.TransferSolutionService = TransferSolutionService;
  86164. SuperMap.TransportationAnalystParameter = TransportationAnalystParameter;
  86165. SuperMap.TransportationAnalystResultSetting = TransportationAnalystResultSetting;
  86166. SuperMap.UGCLayer = UGCLayer;
  86167. SuperMap.UGCMapLayer = UGCMapLayer;
  86168. SuperMap.UGCSubLayer = UGCSubLayer;
  86169. SuperMap.UpdateDatasetParameters = UpdateDatasetParameters;
  86170. SuperMap.UpdateEdgeWeightParameters = UpdateEdgeWeightParameters;
  86171. SuperMap.UpdateEdgeWeightService = UpdateEdgeWeightService;
  86172. SuperMap.UpdateTurnNodeWeightParameters = UpdateTurnNodeWeightParameters;
  86173. SuperMap.UpdateTurnNodeWeightService = UpdateTurnNodeWeightService;
  86174. SuperMap.Vector = Vector_Vector;
  86175. SuperMap.VectorClipJobsParameter = VectorClipJobsParameter;
  86176. SuperMap.VectorClipJobsService = VectorClipJobsService;
  86177. SuperMap.WebPrintingJobContent = WebPrintingJobContent;
  86178. SuperMap.WebPrintingJobCustomItems = WebPrintingJobCustomItems;
  86179. SuperMap.WebPrintingJobExportOptions = WebPrintingJobExportOptions;
  86180. SuperMap.WebPrintingJobImage = WebPrintingJobImage;
  86181. SuperMap.WebPrintingJobLayers = WebPrintingJobLayers;
  86182. SuperMap.WebPrintingJobLayoutOptions = WebPrintingJobLayoutOptions;
  86183. SuperMap.WebPrintingJobLegendOptions = WebPrintingJobLegendOptions;
  86184. SuperMap.WebPrintingJobLittleMapOptions = WebPrintingJobLittleMapOptions;
  86185. SuperMap.WebPrintingJobNorthArrowOptions = WebPrintingJobNorthArrowOptions;
  86186. SuperMap.WebPrintingJobParameters = WebPrintingJobParameters;
  86187. SuperMap.WebPrintingJobScaleBarOptions = WebPrintingJobScaleBarOptions;
  86188. SuperMap.WebPrintingService = WebPrintingService;
  86189. //Online
  86190. SuperMap.Online = Online;
  86191. SuperMap.OnlineData = OnlineData;
  86192. SuperMap.OnlineQueryDatasParameter = OnlineQueryDatasParameter;
  86193. SuperMap.ServiceStatus = ServiceStatus;
  86194. // 包含online中的DataItemType数据类型
  86195. SuperMap.DataItemType = DataItemType;
  86196. SuperMap.DataItemOrderBy = DataItemOrderBy;
  86197. SuperMap.FilterField = FilterField;
  86198. SuperMap.OnlineServiceBase = OnlineServiceBase;
  86199. // overlay
  86200. SuperMap.Feature = SuperMap.Feature || {};
  86201. SuperMap.Feature.Theme = Theme_Theme;
  86202. SuperMap.Feature.Theme.Bar = Bar;
  86203. SuperMap.Feature.Theme.Bar3D = Bar3D;
  86204. SuperMap.Feature.Theme.Circle = Circle;
  86205. SuperMap.Feature.Theme.Graph = Graph;
  86206. SuperMap.Feature.Theme.Line = Line;
  86207. SuperMap.Feature.Theme.Pie = Pie;
  86208. SuperMap.Feature.Theme.Point = overlay_Point_Point;
  86209. SuperMap.Feature.Theme.RankSymbol = RankSymbol;
  86210. SuperMap.Feature.Theme.Ring = Ring;
  86211. SuperMap.Feature.Theme.ThemeVector = ThemeVector;
  86212. SuperMap.Feature.ShapeParameters = ShapeParameters;
  86213. SuperMap.Feature.ShapeParameters.Circle = Circle_Circle;
  86214. SuperMap.Feature.ShapeParameters.Image = Image_Image;
  86215. SuperMap.Feature.ShapeParameters.Label = Label;
  86216. SuperMap.Feature.ShapeParameters.Line = Line_Line;
  86217. SuperMap.Feature.ShapeParameters.Point = Point_Point;
  86218. SuperMap.Feature.ShapeParameters.Polygon = feature_Polygon_Polygon;
  86219. SuperMap.Feature.ShapeParameters.Rectangle = Rectangle_Rectangle;
  86220. SuperMap.Feature.ShapeParameters.Sector = Sector;
  86221. SuperMap.Feature.ShapeFactory = ShapeFactory;
  86222. // LevelRenderer
  86223. SuperMap.LevelRenderer = LevelRenderer;
  86224. // security
  86225. SuperMap.KeyServiceParameter = KeyServiceParameter;
  86226. SuperMap.SecurityManager = SecurityManager;
  86227. SuperMap.ServerInfo = ServerInfo;
  86228. SuperMap.TokenServiceParameter = TokenServiceParameter;
  86229. // style
  86230. SuperMap.ThemeStyle = ThemeStyle;
  86231. SuperMap.CartoCSS = CartoCSS;
  86232. // thirdparty
  86233. // SuperMap.BinaryClassification = BinaryClassification;
  86234. // SuperMap.LandcoverClassification = LandcoverClassification;
  86235. // SuperMap.ObjectDetection = ObjectDetection;
  86236. // SuperMap.WebMachineLearning = WebMachineLearning;
  86237. SuperMap.ElasticSearch = ElasticSearch;
  86238. // util
  86239. SuperMap.ArrayStatistic = ArrayStatistic;
  86240. SuperMap.ColorsPickerUtil = ColorsPickerUtil;
  86241. // REST
  86242. SuperMap.DataFormat = DataFormat;
  86243. SuperMap.ServerType = ServerType;
  86244. SuperMap.GeometryType = REST_GeometryType;
  86245. SuperMap.QueryOption = QueryOption;
  86246. SuperMap.JoinType = JoinType;
  86247. SuperMap.SpatialQueryMode = SpatialQueryMode;
  86248. SuperMap.SpatialRelationType = SpatialRelationType;
  86249. SuperMap.MeasureMode = MeasureMode;
  86250. SuperMap.Unit = Unit;
  86251. SuperMap.BufferRadiusUnit = BufferRadiusUnit;
  86252. SuperMap.EngineType = EngineType;
  86253. SuperMap.ThemeGraphTextFormat = ThemeGraphTextFormat;
  86254. SuperMap.ThemeGraphType = ThemeGraphType;
  86255. SuperMap.GraphAxesTextDisplayMode = GraphAxesTextDisplayMode;
  86256. SuperMap.GraduatedMode = GraduatedMode;
  86257. SuperMap.RangeMode = RangeMode;
  86258. SuperMap.ThemeType = ThemeType;
  86259. SuperMap.ColorGradientType = ColorGradientType;
  86260. SuperMap.TextAlignment = TextAlignment;
  86261. SuperMap.FillGradientMode = FillGradientMode;
  86262. SuperMap.AlongLineDirection = AlongLineDirection;
  86263. SuperMap.LabelBackShape = LabelBackShape;
  86264. SuperMap.LabelOverLengthMode = LabelOverLengthMode;
  86265. SuperMap.DirectionType = DirectionType;
  86266. SuperMap.OverlayOperationType = OverlayOperationType;
  86267. SuperMap.OutputType = OutputType;
  86268. SuperMap.SideType = SideType;
  86269. SuperMap.SupplyCenterType = SupplyCenterType;
  86270. SuperMap.TurnType = TurnType;
  86271. SuperMap.BufferEndType = BufferEndType;
  86272. SuperMap.SmoothMethod = SmoothMethod;
  86273. SuperMap.SurfaceAnalystMethod = SurfaceAnalystMethod;
  86274. SuperMap.DataReturnMode = DataReturnMode;
  86275. SuperMap.EditType = EditType;
  86276. SuperMap.TransferTactic = TransferTactic;
  86277. SuperMap.TransferPreference = TransferPreference;
  86278. SuperMap.GridType = GridType;
  86279. SuperMap.ColorSpaceType = ColorSpaceType;
  86280. SuperMap.LayerType = LayerType;
  86281. SuperMap.UGCLayerType = UGCLayerType;
  86282. SuperMap.StatisticMode = StatisticMode;
  86283. SuperMap.PixelFormat = PixelFormat;
  86284. SuperMap.SearchMode = SearchMode;
  86285. SuperMap.InterpolationAlgorithmType = InterpolationAlgorithmType;
  86286. SuperMap.VariogramMode = VariogramMode;
  86287. SuperMap.Exponent = Exponent;
  86288. SuperMap.ClientType = ClientType;
  86289. SuperMap.ChartType = ChartType;
  86290. SuperMap.ClipAnalystMode = ClipAnalystMode;
  86291. SuperMap.AnalystAreaUnit = AnalystAreaUnit;
  86292. SuperMap.AnalystSizeUnit = AnalystSizeUnit;
  86293. SuperMap.StatisticAnalystMode = StatisticAnalystMode;
  86294. SuperMap.SummaryType = SummaryType;
  86295. SuperMap.TopologyValidatorRule = TopologyValidatorRule;
  86296. SuperMap.BucketAggType = BucketAggType;
  86297. SuperMap.MetricsAggType = MetricsAggType;
  86298. SuperMap.GetFeatureMode = GetFeatureMode;
  86299. SuperMap.RasterFunctionType = RasterFunctionType;
  86300. SuperMap.ResourceType = ResourceType;
  86301. SuperMap.OrderBy = OrderBy;
  86302. SuperMap.OrderType = OrderType;
  86303. SuperMap.SearchType = SearchType;
  86304. SuperMap.AggregationTypes = AggregationTypes;
  86305. SuperMap.PermissionType = PermissionType;
  86306. SuperMap.EntityType = EntityType;
  86307. SuperMap.WebExportFormatType = WebExportFormatType;
  86308. SuperMap.WebScaleOrientationType = WebScaleOrientationType;
  86309. SuperMap.WebScaleType = WebScaleType;
  86310. SuperMap.WebScaleUnit = WebScaleUnit;
  86311. SuperMap.KnowledgeGraph = KnowledgeGraph;
  86312. ;// CONCATENATED MODULE: external "L"
  86313. var external_L_namespaceObject = L;
  86314. var external_L_default = /*#__PURE__*/__webpack_require__.n(external_L_namespaceObject);
  86315. // EXTERNAL MODULE: ./node_modules/proj4/dist/proj4-src.js
  86316. var proj4_src = __webpack_require__(4689);
  86317. var proj4_src_default = /*#__PURE__*/__webpack_require__.n(proj4_src);
  86318. ;// CONCATENATED MODULE: ./src/leaflet/core/Proj4Leaflet.js
  86319. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Proj4Leaflet_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
  86320. 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."); }
  86321. function Proj4Leaflet_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Proj4Leaflet_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 Proj4Leaflet_arrayLikeToArray(o, minLen); }
  86322. function Proj4Leaflet_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; }
  86323. 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; }
  86324. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  86325. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  86326. * This program are made available under the terms of the Apache License, Version 2.0
  86327. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86328. /**
  86329. * Inspired by https://github.com/kartena/Proj4Leaflet
  86330. */
  86331. window.proj4 = (proj4_src_default());
  86332. window.Proj4js = (proj4_src_default());
  86333. (external_L_default()).Proj = (external_L_default()).Proj || {};
  86334. (external_L_default()).Proj._isProj4Obj = function (a) {
  86335. return typeof a.inverse !== 'undefined' && typeof a.forward !== 'undefined';
  86336. };
  86337. /**
  86338. * @class L.Proj.Projection
  86339. * @private
  86340. * @classdesc Proj 投影定义类。
  86341. * @category BaseTypes Projection
  86342. * @extends {L.Class}
  86343. * @param {string} code - proj srsCode
  86344. * @param {string} def - 投影的 proj4 定义。{@link [详细]{https://iclient.supermap.io/web/introduction/leafletDevelop.html#projection}}
  86345. * @param {L.Bounds} bounds - 投影范围参数
  86346. */
  86347. (external_L_default()).Proj.Projection = external_L_default().Class.extend({
  86348. initialize: function initialize(code, def, bounds, wrapLng) {
  86349. var isP4 = external_L_default().Proj._isProj4Obj(code);
  86350. this._proj = isP4 ? code : this._projFromCodeDef(code, def);
  86351. var boundsOption = bounds;
  86352. if (external_L_default().Util.isArray(bounds)) {
  86353. boundsOption = external_L_default().bounds(bounds);
  86354. }
  86355. this.bounds = isP4 ? def : boundsOption;
  86356. this.wrapLng = wrapLng;
  86357. },
  86358. /**
  86359. * @function L.Proj.Projection.prototype.project
  86360. * @description 通过地理坐标得到投影坐标。
  86361. * @param {L.Latlng} latlng - 经纬度坐标。
  86362. * @returns {L.Point} 返回投影坐标点。
  86363. */
  86364. project: function project(latlng) {
  86365. var point = this._proj.forward([latlng.lng, latlng.lat]);
  86366. return new (external_L_default()).Point(point[0], point[1]);
  86367. },
  86368. /**
  86369. * @function L.Proj.Projection.prototype.unproject
  86370. * @description 通过投影坐标得到地理坐标。
  86371. * @param {L.Point} point - 坐标点。
  86372. * @param {number} unbounded - 坐标点高程值等。
  86373. * @returns {L.LatLng} 返回经纬度坐标
  86374. */
  86375. unproject: function unproject(point, zoom) {
  86376. if (this.bounds && !this.wrapLng) {
  86377. point.x = point.x < this.bounds.min.x ? this.bounds.min.x : point.x > this.bounds.max.x ? this.bounds.max.x : point.x;
  86378. point.y = point.y < this.bounds.min.y ? this.bounds.min.y : point.y > this.bounds.max.y ? this.bounds.max.y : point.y;
  86379. }
  86380. var point2 = this._proj.inverse([point.x, point.y]);
  86381. return new (external_L_default()).LatLng(point2[1], point2[0], zoom);
  86382. },
  86383. _projFromCodeDef: function _projFromCodeDef(code, def) {
  86384. if (def) {
  86385. proj4_src_default().defs(code, def);
  86386. } else if ((proj4_src_default()).defs[code] === undefined) {
  86387. var urn = code.split(':');
  86388. if (urn.length > 3) {
  86389. code = urn[urn.length - 3] + ':' + urn[urn.length - 1];
  86390. }
  86391. if ((proj4_src_default()).defs[code] === undefined) {
  86392. throw 'No projection definition for code ' + code;
  86393. }
  86394. }
  86395. return proj4_src_default()(code);
  86396. },
  86397. getUnits: function getUnits() {
  86398. return this._proj.oProj.units || 'degrees';
  86399. }
  86400. });
  86401. /**
  86402. * @class CRS
  86403. * @aliasclass Proj.CRS
  86404. * @deprecatedclass L.Proj.CRS
  86405. * @deprecatedclassinstance L.supermap.Proj.crs
  86406. * @classdesc 基于 Proj4 坐标系统扩展类。
  86407. * 为计算级别,`options.scales` `options.scaleDenominators` `options.resolutions` `options.bounds` 必须指定一个,先后顺序已按优先级排列。
  86408. * 当指定`options.bounds` 时,第 0 级为一张 256 切片包含整个 bounds,即`Math.max(bounds.getSize().x, bounds.getSize().y)/256` 。
  86409. * 为保证切片行列号正确,`options.origin` `options.bounds` 必须指定一个。
  86410. * 当指定`options.bounds` 时,切片原点为 bounds 的左上角。
  86411. * @category BaseTypes Projection
  86412. * @extends {L.Class}
  86413. * @param {string} srsCode - proj srsCode。
  86414. * @param {Object} options - 参数。
  86415. * @param {string} options.def - 投影的proj4定义。[详细]{@link https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection}
  86416. * @param {(Array.<number>|L.Point)} [options.origin] - 原点。
  86417. * @param {Array.<number>} [options.scales] - 比例尺数组。
  86418. * @param {Array.<number>} [options.scaleDenominators] - 比例尺分母数组。
  86419. * @param {Array.<number>} [options.resolutions] - 分辨率数组。
  86420. * @param {(Array.<number>|L.Bounds)} [options.bounds] - 范围。
  86421. * @param {number} [options.dpi=96] - DPI。
  86422. * @param {Array.<number>} [options.wrapLng] - 定义经度(水平)坐标轴是否在给定范围内环绕。大多数情况下默认为[-180,180]。
  86423. * @example
  86424. * var crs =new CRS("EPSG:4326",{
  86425. * origin: [-180,90],
  86426. * scaleDenominators: [2000,1000,500,200,100,50,20,10],
  86427. * });
  86428. * var map=L.map('map', {
  86429. * crs: crs
  86430. * ...
  86431. * })
  86432. * @usage
  86433. */
  86434. var CRS = external_L_default().Class.extend({
  86435. includes: (external_L_default()).CRS,
  86436. options: {
  86437. transformation: new (external_L_default()).Transformation(1, 0, -1, 0)
  86438. },
  86439. initialize: function initialize(srsCode, options) {
  86440. var code, proj, def;
  86441. if (options.bounds && options.bounds.length === 4) {
  86442. var _options$bounds2 = _slicedToArray(options.bounds, 4),
  86443. p1X = _options$bounds2[0],
  86444. p1Y = _options$bounds2[1],
  86445. p2X = _options$bounds2[2],
  86446. p2Y = _options$bounds2[3];
  86447. options.bounds = [[p1X, p1Y], [p2X, p2Y]];
  86448. }
  86449. if (external_L_default().Proj._isProj4Obj(srsCode)) {
  86450. proj = srsCode;
  86451. code = proj.srsCode;
  86452. options = options || {};
  86453. this.projection = new (external_L_default()).Proj.Projection(proj, options.bounds, options.wrapLng);
  86454. } else {
  86455. code = srsCode;
  86456. options = options || {};
  86457. def = options.def || '';
  86458. this.projection = new (external_L_default()).Proj.Projection(code, def, options.bounds, options.wrapLng);
  86459. }
  86460. external_L_default().Util.setOptions(this, options);
  86461. if (this.options.wrapLng) {
  86462. this.wrapLng = this.options.wrapLng;
  86463. }
  86464. this.code = code;
  86465. this.transformation = this.options.transformation;
  86466. this.options.dpi = this.options.dpi || 96;
  86467. if (this.options.bounds) {
  86468. this.options.bounds = external_L_default().bounds(this.options.bounds);
  86469. }
  86470. if (!this.options.origin && this.options.bounds) {
  86471. this.options.origin = [this.options.bounds.min.x, this.options.bounds.max.y];
  86472. }
  86473. if (this.options.origin) {
  86474. if (this.options.origin instanceof (external_L_default()).Point) {
  86475. this.options.origin = [this.options.origin.x, this.options.origin.y];
  86476. }
  86477. this.transformation = new (external_L_default()).Transformation(1, -this.options.origin[0], -1, this.options.origin[1]);
  86478. }
  86479. if (this.options.scales && this.options.scales.length > 0) {
  86480. this.scales = this.options.scales;
  86481. this._scales = this._toProj4Scales(this.options.scales, this.options.dpi);
  86482. } else if (this.options.scaleDenominators && this.options.scaleDenominators.length > 0) {
  86483. this.scales = [];
  86484. for (var i = 0; i < this.options.scaleDenominators.length; i++) {
  86485. this.scales[i] = 1 / this.options.scaleDenominators[i];
  86486. }
  86487. this._scales = this._toProj4Scales(this.scales, this.options.dpi);
  86488. } else if (this.options.resolutions && this.options.resolutions.length > 0) {
  86489. this._scales = [];
  86490. for (var _i3 = this.options.resolutions.length - 1; _i3 >= 0; _i3--) {
  86491. if (this.options.resolutions[_i3]) {
  86492. this._scales[_i3] = 1 / this.options.resolutions[_i3];
  86493. }
  86494. }
  86495. } else if (this.options.bounds) {
  86496. this._scales = this._getDefaultProj4ScalesByBounds(this.options.bounds);
  86497. }
  86498. this._rectify();
  86499. this.infinite = !this.options.bounds;
  86500. },
  86501. _rectify: function _rectify() {
  86502. if (this._scales) {
  86503. if (!this.resolutions) {
  86504. this.resolutions = [];
  86505. this.resolutions = this._proj4ScalesToResolutions(this._scales);
  86506. }
  86507. if (!this.scales) {
  86508. this.scales = [];
  86509. for (var i = 0; i < this.resolutions.length; i++) {
  86510. var scaleD = this.resolutions[i] * this.options.dpi * (1 / 0.0254) * this._getMeterPerMapUnit(this.projection.getUnits());
  86511. this.scales[i] = 1.0 / scaleD;
  86512. }
  86513. }
  86514. }
  86515. },
  86516. /**
  86517. * @function CRS.prototype.scale
  86518. * @description 通过缩放级别获取比例尺值。
  86519. * @param {number} zoom - 缩放级别。
  86520. * @returns 比例尺值。
  86521. */
  86522. scale: function scale(zoom) {
  86523. var iZoom = Math.floor(zoom),
  86524. baseScale,
  86525. nextScale,
  86526. scaleDiff,
  86527. zDiff;
  86528. if (zoom === iZoom) {
  86529. return this._scales[zoom];
  86530. } else {
  86531. // Non-integer zoom, interpolate
  86532. baseScale = this._scales[iZoom];
  86533. nextScale = this._scales[iZoom + 1];
  86534. scaleDiff = nextScale - baseScale;
  86535. zDiff = zoom - iZoom;
  86536. return baseScale + scaleDiff * zDiff;
  86537. }
  86538. },
  86539. /**
  86540. * @function CRS.prototype.zoom
  86541. * @description 根据比例尺返回缩放级别。
  86542. * @param {number} scale - 比例尺。
  86543. * @returns {number} 缩放级别。
  86544. */
  86545. zoom: function zoom(scale) {
  86546. // Find closest number in this._scales, down
  86547. var downScale = this._closestElement(this._scales, scale),
  86548. downZoom = this._scales.indexOf(downScale),
  86549. nextScale,
  86550. nextZoom,
  86551. scaleDiff;
  86552. // Check if scale is downScale => return array index
  86553. if (!downScale) {
  86554. return 0;
  86555. }
  86556. if (scale === downScale) {
  86557. return downZoom;
  86558. }
  86559. // Interpolate
  86560. nextZoom = downZoom + 1;
  86561. nextScale = this._scales[nextZoom];
  86562. if (nextScale === undefined) {
  86563. return downZoom;
  86564. }
  86565. scaleDiff = nextScale - downScale;
  86566. return (scale - downScale) / scaleDiff + downZoom;
  86567. },
  86568. distance: (external_L_default()).CRS.Earth.distance,
  86569. R: (external_L_default()).CRS.Earth.R,
  86570. /* Get the closest lowest element in an array */
  86571. _closestElement: function _closestElement(array, element) {
  86572. var low;
  86573. for (var i = array.length; i--;) {
  86574. if (array[i] <= element && (low === undefined || low < array[i])) {
  86575. low = array[i];
  86576. }
  86577. }
  86578. return low;
  86579. },
  86580. _proj4ScalesToResolutions: function _proj4ScalesToResolutions(_scales) {
  86581. var resolutions = [];
  86582. if (!_scales) {
  86583. return resolutions;
  86584. }
  86585. for (var i = 0; i < _scales.length; i++) {
  86586. resolutions[i] = 1.0 / _scales[i];
  86587. }
  86588. return resolutions;
  86589. },
  86590. _toProj4Scales: function _toProj4Scales(scales, dpi) {
  86591. var proj4Scales = [];
  86592. if (!scales) {
  86593. return proj4Scales;
  86594. }
  86595. for (var i = 0; i < scales.length; i++) {
  86596. var a = this.projection ? this._getMeterPerMapUnit(this.projection.getUnits()) : 1;
  86597. proj4Scales[i] = 1 / (0.0254 / ((dpi || 96) * scales[i]) / a);
  86598. }
  86599. return proj4Scales;
  86600. },
  86601. _getMeterPerMapUnit: function _getMeterPerMapUnit(mapUnit) {
  86602. var earchRadiusInMeters = 6378137;
  86603. var meterPerMapUnit = 1;
  86604. if (mapUnit === 'meter') {
  86605. meterPerMapUnit = 1;
  86606. } else if (mapUnit === 'degrees' || mapUnit === 'degree') {
  86607. // 每度表示多少米。
  86608. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  86609. } else if (mapUnit === 'kilometer') {
  86610. meterPerMapUnit = 1.0e-3;
  86611. } else if (mapUnit === 'inch') {
  86612. meterPerMapUnit = 1 / 2.5399999918e-2;
  86613. } else if (mapUnit === 'feet') {
  86614. meterPerMapUnit = 0.3048;
  86615. }
  86616. return meterPerMapUnit;
  86617. },
  86618. _getDefaultProj4ScalesByBounds: function _getDefaultProj4ScalesByBounds(bounds) {
  86619. if (!bounds) {
  86620. return [];
  86621. }
  86622. var boundsSize = bounds.getSize();
  86623. var extendsSize = Math.max(boundsSize.x, boundsSize.y);
  86624. var resolution = extendsSize / 256;
  86625. var scales = [];
  86626. var maxZoom = 23;
  86627. for (var i = 0; i < maxZoom; i++) {
  86628. scales[i] = Math.pow(2, i) / resolution;
  86629. }
  86630. return scales;
  86631. }
  86632. });
  86633. var crs = function crs(srsCode, options) {
  86634. return new CRS(srsCode, options);
  86635. };
  86636. ;// CONCATENATED MODULE: ./src/leaflet/core/Attributions.js
  86637. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  86638. * This program are made available under the terms of the Apache License, Version 2.0
  86639. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86640. /**
  86641. * @enum attribution
  86642. * @description 版权相关配置。
  86643. * @type {string}
  86644. * @private
  86645. */
  86646. var Attributions = {
  86647. Prefix: "Leaflet with <span>\xA9 <a href='https://iclient.supermap.io' title='SuperMap iClient' target='_blank'>SuperMap iClient</a></span>",
  86648. Common: {
  86649. attribution: "Map Data <span>\xA9 <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>"
  86650. },
  86651. Online: {
  86652. attribution: "Map Data <span>\xA9 <a href='https://www.supermapol.com' title='SuperMap Online' target='_blank'>SuperMap Online</a></span>"
  86653. },
  86654. ECharts: {
  86655. attribution: "\xA9 2018 \u767E\u5EA6 ECharts"
  86656. },
  86657. MapV: {
  86658. attribution: "\xA9 2018 \u767E\u5EA6 MapV "
  86659. },
  86660. Turf: {
  86661. attribution: "<span>\xA9 <a href='https://turfjs.org/' title='turfjs' target='_blank'>turfjs</a></span>"
  86662. },
  86663. Baidu: {
  86664. attribution: "Map Data \xA9 2018 Baidu - GS(2016)2089\u53F7 - Data \xA9 \u957F\u5730\u4E07\u65B9"
  86665. },
  86666. Cloud: {
  86667. attribution: "Map Data \xA92014 SuperMap - GS(2014)6070\u53F7-data\xA9Navinfo"
  86668. },
  86669. Tianditu: {
  86670. attribution: "Map Data <a href='https://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' src='https://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a>"
  86671. }
  86672. };
  86673. /* harmony default export */ var core_Attributions = (Attributions);
  86674. ;// CONCATENATED MODULE: ./src/leaflet/core/Base.js
  86675. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  86676. * This program are made available under the terms of the Apache License, Version 2.0
  86677. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86678. external_L_default().Control.Attribution.include({
  86679. options: {
  86680. position: 'bottomright',
  86681. prefix: core_Attributions.Prefix
  86682. }
  86683. });
  86684. external_L_default().Map.include({
  86685. /*
  86686. * 获取精确的像素坐标.
  86687. * 当需要绘制比较平滑的曲线的时候可调用此方法代替latLngToContainerPoint
  86688. * @param latlng
  86689. */
  86690. latLngToAccurateContainerPoint: function latLngToAccurateContainerPoint(latlng) {
  86691. var projectedPoint = this.project(external_L_default().latLng(latlng));
  86692. var layerPoint = projectedPoint._subtract(this.getPixelOrigin());
  86693. return external_L_default().point(layerPoint).add(this._getMapPanePos());
  86694. }
  86695. });
  86696. wrapToGeoJSON([(external_L_default()).Polyline, (external_L_default()).Polygon, (external_L_default()).Marker, (external_L_default()).CircleMarker, (external_L_default()).Circle, (external_L_default()).LayerGroup]);
  86697. function wrapToGeoJSON(objClassArray) {
  86698. objClassArray.map(function (objClass) {
  86699. objClass.defaultFunction = objClass.prototype.toGeoJSON;
  86700. objClass.include({
  86701. toGeoJSON: function toGeoJSON(precision) {
  86702. return objClass.defaultFunction.call(this, precision || 10);
  86703. }
  86704. });
  86705. return objClass;
  86706. });
  86707. }
  86708. ;// CONCATENATED MODULE: ./src/leaflet/services/ServiceBase.js
  86709. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  86710. * This program are made available under the terms of the Apache License, Version 2.0
  86711. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86712. /**
  86713. * @class ServiceBase
  86714. * @classdesc L.supermap 服务基类。
  86715. * @category iServer Core
  86716. * @param {string} url - 服务地址。
  86717. * @param {Object} options - 参数。
  86718. * @param {string} [options.proxy] - 服务代理地址。
  86719. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  86720. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  86721. * @param {Object} [options.headers] - 请求头。
  86722. * @fires ServiceBase#initialized
  86723. * @fires ServiceBase#destroy
  86724. * @extends {L.Evented}
  86725. * @usage
  86726. */
  86727. var ServiceBase = external_L_default().Evented.extend({
  86728. options: {
  86729. url: null,
  86730. proxy: null,
  86731. withCredentials: false,
  86732. crossOrigin: null
  86733. },
  86734. initialize: function initialize(url, options) {
  86735. if (url) {
  86736. url = url.indexOf("/") !== url.length - 1 ? url : url.substr(0, url.length - 1);
  86737. }
  86738. this.url = url;
  86739. external_L_default().setOptions(this, options);
  86740. /**
  86741. * @event ServiceBase#initialized
  86742. * @description 构造函数构造成功后触发。
  86743. * @property {ServiceBase} this - this 对象。
  86744. */
  86745. this.fire("initialized", this);
  86746. },
  86747. /**
  86748. * @function ServiceBase.prototype.destroy
  86749. * @description 释放资源,将引用的资源属性置空。
  86750. */
  86751. destroy: function destroy() {
  86752. /**
  86753. * @event ServiceBase#destroy
  86754. * @description 资源释放成功后触发。
  86755. * @property {ServiceBase} this - this 对象。
  86756. */
  86757. this.fire("destroy", this);
  86758. }
  86759. });
  86760. ;// CONCATENATED MODULE: ./src/leaflet/services/MapService.js
  86761. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  86762. * This program are made available under the terms of the Apache License, Version 2.0
  86763. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86764. /**
  86765. * @class MapService
  86766. * @deprecatedclassinstance L.supermap.mapService
  86767. * @classdesc 地图信息服务类。
  86768. * @category iServer Map
  86769. * @modulecategory Services
  86770. * @extends {ServiceBase}
  86771. * @param {string} url - 服务地址。
  86772. * @param {Object} options - 参数。
  86773. * @param {string} [options.proxy] - 服务代理地址。
  86774. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  86775. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  86776. * @param {Object} [options.headers] - 请求头。
  86777. * @example
  86778. * new MapService(url)
  86779. * .getMapInfo(function(result){
  86780. * //doSomething
  86781. * })
  86782. * @usage
  86783. */
  86784. var MapService_MapService = ServiceBase.extend({
  86785. options: {
  86786. projection: null
  86787. },
  86788. initialize: function initialize(url, options) {
  86789. options = options || {};
  86790. external_L_default().setOptions(this, options);
  86791. if (options.projection) {
  86792. this.options.projection = options.projection;
  86793. }
  86794. ServiceBase.prototype.initialize.call(this, url, options);
  86795. },
  86796. /**
  86797. * @function MapService.prototype.getMapInfo
  86798. * @description 获取地图信息。
  86799. * @param {RequestCallback} callback - 回调函数。
  86800. */
  86801. getMapInfo: function getMapInfo(callback) {
  86802. var me = this;
  86803. var getMapStatusService = new MapService(me.url, {
  86804. proxy: me.options.proxy,
  86805. withCredentials: me.options.withCredentials,
  86806. crossOrigin: me.options.crossOrigin,
  86807. headers: me.options.headers,
  86808. projection: me.options.projection
  86809. });
  86810. getMapStatusService.processAsync(callback);
  86811. },
  86812. /**
  86813. * @function MapService.prototype.getWkt
  86814. * @description 获取WKT。
  86815. * @param {RequestCallback} callback - 回调函数。
  86816. */
  86817. getWkt: function getWkt(callback) {
  86818. var me = this;
  86819. var getMapStatusService = new MapService("".concat(me.url, "/prjCoordSys.wkt"), {
  86820. proxy: me.options.proxy,
  86821. withCredentials: me.options.withCredentials,
  86822. withoutFormatSuffix: true,
  86823. crossOrigin: me.options.crossOrigin,
  86824. headers: me.options.headers,
  86825. projection: me.options.projection
  86826. });
  86827. getMapStatusService.processAsync(callback);
  86828. },
  86829. /**
  86830. * @function MapService.prototype.getTilesets
  86831. * @description 获取切片列表信息。
  86832. * @param {RequestCallback} callback - 回调函数。
  86833. */
  86834. getTilesets: function getTilesets(callback) {
  86835. var me = this;
  86836. var tilesetsService = new TilesetsService(me.url, {
  86837. proxy: me.options.proxy,
  86838. withCredentials: me.options.withCredentials,
  86839. crossOrigin: me.options.crossOrigin,
  86840. headers: me.options.headers,
  86841. eventListeners: {
  86842. scope: me,
  86843. processCompleted: callback,
  86844. processFailed: callback
  86845. }
  86846. });
  86847. tilesetsService.processAsync();
  86848. }
  86849. });
  86850. var mapService = function mapService(url, options) {
  86851. return new MapService_MapService(url, options);
  86852. };
  86853. ;// CONCATENATED MODULE: ./src/leaflet/control/ChangeTileVersion.js
  86854. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  86855. * This program are made available under the terms of the Apache License, Version 2.0
  86856. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  86857. /**
  86858. * @class ChangeTileVersion
  86859. * @aliasclass control.ChangeTileVersion
  86860. * @deprecatedclassinstance L.supermap.control.changeTileVersion
  86861. * @classdesc 版本切换控件,支持 IE10 及以上。
  86862. * @category Control
  86863. * @extends {L.Control}
  86864. * @modulecategory Control
  86865. * @example
  86866. * new ChangeTileVersion({
  86867. * layer: baseLayer,
  86868. * position: "topleft",
  86869. * orientation: "horizontal"
  86870. * }).addTo(map);
  86871. * @param {Object} options - 参数。
  86872. * @param {L.Layer} options.layer - Leaflet Layer 对象。
  86873. * @param {string} [options.position='topleft'] - 控件位置继承自 Leaflet control。
  86874. * @param {string} [options.title='switch tile version'] - 鼠标滑过时提示。
  86875. * @param {string} [options.tooltip='top'] - tooltip 提示显示位置 top | right | bottom | left。
  86876. * @param {boolean} [options.collapsed=true] - 是否折叠。
  86877. * @param {string} [options.nextText='+'] - 下一个版本的按钮布局。
  86878. * @param {string} [options.lastText='-'] - 上一个版本的按钮布局。
  86879. * @param {string} [options.ico='v'] - 控件显示的 logo。
  86880. * @param {string} [options.orientation='horizontal'] - 方向 horizontal|vertical。
  86881. * @param {boolean} [options.switch=true] - 是否显示上/下一个版本切换控件。
  86882. * @usage
  86883. */
  86884. var ChangeTileVersion = external_L_default().Control.extend({
  86885. options: {
  86886. //绑定的底图图层
  86887. layer: null,
  86888. //控件位置 继承自leaflet control
  86889. position: 'topleft',
  86890. //鼠标滑过时提示
  86891. title: 'switch tile version',
  86892. //tooltip提示显示位置 top | right | bottom | left
  86893. tooltip: "top",
  86894. //是否折叠
  86895. collapsed: true,
  86896. //下一个版本的按钮布局
  86897. nextText: "+",
  86898. //上一个版本的按钮布局
  86899. lastText: "-",
  86900. //控件显示的logo
  86901. ico: 'V',
  86902. //方向horizontal|vertical
  86903. orientation: 'horizontal',
  86904. //是否显示上/下一个版本切换控件
  86905. "switch": true
  86906. },
  86907. /**
  86908. * @private
  86909. * @function ChangeTileVersion.prototype.onAdd
  86910. * @description 添加控件。
  86911. */
  86912. onAdd: function onAdd() {
  86913. if (this.options.orientation !== 'vertical') {
  86914. this.options.orientation = 'horizontal';
  86915. }
  86916. var layout = this._initLayout();
  86917. if (this.options.layer) {
  86918. this.setLayer(this.options.layer);
  86919. }
  86920. return layout;
  86921. },
  86922. /**
  86923. * @function ChangeTileVersion.prototype.setContent
  86924. * @description 设置版本信息。
  86925. * @param {Object} version - 版本信息。
  86926. */
  86927. setContent: function setContent(version) {
  86928. var content = external_L_default().Util.extend({}, version);
  86929. this.setVersionName(content.desc).setToolTip(content.desc);
  86930. },
  86931. /**
  86932. * @function ChangeTileVersion.prototype.setVersionName
  86933. * @description 设置版本号。
  86934. * @param {string} content - 版本信息。
  86935. * @returns {ChangeTileVersion} ChangeTileVersion的实例对象。
  86936. */
  86937. setVersionName: function setVersionName(content) {
  86938. var value = content;
  86939. if (!content) {
  86940. value = this.getValue();
  86941. }
  86942. this._sliderValue.innerHTML = value;
  86943. return this;
  86944. },
  86945. /**
  86946. * @function ChangeTileVersion.prototype.setToolTip
  86947. * @description 设置提示信息。
  86948. * @param {(HTMLElement|string)} tooltip - 提示信息。
  86949. * @returns {ChangeTileVersion} ChangeTileVersion的实例对象。
  86950. */
  86951. setToolTip: function setToolTip(tooltip) {
  86952. this.tooltip.innerHTML = tooltip;
  86953. return this;
  86954. },
  86955. /**
  86956. * @function ChangeTileVersion.prototype.updateLength
  86957. * @description 更新进度条长度。
  86958. * @param {number} length - 进度长度参数。
  86959. */
  86960. updateLength: function updateLength(length) {
  86961. if (length > 0) {
  86962. this.length = length;
  86963. this.max = this.length - 1;
  86964. this.slider.setAttribute("max", this.max);
  86965. }
  86966. },
  86967. /**
  86968. * @function ChangeTileVersion.prototype.setLayer
  86969. * @description 设置需要绑定的图层。
  86970. * @param {TiledMapLayer} layer - 绑定的图层。
  86971. */
  86972. setLayer: function setLayer(layer) {
  86973. if (layer) {
  86974. this.options.layer = layer;
  86975. }
  86976. var me = this;
  86977. var tileLayer = me.options.layer;
  86978. tileLayer.on("tilesetsinfoloaded", function (result) {
  86979. var tileVersions = result && result.tileVersions;
  86980. me.update(tileVersions);
  86981. });
  86982. tileLayer.on("tileversionschanged", function (result) {
  86983. var tileVersions = result && result.tileVersion;
  86984. me.setContent(tileVersions);
  86985. });
  86986. me.getTileSetsInfo();
  86987. },
  86988. /**
  86989. * @function ChangeTileVersion.prototype.update
  86990. * @description 更新缓存切片集和进度条长度。
  86991. * @param {number} tileVersions - 待更新的切片版本号。
  86992. */
  86993. update: function update(tileVersions) {
  86994. this.tileVersions = tileVersions || [];
  86995. this.updateLength(this.tileVersions.length);
  86996. },
  86997. /**
  86998. * @function ChangeTileVersion.prototype.getTileSetsInfo
  86999. * @description 获取切片集信息。
  87000. */
  87001. getTileSetsInfo: function getTileSetsInfo() {
  87002. var me = this;
  87003. if (me.options.layer) {
  87004. new MapService_MapService(me.options.layer._url).getTilesets(function getTilesInfoSucceed(info) {
  87005. me.options.layer.setTileSetsInfo(info.result);
  87006. });
  87007. }
  87008. },
  87009. /**
  87010. * @function ChangeTileVersion.prototype.removeLayer
  87011. * @description 移除绑定的地图图层。
  87012. */
  87013. removeLayer: function removeLayer() {
  87014. this.options.layer = null;
  87015. },
  87016. /**
  87017. * @function ChangeTileVersion.prototype.nextTilesVersion
  87018. * @description 下一个版本,首次调用该函数默认为无版本。
  87019. * @returns {ChangeTileVersion} ChangeTileVersion的实例对象。
  87020. */
  87021. nextTilesVersion: function nextTilesVersion() {
  87022. if (this.firstLoad) {
  87023. this.options.layer.nextTilesVersion();
  87024. this.firstLoad = !!0;
  87025. return this;
  87026. }
  87027. if (parseInt(this.slider.value) > this.max - 1) {
  87028. return this;
  87029. }
  87030. this.slider.value = parseInt(this.slider.value) + 1;
  87031. this.options.layer.nextTilesVersion();
  87032. return this;
  87033. },
  87034. /**
  87035. * @function ChangeTileVersion.prototype.lastTilesVersion
  87036. * @description 上一个版本。
  87037. */
  87038. lastTilesVersion: function lastTilesVersion() {
  87039. if (parseInt(this.slider.value) < this.min + 1) {
  87040. return this;
  87041. }
  87042. this.slider.value = parseInt(this.slider.value) - 1;
  87043. this.options.layer.lastTilesVersion();
  87044. return this;
  87045. },
  87046. /**
  87047. * @function ChangeTileVersion.prototype.tilesVersion
  87048. * @description 请求指定版本。
  87049. * @param {string} version - 版本号参数。
  87050. */
  87051. tilesVersion: function tilesVersion(version) {
  87052. var layer = this.options.layer,
  87053. tileVersions = this.tileVersions;
  87054. var len = tileVersions.length;
  87055. for (var i = 0; i < len; i++) {
  87056. if (tileVersions[i].name == version) {
  87057. layer.updateCurrentTileSetsIndex(i);
  87058. layer.changeTilesVersion();
  87059. break;
  87060. }
  87061. }
  87062. },
  87063. /**
  87064. * @function ChangeTileVersion.prototype.getValue
  87065. * @description 获取进度条的值。(注:进度条的值并不是版本号)。
  87066. */
  87067. getValue: function getValue() {
  87068. return this.slider.value;
  87069. },
  87070. /**
  87071. * @function ChangeTileVersion.prototype.getVersion
  87072. * @description 获取当前进度条的值对应的版本号。
  87073. */
  87074. getVersion: function getVersion() {
  87075. var version = this.tileVersions[this.getValue()];
  87076. return version && version.name;
  87077. },
  87078. _initLayout: function _initLayout() {
  87079. var className = 'leaflet-control-ctv';
  87080. this._container = external_L_default().DomUtil.create('div', className + ' ' + className + '-' + this.options.orientation);
  87081. //正常情况下显示btn
  87082. this._sliderBtn = external_L_default().DomUtil.create('a', className + '-toggle', this._container);
  87083. this._sliderBtn.setAttribute("title", this.options.title);
  87084. this._sliderBtn.innerHTML = this.options.ico;
  87085. //滑块拖动时值显示区域
  87086. this._sliderValue = external_L_default().DomUtil.create('p', className + '-value', this._container);
  87087. this._sliderValue.innerHTML = this.options.ico;
  87088. var sliderClassName = "leaflet-ctv-slider";
  87089. this._sliderContent = external_L_default().DomUtil.create('div', sliderClassName + "-main" + " tooltip", this._container);
  87090. //tooltip提示框
  87091. this.tooltip = external_L_default().DomUtil.create("span", "tooltip-text" + " " + "tooltip-" + this.options.tooltip, this._sliderContent);
  87092. this.tooltip.innerHTML = this.options.ico;
  87093. //加控件
  87094. if (this.options["switch"]) {
  87095. this._next = external_L_default().DomUtil.create('a', sliderClassName + "-incdec" + " " + sliderClassName + '-next', this._sliderContent);
  87096. this._next.innerHTML = this.options.nextText;
  87097. external_L_default().DomEvent.on(this._next, 'click', this.nextTilesVersion, this);
  87098. external_L_default().DomUtil.addClass(this._container, className + '-incdec');
  87099. }
  87100. //滑块
  87101. this._sliderContainer = external_L_default().DomUtil.create('div', sliderClassName + '-container', this._sliderContent);
  87102. this.slider = external_L_default().DomUtil.create('input', sliderClassName, this._sliderContainer);
  87103. this.min = this.min == null || isNaN(this.min) ? 0 : parseInt(this.min);
  87104. this.slider.setAttribute("title", this.options.title);
  87105. this.slider.setAttribute("id", "slider");
  87106. this.slider.setAttribute("type", "range");
  87107. this.slider.setAttribute("min", this.min);
  87108. this.slider.setAttribute("max", 0);
  87109. this.slider.setAttribute("step", 1);
  87110. this.slider.setAttribute("value", 0);
  87111. // //判断浏览器是否支持Range滑动条
  87112. // if (this.slider.type == "text") {
  87113. // console.error("抱歉,您的浏览器不支持HTML5 range滑动条,请使用高版本浏览器");
  87114. // }
  87115. this.firstLoad = true;
  87116. if ('oninput' in this.slider || 'onchange' in this.slider) {
  87117. external_L_default().DomEvent.on(this.slider, "change", this._tilesVersion, this);
  87118. } else {
  87119. this.slider.onpropertychange = this._tilesVersion;
  87120. }
  87121. //减控件
  87122. if (this.options["switch"]) {
  87123. this._last = external_L_default().DomUtil.create('a', sliderClassName + "-incdec" + " " + sliderClassName + '-last', this._sliderContent);
  87124. this._last.innerHTML = this.options.lastText;
  87125. external_L_default().DomEvent.on(this._last, 'click', this.lastTilesVersion, this);
  87126. }
  87127. //if (window.matchMedia("screen and (-webkit-min-device-pixel-ratio:0)").matches && this.options.orientation == 'vertical') {
  87128. if (this.options.orientation === 'vertical') {
  87129. this.slider.style.width = 170 + 'px';
  87130. this._sliderContainer.style.height = 170 + 'px';
  87131. } else {
  87132. this._sliderContainer.style.width = 150 + 'px';
  87133. }
  87134. external_L_default().DomEvent.disableClickPropagation(this._container);
  87135. if (this.options.collapsed) {
  87136. if (!(external_L_default()).Browser.android) {
  87137. external_L_default().DomEvent.on(this._container, 'mouseenter', this._expand, this).on(this._container, 'mouseleave', this._collapse, this);
  87138. }
  87139. if ((external_L_default()).Browser.touch) {
  87140. external_L_default().DomEvent.on(this._sliderBtn, 'click', (external_L_default()).DomEvent.stop).on(this._sliderBtn, 'click', this._expand, this);
  87141. } else {
  87142. external_L_default().DomEvent.on(this._sliderBtn, 'focus', this._expand, this);
  87143. }
  87144. } else {
  87145. this._expand();
  87146. }
  87147. return this._container;
  87148. },
  87149. _expand: function _expand() {
  87150. external_L_default().DomUtil.addClass(this._container, 'leaflet-control-ctv-expanded');
  87151. },
  87152. _collapse: function _collapse() {
  87153. external_L_default().DomUtil.removeClass(this._container, 'leaflet-control-ctv-expanded');
  87154. },
  87155. _tilesVersion: function _tilesVersion() {
  87156. var version = this.getVersion();
  87157. this.tilesVersion(version);
  87158. }
  87159. });
  87160. external_L_default().Map.mergeOptions({
  87161. changeTileVersionControl: false
  87162. });
  87163. external_L_default().Map.addInitHook(function () {
  87164. if (this.options.changeTileVersionControl) {
  87165. this.changeTileVersionControl = new ChangeTileVersion();
  87166. this.addControl(this.changeTileVersionControl);
  87167. }
  87168. });
  87169. var changeTileVersion = function changeTileVersion(options) {
  87170. return new ChangeTileVersion(options);
  87171. };
  87172. ;// CONCATENATED MODULE: ./src/common/control/img/Logo.js
  87173. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87174. * This program are made available under the terms of the Apache License, Version 2.0
  87175. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87176. 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=";
  87177. ;// CONCATENATED MODULE: ./src/leaflet/control/Logo.js
  87178. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87179. * This program are made available under the terms of the Apache License, Version 2.0
  87180. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87181. /**
  87182. * @class Logo
  87183. * @aliasclass control.Logo
  87184. * @deprecatedclassinstance L.supermap.control.logo
  87185. * @classdesc Logo 控件。
  87186. * @category Control
  87187. * @modulecategory Control
  87188. * @extends {L.Control}
  87189. * @example
  87190. * new Logo({
  87191. * imageUrl: xxx,//非必填项
  87192. * }).addTo(map);
  87193. * @param {Object} options - 参数。
  87194. * @param {string} [options.position='bottomright'] - 控件位置继承自 leaflet control。
  87195. * @param {string} [options.imageUrl] - logo 图片地址。
  87196. * @param {string} [options.width] - logo 图片宽度。
  87197. * @param {string} [options.height] - logo 图片高度。
  87198. * @param {string} [options.link] - 跳转链接。
  87199. * @param {string} [options.alt='SuperMap iClient'] - logo 图片失效时显示的提示文本。
  87200. * @usage
  87201. */
  87202. var Logo = external_L_default().Control.extend({
  87203. options: {
  87204. position: 'bottomright',
  87205. //logo图片地址
  87206. imageUrl: null,
  87207. //跳转链接
  87208. link: null,
  87209. //logo图片宽
  87210. width: null,
  87211. //logo图片高
  87212. height: null,
  87213. //logo图片失效时显示文本
  87214. alt: "SuperMap iClient"
  87215. },
  87216. /**
  87217. * @private
  87218. * @function Logo.prototype.onAdd
  87219. * @override
  87220. * @description 添加 logo。
  87221. * @returns {HTMLElement} 返回创建 logo 的 div。
  87222. */
  87223. onAdd: function onAdd() {
  87224. var div = external_L_default().DomUtil.create('div', 'iclient-leaflet-logo');
  87225. div.style.marginTop = 0;
  87226. div.style.marginBottom = 0;
  87227. div.style.marginLeft = 0;
  87228. div.style.marginRight = 0;
  87229. //iClient.png base64
  87230. var imgSrc = LogoBase64;
  87231. if (this.options.imageUrl) {
  87232. imgSrc = this.options.imageUrl;
  87233. }
  87234. var alt = this.options.alt;
  87235. var imageWidth = "94px";
  87236. var imageHeight = "29px";
  87237. var styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  87238. if (this.options.imageUrl) {
  87239. imageWidth = this.options.width;
  87240. imageHeight = this.options.height;
  87241. styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  87242. if (!imageWidth || !imageHeight) {
  87243. styleSize = "";
  87244. }
  87245. }
  87246. var link = this.options.link;
  87247. div.innerHTML = "<a href='" + link + "' target='_blank' style='border: none;display: block;'>" + "<img src=" + imgSrc + " alt='" + alt + "' style='border: none;" + styleSize + "margin-right:5px;margin-bottom:2px;white-space: nowrap'></a>";
  87248. return div;
  87249. }
  87250. });
  87251. //map默认开启logoControl
  87252. external_L_default().Map.mergeOptions({
  87253. logoControl: true
  87254. });
  87255. //map默认开启logoControl
  87256. external_L_default().Map.addInitHook(function () {
  87257. if (!this._logoAdded && this.options.logoControl) {
  87258. if (this.options.logoControl === true) {
  87259. this.logoControl = new Logo();
  87260. } else if (this.options.logoControl instanceof (external_L_default()).Control) {
  87261. this.logoControl = this.options.logoControl;
  87262. }
  87263. if (this.logoControl) {
  87264. this.addControl(this.logoControl);
  87265. this._logoAdded = true;
  87266. }
  87267. }
  87268. });
  87269. var logo = function logo(options) {
  87270. return new Logo(options);
  87271. };
  87272. ;// CONCATENATED MODULE: ./src/leaflet/control/index.js
  87273. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87274. * This program are made available under the terms of the Apache License, Version 2.0
  87275. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87276. ;// CONCATENATED MODULE: ./src/leaflet/core/CommontypesConversion.js
  87277. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87278. * This program are made available under the terms of the Apache License, Version 2.0
  87279. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87280. var isArray = function isArray(obj) {
  87281. return Object.prototype.toString.call(obj) == '[object Array]';
  87282. };
  87283. /**
  87284. * @class CommontypesConversion
  87285. * @category BaseTypes Util
  87286. * @classdesc Leaflet 对象和 SuperMap 对象转换工具。
  87287. * @usage
  87288. */
  87289. var CommontypesConversion = {
  87290. /**
  87291. * @function CommontypesConversion.toSuperMapBounds
  87292. * @description 将 Leaflet 对象的 bounds 转成 SuperMap 的 bounds对象。
  87293. * @param {(L.Bounds|L.LatLngBounds)} bounds - 图层显示范围。
  87294. * @returns {Bounds} SuperMap 的 bounds 对象。
  87295. */
  87296. toSuperMapBounds: function toSuperMapBounds(bounds) {
  87297. if (bounds && ["FeatureCollection", "Feature"].indexOf(bounds.type) !== -1) {
  87298. bounds = external_L_default().geoJSON(bounds).getBounds();
  87299. }
  87300. if (bounds instanceof (external_L_default()).LatLngBounds) {
  87301. return new Bounds(bounds.getSouthWest().lng, bounds.getSouthWest().lat, bounds.getNorthEast().lng, bounds.getNorthEast().lat);
  87302. }
  87303. if (bounds instanceof (external_L_default()).Bounds) {
  87304. return new Bounds(bounds.min.x, bounds.min.y, bounds.max.x, bounds.max.y);
  87305. }
  87306. if (isArray(bounds)) {
  87307. return new Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
  87308. }
  87309. return new Bounds();
  87310. },
  87311. /**
  87312. * @function CommontypesConversion.isArray
  87313. * @description 判断是否为数组格式。
  87314. * @param {Object} obj - 待判断的对象。
  87315. * @returns {boolean} 是否是数组。
  87316. */
  87317. isArray: isArray,
  87318. /**
  87319. * @function CommontypesConversion.toProcessingParam
  87320. * @description 将 Region 节点数组转为 Processing 服务需要的分析参数。
  87321. * @param {Array} points - Region 各个节点数组。
  87322. * @returns processing 服务裁剪、查询分析的分析参数。
  87323. */
  87324. toProcessingParam: function toProcessingParam(points) {
  87325. var geometryParam = {};
  87326. if (points.length < 1) {
  87327. geometryParam = "";
  87328. } else {
  87329. var results = [];
  87330. for (var i = 0; i < points.length; i++) {
  87331. var point = {};
  87332. point.x = points[i][0];
  87333. point.y = points[i][1];
  87334. results.push(point);
  87335. }
  87336. geometryParam.type = "REGION";
  87337. geometryParam.points = results;
  87338. }
  87339. return geometryParam;
  87340. }
  87341. };
  87342. ;// CONCATENATED MODULE: ./src/leaflet/core/ExtendsCRS.js
  87343. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87344. * This program are made available under the terms of the Apache License, Version 2.0
  87345. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87346. /**
  87347. * @name BaiduCRS
  87348. * @description 百度坐标对象。
  87349. * @namespace
  87350. * @category BaseTypes Projection
  87351. * @usage
  87352. * ```
  87353. * // 浏览器
  87354. * <script type="text/javascript" src="{cdn}"></script>
  87355. * <script>
  87356. * const baiduCRS = {namespace}.CRS.BaiduCRS;
  87357. *
  87358. * // 弃用的写法
  87359. * const baiduCRS = L.CRS.BaiduCRS;
  87360. *
  87361. * </script>
  87362. * //ES6 Import
  87363. * import { BaiduCRS } from "{npm}";
  87364. *
  87365. * const baiduCRS = BaiduCRS;
  87366. * ```
  87367. */
  87368. var BaiduCRS = external_L_default().extend({}, (external_L_default()).CRS.EPSG3857, {
  87369. code: 'Baidu',
  87370. scale: function scale(zoom) {
  87371. return 6378137 * Math.PI * 2 / Math.pow(2, 18 - zoom);
  87372. },
  87373. transformation: function () {
  87374. var scale = 0.5 / (Math.PI * 6378137);
  87375. return new (external_L_default()).Transformation(scale, 0, -scale, 0);
  87376. }()
  87377. });
  87378. var tdt_WGS84_resolutions = [];
  87379. for (var i = 1; i < 19; i++) {
  87380. tdt_WGS84_resolutions.push(0.703125 * 2 / Math.pow(2, i));
  87381. }
  87382. /**
  87383. * @name TianDiTu_WGS84CRS
  87384. * @deprecatedclass L.CRS.TianDiTu_WGS84CRS
  87385. * @description 天地图 WGS84 坐标对象。
  87386. * @namespace
  87387. * @category BaseTypes Projection
  87388. * @usage
  87389. * ```
  87390. * // 浏览器
  87391. * <script type="text/javascript" src="{cdn}"></script>
  87392. * <script>
  87393. * const tianDiTu_WGS84CRS = {namespace}.CRS.TianDiTu_WGS84CRS;
  87394. *
  87395. * // 弃用的写法
  87396. * const tianDiTu_WGS84CRS = L.CRS.TianDiTu_WGS84CRS;
  87397. *
  87398. * </script>
  87399. * //ES6 Import
  87400. * import { TianDiTu_WGS84CRS } from "{npm}";
  87401. *
  87402. * const tianDiTu_WGS84CRS = TianDiTu_WGS84CRS;
  87403. *
  87404. * ```
  87405. */
  87406. var TianDiTu_WGS84CRS = crs("EPSG:4326", {
  87407. origin: [-180, 90],
  87408. resolutions: tdt_WGS84_resolutions,
  87409. bounds: external_L_default().bounds([-180, -90], [180, 90]),
  87410. wrapLng: [-180, 180]
  87411. });
  87412. var c = Math.PI * 2 * 6378137;
  87413. var halfC = c / 2;
  87414. var tdt_Mercator_resolutions = [];
  87415. for (var _i2 = 1; _i2 < 19; _i2++) {
  87416. tdt_Mercator_resolutions.push(c / 256 / Math.pow(2, _i2));
  87417. }
  87418. /**
  87419. * @name TianDiTu_MercatorCRS
  87420. * @deprecatedclass L.CRS.TianDiTu_MercatorCRS
  87421. * @description 天地图墨卡托坐标对象。
  87422. * @category BaseTypes Projection
  87423. * @namespace
  87424. * @usage
  87425. * ```
  87426. * // 浏览器
  87427. * <script type="text/javascript" src="{cdn}"></script>
  87428. * <script>
  87429. * const tianDiTu_MercatorCRS = {namespace}.CRS.TianDiTu_MercatorCRS;
  87430. *
  87431. * // 弃用的写法
  87432. * const tianDiTu_MercatorCRS = L.CRS.TianDiTu_MercatorCRS;
  87433. *
  87434. * </script>
  87435. * //ES6 Import
  87436. * import { TianDiTu_MercatorCRS } from "{npm}";
  87437. *
  87438. * const tianDiTu_MercatorCRS = TianDiTu_MercatorCRS;
  87439. *
  87440. * ```
  87441. */
  87442. var TianDiTu_MercatorCRS = crs('EPSG:3857', {
  87443. origin: [-halfC, halfC],
  87444. resolutions: tdt_Mercator_resolutions,
  87445. bounds: external_L_default().bounds([-halfC, -halfC], [halfC, halfC]),
  87446. wrapLng: [-180, 180]
  87447. });
  87448. ;// CONCATENATED MODULE: ./src/leaflet/core/NonEarthCRS.js
  87449. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87450. * This program are made available under the terms of the Apache License, Version 2.0
  87451. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87452. /**
  87453. * @private
  87454. * @class NonProjection
  87455. * @classdesc 平面无投影对象。
  87456. * @category BaseTypes Projection
  87457. * @extends {L.Class}
  87458. * @param {L.Bounds} bounds - 坐标范围
  87459. */
  87460. var NonProjection = external_L_default().Class.extend({
  87461. initialize: function initialize(bounds) {
  87462. this.bounds = bounds;
  87463. },
  87464. project: function project(latlng) {
  87465. return new (external_L_default()).Point(latlng.lng, latlng.lat);
  87466. },
  87467. unproject: function unproject(point) {
  87468. return new (external_L_default()).LatLng(point.y, point.x);
  87469. }
  87470. });
  87471. var nonProjection = function nonProjection(bounds) {
  87472. return new NonProjection(bounds);
  87473. };
  87474. /**
  87475. * @class NonEarthCRS
  87476. * @aliasclass CRS.NonEarthCRS
  87477. * @deprecatedclass L.CRS.NonEarthCRS
  87478. * @deprecatedclassinstance L.supermap.CRS.nonEarthCRS
  87479. * @classdesc 平面无投影坐标类。
  87480. * @category BaseTypes Projection
  87481. * @extends {L.Class}
  87482. * @param {Object} options - 参数。
  87483. * @param {Object} options.origin - 原点。
  87484. * @param {L.Bounds} options.bounds - 范围。
  87485. * @param {Array.<number>} [options.resolutions] - 分辨率。
  87486. * @usage
  87487. */
  87488. var NonEarthCRS = external_L_default().Class.extend({
  87489. /**
  87490. * @member {Object} [NonEarthCRS.prototype.includes=L.CRS]
  87491. * @description 坐标对象。
  87492. */
  87493. includes: (external_L_default()).CRS,
  87494. initialize: function initialize(options) {
  87495. if (options.origin) {
  87496. this.transformation = new (external_L_default()).Transformation(1, -options.origin.x, -1, options.origin.y);
  87497. }
  87498. this.projection = nonProjection(options.bounds);
  87499. this.bounds = options.bounds;
  87500. this.origin = options.origin;
  87501. this.resolutions = options.resolutions;
  87502. },
  87503. /**
  87504. * @function NonEarthCRS.prototype.scale
  87505. * @description 通过缩放级别计算比例尺。
  87506. * @param {number} zoom - 缩放级别。
  87507. * @returns {number} 返回比例尺值。
  87508. */
  87509. scale: function scale(zoom) {
  87510. var defaultScale;
  87511. if (!this.resolutions || this.resolutions.length === 0) {
  87512. var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
  87513. defaultScale = 1.0 / (width / 256);
  87514. return defaultScale * Math.pow(2, zoom);
  87515. }
  87516. if (this.resolutions[zoom]) {
  87517. return 1.0 / this.resolutions[zoom];
  87518. }
  87519. return 1.0 / this.resolutions[0] * Math.pow(2, zoom);
  87520. },
  87521. /**
  87522. * @function NonEarthCRS.prototype.zoom
  87523. * @description 通过比例尺计算范围。
  87524. * @param {number} scale - 比例尺。
  87525. * @returns {number} 返回空间范围值。
  87526. */
  87527. zoom: function zoom(scale) {
  87528. var defaultScale;
  87529. if (!this.resolutions || this.resolutions.length === 0) {
  87530. var width = Math.max(this.bounds.getSize().x, this.bounds.getSize().y);
  87531. defaultScale = 1.0 / (width / 256);
  87532. return Math.log(scale / defaultScale) / Math.LN2;
  87533. }
  87534. var index = this.resolutions.indexOf(1.0 / scale);
  87535. if (index > -1) {
  87536. return index;
  87537. }
  87538. return Math.log(scale / (1.0 / this.resolutions[0])) / Math.LN2;
  87539. },
  87540. /**
  87541. * @function NonEarthCRS.prototype.distance
  87542. * @description 通过两个坐标点计算之间的距离。
  87543. * @param {L.LatLng} latlng1 - 坐标点1。
  87544. * @param {L.LatLng} latlng2 - 坐标点2。
  87545. * @returns {number} 返回距离长度。
  87546. */
  87547. distance: function distance(latlng1, latlng2) {
  87548. var dx = latlng2.lng - latlng1.lng,
  87549. dy = latlng2.lat - latlng1.lat;
  87550. return Math.sqrt(dx * dx + dy * dy);
  87551. },
  87552. infinite: false
  87553. });
  87554. var nonEarthCRS = function nonEarthCRS(options) {
  87555. return new NonEarthCRS(options);
  87556. };
  87557. ;// CONCATENATED MODULE: ./src/leaflet/core/Util.js
  87558. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87559. * This program are made available under the terms of the Apache License, Version 2.0
  87560. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87561. /**
  87562. * @function toGeoJSON
  87563. * @category BaseTypes Util
  87564. * @description 将传入对象转为 GeoJSON 格式。
  87565. * @param {Object} feature - 待转参数。
  87566. * @usage
  87567. * ```
  87568. * // 浏览器
  87569. * <script type="text/javascript" src="{cdn}"></script>
  87570. * <script>
  87571. * const result = {namespace}.Util.toGeoJSON(feature);
  87572. *
  87573. * </script>
  87574. *
  87575. * // ES6 Import
  87576. * import { toGeoJSON } from '{npm}';
  87577. *
  87578. * const result = toGeoJSON(feature);
  87579. * ```
  87580. */
  87581. var toGeoJSON = function toGeoJSON(feature) {
  87582. if (!feature) {
  87583. return feature;
  87584. }
  87585. return new GeoJSON().toGeoJSON(feature);
  87586. };
  87587. /**
  87588. * @function toSuperMapGeometry
  87589. * @category BaseTypes Util
  87590. * @description 将 GeoJSON 对象转为 SuperMap 几何图形。
  87591. * @param {GeoJSONObject} geometry - GeoJSON 对象。
  87592. * @usage
  87593. * ```
  87594. * // 浏览器
  87595. * <script type="text/javascript" src="{cdn}"></script>
  87596. * <script>
  87597. * const result = {namespace}.Util.toSuperMapGeometry(geometry);
  87598. *
  87599. * </script>
  87600. *
  87601. * // ES6 Import
  87602. * import { toSuperMapGeometry } from '{npm}';
  87603. *
  87604. * const result = toSuperMapGeometry(geometry);
  87605. * ```
  87606. */
  87607. var Util_toSuperMapGeometry = function toSuperMapGeometry(geometry) {
  87608. if (!geometry) {
  87609. return geometry;
  87610. }
  87611. var result,
  87612. format = new GeoJSON();
  87613. if (['FeatureCollection', 'Feature', 'Geometry'].indexOf(geometry.type) != -1) {
  87614. result = format.read(geometry, geometry.type);
  87615. } else if (typeof geometry.toGeoJSON === 'function') {
  87616. var geojson = geometry.toGeoJSON();
  87617. result = geojson ? format.read(geojson, geojson.type) : geometry;
  87618. }
  87619. var serverResult = result || geometry;
  87620. if (external_L_default().Util.isArray(result)) {
  87621. if (result.length === 1) {
  87622. serverResult = result[0];
  87623. } else if (result.length > 1) {
  87624. serverResult = [];
  87625. result.map(function (item) {
  87626. serverResult.push(item.geometry);
  87627. return item;
  87628. });
  87629. }
  87630. }
  87631. return serverResult && serverResult.geometry ? serverResult.geometry : serverResult;
  87632. };
  87633. var Util_getMeterPerMapUnit = getMeterPerMapUnit;
  87634. /**
  87635. * @function resolutionToScale
  87636. * @category BaseTypes Util
  87637. * @description 通过分辨率计算比例尺。
  87638. * @param {number} resolution - 分辨率。
  87639. * @param {number} dpi - 屏幕分辨率。
  87640. * @param {string} mapUnit - 地图单位。
  87641. * @returns {number} 比例尺。
  87642. * @usage
  87643. * ```
  87644. * // 浏览器
  87645. * <script type="text/javascript" src="{cdn}"></script>
  87646. * <script>
  87647. * const result = {namespace}.Util.resolutionToScale(resolution, dpi, mapUnit);
  87648. *
  87649. * </script>
  87650. *
  87651. * // ES6 Import
  87652. * import { resolutionToScale } from '{npm}';
  87653. *
  87654. * const result = resolutionToScale(resolution, dpi, mapUnit);
  87655. * ```
  87656. */
  87657. var resolutionToScale = function resolutionToScale(resolution, dpi, mapUnit) {
  87658. var inchPerMeter = 1 / 0.0254;
  87659. // 地球半径。
  87660. var meterPerMapUnit = Util_getMeterPerMapUnit(mapUnit);
  87661. var scale = resolution * dpi * inchPerMeter * meterPerMapUnit;
  87662. scale = 1 / scale;
  87663. return scale;
  87664. };
  87665. /**
  87666. * @function scaleToResolution
  87667. * @category BaseTypes Util
  87668. * @description 通过比例尺计算分辨率。
  87669. * @param {number} scale - 比例尺。
  87670. * @param {number} dpi - 屏幕分辨率。
  87671. * @param {string} mapUnit - 地图单位。
  87672. * @returns {number} 分辨率。
  87673. * @usage
  87674. * ```
  87675. * // 浏览器
  87676. * <script type="text/javascript" src="{cdn}"></script>
  87677. * <script>
  87678. * const result = {namespace}.Util.scaleToResolution(scale, dpi, mapUnit);
  87679. *
  87680. * </script>
  87681. *
  87682. * // ES6 Import
  87683. * import { scaleToResolution } from '{npm}';
  87684. *
  87685. * const result = scaleToResolution(scale, dpi, mapUnit);
  87686. * ```
  87687. */
  87688. var Util_scaleToResolution = function scaleToResolution(scale, dpi, mapUnit) {
  87689. var inchPerMeter = 1 / 0.0254;
  87690. var meterPerMapUnitValue = Util_getMeterPerMapUnit(mapUnit);
  87691. var resolution = scale * dpi * inchPerMeter * meterPerMapUnitValue;
  87692. resolution = 1 / resolution;
  87693. return resolution;
  87694. };
  87695. /**
  87696. * @function normalizeScale
  87697. * @category BaseTypes Util
  87698. * @description 转换比例尺。
  87699. * @param {number} scale - 比例尺。
  87700. * @returns {number} 正常的 scale 值。
  87701. * @usage
  87702. * ```
  87703. * // 浏览器
  87704. * <script type="text/javascript" src="{cdn}"></script>
  87705. * <script>
  87706. * const result = {namespace}.Util.normalizeScale(scale);
  87707. *
  87708. * // 弃用的写法
  87709. * const result = L.supermap.Util.NormalizeScale(scale);
  87710. * const result = L.Util.NormalizeScale(scale);
  87711. * </script>
  87712. *
  87713. * // ES6 Import
  87714. * import { normalizeScale } from '{npm}';
  87715. *
  87716. * const result = normalizeScale(scale);
  87717. * ```
  87718. */
  87719. var normalizeScale = function normalizeScale(scale) {
  87720. return scale > 1.0 ? 1.0 / scale : scale;
  87721. };
  87722. /**
  87723. * @function getResolutionFromScaleDpi
  87724. * @category BaseTypes Util
  87725. * @description 根据比例尺和 DPI 计算屏幕分辨率。
  87726. * @param {number} scale - 比例尺。
  87727. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  87728. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  87729. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  87730. * @returns {number} 当前比例尺下的屏幕分辨率。
  87731. * @usage
  87732. * ```
  87733. * // 浏览器
  87734. * <script type="text/javascript" src="{cdn}"></script>
  87735. * <script>
  87736. * const result = {namespace}.Util.getResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis);
  87737. *
  87738. * // 弃用的写法
  87739. * const result = L.supermap.Util.GetResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis);
  87740. * const result = L.Util.GetResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis);
  87741. * </script>
  87742. *
  87743. * // ES6 Import
  87744. * import { getResolutionFromScaleDpi } from '{npm}';
  87745. *
  87746. * const result = getResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis);
  87747. * ```
  87748. */
  87749. var getResolutionFromScaleDpi = function getResolutionFromScaleDpi(scale, dpi, coordUnit, datumAxis) {
  87750. var resolution = null,
  87751. ratio = 10000;
  87752. //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  87753. datumAxis = datumAxis || 6378137;
  87754. coordUnit = coordUnit || '';
  87755. if (scale > 0 && dpi > 0) {
  87756. scale = normalizeScale(scale);
  87757. if (coordUnit.toLowerCase() === 'degree' || coordUnit.toLowerCase() === 'degrees' || coordUnit.toLowerCase() === 'dd') {
  87758. //scale = CommonUtil.normalizeScale(scale);
  87759. resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  87760. return resolution;
  87761. } else {
  87762. resolution = 0.0254 * ratio / dpi / scale / ratio;
  87763. return resolution;
  87764. }
  87765. }
  87766. return -1;
  87767. };
  87768. ;// CONCATENATED MODULE: ./src/leaflet/core/Transform.js
  87769. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87770. * This program are made available under the terms of the Apache License, Version 2.0
  87771. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87772. /**
  87773. * @function transform
  87774. * @description 转换要素坐标。
  87775. * @category BaseTypes Util
  87776. * @param {(L.Marker|L.CircleMarker|L.Polyline|L.Polygon|L.Rectangle|L.LatLngBounds|L.Bounds|Object)} feature - 待转换要素:Leaflet Vector Layers 的 {@link L.Marker}|{@link L.CircleMarker}|{@link L.Polyline}|{@link L.Polygon}|{@link L.Rectangle}|{@link L.LatLngBounds}|{@link L.Bounds}|{@link GeoJSONObject} 类型。
  87777. * @param {CRS} [sourceCRS=L.CRS.EPSG4326] - 转换要素的源坐标系。
  87778. * @param {CRS} targetCRS - 转换要素的目标坐标系。
  87779. * @returns {GeoJSONObject} 返回 GeoJSON 规范的数据类型。
  87780. * @usage
  87781. * ```
  87782. * // 浏览器
  87783. * <script type="text/javascript" src="{cdn}"></script>
  87784. * <script>
  87785. * const result = {namespace}.Util.transform(feature, sourceCRS, targetCRS);
  87786. *
  87787. * // 弃用的写法:
  87788. * L.Util.transform(feature, sourceCRS, targetCRS);
  87789. *
  87790. * </script>
  87791. *
  87792. * // ES6 Import
  87793. * import { transform } from '{npm}';
  87794. *
  87795. * const result = transform(feature, sourceCRS, targetCRS);
  87796. * ```
  87797. */
  87798. var transform = function transform(feature) {
  87799. var sourceCRS = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (external_L_default()).CRS.EPSG4326;
  87800. var targetCRS = arguments.length > 2 ? arguments[2] : undefined;
  87801. var selfFeatures = null;
  87802. var selfCallback = null;
  87803. //将数据统一为 geojson 格式处理:
  87804. if (["FeatureCollection", "Feature", "Geometry"].indexOf(feature.type) === -1) {
  87805. if (feature.toGeoJSON) {
  87806. feature = feature.toGeoJSON();
  87807. } else if (feature instanceof (external_L_default()).LatLngBounds) {
  87808. feature = external_L_default().rectangle(feature).toGeoJSON();
  87809. } else if (feature instanceof (external_L_default()).Bounds) {
  87810. feature = external_L_default().rectangle([[feature.getTopLeft().x, feature.getTopLeft().y], [feature.getBottomRight().x, feature.getBottomRight().y]]).toGeoJSON();
  87811. } else {
  87812. throw new Error("This tool only supports data conversion in geojson format or Vector Layers of Leaflet.");
  87813. }
  87814. }
  87815. //geojson 几种数据类型及处理形式
  87816. var parseCoords = {
  87817. "point": function point(array) {
  87818. return selfCallback(array);
  87819. },
  87820. "multipoint": function multipoint(array) {
  87821. return parseCoords["linestring"].apply(this, [array]);
  87822. },
  87823. "linestring": function linestring(array) {
  87824. var points = [];
  87825. var p = null;
  87826. for (var i = 0, len = array.length; i < len; ++i) {
  87827. try {
  87828. p = parseCoords["point"].apply(this, [array[i]]);
  87829. } catch (err) {
  87830. throw err;
  87831. }
  87832. points.push(p);
  87833. }
  87834. return points;
  87835. },
  87836. "multilinestring": function multilinestring(array) {
  87837. return parseCoords["polygon"].apply(this, [array]);
  87838. },
  87839. "polygon": function polygon(array) {
  87840. var rings = [];
  87841. var l;
  87842. for (var i = 0, len = array.length; i < len; ++i) {
  87843. try {
  87844. l = parseCoords["linestring"].apply(this, [array[i]]);
  87845. } catch (err) {
  87846. throw err;
  87847. }
  87848. rings.push(l);
  87849. }
  87850. return rings;
  87851. },
  87852. "multipolygon": function multipolygon(array) {
  87853. var polys = [];
  87854. var p = null;
  87855. for (var i = 0, len = array.length; i < len; ++i) {
  87856. try {
  87857. p = parseCoords["polygon"].apply(this, [array[i]]);
  87858. } catch (err) {
  87859. throw err;
  87860. }
  87861. polys.push(p);
  87862. }
  87863. return polys;
  87864. }
  87865. };
  87866. //返回结果:
  87867. return featureTransform(feature, _transformCoordinates);
  87868. function featureTransform(feature, callback) {
  87869. selfFeatures = feature;
  87870. selfCallback = callback;
  87871. //分离处理:
  87872. if (feature.type === "Feature") {
  87873. selfFeatures = _prepareFeatuers(feature);
  87874. } else if (feature.type === "FeatureCollection") {
  87875. var featureResults = [];
  87876. for (var i = 0; i < feature.features.length; ++i) {
  87877. try {
  87878. featureResults.push(_prepareFeatuers(feature.features[i]));
  87879. } catch (err) {
  87880. featureResults = null;
  87881. }
  87882. }
  87883. selfFeatures.features = featureResults;
  87884. }
  87885. return selfFeatures;
  87886. }
  87887. function _prepareFeatuers(feature) {
  87888. var geometry = feature.geometry;
  87889. if (!Util_Util.isArray(geometry.coordinates)) {
  87890. throw "Geometry must have coordinates array: " + geometry;
  87891. }
  87892. if (!parseCoords[geometry.type.toLowerCase()]) {
  87893. throw "Unsupported geometry type: " + geometry.type;
  87894. }
  87895. try {
  87896. geometry.coordinates = parseCoords[geometry.type.toLowerCase()].apply(this, [geometry.coordinates]);
  87897. } catch (err) {
  87898. throw err;
  87899. }
  87900. feature.geometry = geometry;
  87901. return feature;
  87902. }
  87903. function _transformCoordinates(coordinates) {
  87904. //判断code 是投影坐标还是地理坐标
  87905. var point = sourceCRS.unproject({
  87906. x: coordinates[0],
  87907. y: coordinates[1]
  87908. });
  87909. var transform = targetCRS.project(point);
  87910. return [transform.x, transform.y];
  87911. }
  87912. };
  87913. ;// CONCATENATED MODULE: ./src/leaflet/core/index.js
  87914. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87915. * This program are made available under the terms of the Apache License, Version 2.0
  87916. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87917. ;// CONCATENATED MODULE: ./src/leaflet/mapping/BaiduTileLayer.js
  87918. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87919. * This program are made available under the terms of the Apache License, Version 2.0
  87920. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87921. /**
  87922. * @class BaiduTileLayer
  87923. * @deprecatedclassinstance L.supermap.baiduTileLayer
  87924. * @classdesc 百度地图图层类。
  87925. * @category ThirdPartyMap
  87926. * @modulecategory Mapping
  87927. * @extends {L.TileLayer}
  87928. * @param {string} [url='https://online{num}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20150815&scaler=1'] - 切片地址。
  87929. * @param {Object} options - 参数。
  87930. * @param {number} [options.minZoom=3] - 最小缩放级别。
  87931. * @param {number} [options.maxZoom=19] - 最大缩放级别。
  87932. * @param {L.LatLngBounds} [options.bounds=L.latLngBounds([-85.0511287798, -180],[85.0511287798, 180])] - 显示范围。
  87933. * @param {L.Browser} [options.retina=L.Browser.retina] - 浏览器显示分辨率。
  87934. * @param {string} [options.tileProxy] - 服务代理地址。
  87935. * @param {string} [options.attribution='Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方'] - 版权信息。
  87936. * @usage
  87937. */
  87938. var BaiduTileLayer = external_L_default().TileLayer.extend({
  87939. /**
  87940. * @member {string} BaiduTileLayer.prototype.url
  87941. * @description 切片地址。
  87942. */
  87943. url: "http://online{num}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20150815&scaler=1",
  87944. options: {
  87945. minZoom: 3,
  87946. maxZoom: 19,
  87947. bounds: external_L_default().latLngBounds(external_L_default().latLng(-85.0511287798, -180), external_L_default().latLng(85.0511287798, 180)),
  87948. retina: (external_L_default()).Browser.retina,
  87949. attribution: core_Attributions.Baidu.attribution
  87950. },
  87951. initialize: function initialize(url, options) {
  87952. if (url) {
  87953. this.url = url;
  87954. }
  87955. external_L_default().setOptions(this, options);
  87956. if (this.options.retina) {
  87957. this.options.maxZoom = 18;
  87958. }
  87959. external_L_default().stamp(this);
  87960. },
  87961. /**
  87962. * @function BaiduTileLayer.prototype.getTileUrl
  87963. * @description 获取切片地址。
  87964. * @param {Object} coords - 行列号。
  87965. * @returns {string} 切片地址。
  87966. */
  87967. getTileUrl: function getTileUrl(coords) {
  87968. var url = external_L_default().Util.template(this.url, {
  87969. num: Math.abs((coords.x + coords.y) % 8) + 1,
  87970. x: coords.x,
  87971. y: -coords.y - 1,
  87972. z: this._getZoomForUrl(),
  87973. styles: this.options.retina ? 'ph' : 'pl'
  87974. });
  87975. //支持代理
  87976. if (this.options.tileProxy) {
  87977. url = this.options.tileProxy + encodeURIComponent(url);
  87978. }
  87979. return url;
  87980. }
  87981. });
  87982. var baiduTileLayer = function baiduTileLayer(url, options) {
  87983. return new BaiduTileLayer(url, options);
  87984. };
  87985. ;// CONCATENATED MODULE: ./src/leaflet/mapping/CloudTileLayer.js
  87986. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  87987. * This program are made available under the terms of the Apache License, Version 2.0
  87988. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  87989. /**
  87990. * @class CloudTileLayer
  87991. * @deprecatedclassinstance L.supermap.cloudTileLayer
  87992. * @classdesc 超图云服务图层类。
  87993. * @category ThirdPartyMap
  87994. * @modulecategory Mapping
  87995. * @extends {L.TileLayer}
  87996. * @param {string} [url='http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}'] - 服务地址。
  87997. * @param {Object} options - 参数。
  87998. * @param {string} [options.type='web'] - type。
  87999. * @param {number} [options.minZoom=3] - 最小缩放级别。
  88000. * @param {number} [options.maxZoom=18] - 最大缩放级别。
  88001. * @param {string} [options.mapName='quanguo'] - 地图名称。
  88002. * @param {string} [options.attribution='Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo'] - 版权信息。
  88003. * @usage
  88004. */
  88005. var CloudTileLayer = external_L_default().TileLayer.extend({
  88006. defaultURL: 'http://t2.dituhui.com/FileService/image',
  88007. options: {
  88008. /**
  88009. * @member {string} [CloudTileLayer.prototype.options='quanguo']
  88010. * @description 地图名称。
  88011. */
  88012. mapName: "quanguo",
  88013. /**
  88014. * @member {string} CloudTileLayer.prototype.type
  88015. * @description 地图投影。
  88016. */
  88017. type: "web",
  88018. minZoom: 3,
  88019. maxZoom: 18,
  88020. attribution: core_Attributions.Cloud.attribution
  88021. },
  88022. initialize: function initialize(url, options) {
  88023. external_L_default().setOptions(this, options);
  88024. var cloudURL = url || this.defaultURL;
  88025. this._url = cloudURL + "?map=" + this.options.mapName + "&type=" + this.options.type;
  88026. external_L_default().stamp(this);
  88027. },
  88028. /**
  88029. * @function CloudTileLayer.prototype.getTileUrl
  88030. * @description 获取切片地址。
  88031. * @param {Object} coords - 行列号。
  88032. * @returns {string} 切片地址。
  88033. */
  88034. getTileUrl: function getTileUrl(coords) {
  88035. var layerUrl = this._url;
  88036. var tileUrl = layerUrl + "&x=" + coords.x + "&y=" + coords.y + "&z=" + coords.z;
  88037. //支持代理
  88038. if (this.options.tileProxy) {
  88039. tileUrl = this.options.tileProxy + encodeURIComponent(tileUrl);
  88040. }
  88041. return tileUrl;
  88042. }
  88043. });
  88044. var cloudTileLayer = function cloudTileLayer(url, options) {
  88045. return new CloudTileLayer(url, options);
  88046. };
  88047. ;// CONCATENATED MODULE: ./src/leaflet/mapping/ImageMapLayer.js
  88048. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88049. * This program are made available under the terms of the Apache License, Version 2.0
  88050. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88051. /**
  88052. * @class ImageMapLayer
  88053. * @deprecatedclassinstance L.supermap.imageMapLayer
  88054. * @classdesc SuperMap iServer 的 REST 地图服务的图层类(SuperMap iServer Java 6R 及以上分块动态 REST 图层)。使用 Image 资源出图。
  88055. * @category iServer Map Tile
  88056. * @modulecategory Mapping
  88057. * @extends {L.Layer}
  88058. * @example
  88059. * new ImageMapLayer(url).addTo(map);
  88060. * @param {string} url - 服务地址,如:http://{ip}:{port}/iserver/services/map-china400/rest/maps/China。
  88061. * @param {Object} options - 参数。
  88062. * @param {string} [options.layersID] - 获取需要切片的地图图层 ID,即指定需要切片的地图图层,可以是临时图层集,也可以是当前地图中图层的组合。
  88063. * @param {boolean} [options.redirect=false] - 是否重定向,如果为 true,则将请求重定向到瓦片的真实地址;如果为 false,则响应体中是瓦片的字节流。
  88064. * @param {boolean} [options.transparent=true] - 地图瓦片是否透明。
  88065. * @param {boolean} [options.cacheEnabled=true] - 是否启用缓存。
  88066. * @param {boolean} [options.clipRegionEnabled=false] - 是否启用地图裁剪。
  88067. * @param {L.Path} [options.clipRegion] - 地图显示裁剪的区域(区域为一个面对象)。当 clipRegionEnabled = true 时有效,即地图只显示该区域覆盖的部分。
  88068. * @param {Object} [options.prjCoordSys] - 请求的地图的坐标参考系统。如:prjCoordSys={"epsgCode":3857}。
  88069. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内,是否重叠显示。
  88070. * @param {string} [options.overlapDisplayedOptions] - 避免地图对象压盖显示的过滤选项。
  88071. * @param {number} [options.opacity=1] - 图层不透明度。
  88072. * @param {string} [options.alt] - 图像无法显示时的提示文字。
  88073. * @param {string} [options.pane='tilePane'] - 图层所归属的 map DOM 的分组。
  88074. * @param {boolean} [options.interactive=false] - 是否响应鼠标点击或悬停等交互事件。
  88075. * @param {boolean} [options.crossOrigin=false] - 是否设置跨域属性。
  88076. * @param {string} [options.errorOverlayUrl] - 图层未能加载时显示的瓦片地址。
  88077. * @param {number} [options.zIndex=1] - 设置图层的层级。
  88078. * @param {string} [options.className] - 自定义 dom 元素的 className。
  88079. * @param {number} [options.updateInterval=150] - 平移时图层延迟刷新间隔时间。
  88080. * @param {string} [options.tileProxy] - 服务代理地址。
  88081. * @param {string} [options.format='png'] - 瓦片表述类型,支持 "png" 、"webp"、"bmp" 、"jpg"、"gif" 等图片格式。
  88082. * @param {(NDVIParameter|HillshadeParameter)} [options.rasterfunction] - 栅格分析参数。
  88083. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
  88084. * @fires ImageMapLayer#load
  88085. * @fires ImageMapLayer#error
  88086. * @fires ImageMapLayer#loading
  88087. * @usage
  88088. */
  88089. var ImageMapLayer = external_L_namespaceObject.Layer.extend({
  88090. options: {
  88091. //如果有layersID,则是在使用专题图
  88092. layersID: null,
  88093. //如果为 true,则将请求重定向到图片的真实地址;如果为 false,则响应体中是图片的字节流
  88094. redirect: false,
  88095. //地图图片是否透明
  88096. transparent: true,
  88097. //是否启用服务器缓存
  88098. cacheEnabled: true,
  88099. //地图显示裁剪的区域是否有效
  88100. clipRegionEnabled: false,
  88101. //地图显示裁剪的区域
  88102. clipRegion: null,
  88103. //请求的地图的坐标参考系统。如:prjCoordSys= {"epsgCode":3857}。
  88104. prjCoordSys: null,
  88105. //地图对象在同一范围内,是否重叠显示
  88106. overlapDisplayed: false,
  88107. //避免地图对象压盖显示的过滤选项
  88108. overlapDisplayedOptions: null,
  88109. //图层不透明度
  88110. opacity: 1,
  88111. //图像无法显示时的提示文字
  88112. alt: '',
  88113. //图层所归属的map DOM的分组。默认为:"tilePane"
  88114. pane: 'tilePane',
  88115. //是否响应鼠标点击或悬停交互事件
  88116. interactive: false,
  88117. //是否设置跨域属性
  88118. crossOrigin: false,
  88119. //图层未能加载时显示的瓦片地址
  88120. errorOverlayUrl: '',
  88121. //设置图层的显示层级
  88122. zIndex: 1,
  88123. //自定义的html class name
  88124. className: '',
  88125. //版权信息
  88126. attribution: core_Attributions.Common.attribution,
  88127. //平移时图层延迟刷新间隔时间。
  88128. updateInterval: 150,
  88129. //启用托管地址。
  88130. tileProxy: null,
  88131. format: 'png'
  88132. },
  88133. initialize: function initialize(url, options) {
  88134. this._url = url;
  88135. external_L_namespaceObject.Util.setOptions(this, options);
  88136. },
  88137. /**
  88138. * @private
  88139. * @function ImageMapLayer.prototype.onAdd
  88140. * @description 添加到地图。
  88141. * @param {L.Map} map - Leaflet Map 对象。
  88142. */
  88143. onAdd: function onAdd(map) {
  88144. this.update = external_L_namespaceObject.Util.throttle(this.update, this.options.updateInterval, this);
  88145. map.on('moveend', this.update, this);
  88146. if (this._currentImage && this._currentImage._bounds.equals(this._map.getBounds())) {
  88147. map.addLayer(this._currentImage);
  88148. } else if (this._currentImage) {
  88149. this._map.removeLayer(this._currentImage);
  88150. this._currentImage = null;
  88151. }
  88152. this.update();
  88153. },
  88154. /**
  88155. * @private
  88156. * @function ImageMapLayer.prototype.onRemove
  88157. * @description 从地图上移除。
  88158. */
  88159. onRemove: function onRemove() {
  88160. // eslint-disable-line no-unused-vars
  88161. if (this._currentImage) {
  88162. this._map.removeLayer(this._currentImage);
  88163. }
  88164. this._map.off('moveend', this.update, this);
  88165. },
  88166. /**
  88167. * @function ImageMapLayer.prototype.bringToFront
  88168. * @description 置顶当前图层。
  88169. */
  88170. bringToFront: function bringToFront() {
  88171. this.options.position = 'front';
  88172. if (this._currentImage) {
  88173. this._currentImage.bringToFront();
  88174. }
  88175. return this;
  88176. },
  88177. /**
  88178. * @function ImageMapLayer.prototype.bringToBack
  88179. * @description 置底当前图层。
  88180. */
  88181. bringToBack: function bringToBack() {
  88182. this.options.position = 'back';
  88183. if (this._currentImage) {
  88184. this._currentImage.bringToBack();
  88185. }
  88186. return this;
  88187. },
  88188. /**
  88189. * @function ImageMapLayer.prototype.getOpacity
  88190. * @description 获取图层透明度。
  88191. * @returns {number} 图层的透明度。
  88192. */
  88193. getOpacity: function getOpacity() {
  88194. return this.options.opacity;
  88195. },
  88196. /**
  88197. * @function ImageMapLayer.prototype.setOpacity
  88198. * @description 设置图层不透明度。
  88199. */
  88200. setOpacity: function setOpacity(opacity) {
  88201. this.options.opacity = opacity;
  88202. if (this._currentImage) {
  88203. this._currentImage.setOpacity(opacity);
  88204. }
  88205. return this;
  88206. },
  88207. /**
  88208. * @function ImageMapLayer.prototype.getImageUrl
  88209. * @description 获取 image 图层请求地址,子类可重写实现。
  88210. * @returns {string} 请求瓦片地址。
  88211. */
  88212. getImageUrl: function getImageUrl(params) {
  88213. var serviceUrl = Util_Util.urlPathAppend(this._url, "image.".concat(this.options.format));
  88214. var imageUrl = serviceUrl + external_L_namespaceObject.Util.getParamString(Object.assign({}, this._initAllRequestParams(), params), serviceUrl);
  88215. imageUrl = SecurityManager.appendCredential(imageUrl);
  88216. //支持代理
  88217. if (this.options.tileProxy) {
  88218. imageUrl = this.options.tileProxy + encodeURIComponent(imageUrl);
  88219. }
  88220. if (!this.options.cacheEnabled) {
  88221. imageUrl += '&_t=' + new Date().getTime();
  88222. }
  88223. return imageUrl;
  88224. },
  88225. //获取请求瓦片宽高以及请求范围参数
  88226. _getImageParams: function _getImageParams(bounds) {
  88227. var size = this._calculateImageSize(bounds);
  88228. return {
  88229. viewBounds: this._compriseBounds(this._calculateBounds(bounds)),
  88230. width: size.x,
  88231. height: size.y
  88232. };
  88233. },
  88234. //初始化服务请求参数
  88235. _initAllRequestParams: function _initAllRequestParams() {
  88236. var me = this,
  88237. options = me.options || {},
  88238. params = {};
  88239. var redirect = options.redirect === true ? options.redirect : false;
  88240. params['redirect'] = redirect;
  88241. var transparent = options.transparent === true ? options.transparent : false;
  88242. params['transparent'] = transparent;
  88243. var cacheEnabled = options.cacheEnabled === false ? options.cacheEnabled : true;
  88244. params['cacheEnabled'] = cacheEnabled;
  88245. if (options.prjCoordSys) {
  88246. params['prjCoordSys'] = JSON.stringify(options.prjCoordSys);
  88247. }
  88248. if (options.layersID) {
  88249. params['layersID'] = options.layersID;
  88250. }
  88251. if (options.rasterfunction) {
  88252. params['rasterfunction'] = JSON.stringify(options.rasterfunction);
  88253. }
  88254. if (options.clipRegionEnabled && options.clipRegion) {
  88255. params['clipRegionEnabled'] = options.clipRegionEnabled;
  88256. params['clipRegion'] = JSON.stringify(ServerGeometry.fromGeometry(Util_toSuperMapGeometry(options.clipRegion)));
  88257. }
  88258. if (options.overlapDisplayed === false) {
  88259. params['overlapDisplayed'] = false;
  88260. if (options.overlapDisplayedOptions) {
  88261. params['overlapDisplayedOptions'] = me.overlapDisplayedOptions.toString();
  88262. }
  88263. } else {
  88264. params['overlapDisplayed'] = true;
  88265. }
  88266. return params;
  88267. },
  88268. //初始化请求链接
  88269. _requestImage: function _requestImage(params, bounds) {
  88270. var imageUrl = this.getImageUrl(params);
  88271. this._loadImage(imageUrl, bounds);
  88272. },
  88273. //加载请求图层
  88274. _loadImage: function _loadImage(url, bounds) {
  88275. if (!this._map) {
  88276. return;
  88277. }
  88278. var image = new external_L_namespaceObject.ImageOverlay(url, bounds, {
  88279. opacity: 0,
  88280. alt: this.options.alt,
  88281. zIndex: this.options.zIndex,
  88282. className: this.options.className,
  88283. errorOverlayUrl: this.options.error,
  88284. crossOrigin: this.options.crossOrigin,
  88285. pane: this.options.pane || this.getPane(),
  88286. interactive: this.options.interactive
  88287. }).addTo(this._map);
  88288. var onLoad = function onLoad(e) {
  88289. image.off('error', onError, this);
  88290. var map = this._map;
  88291. if (!map) {
  88292. return;
  88293. }
  88294. var newImage = e.target;
  88295. var oldImage = this._currentImage;
  88296. if (newImage._bounds && newImage._bounds.equals(bounds) && newImage._bounds.equals(map.getBounds())) {
  88297. this._currentImage = newImage;
  88298. if (this.options.position === 'front') {
  88299. this.bringToFront();
  88300. }
  88301. if (this.options.position === 'back') {
  88302. this.bringToBack();
  88303. }
  88304. if (this._currentImage._map) {
  88305. this._currentImage.setOpacity(this.options.opacity);
  88306. }
  88307. oldImage && map.removeLayer(oldImage);
  88308. oldImage && oldImage._map && oldImage._map.removeLayer(oldImage);
  88309. } else {
  88310. map.removeLayer(newImage);
  88311. }
  88312. /**
  88313. * @event ImageMapLayer#load
  88314. * @description 请求图层加载完成后触发。
  88315. * @property {L.Bounds} bounds - 图层 bounds。
  88316. */
  88317. this.fire('load', {
  88318. bounds: bounds
  88319. });
  88320. };
  88321. var onError = function onError() {
  88322. this._map.removeLayer(image);
  88323. /**
  88324. * @event ImageMapLayer#error
  88325. * @description 请求图层加载失败后触发。
  88326. */
  88327. this.fire('error');
  88328. image.off('load', onLoad, this);
  88329. };
  88330. image.once('load', onLoad, this);
  88331. image.once('error', onError, this);
  88332. /**
  88333. * @event ImageMapLayer#loading
  88334. * @description 请求图层加载中触发。
  88335. * @property {L.Bounds} bounds - 图层 bounds。
  88336. */
  88337. this.fire('loading', {
  88338. bounds: bounds
  88339. });
  88340. },
  88341. /**
  88342. * @function ImageMapLayer.prototype.update
  88343. * @description 更新图层。
  88344. */
  88345. update: function update() {
  88346. if (!this._map) {
  88347. return;
  88348. }
  88349. var zoom = this._map.getZoom();
  88350. var bounds = this._map.getBounds();
  88351. if (zoom > (this._map.options.maxZoom || 18) || zoom < (this._map.options.minZoom || 0)) {
  88352. if (this._currentImage) {
  88353. this._currentImage._map.removeLayer(this._currentImage);
  88354. this._currentImage = null;
  88355. }
  88356. return;
  88357. }
  88358. var params = this._getImageParams(bounds);
  88359. if (params) {
  88360. this._requestImage(params, bounds);
  88361. } else if (this._currentImage) {
  88362. this._currentImage._map.removeLayer(this._currentImage);
  88363. this._currentImage = null;
  88364. }
  88365. },
  88366. //将像素坐标转成点坐标
  88367. _calculateBounds: function _calculateBounds(bounds) {
  88368. var neProjected = this._map.options.crs.project(bounds.getNorthEast());
  88369. var swProjected = this._map.options.crs.project(bounds.getSouthWest());
  88370. return external_L_default().bounds(neProjected, swProjected);
  88371. },
  88372. //转换viewBounds为JSON字符串
  88373. _compriseBounds: function _compriseBounds(boundsProjected) {
  88374. var projBounds = {
  88375. leftBottom: {
  88376. x: boundsProjected.getBottomLeft().x,
  88377. y: boundsProjected.getTopRight().y
  88378. },
  88379. rightTop: {
  88380. x: boundsProjected.getTopRight().x,
  88381. y: boundsProjected.getBottomLeft().y
  88382. }
  88383. };
  88384. return JSON.stringify(projBounds);
  88385. },
  88386. //计算图层的宽高
  88387. _calculateImageSize: function _calculateImageSize(bounds) {
  88388. // 与imageoverlay 内部逻辑一致
  88389. var sizeBounds = new (external_L_default()).Bounds(this._map.latLngToLayerPoint(bounds.getNorthWest()), this._map.latLngToLayerPoint(bounds.getSouthEast()));
  88390. return sizeBounds.getSize();
  88391. }
  88392. });
  88393. var imageMapLayer = function imageMapLayer(url, options) {
  88394. return new ImageMapLayer(url, options);
  88395. };
  88396. ;// CONCATENATED MODULE: ./src/leaflet/mapping/TileLayer.WMTS.js
  88397. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88398. * This program are made available under the terms of the Apache License, Version 2.0
  88399. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88400. /**
  88401. * @class WMTSLayer
  88402. * @deprecatedclassinstance L.supermap.wmtsLayer
  88403. * @classdesc wmts 图层类。
  88404. * @category OGC
  88405. * @modulecategory Mapping
  88406. * @extends {L.TileLayer}
  88407. * @param {string} url - 服务地址。
  88408. * @param {Object} options - 参数。
  88409. * @param {string} options.layer - 显示的图层。
  88410. * @param {string} [options.tileProxy] - 服务代理地址。
  88411. * @param {Object} [options.style] - 图层样式。
  88412. * @param {string} [options.format='image/png'] - wmts 图像格式('image/png'用于具有透明度的图层)。
  88413. * @param {(number|L.Point)} [options.tileSize='256'] - 瓦片大小。
  88414. * @param {string} [options.requestEncoding='KVP'] - KVP 或者 REST 的请求方式。
  88415. * @param {string} [options.tilematrixSet] - 瓦片矩阵集。
  88416. * @param {Array.<WMTSLayer.matrix>} [options.matrixIds] - 瓦片矩阵对象。不设置时,默认为获取当前级别为 tilematrix 参数。
  88417. * @param {string} [options.version='1.0.0'] - 版本。
  88418. * @param {string} [options.attribution] - 版权信息。
  88419. * @param {string} [options.noWrap=true] - 图层是否 X 方向平铺。
  88420. * @usage
  88421. */
  88422. /**
  88423. * @typedef {Object} WMTSLayer.matrix
  88424. * @description 瓦片矩阵。
  88425. * @property {string} identifier - 瓦片矩阵标识符。
  88426. */
  88427. var WMTSLayer = external_L_default().TileLayer.extend({
  88428. options: {
  88429. version: '1.0.0',
  88430. style: '',
  88431. tilematrixSet: '',
  88432. format: 'image/png',
  88433. tileSize: 256,
  88434. matrixIds: null,
  88435. layer: '',
  88436. requestEncoding: 'KVP',
  88437. attribution: '',
  88438. noWrap: true
  88439. },
  88440. //todo 自动获取Capabilities
  88441. initialize: function initialize(url, options) {
  88442. // (String, Object)
  88443. this._url = url;
  88444. external_L_default().setOptions(this, options);
  88445. var opt = this.options;
  88446. if (opt.requestEncoding === "REST") {
  88447. var formatSuffixMap = {
  88448. "image/png": "png",
  88449. "image/png8": "png",
  88450. "image/png24": "png",
  88451. "image/png32": "png",
  88452. "png": "png",
  88453. "image/jpeg": "jpg",
  88454. "image/jpg": "jpg",
  88455. "jpeg": "jpg",
  88456. "jpg": "jpg"
  88457. };
  88458. this.formatSuffix = "." + (formatSuffixMap[opt.format] || opt.format.split("/").pop() || "png");
  88459. } else {
  88460. opt.requestEncoding = "KVP";
  88461. }
  88462. },
  88463. /**
  88464. * @function WMTSLayer.prototype.getTileUrl
  88465. * @description 获取切片地址。
  88466. * @param {Object} coords - 行列号。
  88467. * @returns {string} 切片地址。
  88468. */
  88469. getTileUrl: function getTileUrl(coords) {
  88470. // (Point, Number) -> String
  88471. var zoom = this._getZoomForUrl();
  88472. var ident = this.options.matrixIds ? this.options.matrixIds[zoom].identifier : zoom;
  88473. var index = this._url.indexOf('?');
  88474. var url = index > -1 ? this._url.substring(0, this._url.indexOf('?')) : this._url;
  88475. var urlParams = index > -1 ? this._url.substring(this._url.indexOf('?')) : '';
  88476. url = external_L_default().Util.template(url, {
  88477. s: this._getSubdomain(coords)
  88478. });
  88479. var obj = {
  88480. service: 'WMTS',
  88481. request: 'GetTile',
  88482. version: this.options.version,
  88483. style: this.options.style,
  88484. tilematrixSet: this.options.tilematrixSet,
  88485. format: this.options.format,
  88486. width: this.options.tileSize,
  88487. height: this.options.tileSize,
  88488. layer: this.options.layer,
  88489. tilematrix: ident,
  88490. tilerow: coords.y,
  88491. tilecol: coords.x
  88492. };
  88493. if (this.options.tileProxy) {
  88494. url = this.options.tileProxy + url;
  88495. }
  88496. if (this.options.requestEncoding === 'KVP') {
  88497. url += external_L_default().Util.getParamString(obj, url);
  88498. } else if (this.options.requestEncoding === 'REST') {
  88499. var params = "/" + obj.layer + "/" + obj.style + "/" + obj.tilematrixSet + "/" + obj.tilematrix + "/" + obj.tilerow + "/" + obj.tilecol + this.formatSuffix;
  88500. url += params;
  88501. }
  88502. url = Util_Util.urlAppend(url, urlParams);
  88503. url = SecurityManager.appendCredential(url);
  88504. return url;
  88505. }
  88506. });
  88507. var wmtsLayer = function wmtsLayer(url, options) {
  88508. return new WMTSLayer(url, options);
  88509. };
  88510. ;// CONCATENATED MODULE: ./src/leaflet/mapping/TiandituTileLayer.js
  88511. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88512. * This program are made available under the terms of the Apache License, Version 2.0
  88513. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88514. /**
  88515. * @class TiandituTileLayer
  88516. * @deprecatedclassinstance L.supermap.tiandituTileLayer
  88517. * @classdesc 天地图图层类。
  88518. * @category ThirdPartyMap
  88519. * @modulecategory Mapping
  88520. * @extends WMTSLayer
  88521. * @param {Object} options - 参数。
  88522. * @param {string} [options.url='https://t{s}.tianditu.gov.cn/{layer}_{proj}/wmts?'] - 服务地址。
  88523. * @param {string} options.key - 天地图服务密钥。详见 {@link https://lbs.tianditu.gov.cn/server/MapService.html}
  88524. * @param {string} [options.layerType='vec'] - 图层类型。( vec: 矢量图层,img: 影像图层,ter: 地形图层)
  88525. * @param {string} [options.style='default'] - 图层风格。
  88526. * @param {string} [options.format='tiles'] - 格式。
  88527. * @param {boolean} [options.isLabel=false] - 是否是标注图层。
  88528. * @param {Array.<number>} [options.subdomains=[0, 1, 2, 3, 4, 5, 6, 7]] - 子域名数组。
  88529. * @param {string} [options.attribution='Map Data <a href='https://www.tianditu.gov.cn' target='_blank'><img style='background-color:transparent;bottom:2px;opacity:1;' src='https://api.tianditu.gov.cn/img/map/logo.png' width='53px' height='22px' opacity='0'></a>'] - 版权信息。
  88530. * @param {string} [options.noWrap=true] - 图层是否 X 方向平铺。
  88531. * @usage
  88532. */
  88533. var TiandituTileLayer = WMTSLayer.extend({
  88534. layerLabelMap: {
  88535. vec: 'cva',
  88536. ter: 'cta',
  88537. img: 'cia'
  88538. },
  88539. layerZoomMap: {
  88540. vec: 18,
  88541. ter: 14,
  88542. img: 18
  88543. },
  88544. options: {
  88545. layerType: 'vec',
  88546. //(vec:矢量图层,vec:矢量标签图层,img:影像图层,cia:影像标签图层,ter:地形,cta:地形标签图层)
  88547. isLabel: false,
  88548. attribution: core_Attributions.Tianditu.attribution,
  88549. url: 'https://t{s}.tianditu.gov.cn/{layer}_{proj}/wmts?',
  88550. zoomOffset: 1,
  88551. key: '',
  88552. dpi: 96,
  88553. style: 'default',
  88554. format: 'tiles',
  88555. subdomains: [0, 1, 2, 3, 4, 5, 6, 7],
  88556. bounds: [[-90, -180], [90, 180]],
  88557. noWrap: true
  88558. },
  88559. initialize: function initialize(options) {
  88560. options = options || {};
  88561. external_L_default().setOptions(this, options);
  88562. this.options.layer = this.options.isLabel ? this.layerLabelMap[this.options.layerType] : this.options.layerType;
  88563. this.options.maxZoom = this.layerZoomMap[this.options.layerType] - 1;
  88564. WMTSLayer.prototype.initialize.call(this, this.options.url, this.options);
  88565. external_L_default().stamp(this);
  88566. if (this.options.key) {
  88567. this._url = "".concat(this._url, "tk=").concat(this.options.key);
  88568. }
  88569. },
  88570. onAdd: function onAdd(map) {
  88571. this.options.tilematrixSet = map.options.crs.code === "EPSG:4326" ? "c" : "w";
  88572. this._url = this._url.replace("{layer}", this.options.layer).replace("{proj}", this.options.tilematrixSet);
  88573. WMTSLayer.prototype.onAdd.call(this, map);
  88574. },
  88575. _isValidTile: function _isValidTile(coords) {
  88576. var crs = this._map.options.crs;
  88577. if (!crs.infinite) {
  88578. var bounds = this._globalTileRange;
  88579. if ((!crs.wrapLng || this.options.noWrap) && (coords.x < bounds.min.x || coords.x > bounds.max.x) || !crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y)) {
  88580. return false;
  88581. }
  88582. }
  88583. if (!this.options.bounds) {
  88584. return true;
  88585. }
  88586. var tileBounds = this._tileCoordsToBounds(coords);
  88587. return external_L_default().latLngBounds(this.options.bounds).overlaps(tileBounds);
  88588. }
  88589. });
  88590. var tiandituTileLayer = function tiandituTileLayer(options) {
  88591. return new TiandituTileLayer(options);
  88592. };
  88593. ;// CONCATENATED MODULE: ./src/leaflet/mapping/TiledMapLayer.js
  88594. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88595. * This program are made available under the terms of the Apache License, Version 2.0
  88596. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88597. /**
  88598. * @class TiledMapLayer
  88599. * @deprecatedclassinstance L.supermap.tiledMapLayer
  88600. * @classdesc SuperMap iServer 的 REST 地图服务的图层(SuperMap iServer Java 6R 及以上分块动态 REST 图层)。使用 TileImage 资源出图。
  88601. * @category iServer Map Tile
  88602. * @extends {L.TileLayer}
  88603. * @modulecategory Mapping
  88604. * @example
  88605. * new TiledMapLayer(url).addTo(map);
  88606. * @param {string} url - 服务地址,例如: http://{ip}:{port}/iserver/services/map-world/rest/maps/World。
  88607. * @param {Object} options - 参数。
  88608. * @param {string} [options.layersID] - 获取进行切片的地图图层 ID,即指定进行地图切片的图层,可以是临时图层集,也可以是当前地图中图层的组合
  88609. * @param {boolean} [options.redirect=false] - 是否重定向,如果为 true,则将请求重定向到瓦片的真实地址;如果为 false,则响应体中是瓦片的字节流。
  88610. * @param {boolean} [options.transparent=true] - 是否背景透明。
  88611. * @param {boolean} [options.cacheEnabled=true] - 启用缓存。
  88612. * @param {boolean} [options.clipRegionEnabled=false] - 是否启用地图裁剪。
  88613. * @param {L.Path} [options.clipRegion] - 地图显示裁剪的区域。是一个面对象,当 clipRegionEnabled = true 时有效,即地图只显示该区域覆盖的部分。
  88614. * @param {Object} [options.prjCoordSys] - 请求的地图的坐标参考系统。如:prjCoordSys={"epsgCode":3857}。
  88615. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
  88616. * @param {string} [options.overlapDisplayedOptions] - 避免地图对象压盖显示的过滤选项。
  88617. * @param {string} [options.tileversion] - 切片版本名称,cacheEnabled 为 true 时有效。如果没有设置 tileversion 参数,而且当前地图的切片集中存在多个版本,则默认使用最后一个更新版本。
  88618. * @param {CRS} [options.crs] - 坐标系统类。
  88619. * @param {string} [options.tileProxy] - 服务代理地址。
  88620. * @param {string} [options.format='png'] - 瓦片表述类型,支持 "png"、"webp"、"bmp"、"jpg"、"gif" 等图片格式。
  88621. * @param {(number|L.Point)} [options.tileSize=256] - 瓦片大小。
  88622. * @param {(NDVIParameter|HillshadeParameter)} [options.rasterfunction] - 栅格分析参数。
  88623. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
  88624. * @param {Array.<number>} [options.subdomains] - 子域名数组。
  88625. * @fires TiledMapLayer#tilesetsinfoloaded
  88626. * @fires TiledMapLayer#tileversionschanged
  88627. * @usage
  88628. */
  88629. var TiledMapLayer = external_L_default().TileLayer.extend({
  88630. options: {
  88631. //如果有layersID,则是在使用专题图
  88632. layersID: null,
  88633. //如果为 true,则将请求重定向到瓦片的真实地址;如果为 false,则响应体中是瓦片的字节流
  88634. redirect: false,
  88635. transparent: true,
  88636. cacheEnabled: true,
  88637. clipRegionEnabled: false,
  88638. //地图显示裁剪的区域
  88639. clipRegion: null,
  88640. //请求的地图的坐标参考系统。如:prjCoordSys={"epsgCode":3857}
  88641. prjCoordSys: null,
  88642. //地图对象在同一范围内时,是否重叠显示
  88643. overlapDisplayed: false,
  88644. //避免地图对象压盖显示的过滤选项
  88645. overlapDisplayedOptions: null,
  88646. //切片版本名称,cacheEnabled 为 true 时有效。
  88647. tileversion: null,
  88648. crs: null,
  88649. format: 'png',
  88650. //启用托管地址。
  88651. tileProxy: null,
  88652. attribution: core_Attributions.Common.attribution,
  88653. subdomains: null
  88654. },
  88655. initialize: function initialize(url, options) {
  88656. this._url = url;
  88657. external_L_default().TileLayer.prototype.initialize.apply(this, arguments);
  88658. external_L_default().setOptions(this, options);
  88659. external_L_default().stamp(this);
  88660. //当前切片在切片集中的index
  88661. this.tileSetsIndex = -1;
  88662. this.tempIndex = -1;
  88663. },
  88664. /**
  88665. * @private
  88666. * @function TiledMapLayer.prototype.onAdd
  88667. * @description 添加地图。
  88668. * @param {L.Map} map - Leaflet Map 对象。
  88669. */
  88670. onAdd: function onAdd(map) {
  88671. this._crs = this.options.crs || map.options.crs;
  88672. external_L_default().TileLayer.prototype.onAdd.call(this, map);
  88673. },
  88674. /**
  88675. * @function TiledMapLayer.prototype.getTileUrl
  88676. * @description 根据行列号获取瓦片地址。
  88677. * @param {Object} coords - 行列号。
  88678. * @returns {string} 瓦片地址。
  88679. */
  88680. getTileUrl: function getTileUrl(coords) {
  88681. var scale = this.getScaleFromCoords(coords);
  88682. var layerUrl = this._getLayerUrl();
  88683. var tileUrl = layerUrl + "&scale=" + scale + "&x=" + coords.x + "&y=" + coords.y;
  88684. //支持代理
  88685. if (this.options.tileProxy) {
  88686. tileUrl = this.options.tileProxy + encodeURIComponent(tileUrl);
  88687. }
  88688. if (!this.options.cacheEnabled) {
  88689. tileUrl += "&_t=" + new Date().getTime();
  88690. }
  88691. if (this.options.subdomains) {
  88692. tileUrl = external_L_default().Util.template(tileUrl, {
  88693. s: this._getSubdomain(coords)
  88694. });
  88695. }
  88696. return tileUrl;
  88697. },
  88698. /**
  88699. * @function TiledMapLayer.prototype.getScale
  88700. * @description 根据缩放级别获取比例尺。
  88701. * @param {number} zoom - 缩放级别。
  88702. * @returns {number} 比例尺。
  88703. */
  88704. getScale: function getScale(zoom) {
  88705. var me = this;
  88706. //返回当前比例尺
  88707. var z = zoom || me._map.getZoom();
  88708. return me.scales[z];
  88709. },
  88710. /**
  88711. * @function TiledMapLayer.prototype.getScaleFromCoords
  88712. * @description 通过行列号获取比例尺。
  88713. * @param {Object} coords - 行列号。
  88714. * @returns {number} 比例尺。
  88715. */
  88716. getScaleFromCoords: function getScaleFromCoords(coords) {
  88717. var me = this,
  88718. scale;
  88719. if (me.scales && me.scales[coords.z]) {
  88720. return me.scales[coords.z];
  88721. }
  88722. me.scales = me.scales || {};
  88723. scale = me.getDefaultScale(coords);
  88724. me.scales[coords.z] = scale;
  88725. return scale;
  88726. },
  88727. /**
  88728. * @private
  88729. * @function TiledMapLayer.prototype.getDefaultScale
  88730. * @description 获取默认比例尺信息。
  88731. * @param {Object} coords - 坐标对象参数。
  88732. */
  88733. getDefaultScale: function getDefaultScale(coords) {
  88734. var me = this,
  88735. crs = me._crs;
  88736. if (crs.scales) {
  88737. return crs.scales[coords.z];
  88738. } else {
  88739. var tileBounds = me._tileCoordsToBounds(coords);
  88740. var ne = crs.project(tileBounds.getNorthEast());
  88741. var sw = crs.project(tileBounds.getSouthWest());
  88742. var tileSize = me.options.tileSize;
  88743. var resolution = Math.max(Math.abs(ne.x - sw.x) / tileSize, Math.abs(ne.y - sw.y) / tileSize);
  88744. var mapUnit = Unit.METER;
  88745. if (crs.code) {
  88746. var array = crs.code.split(':');
  88747. if (array && array.length > 1) {
  88748. var code = parseInt(array[1]);
  88749. mapUnit = code && code >= 4000 && code <= 5000 ? Unit.DEGREE : Unit.METER;
  88750. }
  88751. }
  88752. return resolutionToScale(resolution, 96, mapUnit);
  88753. }
  88754. },
  88755. /**
  88756. * @function TiledMapLayer.prototype.setTileSetsInfo
  88757. * @description 设置瓦片集信息。
  88758. * @param {Object} tileSets - 瓦片对象集。
  88759. */
  88760. setTileSetsInfo: function setTileSetsInfo(tileSets) {
  88761. this.tileSets = tileSets;
  88762. if (external_L_default().Util.isArray(this.tileSets)) {
  88763. this.tileSets = this.tileSets[0];
  88764. }
  88765. if (!this.tileSets) {
  88766. return;
  88767. }
  88768. /**
  88769. * @event TiledMapLayer#tilesetsinfoloaded
  88770. * @description 瓦片集信息设置完成后触发。
  88771. * @property {Array.<Object>} tileVersions - 瓦片集信息。
  88772. */
  88773. this.fire('tilesetsinfoloaded', {
  88774. tileVersions: this.tileSets.tileVersions
  88775. });
  88776. this.changeTilesVersion();
  88777. },
  88778. /**
  88779. * @function TiledMapLayer.prototype.lastTilesVersion
  88780. * @description 请求上一个版本切片,并重新绘制。
  88781. */
  88782. lastTilesVersion: function lastTilesVersion() {
  88783. this.tempIndex = this.tileSetsIndex - 1;
  88784. this.changeTilesVersion();
  88785. },
  88786. /**
  88787. * @function TiledMapLayer.prototype.nextTilesVersion
  88788. * @description 请求下一个版本切片,并重新绘制。
  88789. */
  88790. nextTilesVersion: function nextTilesVersion() {
  88791. this.tempIndex = this.tileSetsIndex + 1;
  88792. this.changeTilesVersion();
  88793. },
  88794. /**
  88795. * @function TiledMapLayer.prototype.changeTilesVersion
  88796. * @description 切换到某一版本的切片,并重绘。通过 this.tempIndex 保存需要切换的版本索引
  88797. */
  88798. changeTilesVersion: function changeTilesVersion() {
  88799. var me = this;
  88800. //切片版本集信息是否存在
  88801. if (me.tileSets == null) {
  88802. //版本信息为空,重新查询,查询成功继续跳转到相应的版本
  88803. //me.getTileSetsInfo();
  88804. return;
  88805. }
  88806. if (me.tempIndex === me.tileSetsIndex || this.tempIndex < 0) {
  88807. return;
  88808. }
  88809. //检测index是否可用
  88810. var tileVersions = me.tileSets.tileVersions;
  88811. if (tileVersions && me.tempIndex < tileVersions.length && me.tempIndex >= 0) {
  88812. var name = tileVersions[me.tempIndex].name;
  88813. var result = me.mergeTileVersionParam(name);
  88814. if (result) {
  88815. me.tileSetsIndex = me.tempIndex;
  88816. /**
  88817. * @event TiledMapLayer#tileversionschanged
  88818. * @description 切片的版本切换和重绘成功之后触发。
  88819. * @property {Object} tileVersion - 该版本的切片。
  88820. */
  88821. me.fire('tileversionschanged', {
  88822. tileVersion: tileVersions[me.tempIndex]
  88823. });
  88824. }
  88825. }
  88826. },
  88827. /**
  88828. * @function TiledMapLayer.prototype.updateCurrentTileSetsIndex
  88829. * @description 手动设置当前切片集索引,目前主要提供给控件使用。
  88830. * @param {number} index - 索引值。
  88831. */
  88832. updateCurrentTileSetsIndex: function updateCurrentTileSetsIndex(index) {
  88833. this.tempIndex = index;
  88834. },
  88835. /**
  88836. * @function TiledMapLayer.prototype.mergeTileVersionParam
  88837. * @description 更改URL请求参数中的切片版本号,并重绘。
  88838. * @param {string} version - 切片版本号。
  88839. * @returns {boolean} 是否成功。
  88840. */
  88841. mergeTileVersionParam: function mergeTileVersionParam(version) {
  88842. if (version) {
  88843. this.requestParams["tileversion"] = version;
  88844. this._paramsChanged = true;
  88845. this.redraw();
  88846. this._paramsChanged = false;
  88847. return true;
  88848. }
  88849. return false;
  88850. },
  88851. _getLayerUrl: function _getLayerUrl() {
  88852. if (this._paramsChanged) {
  88853. this._layerUrl = this._createLayerUrl();
  88854. }
  88855. return this._layerUrl || this._createLayerUrl();
  88856. },
  88857. _createLayerUrl: function _createLayerUrl() {
  88858. var layerUrl = Util_Util.urlPathAppend(this._url, "tileImage.".concat(this.options.format));
  88859. this.requestParams = this.requestParams || this._getAllRequestParams();
  88860. layerUrl = Util_Util.urlAppend(layerUrl, external_L_namespaceObject.Util.getParamString(this.requestParams));
  88861. layerUrl = SecurityManager.appendCredential(layerUrl);
  88862. this._layerUrl = layerUrl;
  88863. return layerUrl;
  88864. },
  88865. _getAllRequestParams: function _getAllRequestParams() {
  88866. var me = this,
  88867. options = me.options || {},
  88868. params = {};
  88869. var tileSize = this.options.tileSize;
  88870. if (!(tileSize instanceof (external_L_default()).Point)) {
  88871. tileSize = external_L_default().point(tileSize, tileSize);
  88872. }
  88873. params["width"] = tileSize.x;
  88874. params["height"] = tileSize.y;
  88875. params["redirect"] = options.redirect === true;
  88876. params["transparent"] = options.transparent === true;
  88877. params["cacheEnabled"] = !(options.cacheEnabled === false);
  88878. if (options.prjCoordSys) {
  88879. params["prjCoordSys"] = JSON.stringify(options.prjCoordSys);
  88880. }
  88881. if (options.layersID) {
  88882. params["layersID"] = options.layersID.toString();
  88883. }
  88884. if (options.clipRegionEnabled && options.clipRegion) {
  88885. options.clipRegion = ServerGeometry.fromGeometry(Util_toSuperMapGeometry(options.clipRegion));
  88886. params["clipRegionEnabled"] = options.clipRegionEnabled;
  88887. params["clipRegion"] = JSON.stringify(options.clipRegion);
  88888. }
  88889. //切片的起始参考点,默认为地图范围的左上角。
  88890. var crs = me._crs;
  88891. if (crs.options && crs.options.origin) {
  88892. params["origin"] = JSON.stringify({
  88893. x: crs.options.origin[0],
  88894. y: crs.options.origin[1]
  88895. });
  88896. } else if (crs.projection && crs.projection.bounds) {
  88897. var bounds = crs.projection.bounds;
  88898. var tileOrigin = external_L_default().point(bounds.min.x, bounds.max.y);
  88899. params["origin"] = JSON.stringify({
  88900. x: tileOrigin.x,
  88901. y: tileOrigin.y
  88902. });
  88903. }
  88904. if (options.overlapDisplayed === false) {
  88905. params["overlapDisplayed"] = false;
  88906. if (options.overlapDisplayedOptions) {
  88907. params["overlapDisplayedOptions"] = options.overlapDisplayedOptions;
  88908. }
  88909. } else {
  88910. params["overlapDisplayed"] = true;
  88911. }
  88912. if (params.cacheEnabled === true && options.tileversion) {
  88913. params["tileversion"] = options.tileversion.toString();
  88914. }
  88915. if (options.rasterfunction) {
  88916. params["rasterfunction"] = JSON.stringify(options.rasterfunction);
  88917. }
  88918. return params;
  88919. }
  88920. });
  88921. var tiledMapLayer = function tiledMapLayer(url, options) {
  88922. return new TiledMapLayer(url, options);
  88923. };
  88924. // EXTERNAL MODULE: ./node_modules/jsonsql/index.js
  88925. var jsonsql = __webpack_require__(6879);
  88926. var jsonsql_default = /*#__PURE__*/__webpack_require__.n(jsonsql);
  88927. ;// CONCATENATED MODULE: ./src/leaflet/overlay/carto/CartoDefaultStyle.js
  88928. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88929. * This program are made available under the terms of the Apache License, Version 2.0
  88930. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88931. /**
  88932. * @constant DefaultStyle
  88933. * @description 这个 style 对应的是默认设置。
  88934. * @category BaseTypes Style
  88935. * @private
  88936. */
  88937. var DefaultStyle = {
  88938. /**
  88939. * @constant DefaultStyle.prototype.TEXT
  88940. * @description 默认文本样式。
  88941. */
  88942. "TEXT": {
  88943. fontSize: "14px",
  88944. fontFamily: "Arial Unicode MS Regular,Microsoft YaHei",
  88945. textAlign: "left",
  88946. color: "rgba(255,255,255,0)",
  88947. fillColor: "rgba(80,80,80,1)",
  88948. weight: 1,
  88949. globalAlpha: 1
  88950. },
  88951. /**
  88952. * @constant DefaultStyle.prototype.POINT
  88953. * @description 默认点样式。
  88954. */
  88955. "POINT": {
  88956. fillColor: "#ffcc00",
  88957. color: "#cc3333",
  88958. weight: 1,
  88959. radius: 3,
  88960. opacity: 1
  88961. },
  88962. /**
  88963. * @constant DefaultStyle.prototype.LINE
  88964. * @description 默认线样式。
  88965. */
  88966. "LINE": {
  88967. color: "rgba(0,0,0,0)",
  88968. weight: 1,
  88969. lineCap: "butt",
  88970. lineJoin: "round",
  88971. dashOffset: 0,
  88972. dashArray: [],
  88973. opacity: 1
  88974. },
  88975. /**
  88976. * @constant DefaultStyle.prototype.REGION
  88977. * @description 默认多边形样式。
  88978. */
  88979. "REGION": {
  88980. color: "rgba(0,0,0,0)",
  88981. fillColor: "rgba(0,0,0,0)",
  88982. weight: 1,
  88983. lineCap: "butt",
  88984. lineJoin: "round",
  88985. dashOffset: 0,
  88986. opacity: 1,
  88987. fillOpacity: 1,
  88988. dashArray: []
  88989. }
  88990. };
  88991. ;// CONCATENATED MODULE: ./src/leaflet/overlay/carto/CartoStyleMap.js
  88992. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  88993. * This program are made available under the terms of the Apache License, Version 2.0
  88994. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  88995. /**
  88996. * @constant CartoStyleMap
  88997. * @description CartoCSS 中的 style 属性名与 leaflet 的 style 属性名的对应表。
  88998. * @category BaseTypes Style
  88999. * @private
  89000. */
  89001. var CartoStyleMap = {
  89002. /*
  89003. * @constant CartoStyleMap.prototype.TEXT
  89004. * @description 默认文本样式。
  89005. */
  89006. "TEXT": {
  89007. "text-size": "fontSize",
  89008. "text-face-name": "fontFamily",
  89009. "text-align": "textAlign",
  89010. "text-name": "textName",
  89011. 'text-weight': 'fontWeight',
  89012. "text-halo-color": "color",
  89013. "text-fill": "fillColor",
  89014. "text-comp-op": "globalCompositeOperation"
  89015. },
  89016. /*
  89017. * @constant CartoStyleMap.prototype.POINT
  89018. * @description 默认点样式。
  89019. */
  89020. "POINT": {
  89021. "point-file": "iconUrl",
  89022. "point-fill": "fillColor",
  89023. "point-radius": "radius",
  89024. "point-halo-color": "color",
  89025. "point-comp-op": "globalCompositeOperation"
  89026. },
  89027. /*
  89028. * @constant CartoStyleMap.prototype.LINE
  89029. * @description 默认线样式。
  89030. */
  89031. "LINE": {
  89032. "line-color": "color",
  89033. "line-width": "weight",
  89034. "line-cap": "lineCap",
  89035. "line-join": "lineJoin",
  89036. "line-dash-offset": "dashOffset",
  89037. "line-opacity": "opacity",
  89038. "line-dasharray": "dashArray",
  89039. "line-comp-op": "globalCompositeOperation"
  89040. },
  89041. /*
  89042. * @constant CartoStyleMap.prototype.REGION
  89043. * @description 默认多边形样式。
  89044. */
  89045. "REGION": {
  89046. "line-color": "color",
  89047. "line-width": "weight",
  89048. "line-cap": "lineCap",
  89049. "line-join": "lineJoin",
  89050. "line-dash-offset": "dashOffset",
  89051. "line-opacity": "opacity",
  89052. "line-dasharray": "dashArray",
  89053. "polygon-fill": "fillColor",
  89054. "polygon-opacity": "fillOpacity",
  89055. "polygon-comp-op": "globalCompositeOperation"
  89056. }
  89057. };
  89058. /**
  89059. * @constant ServerStyleMap
  89060. * @description 服务端传过来的 style 属性名与 leaflet 的 style 属性名的对应表。
  89061. * @private
  89062. */
  89063. var ServerStyleMap = {
  89064. /**
  89065. * @member ServerStyleMap.prototype.lineWidth
  89066. * @description 线宽。
  89067. */
  89068. lineWidth: {
  89069. leafletStyle: "weight",
  89070. type: "number",
  89071. unit: "mm",
  89072. defaultValue: 0.1
  89073. },
  89074. /**
  89075. * @member ServerStyleMap.prototype.fillForeColor
  89076. * @description 填充前景色。
  89077. */
  89078. fillForeColor: {
  89079. leafletStyle: "fillColor",
  89080. type: "color",
  89081. defaultValue: "rgba(0,0,0,0)"
  89082. },
  89083. /**
  89084. * @member ServerStyleMap.prototype.foreColor
  89085. * @description 前景色。
  89086. */
  89087. foreColor: {
  89088. leafletStyle: "color",
  89089. type: "color",
  89090. defaultValue: "rgba(0,0,0,0)"
  89091. },
  89092. /**
  89093. * @member ServerStyleMap.prototype.markerSize
  89094. * @description 图标大小。
  89095. */
  89096. markerSize: {
  89097. leafletStyle: "markerSize",
  89098. type: "number",
  89099. unit: "mm",
  89100. defaultValue: 2.4
  89101. },
  89102. /**
  89103. * @member ServerStyleMap.prototype.lineColor
  89104. * @description 线要素颜色。
  89105. */
  89106. lineColor: {
  89107. leafletStyle: "color",
  89108. type: "color",
  89109. defaultValue: "#000000"
  89110. }
  89111. };
  89112. /**
  89113. * @constant CompOpMap
  89114. * @description Canvas 中的 globalCompositeOperation 属性值与 CartoCSS 中的 CompOp 属性值对照表。
  89115. * @private
  89116. */
  89117. var CompOpMap = {
  89118. "clear": "",
  89119. "src": "",
  89120. "dst": "",
  89121. "src-over": "source-over",
  89122. "dst-over": "destination-over",
  89123. "src-in": "source-in",
  89124. "dst-in": "destination-in",
  89125. "src-out": "source-out",
  89126. "dst-out": "destination-out",
  89127. "src-atop": "source-atop",
  89128. "dst-atop": "destination-atop",
  89129. "xor": "xor",
  89130. "plus": "lighter",
  89131. "minus": "",
  89132. "multiply": "",
  89133. "screen": "",
  89134. "overlay": "",
  89135. "darken": "",
  89136. "lighten": "lighter",
  89137. "color-dodge": "",
  89138. "color-burn": "",
  89139. "hard-light": "",
  89140. "soft-light": "",
  89141. "difference": "",
  89142. "exclusion": "",
  89143. "contrast": "",
  89144. "invert": "",
  89145. "invert-rgb": "",
  89146. "grain-merge": "",
  89147. "grain-extract": "",
  89148. "hue": "",
  89149. "saturation": "",
  89150. "color": "",
  89151. "value": ""
  89152. };
  89153. ;// CONCATENATED MODULE: ./src/leaflet/overlay/carto/CartoCSSToLeaflet.js
  89154. function CartoCSSToLeaflet_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  89155. function CartoCSSToLeaflet_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  89156. function CartoCSSToLeaflet_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartoCSSToLeaflet_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartoCSSToLeaflet_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  89157. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89158. * This program are made available under the terms of the Apache License, Version 2.0
  89159. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89160. /**
  89161. * @class CartoCSSToLeaflet
  89162. * @classdesc CartoCSS 样式转 Leaflet 样式类。
  89163. * @category BaseTypes Style
  89164. * @param {string} url - 服务地址。
  89165. * @private
  89166. */
  89167. var CartoCSSToLeaflet = /*#__PURE__*/function () {
  89168. function CartoCSSToLeaflet(url) {
  89169. CartoCSSToLeaflet_classCallCheck(this, CartoCSSToLeaflet);
  89170. /**
  89171. * @member CartoCSSToLeaflet.prototype.cartoCSS
  89172. * @description CartoCSS 样式。
  89173. */
  89174. this.cartoCSS = null;
  89175. /**
  89176. * @member CartoCSSToLeaflet.prototype.mapUrl
  89177. * @description 地图服务地址。
  89178. */
  89179. this.mapUrl = url;
  89180. }
  89181. /**
  89182. * @function CartoCSSToLeaflet.prototype.pretreatedCartoCSS
  89183. * @description CartoCSS 样式预处理。
  89184. * @param {string} cartoStr - Carto 信息。
  89185. * @param {Object} processCharacters - 需要处理的特征对象。
  89186. */
  89187. CartoCSSToLeaflet_createClass(CartoCSSToLeaflet, [{
  89188. key: "pretreatedCartoCSS",
  89189. value: function pretreatedCartoCSS(cartoStr, processCharacters) {
  89190. if (processCharacters) {
  89191. cartoStr = this.processCharacters(cartoStr);
  89192. }
  89193. this.cartoCSS = this.cartoCSS || {};
  89194. var shaders = new CartoCSS(cartoStr).getShaders();
  89195. if (!shaders) {
  89196. return;
  89197. }
  89198. for (var i = 0; i < shaders.length; i++) {
  89199. var element = shaders[i].elements[0];
  89200. var attachment = shaders[i].attachment;
  89201. this.cartoCSS[element.clean] = this.cartoCSS[element.clean] || {};
  89202. this.cartoCSS[element.clean][attachment] = this.cartoCSS[element.clean][attachment] || [];
  89203. this.cartoCSS[element.clean][attachment].push(shaders[i]);
  89204. }
  89205. }
  89206. /**
  89207. * @function CartoCSSToLeaflet.prototype.processCharacters
  89208. * @description 替换一些关键符号。
  89209. * @param {string} cartoCSSStr - cartoCSSS 信息。
  89210. */
  89211. }, {
  89212. key: "processCharacters",
  89213. value: function processCharacters(cartoCSSStr) {
  89214. var style = cartoCSSStr;
  89215. if (!style) {
  89216. return;
  89217. }
  89218. var me = this;
  89219. style = style.replace(/[@]/gi, "___");
  89220. style = style.replace(/\\#/gi, "\#");
  89221. var cachedLayer = {};
  89222. me.layersInfo && Object.keys(me.layersInfo).sort().forEach(function (attr) {
  89223. var newAttr = attr.replace(/[@#\s]/gi, "___");
  89224. var to = attr;
  89225. var keys = Object.keys(cachedLayer);
  89226. for (var index = keys.length; index > -1; index--) {
  89227. if (attr.indexOf(keys[index]) > -1) {
  89228. to = attr.replace(keys[index], cachedLayer[keys[index]]);
  89229. break;
  89230. }
  89231. }
  89232. to = to.replace(/[#]/gi, "\#");
  89233. cachedLayer[attr] = newAttr;
  89234. style = style.replace(new RegExp(to, "g"), newAttr);
  89235. });
  89236. style = style.replace(/[#]/gi, "\n#");
  89237. //将zoom转化为scale,以免引起混淆
  89238. style = style.replace(/\[zoom/gi, "[scale");
  89239. return style;
  89240. }
  89241. /**
  89242. * @function CartoCSSToLeaflet.prototype.pickShader
  89243. * @description 拾取着色对象。
  89244. * @param {string} layerName - 图层名称。
  89245. */
  89246. }, {
  89247. key: "pickShader",
  89248. value: function pickShader(layerName) {
  89249. if (!this.cartoCSS) {
  89250. return null;
  89251. }
  89252. var name = layerName.replace(/[@#\s]/gi, "___");
  89253. return this.cartoCSS[name];
  89254. }
  89255. /**
  89256. * @function CartoCSSToLeaflet.prototype.getDefaultStyle
  89257. * @description 获取默认风格。
  89258. * @param {string} type - 默认风格类型。
  89259. */
  89260. }, {
  89261. key: "getDefaultStyle",
  89262. value: function getDefaultStyle(type) {
  89263. var style = {};
  89264. //设置默认值
  89265. var expandStyle = DefaultStyle[type];
  89266. for (var prop in expandStyle) {
  89267. var val = expandStyle[prop];
  89268. style[prop] = val;
  89269. }
  89270. return style;
  89271. }
  89272. /**
  89273. * @function CartoCSSToLeaflet.prototype.getStyleFromiPortalMarker
  89274. * @description 从 iPortalMarker 中获取样式。
  89275. * @param {string} icon - iPortal 图标。
  89276. */
  89277. }, {
  89278. key: "getStyleFromiPortalMarker",
  89279. value: function getStyleFromiPortalMarker(icon) {
  89280. if (icon.indexOf("./") == 0) {
  89281. return null;
  89282. }
  89283. //兼容iportal示例的问题
  89284. // if (icon.indexOf("http://support.supermap.com.cn:8092/static/portal") == 0) {
  89285. // icon = icon.replace("http://support.supermap.com.cn:8092/static/portal", "http://support.supermap.com.cn:8092/apps/viewer/static");
  89286. // }
  89287. return external_L_default().icon({
  89288. iconUrl: icon,
  89289. iconSize: external_L_default().point(48, 43),
  89290. iconAnchor: external_L_default().point(24, 43),
  89291. popupAnchor: external_L_default().point(0, -43)
  89292. });
  89293. }
  89294. /**
  89295. * @function CartoCSSToLeaflet.prototype.getStyleFromiPortalStyle
  89296. * @description 从 iPortal 的风格中获取样式。
  89297. * @param {Object} iPortalStyle - iPortal 的样式对象。
  89298. * @param {string} type - 样式类型。
  89299. * @param {Object} [fStyle] - 图标参数。
  89300. */
  89301. }, {
  89302. key: "getStyleFromiPortalStyle",
  89303. value: function getStyleFromiPortalStyle(iPortalStyle, type, fStyle) {
  89304. var featureStyle = fStyle ? JSON.parse(fStyle) : null;
  89305. var style = {};
  89306. if (type === 'Point' || type === 'MultiPoint') {
  89307. var pointStyle = featureStyle || iPortalStyle.pointStyle;
  89308. if (pointStyle.externalGraphic) {
  89309. if (pointStyle.externalGraphic.indexOf("./") == 0) {
  89310. return null;
  89311. }
  89312. //兼容iportal示例的问题
  89313. // if (pointStyle.externalGraphic.indexOf("http://support.supermap.com.cn:8092/static/portal") == 0) {
  89314. // pointStyle.externalGraphic = pointStyle.externalGraphic.replace("http://support.supermap.com.cn:8092/static/portal", "http://support.supermap.com.cn:8092/apps/viewer/static");
  89315. // }
  89316. return external_L_default().icon({
  89317. iconUrl: pointStyle.externalGraphic,
  89318. iconSize: external_L_default().point(pointStyle.graphicWidth, pointStyle.graphicHeight),
  89319. iconAnchor: external_L_default().point(-pointStyle.graphicXOffset, -pointStyle.graphicYOffset),
  89320. popupAnchor: external_L_default().point(0, -pointStyle.graphicHeight)
  89321. });
  89322. }
  89323. style.radius = pointStyle.pointRadius;
  89324. style.color = pointStyle.strokeColor;
  89325. style.opacity = pointStyle.strokeOpacity;
  89326. style.lineCap = pointStyle.strokeLineCap;
  89327. style.weight = pointStyle.strokeWidth;
  89328. style.fillColor = pointStyle.fillColor;
  89329. style.fillOpacity = pointStyle.fillOpacity;
  89330. style.dashArray = this.dashStyle(pointStyle, 1);
  89331. return style;
  89332. }
  89333. if (type === 'LineString' || type === 'MultiLineString' || type === 'Box') {
  89334. var lineStyle = featureStyle || iPortalStyle.lineStyle;
  89335. style.color = lineStyle.strokeColor;
  89336. style.opacity = lineStyle.strokeOpacity;
  89337. style.fillOpacity = lineStyle.fillOpacity;
  89338. style.lineCap = lineStyle.strokeLineCap;
  89339. style.weight = lineStyle.strokeWidth;
  89340. style.dashArray = this.dashStyle(lineStyle, 1);
  89341. return style;
  89342. }
  89343. if (type === 'Polygon' || type === 'MultiPolygon') {
  89344. var polygonStyle = featureStyle || iPortalStyle.polygonStyle;
  89345. style.color = polygonStyle.strokeColor;
  89346. style.opacity = polygonStyle.strokeOpacity;
  89347. style.lineCap = polygonStyle.strokeLineCap;
  89348. style.weight = polygonStyle.strokeWidth;
  89349. style.fillColor = polygonStyle.fillColor;
  89350. style.fillOpacity = polygonStyle.fillOpacity;
  89351. style.dashArray = this.dashStyle(polygonStyle, 1);
  89352. return style;
  89353. }
  89354. }
  89355. /**
  89356. * @function CartoCSSToLeaflet.prototype.dashStyle
  89357. * @description 符号样式。
  89358. * @param {Object} style - 样式参数。
  89359. * @param {number} widthFactor - 宽度系数。
  89360. */
  89361. }, {
  89362. key: "dashStyle",
  89363. value: function dashStyle(style, widthFactor) {
  89364. if (!style) {
  89365. return [];
  89366. }
  89367. var w = style.strokeWidth * widthFactor;
  89368. var str = style.strokeDashstyle;
  89369. switch (str) {
  89370. case 'solid':
  89371. return [];
  89372. case 'dot':
  89373. return [1, 4 * w];
  89374. case 'dash':
  89375. return [4 * w, 4 * w];
  89376. case 'dashdot':
  89377. return [4 * w, 4 * w, 1, 4 * w];
  89378. case 'longdash':
  89379. return [8 * w, 4 * w];
  89380. case 'longdashdot':
  89381. return [8 * w, 4 * w, 1, 4 * w];
  89382. default:
  89383. if (!str) {
  89384. return [];
  89385. }
  89386. if (Util_Util.isArray(str)) {
  89387. return str;
  89388. }
  89389. str = StringExt.trim(str).replace(/\s+/g, ",");
  89390. return str.replace(/\[|\]/gi, "").split(",");
  89391. }
  89392. }
  89393. /**
  89394. * @function CartoCSSToLeaflet.prototype.getValidStyleFromCarto
  89395. * @description 从 Carto 中获取有效的样式。
  89396. * @param {number} zoom - 缩放级别。
  89397. * @param {number} scale - 比例尺。
  89398. * @param {Array.<Object>} shader - 渲染器对象数组。
  89399. * @param {Object} feature - 要素。
  89400. * @param {string} [fromServer] - 服务源。
  89401. */
  89402. }, {
  89403. key: "getValidStyleFromCarto",
  89404. value: function getValidStyleFromCarto(zoom, scale, shader, feature, fromServer) {
  89405. if (!shader) {
  89406. return null;
  89407. }
  89408. var type = feature.type,
  89409. attributes = feature.properties.attributes || {},
  89410. style = this.getDefaultStyle(type);
  89411. fromServer = fromServer === undefined ? true : fromServer;
  89412. attributes.FEATUREID = feature.properties.id;
  89413. attributes.SCALE = scale;
  89414. var cartoStyleMap = CartoStyleMap[type];
  89415. var fontSize, fontName;
  89416. for (var i = 0, len = shader.length; i < len; i++) {
  89417. var _shader = shader[i];
  89418. var prop = cartoStyleMap[_shader.property];
  89419. var value = _shader.getValue(attributes, zoom, true);
  89420. if (value !== null && prop) {
  89421. if (prop === "fontSize") {
  89422. if (fromServer) {
  89423. value *= 0.8;
  89424. }
  89425. fontSize = value + "px";
  89426. style.fontSize = fontSize;
  89427. } else if (prop === "fontName") {
  89428. fontName = value;
  89429. style.fontName = fontName;
  89430. } else {
  89431. if (prop === "globalCompositeOperation") {
  89432. value = CompOpMap[value];
  89433. if (!value) {
  89434. continue;
  89435. }
  89436. } else if (fromServer && prop === 'iconUrl') {
  89437. value = this.mapUrl + '/tileFeature/symbols/' + value.replace(/(___)/gi, '@');
  89438. value = value.replace(/(__0__0__)/gi, '__8__8__');
  89439. style["iconUrl"] = value;
  89440. continue;
  89441. }
  89442. if (prop === 'weight' && value < 1) {
  89443. value = Math.ceil(value);
  89444. }
  89445. style[prop] = value;
  89446. }
  89447. }
  89448. }
  89449. return style;
  89450. }
  89451. /**
  89452. * @function CartoCSSToLeaflet.prototype.getValidStyleFromLayerInfo
  89453. * @description 通过图层信息获取有效的样式。
  89454. * @param {Feature} feature - 要素。
  89455. * @param {Object} layerInfo - 图层信息。
  89456. */
  89457. }, {
  89458. key: "getValidStyleFromLayerInfo",
  89459. value: function getValidStyleFromLayerInfo(feature, layerInfo) {
  89460. var type = feature.type,
  89461. style = this.getDefaultStyle(type),
  89462. shader = layerInfo && layerInfo.layerStyle;
  89463. if (!shader) {
  89464. return style;
  89465. }
  89466. if (type === "POINT") {
  89467. var size = Math.ceil(shader.markerSize * DOTS_PER_INCH * INCHES_PER_UNIT["mm"]) || 8;
  89468. var symbolParameters = {
  89469. "transparent": true,
  89470. "resourceType": "SYMBOLMARKER",
  89471. "picWidth": size,
  89472. "picHeight": size,
  89473. "style": JSON.stringify(shader)
  89474. };
  89475. style.iconUrl = Util_Util.urlAppend(this.mapUrl + "/symbol.png", Util_Util.getParameterString(symbolParameters));
  89476. style.iconSize = [size, size];
  89477. return style;
  89478. }
  89479. if (type === "TEXT") {
  89480. shader = feature.properties.textStyle || layerInfo.layerStyle;
  89481. //设置文本是否使用粗体
  89482. style.fontWeight = shader.bold ? shader.fontWeight : "normal";
  89483. //设置文本的尺寸(对应fontHeight属性)和行高,行高iserver不支持,默认5像素
  89484. //固定大小的时候单位是毫米
  89485. if (shader.fontHeight) {
  89486. var text_h = shader.fontHeight * DOTS_PER_INCH * INCHES_PER_UNIT["mm"] * 0.85; //毫米转像素,服务端的字体貌似要稍微小一点
  89487. style.fontSize = text_h + "px";
  89488. style.textHeight = text_h;
  89489. }
  89490. //设置文本字体类型
  89491. //在桌面字体钱加@时为了解决对联那种形式,但是在canvas不支持,并且添加了@会导致
  89492. //字体大小被固定,这里需要去掉
  89493. if (shader.fontName) {
  89494. style.fontFamily = shader.fontName.indexOf("@") ? shader.fontName.replace(/@/g, "") : shader.fontName;
  89495. }
  89496. //设置对齐方式
  89497. if (shader.align) {
  89498. var alignStr = shader.align.replace(/TOP|MIDDLE|BASELINE|BOTTOM/, "");
  89499. style.textAlign = alignStr.toLowerCase();
  89500. }
  89501. style.weight = shader.outline ? shader.outlineWidth : 0;
  89502. if (shader.backColor) {
  89503. style.color = "rgba(" + shader.backColor.red + "," + shader.backColor.green + "," + shader.backColor.blue + ",1)";
  89504. }
  89505. if (shader.foreColor) {
  89506. style.fillColor = "rgba(" + shader.foreColor.red + "," + shader.foreColor.green + "," + shader.foreColor.blue + ",1)";
  89507. }
  89508. style.rotation = shader.rotation || 0;
  89509. return style;
  89510. }
  89511. //目前只实现桌面系统默认的几种symbolID,非系统默认的面用颜色填充替代,线则用实线来替代
  89512. var fillSymbolID = shader["fillSymbolID"] > 7 ? 0 : shader["fillSymbolID"];
  89513. var lineSymbolID = shader["lineSymbolID"] > 5 ? 0 : shader["lineSymbolID"];
  89514. for (var attr in shader) {
  89515. var obj = ServerStyleMap[attr];
  89516. if (!obj) {
  89517. continue;
  89518. }
  89519. var leafletStyle = obj.leafletStyle;
  89520. switch (obj.type) {
  89521. case "number":
  89522. {
  89523. var value = shader[attr];
  89524. if (obj.unit) {
  89525. value = value * DOTS_PER_INCH * INCHES_PER_UNIT[obj.unit] * 2.5;
  89526. }
  89527. style[leafletStyle] = value;
  89528. break;
  89529. }
  89530. case "color":
  89531. {
  89532. var color = shader[attr];
  89533. var _value = void 0,
  89534. alpha = 1;
  89535. if (leafletStyle === "fillColor") {
  89536. if (fillSymbolID === 0 || fillSymbolID === 1) {
  89537. //当fillSymbolID为0时,用颜色填充,为1是无填充,即为透明填充,alpha通道为0
  89538. alpha = 1 - fillSymbolID;
  89539. _value = "rgba(" + color.red + "," + color.green + "," + color.blue + "," + alpha + ")";
  89540. }
  89541. } else if (leafletStyle === "color") {
  89542. if (lineSymbolID === 0 || lineSymbolID === 5) {
  89543. //对于lineSymbolID为0时,线为实线,为lineSymbolID为5时,为无线模式,即线为透明,即alpha通道为0
  89544. alpha = lineSymbolID === 0 ? 1 : 0;
  89545. } else {
  89546. //以下几种linePattern分别模拟了桌面的SymbolID为1~4几种符号的linePattern
  89547. var linePattern = [1, 0];
  89548. switch (lineSymbolID) {
  89549. case 1:
  89550. linePattern = [9.7, 3.7];
  89551. break;
  89552. case 2:
  89553. linePattern = [3.7, 3.7];
  89554. break;
  89555. case 3:
  89556. linePattern = [9.7, 3.7, 2.3, 3.7];
  89557. break;
  89558. case 4:
  89559. linePattern = [9.7, 3.7, 2.3, 3.7, 2.3, 3.7];
  89560. break;
  89561. default:
  89562. break;
  89563. }
  89564. style.lineDasharray = linePattern;
  89565. }
  89566. _value = "rgba(" + color.red + "," + color.green + "," + color.blue + "," + alpha + ")";
  89567. }
  89568. style[leafletStyle] = _value;
  89569. break;
  89570. }
  89571. default:
  89572. break;
  89573. }
  89574. }
  89575. //处理标签文本的情况
  89576. if (layerInfo.textField) {
  89577. style.textAlign = "LEFT";
  89578. }
  89579. return style;
  89580. }
  89581. }]);
  89582. return CartoCSSToLeaflet;
  89583. }();
  89584. ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/Graphic.js
  89585. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89586. * This program are made available under the terms of the Apache License, Version 2.0
  89587. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89588. /**
  89589. * @class Graphic
  89590. * @deprecatedclassinstance L.supermap.graphic
  89591. * @classdesc 高效率点图层要素类。
  89592. * @category Visualization Graphic
  89593. * @extends {L.Class}
  89594. * @param {Object} options - 参数。
  89595. * @param {L.LatLng} options.latLng - 经纬度。
  89596. * @param {number} options.id - 要素ID。
  89597. * @param {(CircleStyle|CloverStyle|ImageStyle)} [options.style] - 点样式。
  89598. * @param {Object} [options.attributes] - 要素属性。
  89599. * @usage
  89600. */
  89601. var Graphic = external_L_default().Class.extend({
  89602. initialize: function initialize(options) {
  89603. options = options || {};
  89604. var latLng = options.latLng || options._latLng;
  89605. this._latLng = external_L_default().latLng(latLng.lat, latLng.lng);
  89606. this._style = options.style || options._canvas;
  89607. this.attributes = options.attributes;
  89608. this.id = options.id ? options.id : null;
  89609. },
  89610. /**
  89611. * @function Graphic.prototype.getId
  89612. * @description 获取当前要素 ID。
  89613. * @returns {string} 要素 ID。
  89614. */
  89615. getId: function getId() {
  89616. return this.id;
  89617. },
  89618. /**
  89619. * @function Graphic.prototype.setId
  89620. * @description 设置当前要素 ID。
  89621. * @param {string} id - 要素 ID。
  89622. */
  89623. setId: function setId(id) {
  89624. this.id = id;
  89625. },
  89626. /**
  89627. * @function Graphic.prototype.setLatLng
  89628. * @description 设置经纬度。
  89629. * @param {L.LatLng} latLng - 经纬度参数。
  89630. */
  89631. setLatLng: function setLatLng(latLng) {
  89632. this._latLng = latLng;
  89633. },
  89634. /**
  89635. * @deprecated
  89636. * @function Graphic.prototype.setCanvas
  89637. * @description 设置画布,已弃用该设置,请使用 setStyle 接口。
  89638. * @param {HTMLCanvasElement} canvas - 传入需要设置的画布。
  89639. */
  89640. setCanvas: function setCanvas(canvas) {
  89641. this._style = canvas;
  89642. },
  89643. /**
  89644. * @function Graphic.prototype.setAttributes
  89645. * @description 设置要素属性。
  89646. * @param {Object} attributes - 属性对象。
  89647. */
  89648. setAttributes: function setAttributes(attributes) {
  89649. this.attributes = attributes;
  89650. },
  89651. /**
  89652. * @function Graphic.prototype.getLatLng
  89653. * @description 获取经纬度。
  89654. * @returns {L.LatLng} 经纬度。
  89655. */
  89656. getLatLng: function getLatLng() {
  89657. return this._latLng;
  89658. },
  89659. /**
  89660. * @deprecated
  89661. * @function Graphic.prototype.getCanvas
  89662. * @description 获取画布,已弃用该设置,请使用 getStyle 接口。
  89663. * @returns {HTMLCanvasElement} 画布。
  89664. */
  89665. getCanvas: function getCanvas() {
  89666. return this._style;
  89667. },
  89668. /**
  89669. * @function Graphic.prototype.getAttributes
  89670. * @description 获取要素属性。
  89671. * @returns {Object} 要素属性。
  89672. */
  89673. getAttributes: function getAttributes() {
  89674. return this.attributes;
  89675. },
  89676. /**
  89677. * @function Graphic.prototype.setStyle
  89678. * @description 设置样式。
  89679. * @param {(CircleStyle|ImageStyle|CloverStyle)} style - 样式。
  89680. */
  89681. setStyle: function setStyle(style) {
  89682. this._style = style;
  89683. },
  89684. /**
  89685. * @function Graphic.prototype.getStyle
  89686. * @description 获取样式。
  89687. * @returns {(CircleStyle|ImageStyle|CloverStyle)} 样式。
  89688. */
  89689. getStyle: function getStyle() {
  89690. return this._style;
  89691. }
  89692. });
  89693. var graphic = function graphic(options) {
  89694. return new Graphic(options);
  89695. };
  89696. ;// CONCATENATED MODULE: ./src/leaflet/overlay/theme/ThemeFeature.js
  89697. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89698. * This program are made available under the terms of the Apache License, Version 2.0
  89699. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89700. /**
  89701. * @class ThemeFeature
  89702. * @deprecatedclassinstance L.supermap.themeFeature
  89703. * @classdesc 客户端专题图要素类。
  89704. * 支持的 geometry 参数类型为 {@link L.Point},{@link L.LatLng},{@link L.Polyline},{@link L.Polygon}。
  89705. * @category Visualization Theme
  89706. * @extends {L.Class}
  89707. * @param {(L.Path|L.Point|L.LatLng)} geometry - 要素图形。
  89708. * @param {Object} attributes - 要素属性。
  89709. * @usage
  89710. */
  89711. var ThemeFeature = external_L_default().Class.extend({
  89712. initialize: function initialize(geometry, attributes) {
  89713. this.geometry = geometry;
  89714. this.attributes = attributes;
  89715. },
  89716. /**
  89717. * @function ThemeFeature.prototype.toFeature
  89718. * @description 转为内部矢量要素。
  89719. * @returns {FeatureVector} 内部矢量要素。
  89720. */
  89721. toFeature: function toFeature() {
  89722. var geometry = this.geometry;
  89723. if (geometry.toGeoJSON) {
  89724. var geojsonObject = geometry.toGeoJSON();
  89725. geojsonObject.properties = this.attributes;
  89726. return new GeoJSON().read(geojsonObject)[0];
  89727. }
  89728. if (geometry.length === 3) {
  89729. geometry = new GeoText(geometry[1], geometry[0], geometry[2]);
  89730. } else if (geometry.length === 2) {
  89731. geometry = new Point(geometry[0], geometry[1]);
  89732. } else if (geometry instanceof (external_L_default()).LatLng) {
  89733. geometry = new Point(geometry.lng, geometry.lat);
  89734. } else if (geometry instanceof (external_L_default()).Point) {
  89735. geometry = new Point(geometry.x, geometry.y);
  89736. } else if (geometry instanceof (external_L_default()).CircleMarker) {
  89737. var latLng = geometry.getLatLng();
  89738. geometry = new Point(latLng.lng, latLng.lat);
  89739. }
  89740. return new Vector(geometry, this.attributes);
  89741. },
  89742. /**
  89743. * @function ThemeFeature.prototype.reverseLatLngs
  89744. * @description 坐标反转。
  89745. * @param {L.LatLng} latlngs - 坐标值。
  89746. */
  89747. reverseLatLngs: function reverseLatLngs(latlngs) {
  89748. if (!external_L_default().Util.isArray(latlngs)) {
  89749. latlngs = [latlngs];
  89750. }
  89751. for (var i = 0; i < latlngs.length; i++) {
  89752. latlngs[i] = [latlngs[i].lng, latlngs[i].lat];
  89753. }
  89754. return latlngs;
  89755. }
  89756. });
  89757. var themeFeature = function themeFeature(geometry, attributes) {
  89758. return new ThemeFeature(geometry, attributes);
  89759. };
  89760. ;// CONCATENATED MODULE: ./src/leaflet/overlay/theme/ThemeLayer.js
  89761. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  89762. * This program are made available under the terms of the Apache License, Version 2.0
  89763. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  89764. /**
  89765. * @class ThemeLayer
  89766. * @classdesc 专题图层基类,调用建议使用其子类实现类。
  89767. * @category Visualization Theme
  89768. * @extends {L.Layer}
  89769. * @param {string} name - 专题图图层名称。
  89770. * @param {Object} options - 参数。
  89771. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  89772. * @param {number} [options.opacity=1] - 图层透明度。
  89773. * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
  89774. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
  89775. * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
  89776. * @fires ThemeLayer#featuresremoved
  89777. * @usage
  89778. */
  89779. var ThemeLayer = external_L_default().Layer.extend({
  89780. options: {
  89781. //要素坐标是否和地图坐标系一致,默认为false,要素默认是经纬度坐标。
  89782. alwaysMapCRS: false,
  89783. id: Util_Util.createUniqueID("themeLayer_"),
  89784. opacity: 1,
  89785. // {Array} 专题要素事件临时存储,临时保存图层未添加到 map 前用户添加的事件监听,待图层添加到 map 后把这些事件监听添加到图层上,清空此图层。
  89786. //这是一个二维数组,组成二维数组的每个一维数组长度为 2,分别是 event, callback。
  89787. TFEvents: [],
  89788. attribution: core_Attributions.Common.attribution
  89789. },
  89790. initialize: function initialize(name, options) {
  89791. external_L_default().Util.setOptions(this, options);
  89792. this.name = name;
  89793. this.features = [];
  89794. this.TFEvents = this.options.TFEvents;
  89795. this.levelRenderer = new LevelRenderer();
  89796. this.movingOffset = [0, 0];
  89797. },
  89798. /**
  89799. * @function ThemeLayer.prototype.getEvents
  89800. * @description 获取图层事件。
  89801. * @returns {Object} 返回图层事件。
  89802. */
  89803. getEvents: function getEvents() {
  89804. var me = this;
  89805. var events = {
  89806. zoomend: me._reset,
  89807. moveend: me._reset,
  89808. resize: me._resize
  89809. };
  89810. if (this._map._zoomAnimated) {
  89811. events.zoomanim = me._zoomAnim;
  89812. }
  89813. return events;
  89814. },
  89815. /**
  89816. * @function ThemeLayer.prototype.onRemove
  89817. * @description 删除某个地图。
  89818. * @param {L.Map} map - Leaflet Map 对象。
  89819. */
  89820. onRemove: function onRemove(map) {
  89821. var me = this;
  89822. external_L_default().DomUtil.remove(me.container);
  89823. map.off("mousemove", me.mouseMoveHandler);
  89824. },
  89825. /**
  89826. * @function ThemeLayer.prototype.onAdd
  89827. * @description 添加专题图。
  89828. * @param {L.Map} map - Leaflet Map 对象。
  89829. * @private
  89830. */
  89831. onAdd: function onAdd(map) {
  89832. var me = this;
  89833. me.map = me._map = map;
  89834. me._initContainer();
  89835. if (!me.levelRenderer) {
  89836. map.removeLayer(me);
  89837. return;
  89838. }
  89839. //初始化渲染器
  89840. var size = map.getSize();
  89841. me.container.style.width = size.x + "px";
  89842. me.container.style.height = size.y + "px";
  89843. me._updateOpacity();
  89844. me.renderer = me.levelRenderer.init(me.container);
  89845. me.renderer.clear();
  89846. if (me.features && me.features.length > 0) {
  89847. me._reset();
  89848. }
  89849. //处理用户预先(在图层添加到 map 前)监听的事件
  89850. me.addTFEvents();
  89851. me.mouseMoveHandler = function (e) {
  89852. var xy = e.layerPoint;
  89853. me.currentMousePosition = external_L_default().point(xy.x + me.movingOffset[0], xy.y + me.movingOffset[1]);
  89854. };
  89855. map.on("mousemove", me.mouseMoveHandler);
  89856. me.update(map.getBounds());
  89857. },
  89858. /**
  89859. * @function L.supermap.ThemeLayer.prototype.addFeatures
  89860. * @description 向专题图图层中添加数据。
  89861. * @param {(Array.<ServerFeature>|Array.<ThemeFeature>|Array.<GeoJSONObject>|ServerFeature|ThemeFeature|GeoJSONObject)} features - 待添加要素。
  89862. */
  89863. addFeatures: function addFeatures(features) {// eslint-disable-line no-unused-vars
  89864. //子类实现此方法
  89865. },
  89866. /**
  89867. * @function ThemeLayer.prototype.redrawThematicFeatures
  89868. * @description 抽象方法,实例化子类前先执行此方法。
  89869. * @param {L.Bounds} bounds - 重绘专题要素范围。
  89870. */
  89871. redrawThematicFeatures: function redrawThematicFeatures(bounds) {// eslint-disable-line no-unused-vars
  89872. //子类必须实现此方法
  89873. },
  89874. /**
  89875. * @function ThemeLayer.prototype.destroyFeatures
  89876. * @description 销毁要素。
  89877. * @param {Array.<FeatureVector>|FeatureVector} features - 将被销毁的要素。
  89878. */
  89879. destroyFeatures: function destroyFeatures(features) {
  89880. if (features === undefined) {
  89881. features = this.features;
  89882. }
  89883. if (!features) {
  89884. return;
  89885. }
  89886. this.removeFeatures(features);
  89887. if (!Array.isArray(features)) {
  89888. features = [features];
  89889. }
  89890. for (var i = features.length - 1; i >= 0; i--) {
  89891. features[i].destroy();
  89892. }
  89893. },
  89894. /**
  89895. * @function L.supermap.ThemeLayer.prototype.removeFeatures
  89896. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  89897. * @param {(Array.<FeatureVector>|FeatureVector|Function)} features - 将被删除的要素或用来过滤的回调函数。
  89898. */
  89899. removeFeatures: function removeFeatures(features) {
  89900. var me = this;
  89901. if (!features) {
  89902. return;
  89903. }
  89904. if (features === me.features) {
  89905. return me.removeAllFeatures();
  89906. }
  89907. if (!external_L_default().Util.isArray(features) && !(typeof features === 'function')) {
  89908. features = [features];
  89909. }
  89910. var featuresFailRemoved = [];
  89911. for (var i = 0; i < me.features.length; i++) {
  89912. var feature = me.features[i];
  89913. //如果我们传入的feature在features数组中没有的话,则不进行删除,
  89914. //并将其放入未删除的数组中。
  89915. if (features && typeof features === 'function') {
  89916. if (features(feature)) {
  89917. me.features.splice(i--, 1);
  89918. }
  89919. } else {
  89920. var findex = external_L_default().Util.indexOf(features, feature);
  89921. if (findex === -1) {
  89922. featuresFailRemoved.push(feature);
  89923. } else {
  89924. me.features.splice(i--, 1);
  89925. }
  89926. }
  89927. }
  89928. var drawFeatures = [];
  89929. for (var hex = 0, len = me.features.length; hex < len; hex++) {
  89930. feature = me.features[hex];
  89931. drawFeatures.push(feature);
  89932. }
  89933. me.features = [];
  89934. me.addFeatures(drawFeatures);
  89935. //绘制专题要素
  89936. if (me.renderer) {
  89937. if (me._map) {
  89938. me.redrawThematicFeatures(me._map.getBounds());
  89939. } else {
  89940. me.redrawThematicFeatures();
  89941. }
  89942. }
  89943. var succeed = featuresFailRemoved.length == 0;
  89944. /**
  89945. * @event ThemeLayer#featuresremoved
  89946. * @description 删除的要素成功之后触发。
  89947. * @property {Array.<FeatureVector>} features - 删除失败的要素数组。
  89948. * @property {boolean} succeed - 要输是否删除成功,true 为删除成功,false 为删除失败。
  89949. */
  89950. me.fire("featuresremoved", {
  89951. features: featuresFailRemoved,
  89952. succeed: succeed
  89953. });
  89954. },
  89955. /**
  89956. * @function ThemeLayer.prototype.removeAllFeatures
  89957. * @description 清除当前图层所有的矢量要素。
  89958. */
  89959. removeAllFeatures: function removeAllFeatures() {
  89960. var me = this;
  89961. if (me.renderer) {
  89962. me.renderer.clear();
  89963. }
  89964. me.features = [];
  89965. me.fire("featuresremoved", {
  89966. features: [],
  89967. succeed: true
  89968. });
  89969. },
  89970. /**
  89971. * @function ThemeLayer.prototype.getFeatures
  89972. * @description 查看当前图层中的有效数据。
  89973. * @param {Function} [filter] - 根据条件过滤要素的回调函数。
  89974. * @returns {Array.<FeatureVector>} 返回图层中的要素。
  89975. */
  89976. getFeatures: function getFeatures(filter) {
  89977. var len = this.features.length;
  89978. var clonedFeatures = [];
  89979. for (var i = 0; i < len; ++i) {
  89980. if (!filter || filter && typeof filter === 'function' && filter(this.features[i])) {
  89981. clonedFeatures.push(this.features[i]);
  89982. }
  89983. }
  89984. return clonedFeatures;
  89985. },
  89986. /**
  89987. * @function L.supermap.ThemeLayer.prototype.getFeatureBy
  89988. * @description 在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,返回此 feature(并且只返回第一个)。
  89989. * @param {string} property - 要的某个属性名。
  89990. * @param {string} value - 对应属性名得值。
  89991. * @returns {Array.<FeatureVector>} 返回图层中的要素。
  89992. */
  89993. getFeatureBy: function getFeatureBy(property, value) {
  89994. var me = this;
  89995. var feature = null;
  89996. for (var id in me.features) {
  89997. if (me.features[id][property] !== value) {
  89998. continue;
  89999. }
  90000. feature = me.features[id];
  90001. break;
  90002. }
  90003. return feature;
  90004. },
  90005. /**
  90006. * @function ThemeLayer.prototype.getFeatureById
  90007. * @description 返回指定 ID 的矢量要素,不存在则返回 null。
  90008. * @param {number} featureId - 要素 ID。
  90009. * @returns {Array.<FeatureVector>} 返回图层中的要素。
  90010. */
  90011. getFeatureById: function getFeatureById(featureId) {
  90012. return this.getFeatureBy('id', featureId);
  90013. },
  90014. /**
  90015. * @function L.supermap.ThemeLayer.prototype.getFeaturesByAttribute
  90016. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  90017. * @param {string} attrName - key 值。
  90018. * @param {string} attrValue - value 值。
  90019. * @returns {Array.<FeatureVector>} 返回所有匹配的要素数组。
  90020. */
  90021. getFeaturesByAttribute: function getFeaturesByAttribute(attrName, attrValue) {
  90022. var me = this,
  90023. feature,
  90024. foundFeatures = [];
  90025. for (var id in me.features) {
  90026. feature = me.features[id];
  90027. if (feature && feature.attributes && feature.attributes[attrName] === attrValue) {
  90028. foundFeatures.push(feature);
  90029. }
  90030. }
  90031. return foundFeatures;
  90032. },
  90033. /**
  90034. * @function ThemeLayer.prototype.update
  90035. * @description 更新图层。
  90036. * @param {L.Bounds} bounds - 图层范围。
  90037. */
  90038. update: function update(bounds) {
  90039. var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
  90040. external_L_default().DomUtil.setPosition(this.container, mapOffset);
  90041. var me = this;
  90042. // var bounds = me._map.getBounds();
  90043. // var topLeft = me._map.latLngToLayerPoint(bounds.getNorthWest());
  90044. // var mapOffset = [parseInt(topLeft.x, 10) || 0, parseInt(topLeft.y, 10) || 0]
  90045. // // var offsetLeft = parseInt(me._map.getContainer().style.left, 10);
  90046. // // offsetLeft = -Math.round(offsetLeft);
  90047. // //var offsetTop = parseInt(me._map.getContainer().style.top, 10);
  90048. // //offsetTop = -Math.round(offsetTop);
  90049. // me.container.style.left = mapOffset[0] + 'px';
  90050. // me.container.style.top = mapOffset[1] + 'px';
  90051. //绘制专题要素
  90052. if (me.renderer) {
  90053. me.redrawThematicFeatures(bounds);
  90054. }
  90055. if (me.currentMousePosition) {
  90056. me.currentMousePosition = external_L_default().point(me.currentMousePosition.x - me.movingOffset[0], me.currentMousePosition.y - me.movingOffset[1]);
  90057. }
  90058. me.movingOffset = [0, 0];
  90059. me._zoom = me._map.getZoom();
  90060. me._center = me._map.getCenter();
  90061. },
  90062. /**
  90063. * @function ThemeLayer.prototype.setOpacity
  90064. * @description 设置图层的不透明度,取值 [0-1] 之间。
  90065. * @param {number} opacity - 不透明度。
  90066. */
  90067. setOpacity: function setOpacity(opacity) {
  90068. var me = this;
  90069. if (opacity === me.options.opacity) {
  90070. return;
  90071. }
  90072. if (!isNaN(opacity)) {
  90073. me.options.opacity = opacity;
  90074. me._updateOpacity();
  90075. }
  90076. },
  90077. /**
  90078. * @function ThemeLayer.prototype.redraw
  90079. * @description 重绘该图层。
  90080. * @returns {boolean} 返回是否重绘成功。
  90081. */
  90082. redraw: function redraw() {
  90083. var me = this;
  90084. if (!me.renderer) {
  90085. return false;
  90086. }
  90087. if (me._map) {
  90088. me.redrawThematicFeatures(me._map.getBounds());
  90089. } else {
  90090. me.redrawThematicFeatures();
  90091. }
  90092. return true;
  90093. },
  90094. /**
  90095. * @function ThemeLayer.prototype.on
  90096. * @description 监听事件。监听专题要素事件。
  90097. * @param {Event} event - 监听事件。
  90098. * @param {function} callback - 回调函数。
  90099. * @param {string} context - 信息。
  90100. */
  90101. on: function on(event, callback, context) {
  90102. // eslint-disable-line no-unused-vars
  90103. if (this.renderer) {
  90104. this.renderer.on(event, callback);
  90105. } else {
  90106. external_L_default().Layer.prototype.on.call(this, event, callback);
  90107. }
  90108. return this;
  90109. },
  90110. /**
  90111. * @function ThemeLayer.prototype.off
  90112. * @description 移除事件监听。
  90113. * @param {Event} event - 监听事件。
  90114. * @param {function} callback - 回调函数。
  90115. * @param {string} context - 信息。
  90116. */
  90117. off: function off(event, callback, context) {
  90118. // eslint-disable-line no-unused-vars
  90119. var me = this;
  90120. if (me.renderer) {
  90121. me.renderer.un(event, callback);
  90122. } else {
  90123. external_L_default().Layer.prototype.off.call(this, event, callback);
  90124. }
  90125. return this;
  90126. },
  90127. fire: function fire(type, data, propagate) {
  90128. // eslint-disable-line no-unused-vars
  90129. if (this.renderer) {
  90130. this.renderer.trigger(type, data);
  90131. }
  90132. external_L_default().Layer.prototype.fire.call(this, type, data, propagate);
  90133. return this;
  90134. },
  90135. /**
  90136. * @function ThemeLayer.prototype.addTFEvents
  90137. * @description 先把事件监听添加到图层,再把图层添加到地图。
  90138. * @private
  90139. */
  90140. addTFEvents: function addTFEvents() {
  90141. var me = this;
  90142. var tfEs = me.TFEvents;
  90143. var len = tfEs.length;
  90144. for (var i = 0; i < len; i++) {
  90145. me.renderer.on(tfEs[i][0], tfEs[i][1]);
  90146. }
  90147. },
  90148. /**
  90149. * @function ThemeLayer.prototype.getLocalXY
  90150. * @description 地理坐标转为像素坐标。
  90151. * @param {Array} coordinate
  90152. */
  90153. getLocalXY: function getLocalXY(coordinate) {
  90154. if (!this._map) {
  90155. return coordinate;
  90156. }
  90157. var coor = coordinate;
  90158. if (external_L_default().Util.isArray(coordinate)) {
  90159. coor = external_L_default().point(coordinate[0], coordinate[1]);
  90160. }
  90161. if (!(coordinate instanceof (external_L_default()).Point)) {
  90162. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  90163. coor = external_L_default().point(coordinate.x, coordinate.y);
  90164. } else {
  90165. coor = external_L_default().point(coordinate.lon, coordinate.lat);
  90166. }
  90167. }
  90168. var point = this._map.latLngToAccurateContainerPoint(!this.options.alwaysMapCRS ? external_L_default().latLng(coor.y, coor.x) : this._map.options.crs.unproject(coor));
  90169. return [point.x, point.y];
  90170. },
  90171. /**
  90172. * @function ThemeLayer.prototype.toiClientFeature
  90173. * @description 转为 iClient 要素。
  90174. * @param {(Array.<ServerFeature>|Array.<ThemeFeature>|Array.<GeoJSONObject>|ServerFeature|ThemeFeature|GeoJSONObject)} features - 待转要素。
  90175. * @returns {Array.<FeatureVector>} 转换后的 iClient 要素。
  90176. */
  90177. toiClientFeature: function toiClientFeature(features) {
  90178. //若 features 非数组形式 feature 则先做以下处理:
  90179. if (!Util_Util.isArray(features)) {
  90180. features = [features];
  90181. }
  90182. var featuresTemp = [];
  90183. for (var i = 0; i < features.length; i++) {
  90184. //themeFeature 数据类型
  90185. if (features[i] instanceof ThemeFeature) {
  90186. featuresTemp.push(features[i].toFeature());
  90187. } else if (features[i] instanceof Vector) {
  90188. // 若是 FeatureVector 类型直接返回
  90189. featuresTemp.push(features[i]);
  90190. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  90191. //GeoJSON 规范数据类型
  90192. var format = new GeoJSON();
  90193. featuresTemp = featuresTemp.concat(format.read(features[i]));
  90194. } else if (features[i].geometry && features[i].geometry.parts) {
  90195. //iServer服务器返回数据格式 todo 暂未找到更好的参数判断,暂用 geometry.parts 试用
  90196. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  90197. } else {
  90198. throw new Error("features[".concat(i, "]'s type is not be supported."));
  90199. }
  90200. }
  90201. return featuresTemp;
  90202. },
  90203. /**
  90204. * @function ThemeLayer.prototype.toFeature
  90205. * @deprecated
  90206. * @description 转为 iClient 要素,该方法将被弃用,由 {@link ThemeLayer#toiClientFeature} 代替。
  90207. * @param {(Array.<ServerFeature>|Array.<ThemeFeature>|Array.<GeoJSONObject>|ServerFeature|ThemeFeature|GeoJSONObject)} features - 待转要素。
  90208. * @returns {FeatureVector} 转换后的 iClient 要素。
  90209. */
  90210. toFeature: function toFeature(features) {
  90211. return this.toiClientFeature(features);
  90212. },
  90213. _initContainer: function _initContainer() {
  90214. var parentContainer = this.getPane();
  90215. var animated = this._map.options.zoomAnimation && (external_L_default()).Browser.any3d;
  90216. var className = 'themeLayer leaflet-layer leaflet-zoom-' + (animated ? 'animated' : 'hide');
  90217. this.container = external_L_default().DomUtil.create("div", className, parentContainer);
  90218. var originProp = external_L_default().DomUtil.testProp(['transformOrigin', 'WebkitTransformOrigin', 'msTransformOrigin']);
  90219. this.container.id = this.options.id;
  90220. this.container.style[originProp] = '50% 50%';
  90221. this.container.style.position = "absolute";
  90222. this.container.style.zIndex = 200;
  90223. },
  90224. _zoomAnim: function _zoomAnim(e) {
  90225. var scale = this._map.getZoomScale(e.zoom),
  90226. offset = this._map._getCenterOffset(e.center)._multiplyBy(-scale).subtract(this._map._getMapPanePos());
  90227. if ((external_L_default()).DomUtil.setTransform) {
  90228. external_L_default().DomUtil.setTransform(this.container, offset, scale);
  90229. } else {
  90230. this.container.style[(external_L_default()).DomUtil.TRANSFORM] = external_L_default().DomUtil.getTranslateString(offset) + ' scale(' + scale + ')';
  90231. }
  90232. },
  90233. _updateOpacity: function _updateOpacity() {
  90234. var me = this;
  90235. Util_Util.modifyDOMElement(me.container, null, null, null, null, null, null, me.options.opacity);
  90236. if (me._map !== null) {
  90237. /**
  90238. * @event ThemeLayer#changelayer
  90239. * @description 图层属性改变之后触发。
  90240. * @property {Object} layer - 图层。
  90241. * @property {string} property - 图层属性。
  90242. */
  90243. me._map.fire("changelayer", {
  90244. layer: me,
  90245. property: "opacity"
  90246. });
  90247. }
  90248. },
  90249. //缩放移动重绘
  90250. _reset: function _reset() {
  90251. var me = this;
  90252. var latLngBounds = me._map.getBounds();
  90253. me.update(latLngBounds);
  90254. var size = me._map.getSize();
  90255. // var bounds = me._map.getBounds();
  90256. // var topLeft = me._map.latLngToLayerPoint(bounds.getNorthWest());
  90257. // var mapOffset = [parseInt(topLeft.x, 10) || 0, parseInt(topLeft.y, 10) || 0]
  90258. // var offsetLeft = parseInt(me._map.getContainer().style.left, 10);
  90259. // offsetLeft = -Math.round(offsetLeft);
  90260. //var offsetTop = parseInt(me._map.getContainer().style.top, 10);
  90261. //offsetTop = -Math.round(offsetTop);
  90262. //me.container.style.left = mapOffset[0] + 'px';
  90263. //me.container.style.top = mapOffset[1] + 'px';
  90264. var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
  90265. external_L_default().DomUtil.setPosition(this.container, mapOffset);
  90266. if (parseFloat(me.container.width) !== parseFloat(size.x)) {
  90267. me.container.width = size.x + 'px';
  90268. }
  90269. if (parseFloat(me.container.height) !== parseFloat(size.y)) {
  90270. me.container.height = size.y + 'px';
  90271. }
  90272. me.redraw();
  90273. },
  90274. //通知渲染器的尺寸变化
  90275. _resize: function _resize() {
  90276. var me = this;
  90277. var newSize = me._map.getSize();
  90278. me.container.style.width = newSize.x + "px";
  90279. me.container.style.height = newSize.y + "px";
  90280. me.renderer.resize();
  90281. }
  90282. });
  90283. ;// CONCATENATED MODULE: ./src/leaflet/overlay/theme/GeoFeatureThemeLayer.js
  90284. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90285. * This program are made available under the terms of the Apache License, Version 2.0
  90286. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90287. /**
  90288. * @class GeoFeatureThemeLayer
  90289. * @classdesc 地理几何专题要素型专题图层基类。此类型专题图的专题要素形状就是由 feature.geometry 决定。此类不建议直接实例化调用。
  90290. * @category Visualization Theme
  90291. * @extends ThemeLayer
  90292. * @category Visualization Graphic
  90293. * @param {string} name - 专题图名。
  90294. * @param {Object} options - 参数。
  90295. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  90296. * @param {number} [options.opacity=1] - 图层透明度。
  90297. * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
  90298. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
  90299. * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
  90300. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离。
  90301. * @param {boolean} [options.isHoverAble=false] - 图形是否在 hover 时高亮。
  90302. * @param {boolean} [options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
  90303. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  90304. * @param {boolean} [options.isAllowFeatureStyle=false] - 是否允许 feature 样式(style)中的有效属性应用到专题图层。
  90305. * 禁止对专题要素使用数据(feature)的 style。
  90306. * 此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature)对应专题要素赋予独立 style。
  90307. * @fires GeoFeatureThemeLayer#beforefeaturesadded
  90308. * @usage
  90309. */
  90310. var GeoFeatureThemeLayer = ThemeLayer.extend({
  90311. options: {
  90312. // {number} 节点抽稀像素距离,默认值 2。
  90313. nodesClipPixel: 2,
  90314. //{boolean} 图形是否在 hover 时高亮 ,默认值:false。
  90315. isHoverAble: false,
  90316. //{boolean} 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面),默认值:false。
  90317. isMultiHover: false,
  90318. // {boolean} 图形是否可点击,默认 true
  90319. isClickAble: true,
  90320. //是否允许 feature 样式(style)中的有效属性应用到专题图层。
  90321. //默认值为: false,禁止对专题要素使用数据(feature)的 style。
  90322. //此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
  90323. //的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature)对应专题要素赋予独立 style。
  90324. isAllowFeatureStyle: false
  90325. },
  90326. initialize: function initialize(name, options) {
  90327. ThemeLayer.prototype.initialize.call(this, name, options);
  90328. external_L_default().Util.setOptions(this, options);
  90329. var me = this;
  90330. me.cache = {};
  90331. me.cacheFields = [];
  90332. me.style = {};
  90333. me.highlightStyle = {};
  90334. },
  90335. /**
  90336. * @function GeoFeatureThemeLayer.prototype.addFeatures
  90337. * @description 添加数据。
  90338. * @param {(Array.<ServerFeature>|Array.<ThemeFeature>|Array.<GeoJSONObject>|ServerFeature|ThemeFeature|GeoJSONObject)} features - 待添加的要素。
  90339. */
  90340. addFeatures: function addFeatures(features) {
  90341. var me = this;
  90342. /**
  90343. * @event GeoFeatureThemeLayer#beforefeaturesadded
  90344. * @description 添加数据之前触发。
  90345. * @property {(Array.<ServerFeature>|Array.<ThemeFeature>|Array.<GeoJSONObject>|ServerFeature|ThemeFeature|GeoJSONObject)} features - 要素。
  90346. */
  90347. me.fire("beforefeaturesadded", {
  90348. features: features
  90349. });
  90350. //转换 features 形式
  90351. this.features = this.toiClientFeature(features);
  90352. if (!me.isCustomSetMaxCacheCount) {
  90353. me.maxCacheCount = me.features.length * 5;
  90354. }
  90355. if (!me.renderer) {
  90356. return;
  90357. }
  90358. //绘制专题要素
  90359. if (me._map) {
  90360. me.redrawThematicFeatures(me._map.getBounds());
  90361. } else {
  90362. me.redrawThematicFeatures();
  90363. }
  90364. },
  90365. /**
  90366. * @function GeoFeatureThemeLayer.prototype.removeFeatures
  90367. * @description 删除专题图中 features。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
  90368. * @param {(Array.<FeatureVector>|FeatureVector|Function)} features - 要删除的要素或用于条件删除的回调函数。
  90369. */
  90370. removeFeatures: function removeFeatures(features) {
  90371. // eslint-disable-line no-unused-vars
  90372. this.clearCache();
  90373. ThemeLayer.prototype.removeFeatures.call(this, features);
  90374. },
  90375. /**
  90376. * @function GeoFeatureThemeLayer.prototype.removeAllFeatures
  90377. * @description 清除当前图层所有的矢量要素。
  90378. */
  90379. removeAllFeatures: function removeAllFeatures() {
  90380. this.clearCache();
  90381. ThemeLayer.prototype.removeAllFeatures.call(this, arguments);
  90382. },
  90383. /**
  90384. * @function GeoFeatureThemeLayer.prototype.redrawThematicFeatures
  90385. * @description 重绘所有专题要素。
  90386. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
  90387. * 地图漫游时调用此方法进行图层刷新。
  90388. * @param {L.Bounds} bounds - 重绘的范围。
  90389. */
  90390. redrawThematicFeatures: function redrawThematicFeatures(bounds) {
  90391. var me = this;
  90392. //获取高亮专题要素对应的用户 id
  90393. var hoverone = me.renderer.getHoverOne();
  90394. var hoverFid = null;
  90395. if (hoverone && hoverone.refDataID) {
  90396. hoverFid = hoverone.refDataID;
  90397. }
  90398. if (this.options.alwaysMapCRS && bounds && bounds instanceof (external_L_default()).LatLngBounds) {
  90399. var crs = this._map.options.crs;
  90400. bounds = external_L_default().bounds(crs.project(bounds.getSouthWest()), crs.project(bounds.getNorthEast()));
  90401. }
  90402. bounds = CommontypesConversion.toSuperMapBounds(bounds);
  90403. //清除当前所有可视元素
  90404. me.renderer.clearAll();
  90405. var features = me.features;
  90406. var cache = me.cache;
  90407. var cacheFields = me.cacheFields;
  90408. var cmZoom = me._map.getZoom();
  90409. var maxCC = me.maxCacheCount;
  90410. for (var i = 0, len = features.length; i < len; i++) {
  90411. var feature = features[i];
  90412. var feaBounds = feature.geometry.getBounds();
  90413. //剔除当前视图(地理)范围以外的数据
  90414. if (bounds && !bounds.intersectsBounds(feaBounds)) {
  90415. continue;
  90416. }
  90417. //缓存字段
  90418. var fields = feature.id + "_zoom_" + cmZoom.toString();
  90419. if (cache[fields]) {
  90420. cache[fields].updateAndAddShapes();
  90421. continue;
  90422. }
  90423. var thematicFeature = me.createThematicFeature(features[i]);
  90424. //检查 thematicFeature 是否有可视化图形
  90425. if (thematicFeature.getShapesCount() < 1) {
  90426. continue;
  90427. }
  90428. //加入缓存
  90429. cache[fields] = thematicFeature;
  90430. cacheFields.push(fields);
  90431. //缓存数量限制
  90432. if (cacheFields.length > maxCC) {
  90433. var fieldsTemp = cacheFields[0];
  90434. cacheFields.splice(0, 1);
  90435. delete cache[fieldsTemp];
  90436. }
  90437. }
  90438. me.renderer.render();
  90439. //地图漫游后,重新高亮图形
  90440. if (hoverFid && me.options.isHoverAble && me.options.isMultiHover) {
  90441. var hShapes = this.getShapesByFeatureID(hoverFid);
  90442. this.renderer.updateHoverShapes(hShapes);
  90443. }
  90444. },
  90445. /**
  90446. * @function GeoFeatureThemeLayer.prototype.createThematicFeature
  90447. * @description 创建专题要素。
  90448. * @param {FeatureVector} feature - 要创建的要素。
  90449. * @returns {Array.<FeatureVector>} 返回矢量要素。
  90450. */
  90451. createThematicFeature: function createThematicFeature(feature) {
  90452. var me = this;
  90453. var style = me.getStyleByData(feature);
  90454. if (feature.style && me.isAllowFeatureStyle) {
  90455. style = Util_Util.copyAttributesWithClip(feature.style);
  90456. }
  90457. //创建专题要素时的可选参数
  90458. var options = {};
  90459. options.nodesClipPixel = me.options.nodesClipPixel;
  90460. options.isHoverAble = me.options.isHoverAble;
  90461. options.isMultiHover = me.options.isMultiHover;
  90462. options.isClickAble = me.options.isClickAble;
  90463. options.highlightStyle = ShapeFactory.transformStyle(me.highlightStyle);
  90464. //将数据转为专题要素(Vector)
  90465. var thematicFeature = new ThemeVector(feature, me, ShapeFactory.transformStyle(style), options);
  90466. //直接添加图形到渲染器
  90467. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  90468. me.renderer.addShape(thematicFeature.shapes[m]);
  90469. }
  90470. return thematicFeature;
  90471. },
  90472. /**
  90473. * @function GeoFeatureThemeLayer.prototype.redraw
  90474. * @description 重绘该图层。
  90475. */
  90476. redraw: function redraw() {
  90477. this.clearCache();
  90478. return ThemeLayer.prototype.redraw.apply(this, arguments);
  90479. },
  90480. /**
  90481. * @function GeoFeatureThemeLayer.prototype.clearCache
  90482. * @description 清除缓存数据。
  90483. */
  90484. clearCache: function clearCache() {
  90485. this.cache = {};
  90486. this.cacheFields = [];
  90487. },
  90488. /**
  90489. * @function GeoFeatureThemeLayer.prototype.clear
  90490. * @description 清除的内容包括数据(features)、专题要素、缓存。
  90491. */
  90492. clear: function clear() {
  90493. var me = this;
  90494. me.renderer.clearAll();
  90495. me.renderer.refresh();
  90496. me.removeAllFeatures();
  90497. me.clearCache();
  90498. },
  90499. /**
  90500. * @function GeoFeatureThemeLayer.prototype.getCacheCount
  90501. * @description 获取当前缓存数量。
  90502. * @returns {number} 返回当前缓存数量。
  90503. */
  90504. getCacheCount: function getCacheCount() {
  90505. return this.cacheFields.length;
  90506. },
  90507. /**
  90508. * @function GeoFeatureThemeLayer.prototype.setMaxCacheCount
  90509. * @description 设置最大缓存数量。
  90510. * @param {number} cacheCount - 最大缓存量。
  90511. */
  90512. setMaxCacheCount: function setMaxCacheCount(cacheCount) {
  90513. if (isNaN(cacheCount)) {
  90514. return;
  90515. }
  90516. this.maxCacheCount = cacheCount;
  90517. this.isCustomSetMaxCacheCount = true;
  90518. },
  90519. /**
  90520. * @function GeoFeatureThemeLayer.prototype.getShapesByFeatureID
  90521. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  90522. * @param {number} featureID - 要素 ID。
  90523. * @returns {Array} 返回图形数组。
  90524. */
  90525. getShapesByFeatureID: function getShapesByFeatureID(featureID) {
  90526. var me = this,
  90527. list = [],
  90528. shapeList = me.renderer.getAllShapes();
  90529. if (!featureID) {
  90530. return shapeList;
  90531. }
  90532. for (var i = 0, len = shapeList.length; i < len; i++) {
  90533. var si = shapeList[i];
  90534. if (si.refDataID && featureID === si.refDataID) {
  90535. list.push(si);
  90536. }
  90537. }
  90538. return list;
  90539. }
  90540. });
  90541. ;// CONCATENATED MODULE: ./src/leaflet/overlay/UniqueThemeLayer.js
  90542. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90543. * This program are made available under the terms of the Apache License, Version 2.0
  90544. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90545. /**
  90546. * @class UniqueThemeLayer
  90547. * @deprecatedclassinstance L.supermap.uniqueThemeLayer
  90548. * @category Visualization Theme
  90549. * @classdesc 客户端单值专题图类。单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。
  90550. * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。
  90551. * @modulecategory Overlay
  90552. * @extends GeoFeatureThemeLayer
  90553. * @param {string} name - 专题图层名。
  90554. * @param {Object} options - 参数。
  90555. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  90556. * @param {number} [options.opacity=1] - 图层透明度。
  90557. * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
  90558. * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
  90559. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离。
  90560. * @param {boolean} [options.isHoverAble=false] - 图形是否在 hover 时高亮。
  90561. * @param {boolean} [options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
  90562. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  90563. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
  90564. * @param {boolean} [options.isAllowFeatureStyle=false] - 是否允许 feature 的 style 中的有效属性应用到专题图层。
  90565. * 此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature)对应专题要素赋予独立 style。
  90566. * @usage
  90567. */
  90568. var UniqueThemeLayer = GeoFeatureThemeLayer.extend({
  90569. /**
  90570. * @member {Object} UniqueThemeLayer.prototype.style
  90571. * @description 专题图样式。
  90572. */
  90573. /**
  90574. * @member {Object} UniqueThemeLayer.prototype.styleGroups
  90575. * @description 各专题类型样式组。
  90576. */
  90577. /**
  90578. * @member {Object} UniqueThemeLayer.prototype.highlightStyle
  90579. * @description 开启 hover 事件后,触发的样式风格。
  90580. */
  90581. initialize: function initialize(name, options) {
  90582. GeoFeatureThemeLayer.prototype.initialize.call(this, name, options);
  90583. //{Array.<ThemeStyle>} 图层中专题要素的样式
  90584. this.style = [];
  90585. //{string} 用于指定专题要素样式的属性字段名称。
  90586. // 此属性字段是要用户数据(feature) attributes 中包含的字段,且字段对应的值的类型必须是数值型。使用标签分组显示还需要设置 styleGroups 属性。
  90587. this.themeField = null;
  90588. //使用此属性需要设置 themeField 属性。
  90589. //1.没有同时设置 themeField 和 styleGroups,则所有专题要素都使用本图层的 style 进行渲染;
  90590. //2.同时设置 themeField 和 styleGroups,则按照 themeField 指定的字段名称获取用户数据(feature)attributes 中对应的属性值;
  90591. // a.如果属性值等于 styleGroups 数组里某个元素定义的 value 值,则此专题要素取 styleGroups 数组中该元素定义的 style 进行渲染。
  90592. // b.如果属性值不等于 styleGroups 数组里任何元素定义的 value 值,则此专题要素按照本图层的 style 进行渲染。
  90593. //此数组每个元素对象必须有两个属性:value : 与字段 themeField 相对应的属性值;style:专题要素 style。
  90594. this.styleGroups = [];
  90595. },
  90596. /**
  90597. * @private
  90598. * @function UniqueThemeLayer.prototype.getStyleByData
  90599. * @description 根据用户数据(feature)设置专题要素的 Style。
  90600. * @param {FeatureVector} feat - 用户要素数据。
  90601. * @returns {Array.<ThemeStyle>} 返回包含专题要素 style 的对象。
  90602. */
  90603. getStyleByData: function getStyleByData(feat) {
  90604. var me = this,
  90605. feature = feat,
  90606. style = Util_Util.copyAttributesWithClip({}, me.style);
  90607. var groups = me.styleGroups,
  90608. isSfInAttributes = false,
  90609. //指定的 themeField 是否是 feature 的属性字段之一
  90610. attribute = null; //属性值
  90611. var isValidStyleGroup = me.styleGroups && me.styleGroups.length > 0;
  90612. if (me.themeField && isValidStyleGroup && feature.attributes) {
  90613. var tf = me.themeField,
  90614. attributes = feature.attributes;
  90615. for (var property in attributes) {
  90616. if (tf !== property) {
  90617. continue;
  90618. }
  90619. isSfInAttributes = true;
  90620. attribute = attributes[property];
  90621. break;
  90622. }
  90623. }
  90624. //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  90625. if (isSfInAttributes) {
  90626. for (var i = 0, len = groups.length; i < len; i++) {
  90627. if (attribute.toString() === groups[i].value.toString()) {
  90628. var sty1 = groups[i].style;
  90629. style = Util_Util.copyAttributesWithClip(style, sty1);
  90630. }
  90631. }
  90632. }
  90633. return style;
  90634. }
  90635. });
  90636. var uniqueThemeLayer = function uniqueThemeLayer(name, options) {
  90637. return new UniqueThemeLayer(name, options);
  90638. };
  90639. ;// CONCATENATED MODULE: ./src/leaflet/overlay/RangeThemeLayer.js
  90640. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90641. * This program are made available under the terms of the Apache License, Version 2.0
  90642. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90643. /**
  90644. * @class RangeThemeLayer
  90645. * @deprecatedclassinstance L.supermap.rangeThemeLayer
  90646. * @category Visualization Theme
  90647. * @classdesc 范围分段专题图类。范围分段专题图对数据({@link FeatureVector})属性字段(attributes)的属性值进行分段,使用不同的颜色或符号(线型、填充)渲染不同范围段的属性值。
  90648. * 分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
  90649. * @modulecategory Overlay
  90650. * @extends GeoFeatureThemeLayer
  90651. * @param {string} name - 图层名。
  90652. * @param {Object} options - 参数。
  90653. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  90654. * @param {number} [options.opacity=1] - 图层透明度。
  90655. * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
  90656. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
  90657. * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
  90658. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离。
  90659. * @param {boolean} [options.isHoverAble=false] - 图形是否在 hover 时高亮。
  90660. * @param {boolean} [options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
  90661. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  90662. * @param {boolean} [options.isAllowFeatureStyle=false] - 是否允许 feature 的 style 中的有效属性应用到专题图层。此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature)对应专题要素赋予独立 style。
  90663. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
  90664. * @usage
  90665. */
  90666. var RangeThemeLayer = GeoFeatureThemeLayer.extend({
  90667. /**
  90668. * @member {Object} RangeThemeLayer.prototype.style
  90669. * @description 专题图样式。
  90670. */
  90671. /**
  90672. * @member {Object} RangeThemeLayer.prototype.styleGroups
  90673. * @description 各专题类型样式组。
  90674. */
  90675. /**
  90676. * @member {Object} RangeThemeLayer.prototype.highlightStyle
  90677. * @description hover 的样式风格。
  90678. */
  90679. initialize: function initialize(name, options) {
  90680. GeoFeatureThemeLayer.prototype.initialize.call(this, name, options);
  90681. //{Array.<ThemeStyle>} 图层中专题要素的样式
  90682. this.style = [];
  90683. //{string} 用于指定专题要素样式的属性字段名称。
  90684. // 此属性字段是要用户数据(feature) attributes 中包含的字段,且字段对应的值的类型必须是数值型。使用标签分组显示还需要设置 styleGroups 属性。
  90685. this.themeField = null;
  90686. //使用此属性需要设置 themeField 属性。
  90687. //1.没有同时设置 themeField 和 styleGroups,则所有专题要素都使用本图层的 style 进行渲染;
  90688. //2.同时设置 themeField 和 styleGroups,则按照 themeField 指定的字段名称获取用户数据(feature)attributes 中对应的属性值;
  90689. // a.如果属性值等于 styleGroups 数组里某个元素定义的 value 值,则此专题要素取 styleGroups 数组中该元素定义的 style 进行渲染。
  90690. // b.如果属性值不等于 styleGroups 数组里任何元素定义的 value 值,则此专题要素按照本图层的 style 进行渲染。
  90691. //此数组每个元素对象必须有两个属性:value : 与字段 themeField 相对应的属性值;style:专题要素 style。
  90692. this.styleGroups = [];
  90693. },
  90694. /**
  90695. * @function RangeThemeLayer.prototype.getStyleByData
  90696. * @description 根据用户数据( feature )设置专题要素的 Style。
  90697. * @param {FeatureVector} feat - 矢量要素对象。
  90698. * @returns {Array.<ThemeStyle>} 专题要素的 Style。
  90699. */
  90700. getStyleByData: function getStyleByData(feat) {
  90701. var me = this,
  90702. feature = feat,
  90703. style = Util_Util.copyAttributesWithClip({}, me.style);
  90704. var groups = me.styleGroups,
  90705. isSfInAttributes = false,
  90706. //指定的 themeField 是否是 feature 的属性字段之一
  90707. attribute = null; //属性值
  90708. var isValidStyleGroup = me.styleGroups && me.styleGroups.length > 0;
  90709. if (me.themeField && isValidStyleGroup && feature.attributes) {
  90710. var Sf = me.themeField,
  90711. attributes = feature.attributes;
  90712. for (var property in attributes) {
  90713. if (Sf !== property) {
  90714. continue;
  90715. }
  90716. isSfInAttributes = true;
  90717. attribute = attributes[property];
  90718. break;
  90719. }
  90720. }
  90721. //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  90722. if (isSfInAttributes) {
  90723. for (var i = 0, len = groups.length; i < len; i++) {
  90724. var isContianed = i === len - 1 ? attribute >= groups[i].start && attribute <= groups[i].end : attribute >= groups[i].start && attribute < groups[i].end;
  90725. if (isContianed) {
  90726. var sty1 = groups[i].style;
  90727. style = Util_Util.copyAttributesWithClip(style, sty1);
  90728. }
  90729. }
  90730. }
  90731. return style;
  90732. }
  90733. });
  90734. var rangeThemeLayer = function rangeThemeLayer(name, options) {
  90735. return new RangeThemeLayer(name, options);
  90736. };
  90737. ;// CONCATENATED MODULE: ./src/leaflet/overlay/LabelThemeLayer.js
  90738. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  90739. * This program are made available under the terms of the Apache License, Version 2.0
  90740. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  90741. /**
  90742. * @class LabelThemeLayer
  90743. * @deprecatedclassinstance L.supermap.labelThemeLayer
  90744. * @classdesc 标签专题图类。
  90745. * @category Visualization Theme
  90746. * @modulecategory Overlay
  90747. * @extends GeoFeatureThemeLayer
  90748. * @param {string} name - 图层名。
  90749. * @param {Object} options - 参数。
  90750. * @param {string} options.themeFields - 指定创建专题图字段。
  90751. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  90752. * @param {boolean} [options.isAvoid=true] - 是否进行地图边缘的避让处理。
  90753. * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
  90754. * @param {boolean} [options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  90755. * @param {number} [options.opacity=1] - 图层透明度。
  90756. * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
  90757. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离。
  90758. * @param {boolean} [options.isHoverAble=false] - 图形是否在 hover 时高亮。
  90759. * @param {boolean} [options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
  90760. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  90761. * @param {boolean} [options.isAllowFeatureStyle=false] - 是否允许 feature 的 style 中的有效属性应用到专题图层。此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature)对应专题要素赋予独立 style。
  90762. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
  90763. * @usage
  90764. */
  90765. var LabelThemeLayer = GeoFeatureThemeLayer.extend({
  90766. /**
  90767. * @member {Object} LabelThemeLayer.prototype.style
  90768. * @description 专题图样式。
  90769. */
  90770. /**
  90771. * @member {Object} LabelThemeLayer.prototype.styleGroups
  90772. * @description 各专题类型样式组。
  90773. */
  90774. /**
  90775. * @member {Object} LabelThemeLayer.prototype.highlightStyle
  90776. * @description 开启 hover 事件后,触发的样式风格。
  90777. */
  90778. options: {
  90779. //是否进行压盖处理,如果设为true,将隐藏被压盖的标签,默认为true。
  90780. isOverLay: true,
  90781. //是否进行地图边缘的避让处理,如果设为true,将把与地图边缘相交的标签移到地图范围内,默认为 true,在地图边缘处做避让处理。
  90782. isAvoid: true
  90783. },
  90784. initialize: function initialize(name, options) {
  90785. GeoFeatureThemeLayer.prototype.initialize.call(this, name, options);
  90786. external_L_default().Util.setOptions(this, options);
  90787. //图层中专题要素的样式
  90788. this.style = [];
  90789. //用于指定专题要素样式的属性字段名称。
  90790. // 此属性字段是要用户数据(feature) attributes 中包含的字段,且字段对应的值的类型必须是数值型。使用标签分组显示还需要设置 styleGroups 属性。
  90791. this.themeField = null;
  90792. //使用此属性需要设置 themeField 属性。
  90793. //1.没有同时设置 themeField 和 styleGroups,则所有专题要素都使用本图层的 style 进行渲染;
  90794. //2.同时设置 themeField 和 styleGroups,则按照 themeField 指定的字段名称获取用户数据(feature)attributes 中对应的属性值;
  90795. // a.如果属性值等于 styleGroups 数组里某个元素定义的 value 值,则此专题要素取 styleGroups 数组中该元素定义的 style 进行渲染。
  90796. // b.如果属性值不等于 styleGroups 数组里任何元素定义的 value 值,则此专题要素按照本图层的 style 进行渲染。
  90797. //此数组每个元素对象必须有两个属性:value : 与字段 themeField 相对应的属性值;style:专题要素 style。
  90798. this.styleGroups = [];
  90799. this.defaultStyle = {
  90800. //默认文本样式
  90801. fontColor: "#000000",
  90802. fontOpacity: 1,
  90803. fontSize: "12px",
  90804. fontStyle: "normal",
  90805. fontWeight: "normal",
  90806. labelAlign: "cm",
  90807. labelXOffset: 0,
  90808. labelYOffset: 0,
  90809. labelRotation: 0,
  90810. //默认样式
  90811. fill: false,
  90812. fillColor: "#ee9900",
  90813. fillOpacity: 0.4,
  90814. stroke: false,
  90815. strokeColor: "#ee9900",
  90816. strokeOpacity: 1,
  90817. strokeWidth: 1,
  90818. strokeLinecap: "round",
  90819. strokeDashstyle: "solid",
  90820. //默认显示背景框
  90821. labelRect: true,
  90822. //对用户隐藏但必须保持此值的属性
  90823. //cursor: "pointer",
  90824. labelSelect: true,
  90825. //用 _isGeoTextStrategyStyle 标记此style,携带此类style的要素特指GeoText策略中的标签要素
  90826. _isGeoTextStrategyStyle: true
  90827. };
  90828. //获取标签像素 bounds 的方式。0 - 表示通过文本类容和文本风格计算获取像素范围,现在支持中文、英文; 1 - 表示通过绘制的文本标签获取像素范围,支持各个语种的文字范围获取,但性能消耗较大(尤其是采用SVG渲染)。默认值为0。
  90829. this.getPxBoundsMode = 0;
  90830. this.labelFeatures = [];
  90831. },
  90832. /**
  90833. * @function LabelThemeLayer.prototype.onAdd
  90834. * @description 添加专题图。
  90835. * @param {L.Map} map - Leaflet Map 对象。
  90836. * @private
  90837. */
  90838. onAdd: function onAdd(map) {
  90839. GeoFeatureThemeLayer.prototype.onAdd.call(this, map);
  90840. this.container.style.zIndex = 200;
  90841. },
  90842. /**
  90843. * @function LabelThemeLayer.prototype.redrawThematicFeatures
  90844. * @description 重绘所有专题要素。
  90845. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
  90846. * 地图漫游时调用此方法进行图层刷新。
  90847. * @param {L.Bounds} bounds - 重绘范围。
  90848. */
  90849. redrawThematicFeatures: function redrawThematicFeatures(bounds) {
  90850. if (this.features.length > 0 && this.labelFeatures.length == 0) {
  90851. var feats = this.setLabelsStyle(this.features);
  90852. for (var i = 0, len = feats.length; i < len; i++) {
  90853. this.labelFeatures.push(feats[i]);
  90854. }
  90855. }
  90856. this.features = this.getDrawnLabels(this.labelFeatures);
  90857. GeoFeatureThemeLayer.prototype.redrawThematicFeatures.call(this, bounds);
  90858. },
  90859. /**
  90860. * @function LabelThemeLayer.prototype.removeFeatures
  90861. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
  90862. * @param {(Array.<FeatureVector>|FeatureVector|Function)} features - 要删除的要素或用于条件删除的回调函数。
  90863. */
  90864. removeFeatures: function removeFeatures(features) {
  90865. // eslint-disable-line no-unused-vars
  90866. this.labelFeatures = [];
  90867. GeoFeatureThemeLayer.prototype.removeFeatures.call(this, features);
  90868. },
  90869. /**
  90870. * @function LabelThemeLayer.prototype.removeAllFeatures
  90871. * @description 清除当前图层所有的矢量要素。
  90872. */
  90873. removeAllFeatures: function removeAllFeatures() {
  90874. this.labelFeatures = [];
  90875. GeoFeatureThemeLayer.prototype.removeAllFeatures.call(this, arguments);
  90876. },
  90877. /**
  90878. * @function LabelThemeLayer.prototype.getDrawnLabels
  90879. * @description 获取经(压盖)处理后将要绘制在图层上的标签要素。
  90880. * @param {Array.<FeatureVector>} labelFeatures - 所有标签要素的数组。
  90881. * @returns {Array.<FeatureVector>} 最终要绘制的标签要素数组。
  90882. */
  90883. getDrawnLabels: function getDrawnLabels(labelFeatures) {
  90884. var feas = [],
  90885. //最终要绘制的标签要素集
  90886. fea,
  90887. //最终要绘制的标签要素
  90888. fi,
  90889. //临时标签要素,用户的第i个标签
  90890. labelsB = [],
  90891. //不产生压盖的标签要素范围集
  90892. styTmp,
  90893. //用于临时存储要素style的变量
  90894. feaSty,
  90895. //标签要素最终的style
  90896. // styleTemp用于屏蔽文本style中带有偏移性质style属性,偏移已经在计算bounds的过程中参与了运算,
  90897. // 所以在最终按照bounds来绘制标签时,需屏蔽style中带有偏移性质属性,否则文本的偏移量将扩大一倍。
  90898. styleTemp = {
  90899. labelAlign: "cm",
  90900. labelXOffset: 0,
  90901. labelYOffset: 0
  90902. };
  90903. var map = this._map;
  90904. var mapSize = map.getSize();
  90905. var zoom = map.getZoom();
  90906. //对用户的每个标签要素进行处理与判断
  90907. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  90908. fi = labelFeatures[i];
  90909. //检查fi的style在避让中是否被改变,如果改变,重新设置要素的style
  90910. if (fi.isStyleChange || fi.isStyleChange === undefined) {
  90911. fi = this.setStyle(fi);
  90912. }
  90913. //标签最终的中心点像素位置 (偏移后)
  90914. var loc = this.getLabelPxLocation(fi);
  90915. //过滤掉地图范围外的标签 (偏移后)
  90916. if (loc.x >= 0 && loc.x <= mapSize.x && loc.y >= 0 && loc.y <= mapSize.y) {
  90917. //根据当前地图缩放级别过滤标签
  90918. if (fi.style.minZoomLevel > -1) {
  90919. if (zoom <= fi.style.minZoomLevel) {
  90920. continue;
  90921. }
  90922. }
  90923. if (fi.style.maxZoomLevel > -1) {
  90924. if (zoom > fi.style.maxZoomLevel) {
  90925. continue;
  90926. }
  90927. }
  90928. //计算标签bounds
  90929. var boundsQuad = null;
  90930. if (fi.isStyleChange) {
  90931. fi.isStyleChange = null;
  90932. boundsQuad = this.calculateLabelBounds(fi, loc);
  90933. } else {
  90934. if (fi.geometry.bsInfo.w && fi.geometry.bsInfo.h) {
  90935. //使用calculateLabelBounds2可以提高bounds的计算效率,尤其是在getPxBoundsMode = 1时
  90936. boundsQuad = this.calculateLabelBounds2(fi, loc);
  90937. } else {
  90938. boundsQuad = this.calculateLabelBounds(fi, loc);
  90939. }
  90940. }
  90941. //避让处理 -start
  90942. var mapViewBounds = new Bounds(0, mapSize.y, mapSize.x, 0),
  90943. //地图像素范围
  90944. quadlen = boundsQuad.length;
  90945. if (this.options.isAvoid) {
  90946. var avoidInfo = this.getAvoidInfo(mapViewBounds, boundsQuad); //避让信息
  90947. if (avoidInfo) {
  90948. //横向(x方向)上的避让
  90949. if (avoidInfo.aspectW === "left") {
  90950. fi.style.labelXOffset += avoidInfo.offsetX;
  90951. for (var j = 0; j < quadlen; j++) {
  90952. boundsQuad[j].x += avoidInfo.offsetX;
  90953. }
  90954. } else if (avoidInfo.aspectW === "right") {
  90955. fi.style.labelXOffset += -avoidInfo.offsetX;
  90956. for (var _j2 = 0; _j2 < quadlen; _j2++) {
  90957. boundsQuad[_j2].x += -avoidInfo.offsetX;
  90958. }
  90959. }
  90960. //纵向(y方向)上的避让
  90961. if (avoidInfo.aspectH === "top") {
  90962. fi.style.labelYOffset += avoidInfo.offsetY;
  90963. for (var _j4 = 0; _j4 < quadlen; _j4++) {
  90964. boundsQuad[_j4].y += avoidInfo.offsetY;
  90965. }
  90966. } else if (avoidInfo.aspectH === "bottom") {
  90967. fi.style.labelYOffset += -avoidInfo.offsetY;
  90968. for (var _j6 = 0; _j6 < quadlen; _j6++) {
  90969. boundsQuad[_j6].y += -avoidInfo.offsetY;
  90970. }
  90971. }
  90972. //如果style发生变化,记录下来
  90973. fi.isStyleChange = true;
  90974. }
  90975. }
  90976. //避让处理 -end
  90977. //压盖处理 -start
  90978. if (this.options.isOverLay) {
  90979. //是否压盖
  90980. var isOL = false;
  90981. if (i != 0) {
  90982. for (var _j8 = 0; _j8 < labelsB.length; _j8++) {
  90983. //压盖判断
  90984. if (this.isQuadrilateralOverLap(boundsQuad, labelsB[_j8])) {
  90985. isOL = true;
  90986. break;
  90987. }
  90988. }
  90989. }
  90990. if (isOL) {
  90991. continue;
  90992. } else {
  90993. labelsB.push(boundsQuad);
  90994. }
  90995. }
  90996. //压盖处理 -end
  90997. //背景(事件)-start
  90998. //将标签像素范围转为地理范围
  90999. var geoBs = [];
  91000. for (var _j10 = 0; _j10 < quadlen - 1; _j10++) {
  91001. geoBs.push(map.containerPointToLatLng(boundsQuad[_j10]));
  91002. }
  91003. //屏蔽有偏移性质的style属性,偏移量在算bounds时已经加入计算
  91004. var leftBottom = geoBs[3];
  91005. var rightTop = geoBs[1];
  91006. var bounds = new Bounds(leftBottom.lng, leftBottom.lat, rightTop.lng, rightTop.lat);
  91007. var center = bounds.getCenterLonLat();
  91008. var label = new GeoText(center.lon, center.lat, fi.attributes[this.themeField]);
  91009. label.calculateBounds();
  91010. styTmp = Util_Util.cloneObject(fi.style);
  91011. feaSty = Util_Util.cloneObject(Util_Util.copyAttributes(styTmp, styleTemp));
  91012. fea = new Vector(label, fi.attributes, feaSty);
  91013. //赋予id
  91014. fea.id = fi.id;
  91015. fea.fid = fi.fid;
  91016. feas.push(fea);
  91017. }
  91018. }
  91019. //返回最终要绘制的标签要素
  91020. return feas;
  91021. },
  91022. /**
  91023. * @function LabelThemeLayer.prototype.getStyleByData
  91024. * @description 根据用户数据(feature)设置专题要素的 Style。
  91025. * @param {FeatureVector} feat - 矢量要素对象。
  91026. * @returns {Array.<ThemeStyle>} 专题要素的 Style。
  91027. */
  91028. getStyleByData: function getStyleByData(feat) {
  91029. var feature = feat;
  91030. feature.style = Util_Util.copyAttributes(feature.style, this.defaultStyle);
  91031. //将style赋给标签
  91032. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  91033. this.style.fontSize = "12px";
  91034. }
  91035. feature.style = Util_Util.copyAttributes(feature.style, this.style);
  91036. if (this.themeField && this.styleGroups && feature.attributes) {
  91037. var Sf = this.themeField;
  91038. var attributes = feature.attributes;
  91039. var groups = this.styleGroups;
  91040. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  91041. var attr = null; //属性值
  91042. for (var property in attributes) {
  91043. if (Sf === property) {
  91044. isSfInAttrs = true;
  91045. attr = attributes[property];
  91046. break;
  91047. }
  91048. }
  91049. //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  91050. if (isSfInAttrs) {
  91051. for (var i = 0, len = groups.length; i < len; i++) {
  91052. if (attr >= groups[i].start && attr < groups[i].end) {
  91053. var sty1 = groups[i].style;
  91054. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  91055. sty1.fontSize = "12px";
  91056. }
  91057. feature.style = Util_Util.copyAttributes(feature.style, sty1);
  91058. }
  91059. }
  91060. }
  91061. feature.style.label = feature.attributes[this.themeField];
  91062. }
  91063. return feature.style;
  91064. },
  91065. /**
  91066. * @function LabelThemeLayer.prototype.setLabelsStyle
  91067. * @description 设置标签要素的 Style。
  91068. * @param {Array.<FeatureVector>} labelFeatures - 需要设置 Style 的标签要素数组。
  91069. * @returns {Array.<FeatureVector>} 赋予 Style 后的标签要素数组。
  91070. */
  91071. setLabelsStyle: function setLabelsStyle(labelFeatures) {
  91072. var fea,
  91073. labelFeas = [];
  91074. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  91075. var feature = labelFeatures[i];
  91076. if (feature.geometry.CLASS_NAME === "SuperMap.Geometry.GeoText") {
  91077. //设置标签的Style
  91078. if (feature.geometry.bsInfo.w || feature.geometry.bsInfo.h) {
  91079. feature.geometry.bsInfo.w = null;
  91080. feature.geometry.bsInfo.h = null;
  91081. feature.geometry.labelWTmp = null;
  91082. }
  91083. fea = this.setStyle(feature);
  91084. //为标签要素指定图层
  91085. fea.layer = this.layer;
  91086. labelFeas.push(fea);
  91087. } else {
  91088. return labelFeatures;
  91089. }
  91090. }
  91091. return labelFeas;
  91092. },
  91093. /**
  91094. * @function LabelThemeLayer.prototype.setStyle
  91095. * @description 设置标签要素的 Style。
  91096. * @param {FeatureVector} feat - 需要赋予 style 的要素。
  91097. */
  91098. setStyle: function setStyle(feat) {
  91099. var feature = feat;
  91100. feature.style = Util_Util.copyAttributes(feature.style, this.defaultStyle);
  91101. //将style赋给标签
  91102. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  91103. this.style.fontSize = "12px";
  91104. }
  91105. feature.style = Util_Util.copyAttributes(feature.style, this.style);
  91106. if (this.groupField && this.styleGroups && feature.attributes) {
  91107. var Sf = this.groupField;
  91108. var Attrs = feature.attributes;
  91109. var Gro = this.styleGroups;
  91110. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  91111. var attr = null; //属性值
  91112. for (var property in Attrs) {
  91113. if (Sf === property) {
  91114. isSfInAttrs = true;
  91115. attr = Attrs[property];
  91116. break;
  91117. }
  91118. }
  91119. //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  91120. if (isSfInAttrs) {
  91121. for (var i = 0, len = Gro.length; i < len; i++) {
  91122. if (attr >= Gro[i].start && attr < Gro[i].end) {
  91123. //feature.style = Util.copyAttributes(feature.style, this.defaultStyle);
  91124. var sty1 = Gro[i].style;
  91125. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  91126. sty1.fontSize = "12px";
  91127. }
  91128. feature.style = Util_Util.copyAttributes(feature.style, sty1);
  91129. }
  91130. }
  91131. }
  91132. }
  91133. //将文本内容赋到标签要素的style上
  91134. feature.style.label = feature.geometry.text;
  91135. return feature;
  91136. },
  91137. /**
  91138. * @function LabelThemeLayer.prototype.getLabelPxLocation
  91139. * @description 获取标签要素的像素坐标。
  91140. * @param {FeatureVector} feature - 标签要素。
  91141. * @returns {L.Point} 标签位置。
  91142. */
  91143. getLabelPxLocation: function getLabelPxLocation(feature) {
  91144. var geoText = feature.geometry;
  91145. var styleTmp = feature.style;
  91146. //将标签的地理位置转为像素位置
  91147. var locationTmp = geoText.getCentroid();
  91148. var locTmp = this._map.latLngToContainerPoint(!this.options.alwaysMapCRS ? external_L_default().latLng(locationTmp.y, locationTmp.x) : this._map.options.crs.unproject(external_L_default().point(locationTmp.x, locationTmp.y)));
  91149. var loc = external_L_default().point(locTmp.x, locTmp.y);
  91150. //偏移处理
  91151. if (styleTmp.labelXOffset || styleTmp.labelYOffset) {
  91152. var xOffset = isNaN(styleTmp.labelXOffset) ? 0 : styleTmp.labelXOffset;
  91153. var yOffset = isNaN(styleTmp.labelYOffset) ? 0 : styleTmp.labelYOffset;
  91154. var point = loc.add(external_L_default().point(xOffset, -yOffset));
  91155. return external_L_default().point(point.x, point.y);
  91156. } else {
  91157. return external_L_default().point(loc.x, loc.y);
  91158. }
  91159. },
  91160. /**
  91161. * @function LabelThemeLayer.prototype.calculateLabelBounds
  91162. * @description 获得标签要素的最终范围。
  91163. *
  91164. * @param {FeatureVector} feature - 需要计算 bounds 的标签要素数。
  91165. * @param {L.Point} loc - 标签位置。
  91166. *
  91167. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  91168. */
  91169. calculateLabelBounds: function calculateLabelBounds(feature, loc) {
  91170. var geoText = feature.geometry;
  91171. //标签范围(未旋转前)
  91172. var labB = null;
  91173. var labelInfo = null;
  91174. //获取bounds的方式
  91175. if (this.getPxBoundsMode == 0) {
  91176. labB = geoText.getLabelPxBoundsByText(loc, feature.style);
  91177. } else if (this.getPxBoundsMode === 1) {
  91178. //canvas
  91179. labelInfo = this.getLabelInfo(feature.geometry.getCentroid(), feature.style);
  91180. labB = geoText.getLabelPxBoundsByLabel(loc, labelInfo.w, labelInfo.h, feature.style);
  91181. } else {
  91182. return null;
  91183. }
  91184. //旋转Bounds
  91185. var boundsQuad = [];
  91186. if (feature.style.labelRotation % 180 == 0) {
  91187. boundsQuad = [{
  91188. "x": labB.left,
  91189. "y": labB.top
  91190. }, {
  91191. "x": labB.right,
  91192. "y": labB.top
  91193. }, {
  91194. "x": labB.right,
  91195. "y": labB.bottom
  91196. }, {
  91197. "x": labB.left,
  91198. "y": labB.bottom
  91199. }, {
  91200. "x": labB.left,
  91201. "y": labB.top
  91202. }];
  91203. } else {
  91204. boundsQuad = this.rotationBounds(labB, loc, feature.style.labelRotation);
  91205. }
  91206. //重置GeoText的bounds
  91207. geoText.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  91208. return boundsQuad;
  91209. },
  91210. /**
  91211. * @function LabelThemeLayer.prototype.calculateLabelBounds2
  91212. * @description 获得标签要素的最终范围的另一种算法(通过记录下的标签宽高),提高计算 bounds 的效率。
  91213. *
  91214. * @param {FeatureVector} feature - 需要计算 bounds 的标签要素数。
  91215. * @param {L.Point} loc - 标签位置。
  91216. *
  91217. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  91218. */
  91219. calculateLabelBounds2: function calculateLabelBounds2(feature, loc) {
  91220. var labB, left, bottom, top, right;
  91221. var labelSize = feature.geometry.bsInfo;
  91222. var style = feature.style;
  91223. var locationPx = Util_Util.cloneObject(loc);
  91224. //处理文字对齐
  91225. if (style.labelAlign && style.labelAlign !== "cm") {
  91226. switch (style.labelAlign) {
  91227. case "lt":
  91228. locationPx.x += labelSize.w / 2;
  91229. locationPx.y += labelSize.h / 2;
  91230. break;
  91231. case "lm":
  91232. locationPx.x += labelSize.w / 2;
  91233. break;
  91234. case "lb":
  91235. locationPx.x += labelSize.w / 2;
  91236. locationPx.y -= labelSize.h / 2;
  91237. break;
  91238. case "ct":
  91239. locationPx.y += labelSize.h / 2;
  91240. break;
  91241. case "cb":
  91242. locationPx.y -= labelSize.h / 2;
  91243. break;
  91244. case "rt":
  91245. locationPx.x -= labelSize.w / 2;
  91246. locationPx.y += labelSize.h / 2;
  91247. break;
  91248. case "rm":
  91249. locationPx.x -= labelSize.w / 2;
  91250. break;
  91251. case "rb":
  91252. locationPx.x -= labelSize.w / 2;
  91253. locationPx.y -= labelSize.h / 2;
  91254. break;
  91255. default:
  91256. break;
  91257. }
  91258. }
  91259. left = locationPx.x - labelSize.w / 2;
  91260. bottom = locationPx.y + labelSize.h / 2;
  91261. //处理斜体字
  91262. if (style.fontStyle && style.fontStyle === "italic") {
  91263. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  91264. } else {
  91265. right = locationPx.x + labelSize.w / 2;
  91266. }
  91267. top = locationPx.y - labelSize.h / 2;
  91268. labB = new Bounds(left, bottom, right, top);
  91269. //旋转Bounds
  91270. var boundsQuad = [];
  91271. if (style.labelRotation % 180 == 0) {
  91272. boundsQuad = [{
  91273. "x": labB.left,
  91274. "y": labB.top
  91275. }, {
  91276. "x": labB.right,
  91277. "y": labB.top
  91278. }, {
  91279. "x": labB.right,
  91280. "y": labB.bottom
  91281. }, {
  91282. "x": labB.left,
  91283. "y": labB.bottom
  91284. }, {
  91285. "x": labB.left,
  91286. "y": labB.top
  91287. }];
  91288. } else {
  91289. boundsQuad = this.rotationBounds(labB, loc, style.labelRotation);
  91290. }
  91291. //重置GeoText的bounds
  91292. feature.geometry.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  91293. return boundsQuad;
  91294. },
  91295. /**
  91296. * @function LabelThemeLayer.prototype.getLabelInfo
  91297. * @description 根据当前位置获取绘制后的标签信息,包括标签的宽,高和行数等。
  91298. * @returns {Object} 绘制后的标签信息。
  91299. */
  91300. getLabelInfo: function getLabelInfo(location, style) {
  91301. var LABEL_ALIGN = {
  91302. "l": "left",
  91303. "r": "right",
  91304. "t": "top",
  91305. "b": "bottom"
  91306. },
  91307. LABEL_FACTOR = {
  91308. "l": 0,
  91309. "r": -1,
  91310. "t": 0,
  91311. "b": -1
  91312. };
  91313. style = Util_Util.extend({
  91314. fontColor: "#000000",
  91315. labelAlign: "cm"
  91316. }, style);
  91317. var pt = this.getLocalXY(location);
  91318. var labelWidth = 0;
  91319. if (style.labelXOffset || style.labelYOffset) {
  91320. var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
  91321. var yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset;
  91322. pt[0] += xOffset;
  91323. pt[1] -= yOffset;
  91324. }
  91325. var canvas = document.createElement('canvas');
  91326. canvas.globalAlpha = 0;
  91327. canvas.lineWidth = 1;
  91328. var ctx = canvas.getContext("2d");
  91329. ctx.fillStyle = style.fontColor;
  91330. ctx.globalAlpha = style.fontOpacity || 1.0;
  91331. var fontStyle = [style.fontStyle ? style.fontStyle : "normal", "normal", style.fontWeight ? style.fontWeight : "normal", style.fontSize ? style.fontSize : "1em", style.fontFamily ? style.fontFamily : "sans-serif"].join(" ");
  91332. var labelRows = style.label.split('\n');
  91333. var numRows = labelRows.length;
  91334. var vfactor, lineHeight, labelWidthTmp;
  91335. if (ctx.fillText) {
  91336. // HTML5
  91337. ctx.font = fontStyle;
  91338. ctx.textAlign = LABEL_ALIGN[style.labelAlign[0]] || "center";
  91339. ctx.textBaseline = LABEL_ALIGN[style.labelAlign[1]] || "middle";
  91340. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  91341. if (vfactor == null) {
  91342. vfactor = -.5;
  91343. }
  91344. lineHeight = ctx.measureText('Mg').height || ctx.measureText('xx').width;
  91345. pt[1] += lineHeight * vfactor * (numRows - 1);
  91346. for (var i = 0; i < numRows; i++) {
  91347. labelWidthTmp = ctx.measureText(labelRows[i]).width;
  91348. if (labelWidth < labelWidthTmp) {
  91349. labelWidth = labelWidthTmp;
  91350. }
  91351. }
  91352. } else if (ctx.mozDrawText) {
  91353. // Mozilla pre-Gecko1.9.1 (<FF3.1)
  91354. ctx.mozTextStyle = fontStyle;
  91355. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  91356. if (vfactor == null) {
  91357. vfactor = -.5;
  91358. }
  91359. lineHeight = ctx.mozMeasureText('xx');
  91360. pt[1] += lineHeight * (1 + vfactor * numRows);
  91361. for (var _i2 = 0; _i2 < numRows; _i2++) {
  91362. labelWidthTmp = ctx.measureText(labelRows[_i2]).width;
  91363. if (labelWidth < labelWidthTmp) {
  91364. labelWidth = labelWidthTmp;
  91365. }
  91366. }
  91367. }
  91368. var labelInfo = {}; //标签信息
  91369. if (labelWidth) {
  91370. labelInfo.w = labelWidth; //标签的宽
  91371. } else {
  91372. return null;
  91373. }
  91374. labelInfo.h = style.fontSize; //一行标签的高
  91375. labelInfo.rows = labelRows.length; //标签的行数
  91376. return labelInfo;
  91377. },
  91378. /**
  91379. * @function LabelThemeLayer.prototype.rotationBounds
  91380. * @description 旋转 bounds。
  91381. *
  91382. * @param {Bounds} bounds - 要旋转的 bounds。
  91383. * @param {Object} rotationCenterPoi - 旋转中心点对象,此对象含有属性x(横坐标),属性y(纵坐标)。
  91384. * @param {number} angle - 旋转角度(顺时针)。
  91385. *
  91386. * @returns {Array.<Object>} bounds旋转后形成的多边形节点数组。是一个四边形,形如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  91387. */
  91388. rotationBounds: function rotationBounds(bounds, rotationCenterPoi, angle) {
  91389. var ltPoi = external_L_default().point(bounds.left, bounds.top);
  91390. var rtPoi = external_L_default().point(bounds.right, bounds.top);
  91391. var rbPoi = external_L_default().point(bounds.right, bounds.bottom);
  91392. var lbPoi = external_L_default().point(bounds.left, bounds.bottom);
  91393. var ver = [];
  91394. ver.push(this.getRotatedLocation(ltPoi.x, ltPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  91395. ver.push(this.getRotatedLocation(rtPoi.x, rtPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  91396. ver.push(this.getRotatedLocation(rbPoi.x, rbPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  91397. ver.push(this.getRotatedLocation(lbPoi.x, lbPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  91398. //bounds旋转后形成的多边形节点数组
  91399. var quad = [];
  91400. for (var i = 0; i < ver.length; i++) {
  91401. quad.push({
  91402. "x": ver[i].x,
  91403. "y": ver[i].y
  91404. });
  91405. }
  91406. quad.push({
  91407. "x": ver[0].x,
  91408. "y": ver[0].y
  91409. });
  91410. return quad;
  91411. },
  91412. /**
  91413. * @function LabelThemeLayer.prototype.getRotatedLocation
  91414. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)。
  91415. *
  91416. * @param {number} x - 旋转点横坐标。
  91417. * @param {number} y - 旋转点纵坐标。
  91418. * @param {number} rx - 旋转中心点横坐标。
  91419. * @param {number} ry - 旋转中心点纵坐标。
  91420. * @param {number} angle - 旋转角度。
  91421. *
  91422. * @returns {Object} 旋转后的坐标位置对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  91423. */
  91424. getRotatedLocation: function getRotatedLocation(x, y, rx, ry, angle) {
  91425. var loc = {},
  91426. x0,
  91427. y0;
  91428. y = -y;
  91429. ry = -ry;
  91430. angle = -angle; //顺时针旋转
  91431. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  91432. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  91433. loc.x = x0;
  91434. loc.y = -y0;
  91435. return loc;
  91436. },
  91437. /**
  91438. * @function LabelThemeLayer.prototype.getAvoidInfo
  91439. * @description 获取避让的信息。
  91440. *
  91441. * @param {Bounds} bounds - 地图像素范围。
  91442. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  91443. *
  91444. * @returns {Object} 避让的信息。
  91445. */
  91446. getAvoidInfo: function getAvoidInfo(bounds, quadrilateral) {
  91447. if (quadrilateral.length !== 5) {
  91448. return null;
  91449. } //不是四边形
  91450. //将bound序列化为点数组形式
  91451. var bounddQuad = [{
  91452. "x": bounds.left,
  91453. "y": bounds.top
  91454. }, {
  91455. "x": bounds.right,
  91456. "y": bounds.top
  91457. }, {
  91458. "x": bounds.right,
  91459. "y": bounds.bottom
  91460. }, {
  91461. "x": bounds.left,
  91462. "y": bounds.bottom
  91463. }, {
  91464. "x": bounds.left,
  91465. "y": bounds.top
  91466. }];
  91467. var isIntersection = false,
  91468. bqLen = bounddQuad.length,
  91469. quadLen = quadrilateral.length;
  91470. var offsetX = 0,
  91471. offsetY = 0,
  91472. aspectH = "",
  91473. aspectW = "";
  91474. for (var i = 0; i < bqLen - 1; i++) {
  91475. for (var j = 0; j < quadLen - 1; j++) {
  91476. var isLineIn = Util_Util.lineIntersection(bounddQuad[i], bounddQuad[i + 1], quadrilateral[j], quadrilateral[j + 1]);
  91477. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  91478. //设置避让信息
  91479. setInfo(quadrilateral[j]);
  91480. setInfo(quadrilateral[j + 1]);
  91481. isIntersection = true;
  91482. }
  91483. }
  91484. }
  91485. if (isIntersection) {
  91486. //组织避让操作所需的信息
  91487. return {
  91488. "aspectW": aspectW,
  91489. "aspectH": aspectH,
  91490. "offsetX": offsetX,
  91491. "offsetY": offsetY
  91492. };
  91493. } else {
  91494. return null;
  91495. }
  91496. //内部函数:设置避让信息
  91497. //参数:vec-{Object} quadrilateral四边形单个节点。如:{"x":1,"y":1}。
  91498. function setInfo(vec) {
  91499. //四边形不在bounds内的节点
  91500. if (!bounds.contains(vec.x, vec.y)) {
  91501. //bounds的Top边
  91502. if (vec.y < bounds.top) {
  91503. var oY = Math.abs(bounds.top - vec.y);
  91504. if (oY > offsetY) {
  91505. offsetY = oY;
  91506. aspectH = "top";
  91507. }
  91508. }
  91509. //bounds的Bottom边
  91510. if (vec.y > bounds.bottom) {
  91511. var _oY = Math.abs(vec.y - bounds.bottom);
  91512. if (_oY > offsetY) {
  91513. offsetY = _oY;
  91514. aspectH = "bottom";
  91515. }
  91516. }
  91517. //bounds的left边
  91518. if (vec.x < bounds.left) {
  91519. var oX = Math.abs(bounds.left - vec.x);
  91520. if (oX > offsetX) {
  91521. offsetX = oX;
  91522. aspectW = "left";
  91523. }
  91524. }
  91525. //bounds的right边
  91526. if (vec.x > bounds.right) {
  91527. var _oX = Math.abs(vec.x - bounds.right);
  91528. if (_oX > offsetX) {
  91529. offsetX = _oX;
  91530. aspectW = "right";
  91531. }
  91532. }
  91533. }
  91534. }
  91535. },
  91536. /**
  91537. * @function LabelThemeLayer.prototype.isQuadrilateralOverLap
  91538. * @description 判断两个四边形是否有压盖。
  91539. *
  91540. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  91541. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  91542. *
  91543. * @returns {boolean} 是否压盖,true表示压盖。
  91544. */
  91545. isQuadrilateralOverLap: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  91546. var quadLen = quadrilateral.length,
  91547. quad2Len = quadrilateral2.length;
  91548. if (quadLen !== 5 || quad2Len !== 5) {
  91549. return null;
  91550. } //不是四边形
  91551. var OverLap = false;
  91552. //如果两四边形互不包含对方的节点,则两个四边形不相交
  91553. for (var i = 0; i < quadLen; i++) {
  91554. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  91555. OverLap = true;
  91556. break;
  91557. }
  91558. }
  91559. for (var _i4 = 0; _i4 < quad2Len; _i4++) {
  91560. if (this.isPointInPoly(quadrilateral2[_i4], quadrilateral)) {
  91561. OverLap = true;
  91562. break;
  91563. }
  91564. }
  91565. //加上两矩形十字相交的情况
  91566. for (var _i6 = 0; _i6 < quadLen - 1; _i6++) {
  91567. if (OverLap) {
  91568. break;
  91569. }
  91570. for (var j = 0; j < quad2Len - 1; j++) {
  91571. var isLineIn = Util_Util.lineIntersection(quadrilateral[_i6], quadrilateral[_i6 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  91572. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  91573. OverLap = true;
  91574. break;
  91575. }
  91576. }
  91577. }
  91578. return OverLap;
  91579. },
  91580. /**
  91581. * @function LabelThemeLayer.prototype.isPointInPoly
  91582. * @description 判断一个点是否在多边形里面(射线法)。
  91583. *
  91584. * @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  91585. * @param {Array.<Object>} poly - 多边形节点数组。例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  91586. * @returns {boolean} 点是否在多边形内。
  91587. */
  91588. isPointInPoly: function isPointInPoly(pt, poly) {
  91589. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  91590. (poly[i].y <= pt.y && pt.y < poly[j].y || poly[j].y <= pt.y && pt.y < poly[i].y) && pt.x < (poly[j].x - poly[i].x) * (pt.y - poly[i].y) / (poly[j].y - poly[i].y) + poly[i].x && (isIn = !isIn);
  91591. }
  91592. return isIn;
  91593. }
  91594. });
  91595. var labelThemeLayer = function labelThemeLayer(name, options) {
  91596. return new LabelThemeLayer(name, options);
  91597. };
  91598. ;// CONCATENATED MODULE: ./src/common/iServer/FeatureService.js
  91599. function FeatureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  91600. 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); } }
  91601. 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; }
  91602. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91603. * This program are made available under the terms of the Apache License, Version 2.0
  91604. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91605. /**
  91606. * @class FeatureService
  91607. * @constructs FeatureService
  91608. * @category iServer Data Feature
  91609. * @classdesc 数据集类。提供:ID 查询,范围查询,SQL查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
  91610. * @example
  91611. * new FeatureService(url).getFeaturesByIDs(param,function(result){
  91612. * //doSomething
  91613. * })
  91614. * @param {string} url - 服务地址。
  91615. * @param {Object} options - 参数。
  91616. * @param {string} [options.proxy] - 服务代理地址。
  91617. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  91618. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  91619. * @param {Object} [options.headers] - 请求头。
  91620. * @extends {ServiceBase}
  91621. * @usage
  91622. */
  91623. var FeatureService = /*#__PURE__*/function () {
  91624. function FeatureService(url, options) {
  91625. FeatureService_classCallCheck(this, FeatureService);
  91626. this.url = url;
  91627. this.options = options || {};
  91628. }
  91629. /**
  91630. * @function FeatureService.prototype.getFeaturesByIDs
  91631. * @description 数据集 ID 查询服务。
  91632. * @param {GetFeaturesByIDsParameters} params - ID查询参数类。
  91633. * @param {RequestCallback} callback - 回调函数。
  91634. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91635. */
  91636. FeatureService_createClass(FeatureService, [{
  91637. key: "getFeaturesByIDs",
  91638. value: function getFeaturesByIDs(params, callback, resultFormat) {
  91639. var me = this;
  91640. var getFeaturesByIDsService = new GetFeaturesByIDsService(me.url, {
  91641. proxy: me.options.proxy,
  91642. withCredentials: me.options.withCredentials,
  91643. crossOrigin: me.options.crossOrigin,
  91644. headers: me.options.headers,
  91645. eventListeners: {
  91646. processCompleted: callback,
  91647. processFailed: callback
  91648. },
  91649. format: resultFormat
  91650. });
  91651. getFeaturesByIDsService.processAsync(params);
  91652. }
  91653. /**
  91654. * @function FeatureService.prototype.getFeaturesByBounds
  91655. * @description 数据集 Bounds 查询服务。
  91656. * @param {GetFeaturesByBoundsParameters} params - 数据集范围查询参数类。
  91657. * @param {RequestCallback} callback - 回调函数。
  91658. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91659. */
  91660. }, {
  91661. key: "getFeaturesByBounds",
  91662. value: function getFeaturesByBounds(params, callback, resultFormat) {
  91663. var me = this;
  91664. var getFeaturesByBoundsService = new GetFeaturesByBoundsService(me.url, {
  91665. proxy: me.options.proxy,
  91666. withCredentials: me.options.withCredentials,
  91667. crossOrigin: me.options.crossOrigin,
  91668. headers: me.options.headers,
  91669. eventListeners: {
  91670. processCompleted: callback,
  91671. processFailed: callback
  91672. },
  91673. format: me._processFormat(resultFormat)
  91674. });
  91675. getFeaturesByBoundsService.processAsync(params);
  91676. }
  91677. /**
  91678. * @function FeatureService.prototype.getFeaturesByBuffer
  91679. * @description 数据集 Buffer 查询服务。
  91680. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  91681. * @param {RequestCallback} callback - 回调函数。
  91682. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91683. */
  91684. }, {
  91685. key: "getFeaturesByBuffer",
  91686. value: function getFeaturesByBuffer(params, callback, resultFormat) {
  91687. var me = this;
  91688. var getFeatureService = new GetFeaturesByBufferService(me.url, {
  91689. proxy: me.options.proxy,
  91690. withCredentials: me.options.withCredentials,
  91691. crossOrigin: me.options.crossOrigin,
  91692. headers: me.options.headers,
  91693. eventListeners: {
  91694. processCompleted: callback,
  91695. processFailed: callback
  91696. },
  91697. format: me._processFormat(resultFormat)
  91698. });
  91699. getFeatureService.processAsync(params);
  91700. }
  91701. /**
  91702. * @function FeatureService.prototype.getFeaturesBySQL
  91703. * @description 数据集 SQL 查询服务。
  91704. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数类。
  91705. * @param {RequestCallback} callback - 回调函数。
  91706. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91707. */
  91708. }, {
  91709. key: "getFeaturesBySQL",
  91710. value: function getFeaturesBySQL(params, callback, resultFormat) {
  91711. var me = this;
  91712. var getFeatureBySQLService = new GetFeaturesBySQLService(me.url, {
  91713. proxy: me.options.proxy,
  91714. withCredentials: me.options.withCredentials,
  91715. crossOrigin: me.options.crossOrigin,
  91716. headers: me.options.headers,
  91717. eventListeners: {
  91718. processCompleted: callback,
  91719. processFailed: callback
  91720. },
  91721. format: me._processFormat(resultFormat)
  91722. });
  91723. getFeatureBySQLService.processAsync(params);
  91724. }
  91725. /**
  91726. * @function FeatureService.prototype.getFeaturesByGeometry
  91727. * @description 数据集几何查询服务类。
  91728. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  91729. * @param {RequestCallback} callback - 回调函数。
  91730. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  91731. */
  91732. }, {
  91733. key: "getFeaturesByGeometry",
  91734. value: function getFeaturesByGeometry(params, callback, resultFormat) {
  91735. var me = this;
  91736. var getFeaturesByGeometryService = new GetFeaturesByGeometryService(me.url, {
  91737. proxy: me.options.proxy,
  91738. withCredentials: me.options.withCredentials,
  91739. crossOrigin: me.options.crossOrigin,
  91740. headers: me.options.headers,
  91741. eventListeners: {
  91742. processCompleted: callback,
  91743. processFailed: callback
  91744. },
  91745. format: me._processFormat(resultFormat)
  91746. });
  91747. getFeaturesByGeometryService.processAsync(params);
  91748. }
  91749. /**
  91750. * @function FeatureService.prototype.editFeatures
  91751. * @description 地物编辑服务。
  91752. * @param {EditFeaturesParameters} params - 数据服务中数据集添加、修改、删除参数类。
  91753. * @param {RequestCallback} callback - 回调函数。
  91754. */
  91755. }, {
  91756. key: "editFeatures",
  91757. value: function editFeatures(params, callback) {
  91758. if (!params || !params.dataSourceName || !params.dataSetName) {
  91759. return;
  91760. }
  91761. var me = this,
  91762. url = me.url,
  91763. dataSourceName = params.dataSourceName,
  91764. dataSetName = params.dataSetName;
  91765. url = Util_Util.urlPathAppend(url, "datasources/" + dataSourceName + "/datasets/" + dataSetName);
  91766. var editFeatureService = new EditFeaturesService(url, {
  91767. proxy: me.options.proxy,
  91768. withCredentials: me.options.withCredentials,
  91769. crossOrigin: me.options.crossOrigin,
  91770. headers: me.options.headers,
  91771. eventListeners: {
  91772. processCompleted: callback,
  91773. processFailed: callback
  91774. }
  91775. });
  91776. editFeatureService.processAsync(params);
  91777. }
  91778. }, {
  91779. key: "_processFormat",
  91780. value: function _processFormat(resultFormat) {
  91781. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  91782. }
  91783. }]);
  91784. return FeatureService;
  91785. }();
  91786. ;// CONCATENATED MODULE: ./src/leaflet/services/FeatureService.js
  91787. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91788. * This program are made available under the terms of the Apache License, Version 2.0
  91789. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91790. /**
  91791. * @class FeatureService
  91792. * @deprecatedclassinstance L.supermap.featureService
  91793. * @classdesc 要素数据集类。提供:ID 查询,范围查询,SQL 查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
  91794. * @category iServer Data Feature
  91795. * @modulecategory Services
  91796. * @example
  91797. * new FeatureService(url)
  91798. * .getFeaturesByIDs(param,function(result){
  91799. * //doSomething
  91800. * })
  91801. * @extends {ServiceBase}
  91802. * @param {string} url - 服务地址。
  91803. * @param {Object} options - 参数。
  91804. * @param {string} [options.proxy] - 服务代理地址。
  91805. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  91806. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  91807. * @param {Object} [options.headers] - 请求头。
  91808. * @usage
  91809. */
  91810. var FeatureService_FeatureService = ServiceBase.extend({
  91811. initialize: function initialize(url, options) {
  91812. ServiceBase.prototype.initialize.call(this, url, options);
  91813. this._featureService = new FeatureService(url, options);
  91814. },
  91815. /**
  91816. * @function FeatureService.prototype.getFeaturesByIDs
  91817. * @description 数据集 ID 查询服务。
  91818. * @param {GetFeaturesByIDsParameters} params - ID 查询参数类。
  91819. * @param {RequestCallback} callback - 回调函数。
  91820. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91821. */
  91822. getFeaturesByIDs: function getFeaturesByIDs(params, callback, resultFormat) {
  91823. params = this._processParams(params);
  91824. this._featureService.getFeaturesByIDs(params, callback, resultFormat);
  91825. },
  91826. /**
  91827. * @function FeatureService.prototype.getFeaturesByBounds
  91828. * @description 数据集 bounds 查询服务。
  91829. * @param {GetFeaturesByBoundsParameters} params - 数据集范围查询参数类。
  91830. * @param {RequestCallback} callback - 回调函数。
  91831. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91832. */
  91833. getFeaturesByBounds: function getFeaturesByBounds(params, callback, resultFormat) {
  91834. params = this._processParams(params);
  91835. this._featureService.getFeaturesByBounds(params, callback, resultFormat);
  91836. },
  91837. /**
  91838. * @function FeatureService.prototype.getFeaturesByBuffer
  91839. * @description 数据集 buffer 查询服务。
  91840. * @param {GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  91841. * @param {RequestCallback} callback - 回调函数。
  91842. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91843. */
  91844. getFeaturesByBuffer: function getFeaturesByBuffer(params, callback, resultFormat) {
  91845. params = this._processParams(params);
  91846. this._featureService.getFeaturesByBuffer(params, callback, resultFormat);
  91847. },
  91848. /**
  91849. * @function FeatureService.prototype.getFeaturesBySQL
  91850. * @description 数据集 SQL 查询服务。
  91851. * @param {GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数类。
  91852. * @param {RequestCallback} callback - 回调函数。
  91853. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91854. */
  91855. getFeaturesBySQL: function getFeaturesBySQL(params, callback, resultFormat) {
  91856. params = this._processParams(params);
  91857. this._featureService.getFeaturesBySQL(params, callback, resultFormat);
  91858. },
  91859. /**
  91860. * @function FeatureService.prototype.getFeaturesByGeometry
  91861. * @description 数据集几何查询服务类。
  91862. * @param {GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  91863. * @param {RequestCallback} callback - 回调函数。
  91864. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  91865. */
  91866. getFeaturesByGeometry: function getFeaturesByGeometry(params, callback, resultFormat) {
  91867. params = this._processParams(params);
  91868. this._featureService.getFeaturesByGeometry(params, callback, resultFormat);
  91869. },
  91870. /**
  91871. * @function FeatureService.prototype.editFeatures
  91872. * @description 地物编辑服务。
  91873. * @param {EditFeaturesParameters} params - 数据服务中数据集添加、修改、删除参数类。
  91874. * @param {RequestCallback} callback - 回调函数。
  91875. */
  91876. editFeatures: function editFeatures(params, callback) {
  91877. if (!params || !params.dataSourceName || !params.dataSetName) {
  91878. return;
  91879. }
  91880. var me = this,
  91881. url = me.url,
  91882. dataSourceName = params.dataSourceName,
  91883. dataSetName = params.dataSetName;
  91884. url = Util_Util.urlPathAppend(url, "datasources/" + dataSourceName + "/datasets/" + dataSetName);
  91885. var editFeatureService = new EditFeaturesService(url, {
  91886. proxy: me.options.proxy,
  91887. withCredentials: me.options.withCredentials,
  91888. crossOrigin: me.options.crossOrigin,
  91889. headers: me.options.headers,
  91890. eventListeners: {
  91891. processCompleted: callback,
  91892. processFailed: callback
  91893. }
  91894. });
  91895. editFeatureService.processAsync(me._processParams(params));
  91896. },
  91897. _processParams: function _processParams(params) {
  91898. if (!params) {
  91899. return {};
  91900. }
  91901. params.returnContent = params.returnContent == null ? true : params.returnContent;
  91902. params.fromIndex = params.fromIndex ? params.fromIndex : 0;
  91903. params.toIndex = params.toIndex ? params.toIndex : -1;
  91904. params.isUseBatch = params.isUseBatch == null ? false : params.isUseBatch;
  91905. if (params.bounds) {
  91906. params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
  91907. }
  91908. if (params.geometry) {
  91909. params.geometry = Util_toSuperMapGeometry(params.geometry);
  91910. }
  91911. if (params.editType) {
  91912. params.editType = params.editType.toLowerCase();
  91913. }
  91914. var me = this;
  91915. if (params.features) {
  91916. var features = [];
  91917. if (external_L_default().Util.isArray(params.features)) {
  91918. params.features.map(function (feature) {
  91919. features.push(me._createServerFeature(feature));
  91920. return feature;
  91921. });
  91922. } else {
  91923. features.push(me._createServerFeature(params.features));
  91924. }
  91925. params.features = features;
  91926. }
  91927. return params;
  91928. },
  91929. _createServerFeature: function _createServerFeature(geoFeature) {
  91930. var geoJSONFeature,
  91931. feature = {},
  91932. fieldNames = [],
  91933. fieldValues = [];
  91934. geoJSONFeature = geoFeature || {};
  91935. for (var key in geoJSONFeature.properties) {
  91936. fieldNames.push(key);
  91937. fieldValues.push(geoJSONFeature.properties[key]);
  91938. }
  91939. feature.fieldNames = fieldNames;
  91940. feature.fieldValues = fieldValues;
  91941. if (geoJSONFeature.id) {
  91942. feature.id = geoJSONFeature.id;
  91943. }
  91944. feature.geometry = Util_toSuperMapGeometry(geoJSONFeature);
  91945. return feature;
  91946. },
  91947. _processFormat: function _processFormat(resultFormat) {
  91948. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  91949. }
  91950. });
  91951. var FeatureService_featureService = function featureService(url, options) {
  91952. return new FeatureService_FeatureService(url, options);
  91953. };
  91954. ;// CONCATENATED MODULE: ./src/leaflet/overlay/UnicodeMarker.js
  91955. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  91956. * This program are made available under the terms of the Apache License, Version 2.0
  91957. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  91958. /**
  91959. * @class UnicodeMarker
  91960. * @deprecatedclassinstance L.supermap.unicodeMarker
  91961. * @classdesc Unicode 字符图标类。
  91962. * @category Visualization Marker
  91963. * @modulecategory Overlay
  91964. * @extends {L.Path}
  91965. * @param {L.LatLngBounds} latlng - 经纬度坐标。
  91966. * @param {Object} options - 参数。
  91967. * @param {string} options.label - 符号 Unicode 值。
  91968. * @param {string} [options.labelRotation='0'] - 符号旋转角度。
  91969. * @param {string} [options.globalAlpha='1'] - 符号的透明值。
  91970. * @param {string} [options.fontStyle='normal'] - 符号的风格。
  91971. * @param {string} [options.fontWeight='normal'] - 符号的粗细。
  91972. * @param {string} [options.fontSize='1em'] - 符号的尺寸。
  91973. * @param {string} [options.fontFamily='sans-serif'] - 符号的字体。
  91974. * @param {string} [options.textAlign='center'] - 符号内容的对齐方式。
  91975. * @param {string} [options.textBaseline='middle'] - 绘制符号时使用的基线。
  91976. * @fires UnicodeMarker#move
  91977. * @usage
  91978. */
  91979. var UnicodeMarker = external_L_default().Path.extend({
  91980. // @section
  91981. // @aka CircleMarker options
  91982. options: {
  91983. fontStyle: "normal",
  91984. fontWeight: "normal",
  91985. fontSize: "1em",
  91986. fontFamily: "sans-serif",
  91987. textAlign: "center",
  91988. textBaseline: "middle",
  91989. vfactor: -.5,
  91990. labelRotation: 0,
  91991. globalAlpha: 1,
  91992. label: ""
  91993. },
  91994. initialize: function initialize(latlng, options) {
  91995. external_L_default().Util.setOptions(this, options);
  91996. this._latlng = latlng;
  91997. },
  91998. /**
  91999. * @function UnicodeMarker.prototype.setLatLng
  92000. * @description 设置 marker 新坐标。
  92001. * @param {L.LatLng} setLatLng - 需要设置的新坐标。
  92002. */
  92003. setLatLng: function setLatLng(latlng) {
  92004. this._latlng = latlng;
  92005. this.redraw();
  92006. /**
  92007. * @event UnicodeMarker#move
  92008. * @description circle marker 重设坐标之后触发。
  92009. * @property {L.LatLng} latlng - 当前 marker 坐标。
  92010. */
  92011. return this.fire('move', {
  92012. latlng: this._latlng
  92013. });
  92014. },
  92015. /**
  92016. * @function UnicodeMarker.prototype.getLatLng
  92017. * @description 获取 marker 坐标。
  92018. * @returns {L.LatLng} 返回当前 marker 坐标。
  92019. */
  92020. getLatLng: function getLatLng() {
  92021. return this._latlng;
  92022. },
  92023. _project: function _project() {
  92024. this._point = this._map.latLngToLayerPoint(this._latlng);
  92025. this._updateBounds();
  92026. },
  92027. _updateBounds: function _updateBounds() {
  92028. var w = this._clickTolerance(),
  92029. p = [w, w];
  92030. this._pxBounds = new (external_L_default()).Bounds(this._point.subtract(p), this._point.add(p));
  92031. },
  92032. _update: function _update() {
  92033. if (this._map) {
  92034. this._updatePath();
  92035. }
  92036. },
  92037. _updatePath: function _updatePath() {
  92038. this._renderer._updateUnicode(this);
  92039. },
  92040. // Needed by the `Canvas` renderer for interactivity
  92041. _containsPoint: function _containsPoint(p) {
  92042. return p.distanceTo(this._point) <= this._clickTolerance();
  92043. }
  92044. });
  92045. var unicodeMarker = function unicodeMarker(latlng, options) {
  92046. return new UnicodeMarker(latlng, options);
  92047. };
  92048. external_L_default().Canvas.include({
  92049. _updateUnicode: function _updateUnicode(layer) {
  92050. if (!this._drawing) {
  92051. return;
  92052. }
  92053. var pt = {
  92054. x: layer._point.x,
  92055. y: layer._point.y
  92056. },
  92057. ctx = this._ctx,
  92058. fontStyle = [layer.options.fontStyle, "normal", layer.options.fontWeight, layer.options.fontSize, layer.options.fontFamily].join(" ");
  92059. var label = layer.options.label.replace(/^&#x/, '');
  92060. label = String.fromCharCode(parseInt(label, 16));
  92061. var labelRows = label.split('\n');
  92062. var numRows = labelRows.length;
  92063. // if (layer.options.labelXOffset || layer.options.labelYOffset) {
  92064. // let xOffset = isNaN(layer.options.labelXOffset) ? 0 : layer.options.labelXOffset;
  92065. // let yOffset = isNaN(layer.options.labelYOffset) ? 0 : layer.options.labelYOffset;
  92066. // pt.x += xOffset;
  92067. // pt.y -= yOffset;
  92068. // }
  92069. ctx.fillStyle = layer.options.fontColor;
  92070. ctx.globalAlpha = 1.0;
  92071. if (layer.options.fontOpacity >= 0 && layer.options.fontOpacity < 1) {
  92072. ctx.globalAlpha = layer.options.fontOpacity;
  92073. }
  92074. if (ctx.fillText) {
  92075. // HTML5
  92076. ctx.font = fontStyle;
  92077. ctx.textAlign = layer.options.textAlign;
  92078. ctx.textBaseline = layer.options.textBaseline;
  92079. var vfactor = layer.options.vfactor;
  92080. var lineHeight = ctx.measureText('Mg').height || ctx.measureText('xx').width;
  92081. pt.y += lineHeight * vfactor * (numRows - 1);
  92082. for (var i = 0; i < numRows; i++) {
  92083. if (layer.options.labelRotation != 0) {
  92084. ctx.save();
  92085. ctx.translate(pt.x, pt.y);
  92086. ctx.rotate(layer.options.labelRotation * Math.PI / 180);
  92087. ctx.fillText(labelRows[i], 0, lineHeight * i);
  92088. ctx.restore();
  92089. } else {
  92090. ctx.fillText(labelRows[i], pt.x, pt.y);
  92091. }
  92092. }
  92093. } else if (ctx.mozDrawText) {
  92094. // Mozilla pre-Gecko1.9.1 (<FF3.1)
  92095. ctx.mozTextStyle = fontStyle;
  92096. // No built-in text alignment, so we measure and adjust the position
  92097. var hfactor = layer.options.textAlign;
  92098. var _vfactor = layer.options.vfactor;
  92099. var _lineHeight = ctx.mozMeasureText('xx');
  92100. pt.y += _lineHeight * (1 + _vfactor * numRows);
  92101. for (var _i2 = 0; _i2 < numRows; _i2++) {
  92102. var x = pt.x + hfactor * ctx.mozMeasureText(labelRows[_i2]);
  92103. var y = pt.y + _i2 * _lineHeight;
  92104. ctx.translate(x, y);
  92105. ctx.mozDrawText(labelRows[_i2]);
  92106. ctx.translate(-x, -y);
  92107. }
  92108. }
  92109. }
  92110. });
  92111. ;// CONCATENATED MODULE: ./src/leaflet/mapping/WebMap.js
  92112. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  92113. * This program are made available under the terms of the Apache License, Version 2.0
  92114. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  92115. /**
  92116. * @class WebMap
  92117. * @deprecatedclassinstance L.supermap.webMap
  92118. * @classdesc 对接 iPortal/Online 地图类。
  92119. * @category iPortal/Online Resources Map
  92120. * @modulecategory Mapping
  92121. * @extends {L.LayerGroup}
  92122. * @param {number} id - iPortal/Online 地图 id。
  92123. * @param {Object} options - 参数。
  92124. * @param {string} [options.map='map'] - 地图容器 id。
  92125. * @param {string} [options.server] - iPortal/Online 服务地址。
  92126. * @param {boolean} [options.featureLayerPopupEnable=true] - 是否启动要素图层提示框。
  92127. * @param {string} [options.featureLayerPopup] - 提示框提示信息。
  92128. * @param {string} [options.credentialValue] - 证书值。
  92129. * @param {string} [options.credentialKey='key'] - 证书密钥。
  92130. * @param {string} [options.attribution='Map Data <span>© <a href='https://www.supermapol.com' title='SuperMap Online' target='_blank'>SuperMap Online</a></span>'] - 版权信息。
  92131. * @fires WebMap#maploaded
  92132. * @fires WebMap#coordconvertsuccess
  92133. * @fires WebMap#coordconvertfailed
  92134. * @fires WebMap#featureunselected
  92135. * @fires WebMap#featureselected
  92136. * @fires WebMap#featuremousemove
  92137. * @usage
  92138. */
  92139. var WebMap = external_L_default().LayerGroup.extend({
  92140. options: {
  92141. map: 'map',
  92142. server: '',
  92143. featureLayerPopupEnable: true,
  92144. featureLayerPopup: null,
  92145. credentialValue: null,
  92146. credentialKey: 'key',
  92147. attribution: core_Attributions.Online.attribution
  92148. },
  92149. /**
  92150. * @private
  92151. * @function WebMap.prototype.defaultFeatureLayerPopup
  92152. * @description 默认图层弹出框。
  92153. * @param {L.Layer} layer - Leaflet Layer 对象。
  92154. * @returns {string} 图层弹出框内容。
  92155. */
  92156. defaultFeatureLayerPopup: function defaultFeatureLayerPopup(layer) {
  92157. return layer.feature.properties.attributes.title + ":" + layer.feature.properties.attributes.description;
  92158. },
  92159. initialize: function initialize(id, options) {
  92160. if (!id && !options) {
  92161. return;
  92162. }
  92163. this._layers = {};
  92164. external_L_default().setOptions(this, options);
  92165. this.id = id;
  92166. this.load();
  92167. this.cartoCSSToLeaflet = new CartoCSSToLeaflet();
  92168. },
  92169. /**
  92170. * @private
  92171. * @function WebMap.prototype.load
  92172. * @description 登陆后添加地图图层。
  92173. */
  92174. load: function load() {
  92175. if (this.options.server.indexOf('http://') < 0 && this.options.server.indexOf('https://') < 0) {
  92176. this.options.server = "http://" + this.options.server;
  92177. }
  92178. var mapUrl = this.options.server + '/web/maps/' + this.id + '.json';
  92179. if (this.options.credentialValue) {
  92180. mapUrl += '?' + this.options.credentialKey + '=' + this.options.credentialValue;
  92181. }
  92182. var me = this;
  92183. FetchRequest.get(mapUrl).then(function (response) {
  92184. return response.json();
  92185. }).then(function (jsonObj) {
  92186. if (!jsonObj) {
  92187. return;
  92188. }
  92189. var layers = jsonObj.layers;
  92190. me.mapInfo = jsonObj;
  92191. me.createLayersByJson(layers);
  92192. });
  92193. },
  92194. /**
  92195. * @private
  92196. * @function WebMap.prototype.addLayerWrapper
  92197. * @description 添加图层容器。
  92198. * @param {L.Layer} layer - Leaflet Layer 对象。
  92199. * @param {boolean} [isBaseLayer] - 是否为底图层。
  92200. * @param {Object} options - 参数。
  92201. * @returns {WebMap} WebMap的实例对象。
  92202. */
  92203. addLayerWrapper: function addLayerWrapper(layer, isBaseLayer, options) {
  92204. if (isBaseLayer) {
  92205. this.createMap(options);
  92206. }
  92207. this.addLayer(layer);
  92208. if (layer.labelLayer) {
  92209. this.addLayer(layer.labelLayer);
  92210. }
  92211. return this;
  92212. },
  92213. /**
  92214. * @private
  92215. * @function WebMap.prototype.createLayersByJson
  92216. * @description 通过 JSON 创建图层。
  92217. * @param {JSONObject} layersJson - 图层的 JSON 信息。
  92218. */
  92219. createLayersByJson: function createLayersByJson(layersJson) {
  92220. if (!external_L_default().Util.isArray(layersJson)) {
  92221. return;
  92222. }
  92223. if (layersJson.length === 0) {
  92224. return;
  92225. }
  92226. this.layers = [];
  92227. var layerQueue = [];
  92228. for (var i = 0; i < layersJson.length; i++) {
  92229. var layerJson = layersJson[i];
  92230. layerJson["_originIndex"] = i;
  92231. var layerJsonType = layerJson.layerType = layerJson.layerType || "BASE_LAYER";
  92232. if (layerJsonType !== "BASE_LAYER") {
  92233. //如果图层不是底图,则先加到图层队列里面等待底图完成后再处理
  92234. layerQueue.unshift(layerJson);
  92235. continue;
  92236. } else {
  92237. layerJson.isBaseLayer = true;
  92238. this.createLayer(layerJson.type, layerJson);
  92239. }
  92240. }
  92241. //底图加载完成后开始处理图层队列里的图层
  92242. while (layerQueue.length > 0) {
  92243. var layerInfo = layerQueue.pop();
  92244. var type = layerInfo.type;
  92245. var layerType = layerInfo.layerType = layerInfo.layerType || "BASE_LAYER";
  92246. if (layerType !== "OVERLAY_LAYER") {
  92247. type = layerType;
  92248. }
  92249. this.createLayer(type, layerInfo);
  92250. }
  92251. /**
  92252. * @event WebMap#maploaded
  92253. * @description 底图加载完成后触发。
  92254. * @property {L.Map} map - Leaflet Map 对象。
  92255. */
  92256. this.fire('maploaded', {
  92257. map: this._map
  92258. });
  92259. },
  92260. /**
  92261. * @private
  92262. * @function WebMap.prototype.createCRS
  92263. * @description 创建坐标对象。
  92264. * @param {number} epsgCode - epsg 编码。
  92265. * @param {string} type - 坐标类型。
  92266. * @param {number} resolutions - 分辨率。
  92267. * @param {L.Point} origin - 切片原点。
  92268. * @param {L.Bounds} bounds - 地图范围。
  92269. */
  92270. createCRS: function createCRS(epsgCode, type, resolutions, origin, bounds) {
  92271. if (epsgCode < 0) {
  92272. return new NonEarthCRS({
  92273. bounds: bounds,
  92274. origin: origin,
  92275. resolutions: resolutions
  92276. });
  92277. }
  92278. if (epsgCode === 910112 || epsgCode === 910102) {
  92279. return BaiduCRS;
  92280. }
  92281. if (epsgCode === 910111) {
  92282. epsgCode = 3857;
  92283. //todo 火星mercator
  92284. }
  92285. if (epsgCode === 910101) {
  92286. epsgCode = 4326;
  92287. //todo 火星
  92288. }
  92289. return crs("EPSG:" + epsgCode, {
  92290. origin: origin,
  92291. resolutions: resolutions,
  92292. bounds: bounds
  92293. });
  92294. },
  92295. /**
  92296. * @private
  92297. * @function WebMap.prototype.createMap
  92298. * @description 创建地图。
  92299. * @param {Object} options - 参数。
  92300. */
  92301. createMap: function createMap(options) {
  92302. var crs = options.crs || (external_L_default()).CRS.EPSG3857;
  92303. var bounds = external_L_default().latLngBounds(crs.unproject(options.bounds.min), crs.unproject(options.bounds.max));
  92304. this._map = external_L_default().map(this.options.map, {
  92305. center: bounds.getCenter(),
  92306. maxZoom: options.maxZoom || 22,
  92307. minZoom: options.minZoom || 0,
  92308. zoom: options.zoom || 0,
  92309. crs: crs,
  92310. renderer: external_L_default().canvas()
  92311. });
  92312. if (crs instanceof NonEarthCRS) {
  92313. this._map.setZoom(options.zoom ? options.zoom + 2 : 2, {
  92314. maxZoom: options.maxZoom || 22
  92315. });
  92316. } else {
  92317. this._map.fitBounds(bounds, {
  92318. maxZoom: options.maxZoom || 22
  92319. });
  92320. }
  92321. },
  92322. /**
  92323. * @private
  92324. * @function WebMap.prototype.getResolutionsFromScales
  92325. * @description 通过比例尺获取分辨率。
  92326. * @param {Array.<number>} scales - 排序比例尺数组。
  92327. * @param {number} dpi - 屏幕分辨率。
  92328. * @param {string} units - 地图的单位。
  92329. * @param {Datum} datum - 大地参照系类。
  92330. * @returns {Array.<number>} 返回给定比例尺所对应的分辨率。
  92331. */
  92332. getResolutionsFromScales: function getResolutionsFromScales(scales, dpi, units, datum) {
  92333. var resolutions = [];
  92334. for (var i = 0; i < scales.length; i++) {
  92335. resolutions.push(getResolutionFromScaleDpi(scales[i], dpi, units, datum));
  92336. }
  92337. return resolutions;
  92338. },
  92339. /**
  92340. * @private
  92341. * @function WebMap.prototype.createLayer
  92342. * @description 创建图层。
  92343. * @param {string} type - 图层类型。
  92344. * @param {Object} layerInfo - 图层信息。
  92345. */
  92346. createLayer: function createLayer(type, layerInfo) {
  92347. var prjCoordSys = layerInfo.prjCoordSys,
  92348. epsgCode = prjCoordSys && prjCoordSys.epsgCode || this.mapInfo.epsgCode,
  92349. center = this.mapInfo.center || layerInfo.center,
  92350. level = this.mapInfo.level || layerInfo.level,
  92351. bounds = this.mapInfo.extent || layerInfo.bounds,
  92352. scales = layerInfo.scales,
  92353. isBaseLayer = layerInfo.isBaseLayer,
  92354. opacity = layerInfo.opacity;
  92355. var mapBounds = external_L_default().bounds([bounds.leftBottom.x, bounds.leftBottom.y], [bounds.rightTop.x, bounds.rightTop.y]);
  92356. var layerBounds = layerInfo.bounds ? external_L_default().bounds([layerInfo.bounds.leftBottom.x, layerInfo.bounds.leftBottom.y], [layerInfo.bounds.rightTop.x, layerInfo.bounds.rightTop.y]) : mapBounds;
  92357. if (!center) {
  92358. center = layerBounds.getCenter();
  92359. }
  92360. var origin = external_L_default().point(layerBounds.min.x, layerBounds.max.y);
  92361. var resolutions = !scales ? null : this.getResolutionsFromScales(scales, 96, layerInfo.units);
  92362. var crs = this.createCRS(epsgCode, prjCoordSys ? prjCoordSys.type : '', resolutions, origin, layerBounds);
  92363. var mapOptions = {
  92364. bounds: mapBounds,
  92365. center: external_L_default().point(center.x, center.y),
  92366. crs: crs,
  92367. zoom: level
  92368. };
  92369. var layer;
  92370. switch (type) {
  92371. case "SUPERMAP_REST":
  92372. layer = tiledMapLayer(layerInfo.url, {
  92373. transparent: true,
  92374. opacity: opacity
  92375. });
  92376. break;
  92377. case "SUPERMAP_REST_VECTOR":
  92378. //ToDO
  92379. break;
  92380. case "TIANDITU_VEC":
  92381. case "TIANDITU_IMG":
  92382. case "TIANDITU_TER":
  92383. mapOptions.crs = epsgCode === 4326 ? TianDiTu_WGS84CRS : TianDiTu_MercatorCRS;
  92384. mapOptions.minZoom = 1;
  92385. mapOptions.zoom = 1 + mapOptions.zoom;
  92386. layer = this.createTiandituLayer(layerInfo);
  92387. break;
  92388. case "BAIDU":
  92389. mapOptions.crs = BaiduCRS;
  92390. mapOptions.zoom = 3 + mapOptions.zoom;
  92391. mapOptions.minZoom = 3;
  92392. layer = baiduTileLayer();
  92393. break;
  92394. case 'BING':
  92395. //todo
  92396. break;
  92397. case "WMS":
  92398. layer = this.createWmsLayer(layerInfo);
  92399. break;
  92400. case "WMTS":
  92401. mapOptions.resolutions = this.getResolutionsFromScales(scales, 90.71446714322, layerInfo.units);
  92402. var identifier = layerInfo.identifier;
  92403. var layerName = identifier.substring(identifier.indexOf("_") + 1);
  92404. layer = wmtsLayer(layerInfo.url, {
  92405. layer: layerName,
  92406. style: "default",
  92407. tilematrixSet: identifier,
  92408. format: "image/png"
  92409. });
  92410. break;
  92411. case "CLOUD":
  92412. mapOptions.crs = (external_L_default()).CRS.EPSG3857;
  92413. mapOptions.zoom = 3 + mapOptions.zoom;
  92414. mapOptions.minZoom = 3;
  92415. layer = cloudTileLayer(layerInfo.url, {
  92416. opacity: opacity
  92417. });
  92418. break;
  92419. case "MARKER_LAYER":
  92420. layer = this.createMarkersLayer(layerInfo, crs);
  92421. break;
  92422. case "FEATURE_LAYER":
  92423. if (layerInfo.identifier == "ANIMATORVECTOR") {
  92424. //todo
  92425. } else if (layerInfo.identifier == "THEME") {
  92426. layer = this.createThemeLayer(layerInfo);
  92427. } else {
  92428. layer = this.createVectorLayer(layerInfo, crs);
  92429. }
  92430. break;
  92431. default:
  92432. throw new Error('unSupported Layer Type');
  92433. }
  92434. if (layer && layerInfo.isVisible) {
  92435. this.addLayerWrapper(layer, isBaseLayer, mapOptions);
  92436. }
  92437. },
  92438. /**
  92439. * @private
  92440. * @function WebMap.prototype.createTiandituLayer
  92441. * @description 创建天地图图层。
  92442. * @param {Object} layerInfo - 图层信息。
  92443. * @returns {tiandituTileLayer} 返回天地图图层对象。
  92444. */
  92445. createTiandituLayer: function createTiandituLayer(layerInfo) {
  92446. var type = layerInfo.type.split('_')[1].toLowerCase();
  92447. var isLabel = layerInfo.layerType === 'OVERLAY_LAYER';
  92448. var layer = new TiandituTileLayer({
  92449. layerType: type,
  92450. isLabel: isLabel
  92451. });
  92452. return layer;
  92453. },
  92454. /**
  92455. * @private
  92456. * @function WebMap.prototype.createMarkersLayer
  92457. * @description 创建图标图层。
  92458. * @param {Object} layerInfo - 图层信息。
  92459. * @param {Object} crs - 坐标对象。
  92460. * @returns {L.Layer} 返回 marker 图层。
  92461. */
  92462. createMarkersLayer: function createMarkersLayer(layerInfo, crs) {
  92463. var that = this;
  92464. var markers = layerInfo.markers || [];
  92465. //style = layerInfo.style,
  92466. //opacity = layerInfo.opacity,
  92467. //marker, point, size, offset, icon, that = this;
  92468. //todo offset
  92469. var coordsToLatLng = function coordsToLatLng(coords) {
  92470. var ll = crs.unproject(external_L_default().point(coords[0], coords[1]));
  92471. return new (external_L_default()).LatLng(ll.lat, ll.lng, coords[2]);
  92472. };
  92473. var layer = external_L_default().geoJSON(toGeoJSON(markers), {
  92474. pointToLayer: function pointToLayer(geojson, latlng) {
  92475. var m = new (external_L_default()).Marker(latlng);
  92476. m.setStyle = function (style) {
  92477. if (style) {
  92478. m.setIcon(style);
  92479. }
  92480. };
  92481. return m;
  92482. },
  92483. coordsToLatLng: coordsToLatLng,
  92484. style: function style(geoJsonFeature) {
  92485. return that.cartoCSSToLeaflet.getStyleFromiPortalMarker(geoJsonFeature.properties.icon);
  92486. }
  92487. });
  92488. if (this.options.featureLayerPopupEnable) {
  92489. layer.bindPopup(this.options.featureLayerPopup || this.defaultFeatureLayerPopup);
  92490. }
  92491. return layer;
  92492. },
  92493. /**
  92494. * @private
  92495. * @function WebMap.prototype.createWmsLayer
  92496. * @description 创建 Wms 图层。
  92497. * @param {Object} layerInfo - 图层信息。
  92498. * @returns {L.Layer} 返回 Wms 图层对象。
  92499. */
  92500. createWmsLayer: function createWmsLayer(layerInfo) {
  92501. var url = layerInfo.url,
  92502. opacity = layerInfo.opacity,
  92503. subLayers = layerInfo.subLayers;
  92504. if (!subLayers || subLayers === "undefined" || subLayers === "null") {
  92505. subLayers = "0";
  92506. }
  92507. return external_L_default().tileLayer.wms(url, {
  92508. layers: subLayers,
  92509. format: 'image/png',
  92510. transparent: true,
  92511. noWrap: true,
  92512. opacity: opacity
  92513. });
  92514. },
  92515. /**
  92516. * @private
  92517. * @function WebMap.prototype.createVectorLayer
  92518. * @description 创建矢量要素图层。
  92519. * @param {Object} layerInfo - 图层信息。
  92520. * @param {Object} crs - 坐标对象。
  92521. * @returns {L.Layer} 返回矢量要素图层对象。
  92522. */
  92523. createVectorLayer: function createVectorLayer(layerInfo, crs) {
  92524. var _this = this;
  92525. var _style = layerInfo.style,
  92526. opacity = layerInfo.opacity,
  92527. me = this;
  92528. //todo readonly = layerInfo.readonly;
  92529. var coordsToLatLng = function coordsToLatLng(coords) {
  92530. var ll = crs.unproject(external_L_default().point(coords[0], coords[1]));
  92531. return new (external_L_default()).LatLng(ll.lat, ll.lng, coords[2]);
  92532. };
  92533. if (!layerInfo.url) {
  92534. var layer = external_L_default().geoJSON(toGeoJSON(layerInfo.features), {
  92535. pointToLayer: function pointToLayer(geojson, latlng) {
  92536. var m = new (external_L_default()).Marker(latlng);
  92537. m.setStyle = function (style) {
  92538. if (style) {
  92539. m.setIcon(style);
  92540. }
  92541. };
  92542. return m;
  92543. },
  92544. coordsToLatLng: coordsToLatLng,
  92545. style: function style(geoJsonFeature) {
  92546. var lStyle = me.cartoCSSToLeaflet.getStyleFromiPortalStyle(_style ? _style : {}, geoJsonFeature.geometry.type, geoJsonFeature.properties.style);
  92547. if (lStyle && lStyle.dashArray && lStyle.dashArray.length == 0) {
  92548. lStyle.dashArray = null;
  92549. }
  92550. return lStyle;
  92551. },
  92552. opacity: opacity
  92553. });
  92554. if (this.options.featureLayerPopupEnable) {
  92555. layer.bindPopup(this.options.featureLayerPopup || this.defaultFeatureLayerPopup);
  92556. }
  92557. return layer;
  92558. } else {
  92559. var url = layerInfo.url,
  92560. datasourceName = layerInfo.name,
  92561. datasets = layerInfo.features;
  92562. for (var setNameIndex = 0; setNameIndex < datasets.length; setNameIndex++) {
  92563. var dataset = datasets[setNameIndex];
  92564. if (dataset.visible) {
  92565. this.getFeaturesBySQL(url, datasourceName, dataset.name, "", DataFormat.GEOJSON, function (serviceResult) {
  92566. var layer = external_L_default().geoJSON(serviceResult.result, {
  92567. pointToLayer: function pointToLayer(geojson, latlng) {
  92568. var m = new (external_L_default()).Marker(latlng);
  92569. m.setStyle = function (style) {
  92570. if (style) {
  92571. m.setIcon(style);
  92572. }
  92573. };
  92574. return m;
  92575. },
  92576. coordsToLatLng: coordsToLatLng,
  92577. style: function style(geoJsonFeature) {
  92578. return this.cartoCSSToLeaflet.getStyleFromiPortalStyle(_style ? _style : {}, geoJsonFeature.geometry.type, geoJsonFeature.properties.style);
  92579. },
  92580. opacity: opacity
  92581. });
  92582. if (_this.options.featureLayerPopupEnable) {
  92583. layer.bindPopup(me.options.featureLayerPopup || me.defaultFeatureLayerPopup);
  92584. }
  92585. _this.addLayer(layer);
  92586. });
  92587. }
  92588. }
  92589. }
  92590. },
  92591. getFeaturesBySQL: function getFeaturesBySQL(url, datasourceName, datasetName, filter, format, callback) {
  92592. filter = filter || "SMID > 0";
  92593. var sqlParam = new GetFeaturesBySQLParameters({
  92594. queryParameter: {
  92595. name: datasetName + "@" + datasourceName,
  92596. attributeFilter: filter
  92597. },
  92598. datasetNames: [datasourceName + ":" + datasetName],
  92599. fromIndex: 0,
  92600. toIndex: 100000
  92601. });
  92602. FeatureService_featureService(url).getFeaturesBySQL(sqlParam, callback, format);
  92603. },
  92604. /**
  92605. * @private
  92606. * @function WebMap.prototype.createThemeLayer
  92607. * @description 创建专题图图层。
  92608. * @param {Object} layerInfo - 图层信息。
  92609. * @returns {L.Layer} 返回专题图图层对象。
  92610. */
  92611. createThemeLayer: function createThemeLayer(layerInfo) {
  92612. var _this2 = this;
  92613. var themeSettings = layerInfo.themeSettings && JSON.parse(layerInfo.themeSettings);
  92614. var layer;
  92615. var type = themeSettings.type;
  92616. layerInfo.themeSettings = themeSettings;
  92617. if (type === "HEAT") {
  92618. layer = this.createHeatLayer(layerInfo, themeSettings);
  92619. } else if (type === "UNIQUE") {
  92620. layer = this.createUniqueLayer(layerInfo, themeSettings);
  92621. } else if (type === "RANGE") {
  92622. layer = this.createRangeLayer(layerInfo, themeSettings);
  92623. } else {
  92624. layer = this.createBaseThemeLayer(layerInfo, themeSettings);
  92625. }
  92626. if (layer) {
  92627. this.addFeature2ThemeLayer(layerInfo, layer);
  92628. layer.on('add', function (e) {
  92629. _this2.registerThemeEvent(e.target);
  92630. });
  92631. }
  92632. if (themeSettings && themeSettings.labelField) {
  92633. var labelLayer = this.createLabelLayer(layerInfo, themeSettings);
  92634. labelLayer.on('add', function (e) {
  92635. _this2.registerThemeEvent(e.target);
  92636. });
  92637. layer.labelLayer = labelLayer;
  92638. }
  92639. return layer;
  92640. },
  92641. createBaseThemeLayer: function createBaseThemeLayer(layerInfo, themeSettings) {
  92642. var style = layerInfo.style,
  92643. opacity = layerInfo.opacity,
  92644. vectorType = themeSettings.vectorType,
  92645. featureStyle = style.pointStyle;
  92646. if (vectorType === "LINE") {
  92647. featureStyle.fill = false;
  92648. } else {
  92649. featureStyle.fill = true;
  92650. }
  92651. var pointStyle = {};
  92652. pointStyle.radius = featureStyle.pointRadius;
  92653. pointStyle.color = featureStyle.strokeColor;
  92654. pointStyle.opacity = featureStyle.strokeOpacity;
  92655. pointStyle.lineCap = featureStyle.strokeLineCap;
  92656. pointStyle.weight = featureStyle.strokeWidth;
  92657. pointStyle.fillColor = featureStyle.fillColor;
  92658. pointStyle.fillOpacity = featureStyle.fillOpacity;
  92659. var pointToLayer = function pointToLayer(geojson, latlng) {
  92660. return external_L_default().circleMarker(latlng, pointStyle);
  92661. };
  92662. if (featureStyle.unicode) {
  92663. pointToLayer = function pointToLayer(geojson, latlng) {
  92664. return new UnicodeMarker(latlng, featureStyle);
  92665. };
  92666. }
  92667. return external_L_default().geoJSON({
  92668. type: "GeometryCollection",
  92669. geometries: []
  92670. }, {
  92671. pointToLayer: pointToLayer,
  92672. opacity: opacity
  92673. });
  92674. //this.registerVectorEvent(vector);
  92675. },
  92676. createUniqueLayer: function createUniqueLayer(layerInfo, themeSettings) {
  92677. var title = layerInfo.title;
  92678. var themeField = themeSettings.field,
  92679. styleGroups = [],
  92680. settings = themeSettings.settings,
  92681. isVisible = layerInfo.isVisible,
  92682. opacity = layerInfo.opacity,
  92683. vectorType = themeSettings.vectorType;
  92684. //组成styleGroup
  92685. for (var i = 0; i < settings.length; i++) {
  92686. var object = {};
  92687. object.value = settings[i].value;
  92688. object.style = settings[i].style;
  92689. styleGroups.push(object);
  92690. }
  92691. var unique = new UniqueThemeLayer(title, {
  92692. opacity: opacity,
  92693. visibility: isVisible
  92694. });
  92695. this.registerThemeEvent(unique);
  92696. unique.style = layerInfo.style.pointStyle;
  92697. if (vectorType === "LINE") {
  92698. unique.style.fill = false;
  92699. } else {
  92700. unique.style.fill = true;
  92701. }
  92702. unique.style.stroke = true;
  92703. unique.themeField = themeField;
  92704. unique.styleGroups = styleGroups;
  92705. var that = this;
  92706. unique.on('click', function (event) {
  92707. if (event.target && event.target.refDataID) {
  92708. var currenFeature = unique.getFeatureById(event.target.refDataID);
  92709. that.events.triggerEvent("uniquefeatureclicked", currenFeature, unique);
  92710. }
  92711. });
  92712. return unique;
  92713. },
  92714. createRangeLayer: function createRangeLayer(layerInfo, themeSettings) {
  92715. var title = layerInfo.title;
  92716. var themeField = themeSettings.field,
  92717. styleGroups = [],
  92718. settings = themeSettings.settings,
  92719. isVisible = layerInfo.isVisible,
  92720. opacity = layerInfo.opacity,
  92721. vectorType = themeSettings.vectorType,
  92722. featureStyle = layerInfo.style.pointStyle;
  92723. if (vectorType === "LINE") {
  92724. featureStyle.fill = false;
  92725. } else {
  92726. featureStyle.fill = true;
  92727. }
  92728. //组成styleGroup
  92729. for (var i = 0; i < settings.length; i++) {
  92730. var object = {};
  92731. object.start = settings[i].start;
  92732. object.end = settings[i].end;
  92733. object.style = settings[i].style;
  92734. styleGroups.push(object);
  92735. }
  92736. var range = new RangeThemeLayer(title, {
  92737. visibility: isVisible,
  92738. opacity: opacity
  92739. });
  92740. this.registerThemeEvent(range);
  92741. range.style = layerInfo.style.pointStyle;
  92742. range.style.stroke = true;
  92743. range.themeField = themeField;
  92744. range.styleGroups = styleGroups;
  92745. return range;
  92746. },
  92747. createLabelLayer: function createLabelLayer(layerInfo, themeSettings) {
  92748. var title = layerInfo.title;
  92749. var labelField = themeSettings.labelField,
  92750. settings = themeSettings.settings,
  92751. isVisible = layerInfo.isVisible;
  92752. //目前只是同一样式
  92753. var style;
  92754. if (!settings || settings.length > 0) {
  92755. style = {
  92756. "fillColor": "#ffffff"
  92757. };
  92758. } else {
  92759. style = settings[0].style;
  92760. }
  92761. var layerStyle = external_L_default().Util.extend(new ThemeStyle(), style);
  92762. layerStyle.fontWeight = "bold";
  92763. layerStyle.fontSize = "14px";
  92764. //默认显示标签边框背景
  92765. layerStyle.labelRect = true;
  92766. layerStyle.strokeColor = layerStyle.fillColor;
  92767. layerStyle.fontColor = themeSettings.labelColor;
  92768. if (themeSettings.labelFont) {
  92769. layerStyle.fontFamily = themeSettings.labelFont;
  92770. }
  92771. var label = new LabelThemeLayer(title, {
  92772. visibility: isVisible,
  92773. opacity: 0.7
  92774. });
  92775. this.registerThemeEvent(label);
  92776. label.style = layerStyle;
  92777. label.themeField = labelField;
  92778. //styleGroup, 目前只是同一样式
  92779. label.styleGroups = [];
  92780. return label;
  92781. },
  92782. createHeatLayer: function createHeatLayer(layerInfo, themeSettings) {
  92783. var colors = themeSettings.colors || ['blue', 'cyan', 'lime', 'yellow', 'red'];
  92784. var gradient = {},
  92785. featureWeight;
  92786. for (var i = 0, len = colors.length, index = 1; i < len; i++) {
  92787. gradient[index / len] = colors[i];
  92788. index++;
  92789. }
  92790. var radius = themeSettings.settings[0].radius;
  92791. //判断单位
  92792. if (themeSettings.heatUnit === "千米" || themeSettings.heatUnit === "km") {
  92793. radius = themeSettings.heatRadius * 1000;
  92794. }
  92795. //权重
  92796. if (themeSettings.settings[0] && themeSettings.settings[0].featureWeight) {
  92797. featureWeight = themeSettings.settings[0].featureWeight;
  92798. }
  92799. return external_L_default().heatLayer([], {
  92800. radius: radius / 2,
  92801. minOpacity: layerInfo.opacity,
  92802. gradient: gradient,
  92803. blur: radius / 2,
  92804. featureWeight: featureWeight
  92805. });
  92806. },
  92807. addFeature2ThemeLayer: function addFeature2ThemeLayer(layerInfo, layer) {
  92808. var _this3 = this;
  92809. if (layerInfo.layerType !== "FEATURE_LAYER" || layerInfo.identifier !== "THEME") {
  92810. return;
  92811. }
  92812. var me = this;
  92813. var isRestData = !!layerInfo.datasourceName;
  92814. var cartoCSS = layerInfo.cartoCSS;
  92815. if (cartoCSS) {
  92816. var needTransform = this.getCartoCSS2Obj(cartoCSS).needTransform;
  92817. var isAddFile = this.getCartoCSS2Obj(cartoCSS).isAddFile;
  92818. }
  92819. var url = layerInfo.url,
  92820. subLayers,
  92821. subLayer,
  92822. layerName,
  92823. credential = layerInfo.credential,
  92824. themeSettings = layerInfo.themeSettings,
  92825. filter = themeSettings.filter;
  92826. if (isAddFile) {
  92827. var position = JSON.parse(layerInfo.datasourceName);
  92828. var sql = this.getSQLFromFilter(filter);
  92829. if (url) {
  92830. this.getFeatureFromFileAdded(layerInfo, function (data) {
  92831. var sFeaturesArr = [],
  92832. features,
  92833. result;
  92834. if (data.type === 'EXCEL' || data.type === 'CSV') {
  92835. features = me.parseFeatureFromEXCEL.apply(me, [data.content.rows, data.content.colTitles, false, position]);
  92836. for (var x = 0, len = features.length; x < len; x++) {
  92837. result = jsonsql_default()({
  92838. attr: features[x].attributes
  92839. }, sql);
  92840. if (result.length > 0) {
  92841. sFeaturesArr.push(features[x]);
  92842. }
  92843. }
  92844. } else {
  92845. features = me.parseFeatureFromJson(data.content);
  92846. for (var i = 0, length = features.length; i < length; i++) {
  92847. result = jsonsql_default()({
  92848. attr: features[i].attributes
  92849. }, sql);
  92850. if (result.length > 0) {
  92851. sFeaturesArr.push(features[i]);
  92852. }
  92853. }
  92854. }
  92855. var newEpsgCode = '4326',
  92856. oldEpsgCode = layerInfo.prjCoordSys && layerInfo.prjCoordSys.epsgCode;
  92857. if (needTransform) {
  92858. me.changeFeatureLayerEpsgCode(oldEpsgCode, newEpsgCode, layer, sFeaturesArr, function (features) {
  92859. addFeatures(features);
  92860. });
  92861. } else {
  92862. addFeatures(sFeaturesArr);
  92863. }
  92864. }, function () {});
  92865. } else {
  92866. var newFeautures = [],
  92867. features = layerInfo.features;
  92868. for (var i = 0, len = features.length; i < len; i++) {
  92869. var feature = features[i];
  92870. var sqlResult = jsonsql_default()({
  92871. attr: feature.attributes
  92872. }, sql);
  92873. if (sqlResult.length > 0) {
  92874. var lon = feature.geometry.points[0].x,
  92875. lat = feature.geometry.points[0].y;
  92876. var point = new Point(lon, lat);
  92877. var vector = new Vector(point, feature.attributes, feature.style);
  92878. newFeautures.push(vector);
  92879. }
  92880. }
  92881. addFeatures(newFeautures);
  92882. }
  92883. } else if (isRestData) {
  92884. var dataSourceName = layerInfo.datasourceName;
  92885. subLayers = layerInfo.subLayers && JSON.parse(layerInfo.subLayers);
  92886. if (subLayers.length && subLayers.length > 0) {
  92887. subLayer = subLayers[0];
  92888. } else {
  92889. subLayer = subLayers;
  92890. }
  92891. layerName = subLayer && subLayer.name;
  92892. this.getFeaturesBySQL(layerInfo.url, dataSourceName, layerName, themeSettings.filter, DataFormat.ISERVER, function (getFeaturesEventArgs) {
  92893. var features,
  92894. feature,
  92895. result = getFeaturesEventArgs.result,
  92896. addedFeatures = [];
  92897. if (result && result.features) {
  92898. features = result.features;
  92899. for (var fi = 0, felen = features.length; fi < felen; fi++) {
  92900. feature = ServerFeature.fromJson(features[fi]).toFeature();
  92901. addedFeatures.push(feature);
  92902. }
  92903. var newEpsgCode = '4326',
  92904. oldEpsgCode = layerInfo.prjCoordSys && layerInfo.prjCoordSys.epsgCode;
  92905. if (needTransform) {
  92906. _this3.changeFeatureLayerEpsgCode(oldEpsgCode, newEpsgCode, layer, addedFeatures, function (features) {
  92907. addFeatures(features);
  92908. });
  92909. } else {
  92910. addFeatures(features);
  92911. }
  92912. }
  92913. });
  92914. } else {
  92915. subLayers = layerInfo.subLayers && JSON.parse(layerInfo.subLayers);
  92916. if (subLayers.length && subLayers.length > 0) {
  92917. subLayer = subLayers[0];
  92918. } else {
  92919. subLayer = subLayers;
  92920. }
  92921. layerName = subLayer && subLayer.name;
  92922. var oldEpsgCode = layerInfo.prjCoordSys && layerInfo.prjCoordSys.epsgCode;
  92923. this.getFeaturesBySQL(url, credential, layerName, filter, DataFormat.ISERVER, function (features) {
  92924. var newEpsgCode = '4326';
  92925. if (needTransform) {
  92926. me.changeFeatureLayerEpsgCode(oldEpsgCode, newEpsgCode, layer, features, function (features) {
  92927. addFeatures(features);
  92928. });
  92929. } else {
  92930. addFeatures(features);
  92931. }
  92932. });
  92933. }
  92934. function addFeatures(features) {
  92935. if (layer && layer.labelLayer instanceof LabelThemeLayer) {
  92936. me.addFeature2LabelLayer(layer.labelLayer, features, layerInfo);
  92937. }
  92938. if ((external_L_default()).HeatLayer && layer instanceof (external_L_default()).HeatLayer) {
  92939. var heatPoints = [];
  92940. for (var _i2 = 0, _len2 = features.length; _i2 < _len2; _i2++) {
  92941. var geometry = features[_i2].geometry;
  92942. heatPoints[_i2] = external_L_default().latLng(geometry.y, geometry.x);
  92943. if (layer.options.featureWeight) {
  92944. heatPoints[_i2] = [heatPoints[_i2].lat, heatPoints[_i2].lng, parseFloat(features[_i2].attributes[layer.options.featureWeight])];
  92945. }
  92946. }
  92947. layer.setLatLngs(heatPoints);
  92948. } else if (layer instanceof (external_L_default()).GeoJSON) {
  92949. layer.addData(new GeoJSON().toGeoJSON(features));
  92950. } else {
  92951. layer.addFeatures(features);
  92952. }
  92953. }
  92954. },
  92955. addFeature2LabelLayer: function addFeature2LabelLayer(layer, features, layerInfo) {
  92956. if (!features) {
  92957. return;
  92958. }
  92959. var feature, geoTextFeature;
  92960. var themeSettings = layerInfo.themeSettings;
  92961. themeSettings = typeof themeSettings === "string" ? JSON.parse(layerInfo.themeSettings) : layerInfo.themeSettings;
  92962. var themeField = themeSettings.labelField;
  92963. var style = layer.style;
  92964. var labelFeatures = [],
  92965. lngLat;
  92966. var styleInfo = layerInfo.styleString && JSON.parse(layerInfo.styleString);
  92967. for (var i = 0; i < features.length; i++) {
  92968. lngLat = this.getLabelLngLat(themeSettings.vectorType, features[i]);
  92969. //设置标签的偏移量
  92970. this.setLabelOffset(themeSettings.vectorType, styleInfo, features[i], style);
  92971. feature = features[i];
  92972. var attributes = feature.attributes;
  92973. geoTextFeature = new ThemeFeature([lngLat.lat, lngLat.lng, attributes[themeField]], attributes);
  92974. labelFeatures.push(geoTextFeature);
  92975. }
  92976. layer.style = style;
  92977. layer.addFeatures(labelFeatures);
  92978. },
  92979. setLabelOffset: function setLabelOffset(vectorType, styleInfo, feature, layerStyle) {
  92980. if (vectorType === 'POINT') {
  92981. var pointRadius = styleInfo.pointStyle.pointRadius || 0;
  92982. var strokeWidth = styleInfo.pointStyle.strokeWidth || 0;
  92983. var fontSize = parseInt(styleInfo.pointStyle.fontSize) || 0;
  92984. layerStyle.labelXOffset = 0;
  92985. layerStyle.labelYOffset = styleInfo.pointStyle.unicode ? 20 + fontSize : 25 + (pointRadius + strokeWidth);
  92986. } else {
  92987. return;
  92988. }
  92989. },
  92990. getLabelLngLat: function getLabelLngLat(vectorType, feature) {
  92991. var lngLat = {};
  92992. if (vectorType === 'POINT') {
  92993. var geometry = feature.geometry;
  92994. lngLat.lng = geometry.x;
  92995. lngLat.lat = geometry.y;
  92996. } else if (vectorType === 'LINE') {
  92997. //一条线所有顶点的数量
  92998. var length, index;
  92999. var components = feature.geometry.components;
  93000. if (components[0].x) {
  93001. //说明是lineString类型
  93002. length = components.length;
  93003. //线取中间点下一个显示标签
  93004. index = parseInt(length / 2);
  93005. lngLat.lng = components[index].x;
  93006. lngLat.lat = components[index].y;
  93007. } else {
  93008. //说明是MultiLineString类型,取第一条线
  93009. var lineOne = components[0].components;
  93010. length = lineOne.length;
  93011. index = parseInt(length / 2);
  93012. lngLat.lng = lineOne[index].x;
  93013. lngLat.lat = lineOne[index].y;
  93014. }
  93015. } else {
  93016. var centroid = feature.geometry.getCentroid();
  93017. lngLat.lng = centroid.x;
  93018. lngLat.lat = centroid.y;
  93019. }
  93020. return lngLat;
  93021. },
  93022. changeFeatureLayerEpsgCode: function changeFeatureLayerEpsgCode(oldEpsgCode, newEpsgCode, layer, features, success) {
  93023. var me = this,
  93024. i,
  93025. len;
  93026. var points = [];
  93027. if (!oldEpsgCode || !newEpsgCode) {
  93028. return;
  93029. }
  93030. if (features && features.length > 0) {
  93031. for (i = 0, len = features.length; i < len; i++) {
  93032. var feature = features[i];
  93033. var geometry = feature.geometry;
  93034. var vertices = geometry.getVertices();
  93035. points = points.concat(vertices);
  93036. }
  93037. oldEpsgCode = 'EPSG:' + oldEpsgCode;
  93038. newEpsgCode = 'EPSG:' + newEpsgCode;
  93039. me.coordsTransform(oldEpsgCode, newEpsgCode, points, function (layer, features) {
  93040. return function (newCoors) {
  93041. var start = 0,
  93042. len = newCoors.length;
  93043. for (i = start; i < len; i++) {
  93044. var point = points[i],
  93045. coor = newCoors[i];
  93046. point.x = coor.x;
  93047. point.y = coor.y;
  93048. point.calculateBounds();
  93049. }
  93050. for (i = 0, len = features.length; i < len; i++) {
  93051. var feature = features[i];
  93052. var geometry = feature.geometry;
  93053. if (geometry.components) {
  93054. me.calculateComponents(geometry.components);
  93055. }
  93056. geometry.calculateBounds();
  93057. }
  93058. success && success.call(me, features);
  93059. };
  93060. }(layer, features));
  93061. }
  93062. return true;
  93063. },
  93064. calculateComponents: function calculateComponents(components) {
  93065. if (components) {
  93066. if (components.components) {
  93067. this.calculateComponents(components.components);
  93068. } else {
  93069. for (var i = 0, len = components.length; i < len; i++) {
  93070. var component = components[i];
  93071. if (component.components) {
  93072. this.calculateComponents(component.components);
  93073. }
  93074. component.calculateBounds();
  93075. }
  93076. }
  93077. }
  93078. },
  93079. coordsTransform: function coordsTransform(fromEpsg, toEpsg, point, success) {
  93080. var newCoord;
  93081. var from = this.SERVER_TYPE_MAP[fromEpsg],
  93082. to = this.SERVER_TYPE_MAP[toEpsg];
  93083. if (fromEpsg === toEpsg || !from || !to) {
  93084. if (point && point.length !== undefined) {
  93085. newCoord = [];
  93086. for (var i = 0, len = point.length; i < len; i++) {
  93087. var coor = {
  93088. x: point[i].x,
  93089. y: point[i].y
  93090. };
  93091. newCoord.push(coor);
  93092. }
  93093. } else {
  93094. newCoord = {
  93095. x: point.x,
  93096. y: point.y
  93097. };
  93098. }
  93099. if (success) {
  93100. success.call(this, newCoord);
  93101. }
  93102. } else {
  93103. var mercator = this.SERVER_TYPE_MAP['EPSG:3857'],
  93104. wgs84 = this.SERVER_TYPE_MAP['EPSG:4326'];
  93105. if ((from === mercator || from === wgs84) && (to === mercator || to === wgs84)) {
  93106. this.projTransform(fromEpsg, toEpsg, point, success);
  93107. } else {
  93108. var convertType = from + '_' + to;
  93109. this.postTransform(convertType, point, success);
  93110. }
  93111. }
  93112. },
  93113. projTransform: function projTransform(fromEpsg, toEpsg, point, success) {
  93114. var newCoor,
  93115. me = this;
  93116. if (!(proj4_src_default())) {
  93117. return;
  93118. }
  93119. if (point && point.length !== undefined) {
  93120. newCoor = [];
  93121. for (var i = 0, len = point.length; i < len; i++) {
  93122. var coor = proj4_src_default()(fromEpsg, toEpsg, [point[i].x, point[i].y]);
  93123. newCoor.push({
  93124. x: coor[0],
  93125. y: coor[1]
  93126. });
  93127. }
  93128. } else {
  93129. newCoor = proj4_src_default()(fromEpsg, toEpsg, [point.x, point.y]);
  93130. newCoor = {
  93131. x: newCoor[0],
  93132. y: newCoor[1]
  93133. };
  93134. }
  93135. if (success) {
  93136. /**
  93137. * @event WebMap#coordconvertsuccess
  93138. * @description 坐标转换成功后触发。
  93139. * @property {L.LatLng} newCoor - 转换成功后的坐标。
  93140. */
  93141. me.fire('coordconvertsuccess', {
  93142. newCoor: newCoor
  93143. });
  93144. success.call(me, newCoor);
  93145. }
  93146. },
  93147. postTransform: function postTransform(convertType, point, success) {
  93148. var _this4 = this;
  93149. var me = this,
  93150. epsgArray = [];
  93151. if (!convertType) {
  93152. return success.call(me, null);
  93153. }
  93154. if (point && point.length !== undefined) {
  93155. for (var i = 0, len = point.length; i < len; i++) {
  93156. epsgArray.push({
  93157. x: point[i].x,
  93158. y: point[i].y
  93159. });
  93160. }
  93161. } else {
  93162. epsgArray = [{
  93163. x: point.x,
  93164. y: point.y
  93165. }];
  93166. }
  93167. if (epsgArray.length === 0) {
  93168. return success.call(me, null);
  93169. }
  93170. var postData = {
  93171. "convertType": convertType,
  93172. "points": epsgArray
  93173. };
  93174. var url = this.server + "/apps/viewer/coordconvert.json";
  93175. postData = JSON.stringify(postData);
  93176. var options = {};
  93177. if (!Util_Util.isInTheSameDomain(url) && this.proxy) {
  93178. options.proxy = this.proxy;
  93179. }
  93180. FetchRequest.post(url, postData, options).then(function (response) {
  93181. return response.json();
  93182. }).then(function (jsonObj) {
  93183. var newCoors = jsonObj;
  93184. if (!point && point.length !== undefined) {
  93185. newCoors = newCoors[0];
  93186. }
  93187. _this4.fire('coordconvertsuccess', {
  93188. newCoors: newCoors
  93189. });
  93190. success.call(_this4, newCoors);
  93191. })["catch"](function (err) {
  93192. if (!_this4.actived) {
  93193. return;
  93194. }
  93195. /**
  93196. * @event WebMap#coordconvertfailed
  93197. * @description 坐标转换失败后触发。
  93198. * @property {Object} err - error 对象。
  93199. */
  93200. _this4.fire('coordconvertfailed', {
  93201. err: err
  93202. });
  93203. });
  93204. },
  93205. getSQLFromFilter: function getSQLFromFilter(filter) {
  93206. if (!filter) {
  93207. return ' * where (1==1||1>=0)';
  93208. } else {
  93209. filter = filter.replace(/=/g, '==').replace(/and|AND/g, '&&').replace(/or|OR/g, '||').replace(/>==/g, '>=').replace(/<==/g, '<=');
  93210. return ' * where (' + filter + ')';
  93211. }
  93212. },
  93213. getAttributesObjFromTable: function getAttributesObjFromTable(cols, colTitles) {
  93214. if (cols.length === 0 || colTitles.length === 0) {
  93215. return;
  93216. }
  93217. var attrArr = [];
  93218. for (var i = 0; i < cols.length; i++) {
  93219. var obj = {};
  93220. for (var j = 0; j < colTitles.length; j++) {
  93221. obj[colTitles[j]] = cols[i][j];
  93222. }
  93223. attrArr.push(obj);
  93224. }
  93225. return attrArr;
  93226. },
  93227. parseFeatureFromEXCEL: function parseFeatureFromEXCEL(rows, colTitles, isGraphic, position) {
  93228. var attrArr = this.getAttributesObjFromTable(rows, colTitles);
  93229. var features = [];
  93230. for (var i = 0, len = attrArr.length; i < len; i++) {
  93231. var lon = attrArr[i][position["lon"]];
  93232. var lat = attrArr[i][position["lat"]];
  93233. if (!lon || !lat) {
  93234. continue;
  93235. }
  93236. lon = parseFloat(lon);
  93237. lat = parseFloat(lat);
  93238. var geometry = new Point(lon, lat);
  93239. var pointGraphic;
  93240. if (isGraphic) {
  93241. pointGraphic = new Graphic(geometry, attrArr[i], null);
  93242. } else {
  93243. pointGraphic = new Vector(geometry, attrArr[i], null);
  93244. }
  93245. features.push(pointGraphic);
  93246. }
  93247. return features;
  93248. },
  93249. parseFeatureFromJson: function parseFeatureFromJson(feature) {
  93250. var format = new GeoJSON();
  93251. var features = format.read(feature);
  93252. //兼容insights数据格式
  93253. if (features == null) {
  93254. var content = JSON.parse(feature.replace(/'/, '"'));
  93255. if (content.isAnalyseResult || content.type === 'MapEditor' || content.type === 'DataInsights' || content.type === 'ISERVER') {
  93256. content = content.data.recordsets[0].features;
  93257. }
  93258. format = new GeoJSON();
  93259. features = format.read(content);
  93260. }
  93261. for (var i = 0, len = features.length; i < len; i++) {
  93262. features[i].attributes = features[i].attributes.properties || features[i].attributes;
  93263. }
  93264. return features;
  93265. },
  93266. getFeatureFromFileAdded: function getFeatureFromFileAdded(layerInfo, success, failed, isGraphic) {
  93267. var url = isGraphic ? layerInfo.url + '?currentPage=1&&pageSize=9999999' : layerInfo.url;
  93268. FetchRequest.get(url).then(function (response) {
  93269. return response.json();
  93270. }).then(function (data) {
  93271. success && success(data);
  93272. })["catch"](function (err) {
  93273. return failed && failed(err);
  93274. });
  93275. },
  93276. getCartoCSS2Obj: function getCartoCSS2Obj(cartoCSS) {
  93277. var isAddFile,
  93278. needTransform = false;
  93279. if (cartoCSS.indexOf('}') > -1) {
  93280. cartoCSS = JSON.parse(cartoCSS);
  93281. needTransform = cartoCSS.needTransform;
  93282. isAddFile = cartoCSS.isAddFile;
  93283. } else {
  93284. if (cartoCSS === 'needTransform') {
  93285. needTransform = true;
  93286. //layerInfo.needTransform = true;
  93287. isAddFile = false;
  93288. } else {
  93289. isAddFile = cartoCSS === 'true';
  93290. }
  93291. }
  93292. return {
  93293. isAddFile: isAddFile,
  93294. needTransform: needTransform
  93295. };
  93296. },
  93297. registerThemeEvent: function registerThemeEvent(themeLayer) {
  93298. var _this5 = this;
  93299. themeLayer.on('click', function (evt) {
  93300. if (!themeLayer.map) {
  93301. return;
  93302. }
  93303. if (_this5.selectedFeature) {
  93304. /**
  93305. * @event WebMap#featureunselected
  93306. * @description 重置选中的要素为空。
  93307. * @property {FeatureVector} feature - 在重置之前选中的要素。
  93308. */
  93309. _this5.fire('featureunselected', {
  93310. feature: _this5.selectedFeature
  93311. });
  93312. _this5.selectedFeature = null;
  93313. }
  93314. var feature;
  93315. if (evt.target && evt.target.refDataID) {
  93316. feature = themeLayer.getFeatureById(evt.target.refDataID);
  93317. }
  93318. if (feature) {
  93319. _this5.selectedFeature = feature;
  93320. /**
  93321. * @event WebMap#featureselected
  93322. * @description 点击要素,要素存在之后触发。设置选中的要素。
  93323. * @property {FeatureVector} feature - 点击的要素。
  93324. */
  93325. _this5.fire('featureselected', {
  93326. feature: feature
  93327. });
  93328. }
  93329. });
  93330. themeLayer.on('mousemove', function (evt) {
  93331. if (!themeLayer.map) {
  93332. return;
  93333. }
  93334. if (evt.target && evt.target.refDataID) {
  93335. var feature;
  93336. if (evt.target && evt.target.refDataID) {
  93337. feature = themeLayer.getFeatureById(evt.target.refDataID);
  93338. }
  93339. if (feature) {
  93340. /**
  93341. * @event WebMap#featuremousemove
  93342. * @description 鼠标移动到要素上之后触发。
  93343. * @property {FeatureVector} feature - 当前被移动到的要素。
  93344. */
  93345. _this5.fire('featuremousemove', {
  93346. feature: feature
  93347. });
  93348. }
  93349. }
  93350. });
  93351. },
  93352. SERVER_TYPE_MAP: {
  93353. "EPSG:4326": "WGS84",
  93354. "EPSG:3857": "MERCATOR",
  93355. "EPSG:900913": "MERCATOR",
  93356. "EPSG:102113": "MERCATOR",
  93357. "EPSG:910101": "GCJ02",
  93358. "EPSG:910111": "GCJ02MERCATOR",
  93359. "EPSG:910102": "BD",
  93360. "EPSG:910112": "BDMERCATOR"
  93361. }
  93362. });
  93363. var webMap = function webMap(id, options) {
  93364. return new WebMap(id, options);
  93365. };
  93366. ;// CONCATENATED MODULE: ./src/leaflet/mapping/ImageTileLayer.js
  93367. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93368. * This program are made available under the terms of the Apache License, Version 2.0
  93369. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93370. /**
  93371. * @class ImageTileLayer
  93372. * @deprecatedclassinstance L.supermap.imageTileLayer
  93373. * @version 10.2.0
  93374. * @classdesc iServer 影像服务图层源。根据请求参数,返回指定的影像数据栅格瓦片并渲染。
  93375. * @category iServer Image
  93376. * @extends {L.TileLayer}
  93377. * @example
  93378. * new ImageTileLayer(url,{collectionId:'xxx'}).addTo(map);
  93379. * @param {string} url - 服务地址,例如: http://{ip}:{port}/iserver/{imageservice-imageserviceName}/restjsr/
  93380. * @param {Object} options - 参数。
  93381. * @param {string} options.collectionId - 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  93382. * @param {string} [options.sqlFilter] 对所显示影像的过滤条件。相当于SQL查询中的where子句。支持st_geometry空间函数过滤。11.0版本暂不支持通过ECQL进行过滤。
  93383. * @param {ImageRenderingRule} [options.renderingRule] 指定影像显示的风格,包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。不指定时,使用发布服务时所配置的风格。
  93384. * @param {Array.<number>} [options.ids] 返回影像集合中指定ID的影像,该ID为系统维护的一个自增ID,为SuperMap SDX引擎的SmID字段内容。
  93385. * @param {Array.<string>} [options.names] 返回影像集合中指定名称影像的瓦片资源。影像名称包含文件后缀,如S-60-45.tif。
  93386. * @param {string} [options.format='png'] - 瓦片表述类型,瓦片格式目前支持png、jpg和webp三种格式。
  93387. * @param {boolean} [options.transparent=true] - 瓦片是否透明。默认透明。
  93388. * @param {boolean} [options.cacheEnabled=true] - 启用缓存。
  93389. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
  93390. * @param {Array.<number>} [options.subdomains] - 子域名数组。
  93391. * @param {string} [options.tileProxy] - 服务代理地址。
  93392. * @usage
  93393. */
  93394. var ImageTileLayer = external_L_default().TileLayer.extend({
  93395. options: {
  93396. collectionId: null,
  93397. sqlFilter: null,
  93398. ids: null,
  93399. names: null,
  93400. renderingRule: null,
  93401. format: 'png',
  93402. zoomOffset: 1,
  93403. transparent: true,
  93404. cacheEnabled: true,
  93405. tileProxy: null,
  93406. //启用托管地址。
  93407. attribution: core_Attributions.Common.attribution,
  93408. subdomains: null
  93409. },
  93410. initialize: function initialize(url, options) {
  93411. this._url = url;
  93412. external_L_default().TileLayer.prototype.initialize.apply(this, arguments);
  93413. external_L_default().setOptions(this, options);
  93414. external_L_default().stamp(this);
  93415. },
  93416. /**
  93417. * @private
  93418. * @function ImageTileLayer.prototype.onAdd
  93419. * @description 添加地图。
  93420. * @param {L.Map} map - Leaflet Map 对象。
  93421. */
  93422. onAdd: function onAdd(map) {
  93423. external_L_default().TileLayer.prototype.onAdd.call(this, map);
  93424. },
  93425. /**
  93426. * @function ImageTileLayer.prototype.getTileUrl
  93427. * @description 根据行列号获取瓦片地址。
  93428. * @param {Object} coords - 行列号。
  93429. * @returns {string} 瓦片地址。
  93430. */
  93431. getTileUrl: function getTileUrl(coords) {
  93432. var layerUrl = this._getLayerUrl();
  93433. var tileUrl = layerUrl + '&z=' + this._getZoomForUrl() + '&x=' + coords.x + '&y=' + coords.y;
  93434. //支持代理
  93435. if (this.options.tileProxy) {
  93436. tileUrl = this.options.tileProxy + encodeURIComponent(tileUrl);
  93437. }
  93438. if (!this.options.cacheEnabled) {
  93439. tileUrl += '&_t=' + new Date().getTime();
  93440. }
  93441. if (this.options.subdomains) {
  93442. tileUrl = external_L_default().Util.template(tileUrl, {
  93443. s: this._getSubdomain(coords)
  93444. });
  93445. }
  93446. return tileUrl;
  93447. },
  93448. _getLayerUrl: function _getLayerUrl() {
  93449. return this._layerUrl || this._createLayerUrl();
  93450. },
  93451. _createLayerUrl: function _createLayerUrl() {
  93452. var layerUrl = Util_Util.urlPathAppend(this._url, "/collections/".concat(this.options.collectionId, "/tile.").concat(this.options.format));
  93453. this.requestParams = this.requestParams || this._getAllRequestParams();
  93454. layerUrl = Util_Util.urlAppend(layerUrl, external_L_namespaceObject.Util.getParamString(this.requestParams));
  93455. layerUrl = SecurityManager.appendCredential(layerUrl);
  93456. this._layerUrl = layerUrl;
  93457. return layerUrl;
  93458. },
  93459. _getAllRequestParams: function _getAllRequestParams() {
  93460. var me = this,
  93461. options = me.options || {},
  93462. params = {};
  93463. params['transparent'] = options.transparent === true;
  93464. params['cacheEnabled'] = !(options.cacheEnabled === false);
  93465. if (options.sqlFilter) {
  93466. params['sqlFilter'] = options.sqlFilter;
  93467. }
  93468. if (options.renderingRule) {
  93469. params['renderingRule'] = JSON.stringify(options.renderingRule);
  93470. }
  93471. if (options.ids) {
  93472. params['ids'] = options.ids.join(',');
  93473. }
  93474. if (options.names) {
  93475. params['names'] = options.names.join(',');
  93476. }
  93477. return params;
  93478. }
  93479. });
  93480. var imageTileLayer = function imageTileLayer(url, options) {
  93481. return new ImageTileLayer(url, options);
  93482. };
  93483. ;// CONCATENATED MODULE: ./src/leaflet/mapping/initMap.js
  93484. function initMap_typeof(obj) { "@babel/helpers - typeof"; return initMap_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; }, initMap_typeof(obj); }
  93485. function initMap_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ initMap_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" == initMap_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; }
  93486. function initMap_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; }
  93487. function initMap_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? initMap_ownKeys(Object(source), !0).forEach(function (key) { initMap_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : initMap_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  93488. function initMap_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; }
  93489. function initMap_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); } }
  93490. function initMap_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { initMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { initMap_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
  93491. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93492. * This program are made available under the terms of the Apache License, Version 2.0
  93493. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93494. /**
  93495. * @function initMap
  93496. * @description 根据 SuperMap iServer 服务参数,创建地图与图层。目前仅支持SuperMap iServer 地图服务,创建的图层为 TiledMapLayer。
  93497. * @category BaseTypes Util
  93498. * @version 11.0.1
  93499. * @example
  93500. * initMap(url, {mapOptions, layerOptions});
  93501. * @param {string} url - 服务地址,例如: http://{ip}:{port}/iserver/services/map-world/rest/maps/World。
  93502. * @param {Object} [options] - 参数。
  93503. * @param {L.MapOptions} [options.mapOptions] - 地图参数,未设置的情况下,默认使用 SuperMap iServer 服务参数进行设置。
  93504. * @param {Object} [options.layerOptions] - 图层参数,参考<a href="TiledMapLayer.html">TiledMapLayer</a>的参数。
  93505. * @returns {Promise} Promise 对象,返回{ map, layer }。
  93506. * @usage
  93507. * ```
  93508. * // 浏览器
  93509. * <script type="text/javascript" src="{cdn}"></script>
  93510. * <script>
  93511. * const initMap = {namespace}.initMap;
  93512. * initMap(url, {mapOptions, layerOptions});
  93513. *
  93514. * </script>
  93515. * // ES6 Import
  93516. * import { initMap } from "{npm}";
  93517. *
  93518. * initMap(url, {mapOptions, layerOptions});
  93519. *
  93520. * ```
  93521. */
  93522. function initMap(url, options) {
  93523. options = options || {};
  93524. var mapOptions = options.mapOptions || {};
  93525. var layerOptions = options.layerOptions || {};
  93526. return new Promise(function (resolve, reject) {
  93527. new MapService_MapService(url).getMapInfo( /*#__PURE__*/function () {
  93528. var _ref = initMap_asyncToGenerator( /*#__PURE__*/initMap_regeneratorRuntime().mark(function _callee(res) {
  93529. var prjCoordSys, epsgCodeStr, mapInfoOptions, map, layer;
  93530. return initMap_regeneratorRuntime().wrap(function _callee$(_context) {
  93531. while (1) switch (_context.prev = _context.next) {
  93532. case 0:
  93533. if (!(res.type === 'processCompleted')) {
  93534. _context.next = 12;
  93535. break;
  93536. }
  93537. prjCoordSys = res.result.prjCoordSys;
  93538. epsgCodeStr = getEpsgCodeStr(prjCoordSys);
  93539. if (isPlaneProjection(prjCoordSys)) {
  93540. _context.next = 6;
  93541. break;
  93542. }
  93543. _context.next = 6;
  93544. return setProj(url, epsgCodeStr);
  93545. case 6:
  93546. mapInfoOptions = getMapOptions(res.result, mapOptions);
  93547. map = external_L_default().map('map', initMap_objectSpread(initMap_objectSpread({}, mapInfoOptions), mapOptions));
  93548. layer = new TiledMapLayer(url, initMap_objectSpread(initMap_objectSpread({}, {
  93549. noWrap: true
  93550. }), layerOptions));
  93551. layer.addTo(map);
  93552. resolve({
  93553. map: map,
  93554. layer: layer
  93555. });
  93556. return _context.abrupt("return");
  93557. case 12:
  93558. reject();
  93559. case 13:
  93560. case "end":
  93561. return _context.stop();
  93562. }
  93563. }, _callee);
  93564. }));
  93565. return function (_x) {
  93566. return _ref.apply(this, arguments);
  93567. };
  93568. }());
  93569. });
  93570. }
  93571. /**
  93572. * @function crsFromMapJSON
  93573. * @description 通过iServer REST地图的配置信息,构建地图的CRS(非平面投影、EPSG:3857、EPSG:4326需要先注册投影)。
  93574. * @category BaseTypes Util
  93575. * @version 11.0.1
  93576. * @param {Object} mapJSONObj - 地图参数。
  93577. * @param {Object} mapJSONObj.prjCoordSys - 投影配置。
  93578. * @param {Object} mapJSONObj.bounds - 范围。
  93579. * @param {number} mapJSONObj.dpi - DPI。
  93580. * @param {Array} mapJSONObj.visibleScales - 自定义比例尺。
  93581. * @param {Array} mapJSONObj.coordUnit - 地图单位。
  93582. * @param {Object} [mapOptions] - 地图参数。
  93583. * @param {Object} [mapOptions.maxZoom=22] - 地图最大缩放级别。没有设置固定比例尺时生效。
  93584. * @returns {CRS} 返回CRS。
  93585. */
  93586. function crsFromMapJSON(mapJSONObj, mapOptions) {
  93587. var _ref2 = mapOptions || {},
  93588. _ref2$maxZoom = _ref2.maxZoom,
  93589. maxZoom = _ref2$maxZoom === void 0 ? 22 : _ref2$maxZoom;
  93590. var bounds = mapJSONObj.bounds,
  93591. prjCoordSys = mapJSONObj.prjCoordSys,
  93592. dpi = mapJSONObj.dpi,
  93593. visibleScales = mapJSONObj.visibleScales,
  93594. coordUnit = mapJSONObj.coordUnit;
  93595. var resolutions = scalesToResolutions(visibleScales, bounds, dpi, coordUnit, maxZoom);
  93596. if (isPlaneProjection(prjCoordSys)) {
  93597. return getNonEarthCRS(bounds);
  93598. }
  93599. var epsgCodeStr = getEpsgCodeStr(prjCoordSys);
  93600. if (!hasRegisterProj(epsgCodeStr)) {
  93601. return;
  93602. }
  93603. return getCRS(epsgCodeStr, {
  93604. bounds: bounds,
  93605. dpi: dpi,
  93606. resolutions: resolutions
  93607. });
  93608. }
  93609. /**
  93610. * @private
  93611. * @function isPlaneProjection
  93612. * @description 是否是平面坐标系。
  93613. * @param {Object} prjCoordSys - prjCoordSys
  93614. * @returns {boolean}
  93615. */
  93616. function isPlaneProjection(prjCoordSys) {
  93617. return prjCoordSys.type === 'PCS_NON_EARTH';
  93618. }
  93619. /**
  93620. * @private
  93621. * @function setProj
  93622. * @description 注册4214 4610 4490等投影。
  93623. * @param {string} url
  93624. * @param {string} epsgCodeStr - epsgCode。
  93625. */
  93626. function setProj(_x2, _x3) {
  93627. return _setProj.apply(this, arguments);
  93628. }
  93629. /**
  93630. * @private
  93631. * @function hasRegisterProj
  93632. * @description 判断是否注册了投影。
  93633. * @param {string} epsgCodeStr - epsgCode。
  93634. * @param {boolean} isConsole - 是否在控制台打印。
  93635. * @returns {boolean}
  93636. */
  93637. function _setProj() {
  93638. _setProj = initMap_asyncToGenerator( /*#__PURE__*/initMap_regeneratorRuntime().mark(function _callee2(url, epsgCodeStr) {
  93639. var def;
  93640. return initMap_regeneratorRuntime().wrap(function _callee2$(_context2) {
  93641. while (1) switch (_context2.prev = _context2.next) {
  93642. case 0:
  93643. if (hasRegisterProj(epsgCodeStr, false)) {
  93644. _context2.next = 5;
  93645. break;
  93646. }
  93647. _context2.next = 3;
  93648. return getWKT(url);
  93649. case 3:
  93650. def = _context2.sent;
  93651. def && proj4_src_default().defs(epsgCodeStr, def);
  93652. case 5:
  93653. case "end":
  93654. return _context2.stop();
  93655. }
  93656. }, _callee2);
  93657. }));
  93658. return _setProj.apply(this, arguments);
  93659. }
  93660. function hasRegisterProj(epsgCodeStr) {
  93661. var isConsole = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  93662. try {
  93663. proj4_src_default()(epsgCodeStr);
  93664. } catch (e) {
  93665. if (isConsole) {
  93666. console.error("The projection of ".concat(epsgCodeStr, " is missing, please register the projection of ").concat(epsgCodeStr, " first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection"));
  93667. }
  93668. return false;
  93669. }
  93670. return true;
  93671. }
  93672. /**
  93673. * @private
  93674. * @function getMapOptions
  93675. * @description 获取地图参数。
  93676. * @param {Object} mapJSONObj - 地图 JSON 对象。
  93677. * @param {Object} [mapOptions] - 地图参数。
  93678. * @param {Object} [mapOptions.maxZoom=22] - 地图最大缩放级别(没有设置固定比例尺时生效)。
  93679. * @returns {Object} mapParams。
  93680. */
  93681. function getMapOptions(mapJSONObj, mapOptions) {
  93682. var bounds = mapJSONObj.bounds,
  93683. center = mapJSONObj.center,
  93684. scale = mapJSONObj.scale,
  93685. visibleScales = mapJSONObj.visibleScales,
  93686. prjCoordSys = mapJSONObj.prjCoordSys,
  93687. dpi = mapJSONObj.dpi,
  93688. coordUnit = mapJSONObj.coordUnit;
  93689. var _mapOptions$maxZoom = mapOptions.maxZoom,
  93690. maxZoom = _mapOptions$maxZoom === void 0 ? 22 : _mapOptions$maxZoom;
  93691. var resolutions = scalesToResolutions(visibleScales, bounds, dpi, coordUnit, maxZoom);
  93692. var crs = crsFromMapJSON({
  93693. prjCoordSys: prjCoordSys,
  93694. bounds: bounds,
  93695. dpi: dpi,
  93696. visibleScales: visibleScales,
  93697. coordUnit: coordUnit
  93698. }, {
  93699. maxZoom: maxZoom
  93700. });
  93701. var visableResolutions = crs.resolutions || resolutions;
  93702. var mapParams = {
  93703. crs: crs,
  93704. center: getCenter(crs, {
  93705. center: center,
  93706. bounds: bounds
  93707. }),
  93708. zoom: getZoomByScale({
  93709. scale: scale,
  93710. dpi: dpi,
  93711. coordUnit: coordUnit
  93712. }, visableResolutions),
  93713. maxZoom: getMaxZoom(resolutions)
  93714. };
  93715. return mapParams;
  93716. }
  93717. /**
  93718. * @private
  93719. * @function getZoomByScale
  93720. * @description 获取Zoom。
  93721. * @param {Object} options
  93722. * @param {string} options.scale - scale。
  93723. * @param {number} options.dpi - dpi
  93724. * @param {string} options.coordUnit - coordUnit
  93725. * @param {Object} visableResolutions - visableResolutions
  93726. * @returns {number} zoom。
  93727. */
  93728. function getZoomByScale(_ref3, visableResolutions) {
  93729. var scale = _ref3.scale,
  93730. dpi = _ref3.dpi,
  93731. coordUnit = _ref3.coordUnit;
  93732. var resolution = Util_scaleToResolution(scale, dpi, coordUnit);
  93733. return getZoomByResolution(resolution, visableResolutions);
  93734. }
  93735. /**
  93736. * @private
  93737. * @function getMaxZoom
  93738. * @description 获取maxZoom。
  93739. * @param {Array} visibleResolutions - visibleResolutions
  93740. * @returns {number} maxZoom。
  93741. */
  93742. function getMaxZoom(visibleResolutions) {
  93743. if (visibleResolutions.length > 0) {
  93744. return visibleResolutions.length - 1;
  93745. }
  93746. return 22;
  93747. }
  93748. /**
  93749. * @private
  93750. * @function getCenter
  93751. * @description 获取center。
  93752. * @param {CRS} crs - crs。
  93753. * @param {Object} mapJSONObj - 地图 JSON 对象。
  93754. * @param {Object} mapJSONObj.center - 地图参数。
  93755. * @param {Object} mapJSONObj.bounds - 地图最大缩放级别。
  93756. * @returns {Object} center。
  93757. */
  93758. function getCenter(crs, _ref4) {
  93759. var center = _ref4.center,
  93760. bounds = _ref4.bounds;
  93761. var code = typeof crs === 'string' ? crs : crs.code;
  93762. if (typeof center.x !== 'number' && typeof center.y !== 'number') {
  93763. center = {
  93764. lat: (bounds.bottom + bounds.top) / 2,
  93765. lng: (bounds.left + bounds.right) / 2
  93766. };
  93767. }
  93768. if (code === 'EPSG:4326') {
  93769. return {
  93770. lat: center.y,
  93771. lng: center.x
  93772. };
  93773. }
  93774. return crs.unproject(external_L_default().point(center.x, center.y));
  93775. }
  93776. /**
  93777. * @private
  93778. * @function getCenter
  93779. * @description 获取center。
  93780. * @param {Object} prjCoordSys
  93781. * @returns {string} center。
  93782. */
  93783. function getEpsgCodeStr(prjCoordSys) {
  93784. var type = prjCoordSys.type,
  93785. epsgCode = prjCoordSys.epsgCode;
  93786. if (type == 'PCS_NON_EARTH') {
  93787. // 平面投影
  93788. return '';
  93789. }
  93790. return 'EPSG:' + epsgCode;
  93791. }
  93792. function getWKT(_x4) {
  93793. return _getWKT.apply(this, arguments);
  93794. }
  93795. function _getWKT() {
  93796. _getWKT = initMap_asyncToGenerator( /*#__PURE__*/initMap_regeneratorRuntime().mark(function _callee3(url) {
  93797. return initMap_regeneratorRuntime().wrap(function _callee3$(_context3) {
  93798. while (1) switch (_context3.prev = _context3.next) {
  93799. case 0:
  93800. return _context3.abrupt("return", new Promise(function (resolve, reject) {
  93801. new MapService_MapService(url, {
  93802. withoutFormatSuffix: true
  93803. }).getWkt(function (res) {
  93804. if (res.type === 'processCompleted') {
  93805. var proj4def = res.result.data;
  93806. resolve(proj4def);
  93807. return;
  93808. }
  93809. reject();
  93810. });
  93811. }));
  93812. case 1:
  93813. case "end":
  93814. return _context3.stop();
  93815. }
  93816. }, _callee3);
  93817. }));
  93818. return _getWKT.apply(this, arguments);
  93819. }
  93820. function getNonEarthCRS(bounds) {
  93821. var options = {
  93822. bounds: external_L_default().bounds([bounds.left, bounds.bottom], [bounds.right, bounds.top]),
  93823. origin: external_L_default().point(bounds.left, bounds.top)
  93824. };
  93825. return new NonEarthCRS(options);
  93826. }
  93827. function getCRS(epsgCodeStr, _ref5) {
  93828. var bounds = _ref5.bounds,
  93829. dpi = _ref5.dpi,
  93830. resolutions = _ref5.resolutions;
  93831. var wrapLngLeft = proj4_src_default()(epsgCodeStr, 'EPSG:4326').forward([bounds.left, 0], true);
  93832. var wrapLngRight = proj4_src_default()(epsgCodeStr, 'EPSG:4326').forward([bounds.right, 0], true);
  93833. var wrapLng = [parseInt(wrapLngLeft[0]), parseInt(wrapLngRight[0])];
  93834. var options = {
  93835. wrapLng: wrapLng,
  93836. bounds: external_L_default().bounds([bounds.left, bounds.bottom], [bounds.right, bounds.top]),
  93837. origin: [bounds.left, bounds.top],
  93838. dpi: dpi
  93839. };
  93840. if (resolutions && resolutions.length > 0) {
  93841. options.resolutions = resolutions;
  93842. }
  93843. return new CRS(epsgCodeStr, options);
  93844. }
  93845. ;// CONCATENATED MODULE: ./src/leaflet/mapping/index.js
  93846. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93847. * This program are made available under the terms of the Apache License, Version 2.0
  93848. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93849. ;// CONCATENATED MODULE: ./src/leaflet/services/DataFlowService.js
  93850. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  93851. * This program are made available under the terms of the Apache License, Version 2.0
  93852. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  93853. /**
  93854. * @class DataFlowService
  93855. * @deprecatedclassinstance L.supermap.dataFlowService
  93856. * @classdesc 数据流服务类。
  93857. * @category iServer DataFlow
  93858. * @modulecategory Services
  93859. * @extends {ServiceBase}
  93860. * @param {string} url - 服务地址。
  93861. * @param {Object} options - 参数。
  93862. * @param {function} [options.style] - 设置数据加载样式。
  93863. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗。
  93864. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  93865. * @param {Object} [options.excludeField] - 排除字段。
  93866. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  93867. * @param {Object} [options.headers] - 请求头。
  93868. * @fires DataFlowService#broadcastSocketConnected
  93869. * @fires DataFlowService#broadcastSocketError
  93870. * @fires DataFlowService#broadcastFailed
  93871. * @fires DataFlowService#broadcastSucceeded
  93872. * @fires DataFlowService#subscribeSocketError
  93873. * @fires DataFlowService#messageSucceeded
  93874. * @fires DataFlowService#setFilterParamSucceeded
  93875. * @usage
  93876. */
  93877. var DataFlowService_DataFlowService = ServiceBase.extend({
  93878. options: {
  93879. geometry: null,
  93880. prjCoordSys: null,
  93881. excludeField: null
  93882. },
  93883. initialize: function initialize(url, options) {
  93884. options = options || {};
  93885. external_L_default().setOptions(this, options);
  93886. if (options.projection) {
  93887. this.options.prjCoordSys = options.projection;
  93888. }
  93889. ServiceBase.prototype.initialize.call(this, url, options);
  93890. this.dataFlow = new DataFlowService(url, options);
  93891. /**
  93892. * @event DataFlowService#broadcastSocketConnected
  93893. * @description broadcast Socket 连接成功。
  93894. */
  93895. /**
  93896. * @event DataFlowService#broadcastSocketError
  93897. * @description broadcast Socket 连接失败。
  93898. */
  93899. /**
  93900. * @event DataFlowService#broadcastFailed
  93901. * @description 广播失败。
  93902. */
  93903. /**
  93904. * @event DataFlowService#broadcastSucceeded
  93905. * @description 广播成功。
  93906. */
  93907. /**
  93908. * @event DataFlowService#subscribeSocketConnected
  93909. * @description 订阅数据连接成功。
  93910. */
  93911. /**
  93912. * @event DataFlowService#subscribeSocketError
  93913. * @description 订阅数据连接失败。
  93914. */
  93915. /**
  93916. * @event DataFlowService#messageSucceeded
  93917. * @description 获取信息成功。
  93918. */
  93919. /**
  93920. * @event DataFlowService#setFilterParamSucceeded
  93921. * @description 设置过滤参数成功。
  93922. */
  93923. this.dataFlow.events.on({
  93924. "broadcastSocketConnected": this._defaultEvent,
  93925. "broadcastSocketError": this._defaultEvent,
  93926. "broadcastFailed": this._defaultEvent,
  93927. "broadcastSucceeded": this._defaultEvent,
  93928. "subscribeSocketConnected": this._defaultEvent,
  93929. "subscribeSocketError": this._defaultEvent,
  93930. "messageSucceeded": this._defaultEvent,
  93931. "setFilterParamSucceeded": this._defaultEvent,
  93932. scope: this
  93933. });
  93934. },
  93935. /**
  93936. * @function DataFlowService.prototype.initBroadcast
  93937. * @description 初始化广播。
  93938. */
  93939. initBroadcast: function initBroadcast() {
  93940. this.dataFlow.initBroadcast();
  93941. return this;
  93942. },
  93943. /**
  93944. * @function DataFlowService.prototype.broadcast
  93945. * @description 加载广播数据。
  93946. * @param {JSONObject} obj - JSON 格式的要素数据。
  93947. */
  93948. broadcast: function broadcast(obj) {
  93949. this.dataFlow.broadcast(obj);
  93950. },
  93951. /**
  93952. * @function DataFlowService.prototype.initSubscribe
  93953. * @description 初始化订阅数据。
  93954. */
  93955. initSubscribe: function initSubscribe() {
  93956. this.dataFlow.initSubscribe();
  93957. return this;
  93958. },
  93959. /**
  93960. * @function DataFlowService.prototype.setExcludeField
  93961. * @description 设置排除字段。
  93962. * @param {Object} excludeField - 排除字段。
  93963. */
  93964. setExcludeField: function setExcludeField(excludeField) {
  93965. this.dataFlow.setExcludeField(excludeField);
  93966. this.options.excludeField = excludeField;
  93967. return this;
  93968. },
  93969. /**
  93970. * @function DataFlowService.prototype.setGeometry
  93971. * @description 设置添加的 GeoJSON 几何要素数据。
  93972. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  93973. */
  93974. setGeometry: function setGeometry(geometry) {
  93975. this.dataFlow.setGeometry(geometry);
  93976. this.options.geometry = geometry;
  93977. return this;
  93978. },
  93979. /**
  93980. * @function DataFlowService.prototype.unSubscribe
  93981. * @description 结束订阅数据。
  93982. */
  93983. unSubscribe: function unSubscribe() {
  93984. this.dataFlow.unSubscribe();
  93985. },
  93986. /**
  93987. * @function DataFlowService.prototype.unBroadcast
  93988. * @description 结束加载广播。
  93989. */
  93990. unBroadcast: function unBroadcast() {
  93991. this.dataFlow.unBroadcast();
  93992. },
  93993. _defaultEvent: function _defaultEvent(e) {
  93994. this.fire(e.eventType || e.type, e);
  93995. }
  93996. });
  93997. var dataFlowService = function dataFlowService(url, options) {
  93998. return new DataFlowService_DataFlowService(url, options);
  93999. };
  94000. ;// CONCATENATED MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
  94001. var external_function_try_return_mapv_catch_e_return_namespaceObject = function(){try{return mapv}catch(e){return {}}}();
  94002. ;// CONCATENATED MODULE: ./src/leaflet/overlay/mapv/MapVRenderer.js
  94003. 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); }
  94004. function MapVRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  94005. 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); } }
  94006. 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; }
  94007. 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); }
  94008. function MapVRenderer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapVRenderer_getPrototypeOf(object); if (object === null) break; } return object; }
  94009. 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); }
  94010. 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); }
  94011. 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); }; }
  94012. 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); }
  94013. function MapVRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  94014. 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; } }
  94015. function MapVRenderer_getPrototypeOf(o) { MapVRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapVRenderer_getPrototypeOf(o); }
  94016. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94017. * This program are made available under the terms of the Apache License, Version 2.0
  94018. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94019. var BaseLayer = external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer ? external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer.__proto__ : Function;
  94020. /**
  94021. * @class MapVRenderer
  94022. * @classdesc 地图渲染类。
  94023. * @category Visualization MapV
  94024. * @private
  94025. * @extends mapv.BaseLayer
  94026. * @param {L.Map} map - Leaflet Map 对象。
  94027. * @param {L.Layer} layer - Leaflet Layer 对象。
  94028. * @param {DataSet} dataSet - 待渲染的数据集。
  94029. * @param {Object} options - 参数。
  94030. * @usage
  94031. */
  94032. var MapVRenderer = /*#__PURE__*/function (_BaseLayer) {
  94033. MapVRenderer_inherits(MapVRenderer, _BaseLayer);
  94034. var _super = MapVRenderer_createSuper(MapVRenderer);
  94035. function MapVRenderer(map, layer, dataSet, options) {
  94036. var _this;
  94037. MapVRenderer_classCallCheck(this, MapVRenderer);
  94038. _this = _super.call(this, map, dataSet, options);
  94039. if (!BaseLayer) {
  94040. return MapVRenderer_possibleConstructorReturn(_this);
  94041. }
  94042. var self = MapVRenderer_assertThisInitialized(_this);
  94043. options = options || {};
  94044. self.init(options);
  94045. self.argCheck(options);
  94046. _this.canvasLayer = layer;
  94047. _this.clickEvent = _this.clickEvent.bind(MapVRenderer_assertThisInitialized(_this));
  94048. _this.mousemoveEvent = _this.mousemoveEvent.bind(MapVRenderer_assertThisInitialized(_this));
  94049. _this._moveStartEvent = _this.moveStartEvent.bind(MapVRenderer_assertThisInitialized(_this));
  94050. _this._moveEndEvent = _this.moveEndEvent.bind(MapVRenderer_assertThisInitialized(_this));
  94051. _this._zoomStartEvent = _this.zoomStartEvent.bind(MapVRenderer_assertThisInitialized(_this));
  94052. _this.bindEvent();
  94053. return _this;
  94054. }
  94055. /**
  94056. * @function MapVRenderer.prototype.clickEvent
  94057. * @description 鼠标点击事件。
  94058. * @param {Object} e - 触发对象。
  94059. */
  94060. MapVRenderer_createClass(MapVRenderer, [{
  94061. key: "clickEvent",
  94062. value: function clickEvent(e) {
  94063. var offset = this.map.containerPointToLayerPoint([0, 0]);
  94064. var devicePixelRatio = this.devicePixelRatio = this.canvasLayer.devicePixelRatio = window.devicePixelRatio || 1;
  94065. var pixel = e.layerPoint;
  94066. MapVRenderer_get(MapVRenderer_getPrototypeOf(MapVRenderer.prototype), "clickEvent", this).call(this, external_L_default().point((pixel.x - offset.x) / devicePixelRatio, (pixel.y - offset.y) / devicePixelRatio), e);
  94067. }
  94068. /**
  94069. * @function MapVRenderer.prototype.mousemoveEvent
  94070. * @description 鼠标移动事件。
  94071. * @param {Object} e - 触发对象。
  94072. */
  94073. }, {
  94074. key: "mousemoveEvent",
  94075. value: function mousemoveEvent(e) {
  94076. var pixel = e.layerPoint;
  94077. MapVRenderer_get(MapVRenderer_getPrototypeOf(MapVRenderer.prototype), "mousemoveEvent", this).call(this, pixel, e);
  94078. }
  94079. /**
  94080. * @function MapVRenderer.prototype.bindEvent
  94081. * @description 监听鼠标移动和点击事件。
  94082. * @param {Object} e - 触发对象。
  94083. */
  94084. }, {
  94085. key: "bindEvent",
  94086. value: function bindEvent() {
  94087. var map = this.map;
  94088. if (this.options.methods) {
  94089. if (this.options.methods.click) {
  94090. map.on('click', this.clickEvent);
  94091. }
  94092. if (this.options.methods.mousemove) {
  94093. map.on('mousemove', this.mousemoveEvent);
  94094. }
  94095. }
  94096. this.map.on('movestart', this._moveStartEvent);
  94097. this.map.on('moveend', this._moveEndEvent);
  94098. this.map.on('zoomstart', this._zoomStartEvent);
  94099. }
  94100. /**
  94101. * @function MapVRenderer.prototype.destroy
  94102. * @description 释放资源。
  94103. */
  94104. }, {
  94105. key: "destroy",
  94106. value: function destroy() {
  94107. this.unbindEvent();
  94108. this.clearData();
  94109. this.animator && this.animator.stop();
  94110. this.animator = null;
  94111. this.canvasLayer = null;
  94112. }
  94113. /**
  94114. * @function MapVRenderer.prototype.unbindEvent
  94115. * @description 移除鼠标事件。
  94116. * @param {Object} e - 触发对象。
  94117. */
  94118. }, {
  94119. key: "unbindEvent",
  94120. value: function unbindEvent() {
  94121. var map = this.map;
  94122. if (this.options.methods) {
  94123. if (this.options.methods.click) {
  94124. map.off('click', this.clickEvent);
  94125. }
  94126. if (this.options.methods.mousemove) {
  94127. map.off('mousemove', this.mousemoveEvent);
  94128. }
  94129. }
  94130. this.map.off('movestart', this._moveStartEvent);
  94131. this.map.off('moveend', this._moveEndEvent);
  94132. this.map.off('zoomstart', this._zoomStartEvent);
  94133. }
  94134. /**
  94135. * @function MapVRenderer.prototype.getContext
  94136. * @description 获取信息。
  94137. */
  94138. }, {
  94139. key: "getContext",
  94140. value: function getContext() {
  94141. return this.canvasLayer.getCanvas().getContext(this.context);
  94142. }
  94143. /**
  94144. * @function MapVRenderer.prototype.addData
  94145. * @description 添加数据。
  94146. * @param {Object} data - 待添加的数据。
  94147. * @param {Object} options - 参数。
  94148. */
  94149. }, {
  94150. key: "addData",
  94151. value: function addData(data, options) {
  94152. var _data = data;
  94153. if (data && data.get) {
  94154. _data = data.get();
  94155. }
  94156. this.dataSet.add(_data);
  94157. this.update({
  94158. options: options
  94159. });
  94160. }
  94161. /**
  94162. * @function MapVRenderer.prototype.update
  94163. * @description 更新图层。
  94164. * @param {Object} opt - 待更新的数据。
  94165. * @param {Object} opt.data - mapv 数据集。
  94166. * @param {Object} opt.options - mapv 绘制参数。
  94167. */
  94168. }, {
  94169. key: "update",
  94170. value: function update(opt) {
  94171. var update = opt || {};
  94172. var _data = update.data;
  94173. if (_data && _data.get) {
  94174. _data = _data.get();
  94175. }
  94176. if (_data != undefined) {
  94177. this.dataSet.set(_data);
  94178. }
  94179. MapVRenderer_get(MapVRenderer_getPrototypeOf(MapVRenderer.prototype), "update", this).call(this, {
  94180. options: update.options
  94181. });
  94182. }
  94183. /**
  94184. * @function MapVRenderer.prototype.getData
  94185. * @description 获取数据
  94186. */
  94187. }, {
  94188. key: "getData",
  94189. value: function getData() {
  94190. return this.dataSet;
  94191. }
  94192. /**
  94193. * @function MapVRenderer.prototype.removeData
  94194. * @description 删除符合过滤条件的数据。
  94195. * @param {function} filter - 过滤条件。参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  94196. */
  94197. }, {
  94198. key: "removeData",
  94199. value: function removeData(_filter) {
  94200. if (!this.dataSet) {
  94201. return;
  94202. }
  94203. var newData = this.dataSet.get({
  94204. filter: function filter(data) {
  94205. return _filter != null && typeof _filter === "function" ? !_filter(data) : true;
  94206. }
  94207. });
  94208. this.dataSet.set(newData);
  94209. this.update({
  94210. options: null
  94211. });
  94212. }
  94213. /**
  94214. * @function MapVRenderer.prototype.clearData
  94215. * @description 清除数据。
  94216. */
  94217. }, {
  94218. key: "clearData",
  94219. value: function clearData() {
  94220. this.dataSet && this.dataSet.clear();
  94221. this.update({
  94222. options: null
  94223. });
  94224. }
  94225. }, {
  94226. key: "_canvasUpdate",
  94227. value: function _canvasUpdate(time) {
  94228. if (!this.canvasLayer) {
  94229. return;
  94230. }
  94231. var self = this;
  94232. var animationOptions = self.options.animation;
  94233. var context = this.getContext();
  94234. var map = this.map;
  94235. if (self.isEnabledTime()) {
  94236. if (time === undefined) {
  94237. this.clear(context);
  94238. return;
  94239. }
  94240. if (this.context === '2d') {
  94241. context.save();
  94242. context.globalCompositeOperation = 'destination-out';
  94243. context.fillStyle = 'rgba(0, 0, 0, .1)';
  94244. context.fillRect(0, 0, context.canvas.width, context.canvas.height);
  94245. context.restore();
  94246. }
  94247. } else {
  94248. this.clear(context);
  94249. }
  94250. if (this.context === '2d') {
  94251. for (var key in self.options) {
  94252. context[key] = self.options[key];
  94253. }
  94254. } else {
  94255. context.clear(context.COLOR_BUFFER_BIT);
  94256. }
  94257. if (self.options.minZoom && map.getZoom() < self.options.minZoom || self.options.maxZoom && map.getZoom() > self.options.maxZoom) {
  94258. return;
  94259. }
  94260. var bounds = map.getBounds();
  94261. //获取当前像素下的地理范围
  94262. var dw = bounds.getEast() - bounds.getWest();
  94263. var dh = bounds.getNorth() - bounds.getSouth();
  94264. var mapCanvas = map.getSize();
  94265. var resolutionX = dw / mapCanvas.x,
  94266. resolutionY = dh / mapCanvas.y;
  94267. // 一个像素是多少米
  94268. var zoomUnit = Util_getMeterPerMapUnit('DEGREE') * resolutionX;
  94269. //var centerPx = map.latLngToLayerPoint(map.getCenter());
  94270. //获取屏幕左上角的地理坐标坐标
  94271. //左上角屏幕坐标为0,0
  94272. var topLeft = this.canvasLayer.getTopLeft();
  94273. var topLeftPX = map.latLngToAccurateContainerPoint(topLeft);
  94274. // var lopLeft = map.containerPointToLatLng([0, 0]);
  94275. var dataGetOptions = {
  94276. transferCoordinate: function transferCoordinate(coordinate) {
  94277. var offset;
  94278. if (self.context === '2d') {
  94279. offset = map.latLngToAccurateContainerPoint(external_L_default().latLng(coordinate[1], coordinate[0]));
  94280. } else {
  94281. offset = {
  94282. 'x': (coordinate[0] - topLeft.lng) / resolutionX,
  94283. 'y': (topLeft.lat - coordinate[1]) / resolutionY
  94284. };
  94285. }
  94286. var pixel = {
  94287. x: offset.x - topLeftPX.x,
  94288. y: offset.y - topLeftPX.y
  94289. };
  94290. return [pixel.x, pixel.y];
  94291. }
  94292. };
  94293. if (time !== undefined) {
  94294. dataGetOptions.filter = function (item) {
  94295. var trails = animationOptions.trails || 10;
  94296. return time && item.time > time - trails && item.time < time;
  94297. };
  94298. }
  94299. var data = self.dataSet.get(dataGetOptions);
  94300. this.processData(data);
  94301. var worldPoint = map.latLngToContainerPoint(external_L_default().latLng(0, 0));
  94302. var pixel = {
  94303. x: worldPoint.x - topLeftPX.x,
  94304. y: worldPoint.y - topLeftPX.y
  94305. };
  94306. // 兼容unit为'm'的情况
  94307. if (self.options.unit === 'm') {
  94308. if (self.options.size) {
  94309. self.options._size = self.options.size / zoomUnit;
  94310. }
  94311. if (self.options.width) {
  94312. self.options._width = self.options.width / zoomUnit;
  94313. }
  94314. if (self.options.height) {
  94315. self.options._height = self.options.height / zoomUnit;
  94316. }
  94317. } else {
  94318. self.options._size = self.options.size;
  94319. self.options._height = self.options.height;
  94320. self.options._width = self.options.width;
  94321. }
  94322. this.drawContext(context, data, self.options, pixel);
  94323. self.options.updateCallback && self.options.updateCallback(time);
  94324. }
  94325. }, {
  94326. key: "init",
  94327. value: function init(options) {
  94328. var self = this;
  94329. self.options = options;
  94330. this.initDataRange(options);
  94331. this.context = self.options.context || '2d';
  94332. if (self.options.zIndex) {
  94333. this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
  94334. }
  94335. this.initAnimator();
  94336. }
  94337. }, {
  94338. key: "addAnimatorEvent",
  94339. value: function addAnimatorEvent() {}
  94340. /**
  94341. * @function MapVRenderer.prototype.moveStartEvent
  94342. * @description 开始移动事件。
  94343. */
  94344. }, {
  94345. key: "moveStartEvent",
  94346. value: function moveStartEvent() {
  94347. var animationOptions = this.options.animation;
  94348. if (this.isEnabledTime() && this.animator) {
  94349. this.steps.step = animationOptions.stepsRange.start;
  94350. this._hide();
  94351. }
  94352. }
  94353. /**
  94354. * @function MapVRenderer.prototype.moveEndEvent
  94355. * @description 移除移动事件。
  94356. */
  94357. }, {
  94358. key: "moveEndEvent",
  94359. value: function moveEndEvent() {
  94360. this.canvasLayer.draw();
  94361. this._show();
  94362. }
  94363. /**
  94364. * @function MapVRenderer.prototype.zoomStartEvent
  94365. * @description 隐藏渲染样式。
  94366. */
  94367. }, {
  94368. key: "zoomStartEvent",
  94369. value: function zoomStartEvent() {
  94370. this._hide();
  94371. }
  94372. /**
  94373. * @function MapVRenderer.prototype.clear
  94374. * @description 清除信息。
  94375. * @param {string} context - 指定要清除的信息。
  94376. */
  94377. }, {
  94378. key: "clear",
  94379. value: function clear(context) {
  94380. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  94381. }
  94382. }, {
  94383. key: "_hide",
  94384. value: function _hide() {
  94385. this.canvasLayer.canvas.style.display = 'none';
  94386. }
  94387. }, {
  94388. key: "_show",
  94389. value: function _show() {
  94390. this.canvasLayer.canvas.style.display = 'block';
  94391. }
  94392. /**
  94393. * @function MapVRenderer.prototype.draw
  94394. * @description 绘制渲染。
  94395. */
  94396. }, {
  94397. key: "draw",
  94398. value: function draw() {
  94399. this.canvasLayer.draw();
  94400. }
  94401. }]);
  94402. return MapVRenderer;
  94403. }(BaseLayer);
  94404. ;// CONCATENATED MODULE: ./src/leaflet/overlay/MapVLayer.js
  94405. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94406. * This program are made available under the terms of the Apache License, Version 2.0
  94407. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94408. /**
  94409. * @class MapVLayer
  94410. * @deprecatedclassinstance L.supermap.mapVLayer
  94411. * @classdesc MapV 图层类。
  94412. * @category Visualization MapV
  94413. * @modulecategory Overlay
  94414. * @extends {L.Layer}
  94415. * @param {Mapv.DataSet} dataSet - MapV 图层数据集。
  94416. * @param {Object} mapVOptions - MapV 图层参数。
  94417. * @param {Object} options - 参数。
  94418. * @param {string} [options.attributionPrefix] - 版权信息前缀。
  94419. * @param {string} [options.attribution='© 2018 百度 MapV'] - 版权信息。
  94420. * @fires MapVLayer#loaded
  94421. * @usage
  94422. */
  94423. var MapVLayer = external_L_default().Layer.extend({
  94424. options: {
  94425. attributionPrefix: null,
  94426. attribution: core_Attributions.MapV.attribution
  94427. },
  94428. initialize: function initialize(dataSet, mapVOptions, options) {
  94429. options = options || {};
  94430. this.dataSet = dataSet || {};
  94431. this.mapVOptions = mapVOptions || {};
  94432. this.render = this.render.bind(this);
  94433. external_L_default().Util.setOptions(this, options);
  94434. if (this.options.attributionPrefix) {
  94435. this.options.attribution = this.options.attributionPrefix + this.options.attribution;
  94436. }
  94437. this.canvas = this._createCanvas();
  94438. external_L_default().stamp(this);
  94439. },
  94440. /**
  94441. * @private
  94442. * @function MapVLayer.prototype.onAdd
  94443. * @description 添加地图图层。
  94444. * @param {L.Map} map - Leaflet Map 对象。
  94445. */
  94446. onAdd: function onAdd(map) {
  94447. this._map = map;
  94448. var overlayPane = this.getPane();
  94449. var container = this.container = external_L_default().DomUtil.create("div", "leaflet-layer leaflet-zoom-animated", overlayPane);
  94450. container.appendChild(this.canvas);
  94451. var size = map.getSize();
  94452. container.style.width = size.x + "px";
  94453. container.style.height = size.y + "px";
  94454. this.renderer = new MapVRenderer(map, this, this.dataSet, this.mapVOptions);
  94455. this.draw();
  94456. /**
  94457. * @event MapVLayer#loaded
  94458. * @description 图层添加完成之后触发。
  94459. */
  94460. this.fire("loaded");
  94461. },
  94462. // _hide: function () {
  94463. // this.canvas.style.display = 'none';
  94464. // },
  94465. // _show: function () {
  94466. // this.canvas.style.display = 'block';
  94467. // },
  94468. /**
  94469. * @private
  94470. * @function MapVLayer.prototype.onRemove
  94471. * @description 删除地图图层。
  94472. */
  94473. onRemove: function onRemove() {
  94474. external_L_default().DomUtil.remove(this.container);
  94475. this.renderer.destroy();
  94476. },
  94477. /**
  94478. * @function MapVLayer.prototype.addData
  94479. * @description 添加数据。
  94480. * @param {Object} data - 需要添加的数据。
  94481. * @param {Object} options - 参数。
  94482. */
  94483. addData: function addData(data, options) {
  94484. this.renderer.addData(data, options);
  94485. },
  94486. /**
  94487. * @function MapVLayer.prototype.update
  94488. * @description 更新图层。
  94489. * @param {Object} opt - 待更新的数据。
  94490. * @param {Object} data - mapv 数据集。
  94491. * @param {Object} options - 参数。
  94492. */
  94493. update: function update(opt) {
  94494. this.renderer.update(opt);
  94495. },
  94496. /**
  94497. * @function MapVLayer.prototype.getData
  94498. * @description 获取数据。
  94499. * @returns {Mapv.DataSet} mapv 数据集。
  94500. */
  94501. getData: function getData() {
  94502. if (this.renderer) {
  94503. this.dataSet = this.renderer.getData();
  94504. }
  94505. return this.dataSet;
  94506. },
  94507. /**
  94508. * @function MapVLayer.prototype.removeData
  94509. * @description 删除数据。
  94510. * @param {function} filter - 过滤条件。指定数据项后,返回值为 true,表示删除该元素;否则表示不删除。
  94511. * @example
  94512. * filter=function(data){
  94513. * if(data.id=="1"){
  94514. * return true
  94515. * }
  94516. * return false;
  94517. * }
  94518. */
  94519. removeData: function removeData(filter) {
  94520. this.renderer && this.renderer.removeData(filter);
  94521. },
  94522. /**
  94523. * @function MapVLayer.prototype.clearData
  94524. * @description 清除数据。
  94525. */
  94526. clearData: function clearData() {
  94527. this.renderer.clearData();
  94528. },
  94529. /**
  94530. * @function MapVLayer.prototype.draw
  94531. * @description 绘制图层。
  94532. */
  94533. draw: function draw() {
  94534. return this._reset();
  94535. },
  94536. /**
  94537. * @function MapVLayer.prototype.setZIndex
  94538. * @description 设置 canvas 层级。
  94539. * @param {number} zIndex - canvas 层级。
  94540. */
  94541. setZIndex: function setZIndex(zIndex) {
  94542. this.canvas.style.zIndex = zIndex;
  94543. },
  94544. /**
  94545. * @function MapVLayer.prototype.render
  94546. * @description 渲染。
  94547. */
  94548. render: function render() {
  94549. this.renderer._canvasUpdate();
  94550. },
  94551. /**
  94552. * @function MapVLayer.prototype.getCanvas
  94553. * @description 获取 canvas。
  94554. * @returns {HTMLElement} 返回 mapV 图层包含的 canvas 对象。
  94555. */
  94556. getCanvas: function getCanvas() {
  94557. return this.canvas;
  94558. },
  94559. /**
  94560. * @function MapVLayer.prototype.getContainer
  94561. * @description 获取容器。
  94562. * @returns {HTMLElement} 返回包含 mapV 图层的 dom 对象。
  94563. */
  94564. getContainer: function getContainer() {
  94565. return this.container;
  94566. },
  94567. /**
  94568. * @function MapVLayer.prototype.getTopLeft
  94569. * @description 获取左上角坐标。
  94570. * @returns {L.Bounds} 返回左上角坐标。
  94571. */
  94572. getTopLeft: function getTopLeft() {
  94573. var map = this._map;
  94574. var topLeft;
  94575. if (map) {
  94576. var bounds = map.getBounds();
  94577. topLeft = bounds.getNorthWest();
  94578. }
  94579. return topLeft;
  94580. },
  94581. _createCanvas: function _createCanvas() {
  94582. var canvas = document.createElement('canvas');
  94583. canvas.style.position = 'absolute';
  94584. canvas.style.top = 0 + "px";
  94585. canvas.style.left = 0 + "px";
  94586. canvas.style.pointerEvents = "none";
  94587. canvas.style.zIndex = this.options.zIndex || 600;
  94588. var global$2 = typeof window === 'undefined' ? {} : window;
  94589. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  94590. if (!this.mapVOptions.context || this.mapVOptions.context === '2d') {
  94591. canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
  94592. }
  94593. return canvas;
  94594. },
  94595. _resize: function _resize() {
  94596. var canvas = this.canvas;
  94597. if (!canvas) {
  94598. return;
  94599. }
  94600. var map = this._map;
  94601. var size = map.getSize();
  94602. if (this.mapVOptions.draw === 'heatmap') {
  94603. canvas.width = parseInt(size.x) * this.devicePixelRatio;
  94604. canvas.height = parseInt(size.y) * this.devicePixelRatio;
  94605. } else {
  94606. canvas.width = parseInt(size.x);
  94607. canvas.height = parseInt(size.y);
  94608. }
  94609. canvas.style.width = size.x + 'px';
  94610. canvas.style.height = size.y + 'px';
  94611. var bounds = map.getBounds();
  94612. var topLeft = map.latLngToLayerPoint(bounds.getNorthWest());
  94613. external_L_default().DomUtil.setPosition(canvas, topLeft);
  94614. },
  94615. _reset: function _reset() {
  94616. this._resize();
  94617. this._render();
  94618. },
  94619. redraw: function redraw() {
  94620. this._resize();
  94621. this._render();
  94622. },
  94623. _render: function _render() {
  94624. this.render();
  94625. }
  94626. });
  94627. var mapVLayer = function mapVLayer(dataSet, mapVOptions, options) {
  94628. return new MapVLayer(dataSet, mapVOptions, options);
  94629. };
  94630. ;// CONCATENATED MODULE: ./src/leaflet/overlay/dataflow/MapvRenderer.js
  94631. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94632. * This program are made available under the terms of the Apache License, Version 2.0
  94633. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94634. /**
  94635. *
  94636. * @class MapvRenderer
  94637. * @classdesc 数据流图层 MapV 渲染器。
  94638. * @category iServer DataFlow
  94639. * @extends {MapVLayer}
  94640. * @param {string} url - 服务地址
  94641. * @param {Object} options - 参数。
  94642. * @param {Object} [options.geometry] - GeoJSON 几何对象。
  94643. * @param {Object} [options.prjCoordSys] - 投影坐标对象。
  94644. * @param {string} [options.excludeField] - 排除字段。
  94645. * @param {string} [options.idField='id'] - 要素属性中表示唯一标识的字段。
  94646. * @usage
  94647. */
  94648. var MapvRenderer = MapVLayer.extend({
  94649. initialize: function initialize(url, options) {
  94650. options = options || {};
  94651. external_L_default().Util.setOptions(this, options);
  94652. this.data = [];
  94653. this.mapVOptions = {
  94654. draw: 'simple'
  94655. };
  94656. MapVLayer.prototype.initialize.call(this, new window.mapv.DataSet([]), this.mapVOptions, options);
  94657. this.idCache = {};
  94658. this.url = url;
  94659. this._last = new Date();
  94660. this._imageCache = {};
  94661. },
  94662. onMessageSuccessed: function onMessageSuccessed(msg) {
  94663. var _this = this;
  94664. var geoID = msg.featureResult.properties['id'];
  94665. var geometry = msg.featureResult.geometry;
  94666. //设置每个点的经纬度和图片的样式
  94667. var item = {
  94668. geometry: msg.featureResult.geometry
  94669. };
  94670. if (geometry.type === 'Point' && this.options.pointToLayer) {
  94671. //const pointStyle = this.options.pointToLayer ? this.options.pointToLayer(msg.featureResult, L.latLng(geometry.coordinates[1],geometry.coordinates[0])) : new L.marker(L.latLng(geometry.coordinates[1],geometry.coordinates[0]));
  94672. var pointStyle = this.options.pointToLayer(msg.featureResult, external_L_default().latLng(geometry.coordinates[1], geometry.coordinates[0]));
  94673. if (pointStyle instanceof (external_L_default()).Marker) {
  94674. this.mapVOptions.draw = 'icon';
  94675. var icon = pointStyle.options.icon;
  94676. var imgUrl = icon._getIconUrl('icon');
  94677. var imgWidth = icon.options.iconSize ? icon.options.iconSize[0] : null;
  94678. var imgHeight = icon.options.iconSize ? icon.options.iconSize[1] : null;
  94679. var iconKey = "".concat(imgUrl, "_").concat(imgWidth, "_").concat(imgHeight);
  94680. var img = this._imageCache[iconKey];
  94681. if (!img) {
  94682. img = icon.createIcon();
  94683. this._imageCache[iconKey] = img;
  94684. img.onload = function () {
  94685. _this.update({
  94686. data: _this.data,
  94687. options: _this.mapVOptions
  94688. });
  94689. };
  94690. }
  94691. item.icon = img;
  94692. if (icon.options.iconSize || img.style.height) {
  94693. this.mapVOptions.offset = {
  94694. x: 0,
  94695. y: -(icon.options.iconSize[1] || img.style.height) / 2
  94696. };
  94697. }
  94698. if (this.options.deg) {
  94699. item.deg = this.options.deg;
  94700. if (typeof item.deg === 'function') {
  94701. if (this.idCache[geoID] && this.data[this.idCache[geoID]]) {
  94702. item.deg = item.deg(msg.featureResult, external_L_default().latLng(geometry.coordinates[1], geometry.coordinates[0]), this.data[this.idCache[geoID]]);
  94703. }
  94704. }
  94705. }
  94706. }
  94707. if (pointStyle instanceof (external_L_default()).CircleMarker) {
  94708. this.mapVOptions.draw = 'simple';
  94709. var sty = this._toMapvStyle(pointStyle);
  94710. for (var key in sty) {
  94711. if (sty.hasOwnProperty(key)) {
  94712. item[key] = sty[key];
  94713. }
  94714. }
  94715. }
  94716. } else if (this.options.style) {
  94717. var _sty = this._toMapvStyle(this.options.style(msg.featureResult));
  94718. for (var _key2 in _sty) {
  94719. if (_sty.hasOwnProperty(_key2)) {
  94720. item[_key2] = _sty[_key2];
  94721. }
  94722. }
  94723. }
  94724. if (this.idCache[geoID] == undefined) {
  94725. this.data.push(item);
  94726. this.idCache[geoID] = this.data.length - 1;
  94727. } else {
  94728. this.data[this.idCache[geoID]] = item;
  94729. }
  94730. //绘制图层
  94731. if (new Date() - this._last > 200) {
  94732. this._last = new Date();
  94733. this.update({
  94734. data: this.data,
  94735. options: this.mapVOptions
  94736. });
  94737. }
  94738. },
  94739. _toMapvStyle: function _toMapvStyle(options) {
  94740. var mapvOps = {
  94741. draw: 'simple'
  94742. };
  94743. mapvOps.strokeStyle = options.color;
  94744. mapvOps.lineWidth = options.width;
  94745. mapvOps.globalAlpha = options.fillOpacity || options.opacity;
  94746. mapvOps.lineCap = options.lineCap;
  94747. mapvOps.lineJoin = options.lineJoin;
  94748. mapvOps.fillStyle = options.fillColor;
  94749. mapvOps.size = options.radius;
  94750. return mapvOps;
  94751. }
  94752. });
  94753. ;// CONCATENATED MODULE: ./src/leaflet/overlay/dataflow/NormalRenderer.js
  94754. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94755. * This program are made available under the terms of the Apache License, Version 2.0
  94756. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94757. /**
  94758. * @class NormalRenderer
  94759. * @classdesc 数据流图层普通渲染器。
  94760. * @category iServer DataFlow
  94761. * @extends {L.GeoJSON}
  94762. * @param {string} url - 服务地址
  94763. * @param {Object} options - 参数。
  94764. * @param {GeoJSONObject} [options.geometry] - GeoJSON 几何对象。
  94765. * @param {Object} [options.prjCoordSys] - 投影坐标对象。
  94766. * @param {string} [options.excludeField] - 排除字段。
  94767. * @param {string} [options.idField='id'] - 要素属性中表示唯一标识的字段。
  94768. * @usage
  94769. */
  94770. var NormalRenderer = external_L_default().GeoJSON.extend({
  94771. initialize: function initialize(url, options) {
  94772. options = options || {};
  94773. if (options.style && !options.pointToLayer) {
  94774. options.pointToLayer = function (geojson, latlng) {
  94775. return external_L_default().circleMarker(latlng, options.style());
  94776. };
  94777. }
  94778. external_L_default().Util.setOptions(this, options);
  94779. this._layers = {};
  94780. external_L_default().stamp(this);
  94781. this.url = url;
  94782. this.idCache = {};
  94783. },
  94784. onMessageSuccessed: function onMessageSuccessed(msg) {
  94785. var geojson = msg.featureResult;
  94786. var geoID = msg.featureResult.properties[this.options.idField];
  94787. var layer = null;
  94788. if (geoID !== undefined && this.idCache[geoID]) {
  94789. layer = this.getLayer(this.idCache[geoID]);
  94790. this._updateLayerData(layer, geojson);
  94791. } else {
  94792. layer = external_L_default().GeoJSON.geometryToLayer(geojson, this.options);
  94793. layer.feature = external_L_default().GeoJSON.asFeature(geojson);
  94794. this.addLayer(layer);
  94795. if (geoID !== undefined) {
  94796. this.idCache[geoID] = this.getLayerId(layer);
  94797. }
  94798. }
  94799. if (this.options.onEachFeature) {
  94800. this.options.onEachFeature(geojson, layer);
  94801. }
  94802. },
  94803. _updateLayerData: function _updateLayerData(layer, geojson) {
  94804. if (geojson.properties) {
  94805. layer.feature.properties = geojson.properties;
  94806. }
  94807. var latlngs = [];
  94808. switch (geojson.geometry.type) {
  94809. case 'Point':
  94810. latlngs = external_L_default().GeoJSON.coordsToLatLng(geojson.geometry.coordinates);
  94811. layer.setLatLng(latlngs);
  94812. break;
  94813. case 'LineString':
  94814. latlngs = external_L_default().GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 0);
  94815. layer.setLatLngs(latlngs);
  94816. break;
  94817. case 'MultiLineString':
  94818. case 'Polygon':
  94819. latlngs = external_L_default().GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 1);
  94820. layer.setLatLngs(latlngs);
  94821. break;
  94822. case 'MultiPolygon':
  94823. latlngs = external_L_default().GeoJSON.coordsToLatLngs(geojson.geometry.coordinates, 2);
  94824. layer.setLatLngs(latlngs);
  94825. break;
  94826. }
  94827. }
  94828. });
  94829. ;// CONCATENATED MODULE: ./src/leaflet/overlay/DataFlowLayer.js
  94830. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94831. * This program are made available under the terms of the Apache License, Version 2.0
  94832. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94833. /**
  94834. * @class DataFlowLayer
  94835. * @deprecatedclassinstance L.supermap.dataFlowLayer
  94836. * @classdesc 数据流图层源。订阅SuperMap iServer 数据流服务并上图。订阅得到的数据会根据 `options.idField` 自动更新。
  94837. * @category iServer DataFlow
  94838. * @extends {L.LayerGroup}
  94839. * @param {string} url - 服务地址。
  94840. * @param {Object} options - 参数。
  94841. * @param {Object} [options.render='normal'] - 绘制方式。可选值为'normal','mapv'。
  94842. 'normal' 表示以 {( {@link L.LatLng}|{@link L.Polyline}|{@link L.Polygon}|{@link L.Marker} )} 方式绘制数据流。'mapv' 表示以 {@link MapVLayer} 方式绘制实时数据。
  94843. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  94844. * @param {Object} [options.prjCoordSys] - 投影坐标对象。
  94845. * @param {string} [options.excludeField] - 排除字段。
  94846. * @param {string} [options.idField='id'] - 要素属性中表示唯一标识的字段。
  94847. * @param {function} [options.pointToLayer] - 定义点要素如何绘制在地图上。
  94848. `function(geoJsonPoint, latlng) {
  94849. return L.marker(latlng);
  94850. }`
  94851. * @param {function} [options.style] - 定义点、线、面要素样式。参数为{@link L.Path-option}。</br>
  94852. `function (feature) {
  94853. return {
  94854. fillColor: "red",
  94855. fillOpacity: 1,
  94856. radius: 6,
  94857. weight: 0
  94858. };
  94859. }`
  94860. * @param {function|number} [options.deg] - 定义图标的旋转角度。`options.render` 为 `mapv` 时有效。</br>
  94861. `function (feature,latlng) {
  94862. return feature.properties['rotate'];
  94863. }`
  94864. * @fires DataFlowLayer#subscribesucceeded
  94865. * @fires DataFlowLayer#subscribefailed
  94866. * @fires DataFlowLayer#setfilterparamsucceeded
  94867. * @fires DataFlowLayer#dataupdated
  94868. * @usage
  94869. */
  94870. var DataFlowLayer = external_L_default().LayerGroup.extend({
  94871. options: {
  94872. geometry: null,
  94873. prjCoordSys: null,
  94874. excludeField: null,
  94875. idField: "id",
  94876. render: 'normal'
  94877. },
  94878. initialize: function initialize(url, options) {
  94879. options = options || {};
  94880. external_L_default().Util.setOptions(this, options);
  94881. this.url = url;
  94882. this._layers = {};
  94883. this.dataService = new DataFlowService_DataFlowService(this.url, {
  94884. geometry: this.options.geometry,
  94885. prjCoordSys: this.options.prjCoordSys,
  94886. excludeField: this.options.excludeField
  94887. });
  94888. },
  94889. /**
  94890. * @private
  94891. * @function DataFlowLayer.prototype.onAdd
  94892. * @description 添加地图。
  94893. * @param {L.Map} map - Leaflet Map 对象。
  94894. */
  94895. onAdd: function onAdd(map) {
  94896. var _this = this;
  94897. // eslint-disable-line no-unused-vars
  94898. this.dataService.initSubscribe();
  94899. /**
  94900. * @event DataFlowLayer#subscribesucceeded
  94901. * @description 初始化成功后触发。
  94902. * @property {Object} e - 事件对象。
  94903. */
  94904. this.dataService.on('subscribeSocketConnected', function (e) {
  94905. return _this.fire("subscribesucceeded", e);
  94906. });
  94907. /**
  94908. * @event DataFlowLayer#subscribefailed
  94909. * @description 初始化失败后触发。
  94910. * @property {Object} e - 事件对象。
  94911. */
  94912. this.dataService.on('subscribeSocketError', function (e) {
  94913. return _this.fire("subscribefailed", e);
  94914. });
  94915. this.dataService.on('messageSucceeded', function (msg) {
  94916. return _this._onMessageSuccessed(msg);
  94917. });
  94918. /**
  94919. * @event DataFlowLayer#setfilterparamsucceeded
  94920. * @description 过滤参数设置成功后触发。
  94921. * @property {Object} e - 事件对象。
  94922. */
  94923. this.dataService.on('setFilterParamSucceeded', function (msg) {
  94924. return _this.fire("setfilterparamsucceeded", msg);
  94925. });
  94926. if (this.options.render === 'mapv') {
  94927. this.addLayer(new MapvRenderer(this.url, this.options));
  94928. } else {
  94929. this.addLayer(new NormalRenderer(this.url, this.options));
  94930. }
  94931. external_L_default().LayerGroup.prototype.onAdd.call(this, map);
  94932. },
  94933. /**
  94934. * @private
  94935. * @function DataFlowLayer.prototype.onRemove
  94936. * @description 删除指定地图。
  94937. * @param {L.Map} map - Leaflet Map 对象。
  94938. */
  94939. onRemove: function onRemove(map) {
  94940. // eslint-disable-line no-unused-vars
  94941. external_L_default().LayerGroup.prototype.onRemove.call(this, map);
  94942. this.dataService && this.dataService.unSubscribe();
  94943. },
  94944. /**
  94945. * @function DataFlowLayer.prototype.setExcludeField
  94946. * @description 设置唯一字段。
  94947. * @param {string} excludeField - 唯一字段。
  94948. */
  94949. setExcludeField: function setExcludeField(excludeField) {
  94950. this.dataService.setExcludeField(excludeField);
  94951. this.options.excludeField = excludeField;
  94952. return this;
  94953. },
  94954. /**
  94955. * @function DataFlowLayer.prototype.setGeometry
  94956. * @description 设置几何要素。
  94957. * @param {GeoJSONObject} geometry - 待设置的 GeoJSON 几何要素对象。
  94958. */
  94959. setGeometry: function setGeometry(geometry) {
  94960. this.dataService.setGeometry(geometry);
  94961. this.options.geometry = geometry;
  94962. return this;
  94963. },
  94964. _onMessageSuccessed: function _onMessageSuccessed(msg) {
  94965. var _this2 = this;
  94966. this.getLayers().map(function (layer) {
  94967. if (layer.onMessageSuccessed) {
  94968. layer.onMessageSuccessed(msg);
  94969. /**
  94970. * @description 图层数据更新成功后触发。
  94971. * @event DataFlowLayer#dataupdated
  94972. * @property {Object} layer - 更新数据成功的图层。
  94973. * @property {Object} data - 更新的要素。
  94974. */
  94975. _this2.fire("dataupdated", {
  94976. layer: layer,
  94977. data: msg.featureResult
  94978. });
  94979. }
  94980. return layer;
  94981. });
  94982. }
  94983. });
  94984. var dataFlowLayer = function dataFlowLayer(url, options) {
  94985. return new DataFlowLayer(url, options);
  94986. };
  94987. ;// CONCATENATED MODULE: ./src/leaflet/overlay/EChartsLayer.js
  94988. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  94989. * This program are made available under the terms of the Apache License, Version 2.0
  94990. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  94991. /**
  94992. * @class EchartsLayer
  94993. * @deprecatedclassinstance L.supermap.echartsLayer
  94994. * @classdesc 百度 ECharts 图层类。
  94995. * @category Visualization ECharts
  94996. * @modulecategory Overlay
  94997. * @extends {L.Layer}
  94998. * @param {Object} echartsOptions - 图表参数。
  94999. * @param {Object} options - 参数。
  95000. * @param {boolean} [options.loadWhileAnimating=false] - 是否在移动时实时绘制。
  95001. * @param {string} [options.attribution='© 2018 百度 ECharts'] - 版权信息。
  95002. * @usage
  95003. */
  95004. var EchartsLayer = external_L_default().Layer.extend({
  95005. includes: [],
  95006. _echartsContainer: null,
  95007. _map: null,
  95008. _ec: null,
  95009. _echartsOptions: null,
  95010. options: {
  95011. attribution: core_Attributions.ECharts.attribution,
  95012. loadWhileAnimating: false
  95013. },
  95014. initialize: function initialize(echartsOptions, options) {
  95015. external_L_default().Util.setOptions(this, options);
  95016. this.setOption(echartsOptions);
  95017. },
  95018. /**
  95019. * @function EchartsLayer.prototype.setOption
  95020. * @description 设置图表地图参数。
  95021. * @param {Object} echartsOptions - 图表参数。
  95022. * @param {string} lazyUpdate - 后台自动更新。
  95023. * @param {boolean} [notMerge] - 是否合并参数。
  95024. */
  95025. setOption: function setOption(echartsOptions, notMerge, lazyUpdate) {
  95026. var baseOption = echartsOptions.baseOption || echartsOptions;
  95027. baseOption.LeafletMap = baseOption.LeafletMap || {
  95028. roam: true
  95029. };
  95030. baseOption.animation = baseOption.animation === true;
  95031. this._echartsOptions = echartsOptions;
  95032. this._ec && this._ec.setOption(echartsOptions, notMerge, lazyUpdate);
  95033. },
  95034. getEcharts: function getEcharts() {
  95035. return this._ec;
  95036. },
  95037. _disableEchartsContainer: function _disableEchartsContainer() {
  95038. this._echartsContainer.style.visibility = "hidden";
  95039. },
  95040. _enableEchartsContainer: function _enableEchartsContainer() {
  95041. this._echartsContainer.style.visibility = "visible";
  95042. },
  95043. /**
  95044. * @private
  95045. * @function EchartsLayer.prototype.onAdd
  95046. * @description 添加地图。
  95047. * @param {L.Map} map - Leaflet Map 对象。
  95048. */
  95049. onAdd: function onAdd(map) {
  95050. this._map = map;
  95051. this._initEchartsContainer();
  95052. this._ec = external_function_try_return_echarts_catch_e_return_namespaceObject.init(this._echartsContainer);
  95053. this._ec.leafletMap = map;
  95054. var me = this;
  95055. map.on("zoomstart", function () {
  95056. me._disableEchartsContainer();
  95057. });
  95058. !me.options.loadWhileAnimating && map.on("movestart", function () {
  95059. me._disableEchartsContainer();
  95060. });
  95061. external_function_try_return_echarts_catch_e_return_namespaceObject.registerAction({
  95062. type: 'LeafletMapLayout',
  95063. event: 'LeafletMapLayout',
  95064. update: 'updateLayout'
  95065. }, function (payload) {// eslint-disable-line no-unused-vars
  95066. });
  95067. external_function_try_return_echarts_catch_e_return_namespaceObject.registerCoordinateSystem('leaflet', LeafletMapCoordSys);
  95068. external_function_try_return_echarts_catch_e_return_namespaceObject.extendComponentModel({
  95069. type: 'LeafletMap',
  95070. getBMap: function getBMap() {
  95071. return this.__LeafletMap;
  95072. },
  95073. defaultOption: {
  95074. roam: false
  95075. }
  95076. });
  95077. external_function_try_return_echarts_catch_e_return_namespaceObject.extendComponentView({
  95078. type: 'LeafletMap',
  95079. render: function render(LeafletMapModel, ecModel, api) {
  95080. var rendering = true;
  95081. var leafletMap = ecModel.scheduler.ecInstance.leafletMap;
  95082. var viewportRoot = api.getZr().painter.getViewportRoot();
  95083. var animated = leafletMap.options.zoomAnimation && (external_L_default()).Browser.any3d;
  95084. viewportRoot.className = ' leaflet-layer leaflet-zoom-' + (animated ? 'animated' : 'hide') + ' echarts-layer';
  95085. var originProp = external_L_default().DomUtil.testProp(['transformOrigin', 'WebkitTransformOrigin', 'msTransformOrigin']);
  95086. viewportRoot.style[originProp] = '50% 50%';
  95087. var coordSys = LeafletMapModel.coordinateSystem;
  95088. var ecLayers = api.getZr().painter.getLayers();
  95089. _setCanvasPosition(me._map, viewportRoot);
  95090. var moveHandler = function moveHandler() {
  95091. if (rendering) {
  95092. return;
  95093. }
  95094. var mapOffset = _setCanvasPosition(me._map, viewportRoot);
  95095. if (!me.options.loadWhileAnimating) {
  95096. for (var item in ecLayers) {
  95097. if (!ecLayers.hasOwnProperty(item)) {
  95098. continue;
  95099. }
  95100. ecLayers[item] && clearContext(ecLayers[item].ctx);
  95101. }
  95102. me._enableEchartsContainer();
  95103. }
  95104. coordSys.setMapOffset(mapOffset);
  95105. LeafletMapModel.__mapOffset = mapOffset;
  95106. api.dispatchAction({
  95107. type: 'LeafletMapLayout'
  95108. });
  95109. };
  95110. function clearContext(context) {
  95111. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  95112. }
  95113. function zoomEndHandler() {
  95114. if (rendering) {
  95115. return;
  95116. }
  95117. api.dispatchAction({
  95118. type: 'LeafletMapLayout'
  95119. });
  95120. me._enableEchartsContainer();
  95121. }
  95122. if (me._oldMoveHandler) {
  95123. leafletMap.off(me.options.loadWhileAnimating ? 'move' : 'moveend', me._oldMoveHandler);
  95124. }
  95125. if (me._oldZoomEndHandler) {
  95126. leafletMap.off('zoomend', me._oldZoomEndHandler);
  95127. }
  95128. leafletMap.on(me.options.loadWhileAnimating ? 'move' : 'moveend', moveHandler);
  95129. leafletMap.on('zoomend', zoomEndHandler);
  95130. me._oldMoveHandler = moveHandler;
  95131. me._oldZoomEndHandler = zoomEndHandler;
  95132. rendering = false;
  95133. }
  95134. });
  95135. this._ec.setOption(this._echartsOptions);
  95136. },
  95137. onRemove: function onRemove() {
  95138. // 销毁echarts实例
  95139. this._ec.clear();
  95140. this._ec.dispose();
  95141. delete this._ec;
  95142. external_L_default().DomUtil.remove(this._echartsContainer);
  95143. if (this._oldZoomEndHandler) {
  95144. this._map.off("zoomend", this._oldZoomEndHandler);
  95145. this._oldZoomEndHandler = null;
  95146. }
  95147. if (this._oldMoveHandler) {
  95148. this._map.off(this.options.loadWhileAnimating ? 'move' : 'moveend', this._oldMoveHandler);
  95149. this._oldMoveHandler = null;
  95150. }
  95151. if (this._resizeHandler) {
  95152. this._map.off('resize', this._resizeHandler);
  95153. this._resizeHandler = null;
  95154. }
  95155. delete this._map;
  95156. },
  95157. _initEchartsContainer: function _initEchartsContainer() {
  95158. var size = this._map.getSize();
  95159. var _div = document.createElement('div');
  95160. _div.style.position = 'absolute';
  95161. _div.style.height = size.y + 'px';
  95162. _div.style.width = size.x + 'px';
  95163. _div.style.zIndex = 10;
  95164. this._echartsContainer = _div;
  95165. this.getPane().appendChild(this._echartsContainer);
  95166. var me = this;
  95167. function _resizeHandler(e) {
  95168. var size = e.newSize;
  95169. me._echartsContainer.style.width = size.x + 'px';
  95170. me._echartsContainer.style.height = size.y + 'px';
  95171. me._ec.resize();
  95172. }
  95173. this._map.on('resize', _resizeHandler);
  95174. this._resizeHandler = _resizeHandler;
  95175. }
  95176. });
  95177. /**
  95178. * @class LeafletMapCoordSys
  95179. * @private
  95180. * @classdesc 地图坐标系统类。
  95181. * @param {L.Map} leafletMap - Leaflet Map 对象。
  95182. */
  95183. function LeafletMapCoordSys(leafletMap) {
  95184. this._LeafletMap = leafletMap;
  95185. this.dimensions = ['lng', 'lat'];
  95186. this._mapOffset = _getMapOffset(leafletMap);
  95187. }
  95188. LeafletMapCoordSys.prototype.dimensions = ['lng', 'lat'];
  95189. LeafletMapCoordSys.prototype.setMapOffset = function (mapOffset) {
  95190. this._mapOffset = mapOffset;
  95191. };
  95192. LeafletMapCoordSys.prototype.getBMap = function () {
  95193. return this._LeafletMap;
  95194. };
  95195. LeafletMapCoordSys.prototype.prepareCustoms = function () {
  95196. var zrUtil = external_function_try_return_echarts_catch_e_return_namespaceObject.util;
  95197. var rect = this.getViewRect();
  95198. return {
  95199. coordSys: {
  95200. // The name exposed to user is always 'cartesian2d' but not 'grid'.
  95201. type: 'leaflet',
  95202. x: rect.x,
  95203. y: rect.y,
  95204. width: rect.width,
  95205. height: rect.height
  95206. },
  95207. api: {
  95208. coord: zrUtil.bind(this.dataToPoint, this),
  95209. size: zrUtil.bind(dataToCoordSize, this)
  95210. }
  95211. };
  95212. function dataToCoordSize(dataSize, dataItem) {
  95213. dataItem = dataItem || [0, 0];
  95214. return zrUtil.map([0, 1], function (dimIdx) {
  95215. var val = dataItem[dimIdx];
  95216. var halfSize = dataSize[dimIdx] / 2;
  95217. var p1 = [];
  95218. var p2 = [];
  95219. p1[dimIdx] = val - halfSize;
  95220. p2[dimIdx] = val + halfSize;
  95221. p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
  95222. return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
  95223. }, this);
  95224. }
  95225. };
  95226. LeafletMapCoordSys.prototype.dataToPoint = function (data) {
  95227. //处理数据中的null值
  95228. if (data[1] === null) {
  95229. data[1] = (external_L_default()).CRS.EPSG3857.projection.MAX_LATITUDE;
  95230. }
  95231. //平面坐标系不能这么处理
  95232. //data[1] = this.fixLat(data[1]);
  95233. var px = this._LeafletMap.latLngToLayerPoint([data[1], data[0]]);
  95234. var mapOffset = this._mapOffset;
  95235. return [px.x - mapOffset[0], px.y - mapOffset[1]];
  95236. };
  95237. LeafletMapCoordSys.prototype.fixLat = function (lat) {
  95238. if (lat >= 90) {
  95239. return 89.99999999999999;
  95240. }
  95241. if (lat <= -90) {
  95242. return -89.99999999999999;
  95243. }
  95244. return lat;
  95245. };
  95246. LeafletMapCoordSys.prototype.pointToData = function (pt) {
  95247. var mapOffset = this._mapOffset;
  95248. var point = this._LeafletMap.layerPointToLatLng([pt[0] + mapOffset[0], pt[1] + mapOffset[1]]);
  95249. return [point.lng, point.lat];
  95250. };
  95251. LeafletMapCoordSys.prototype.getViewRect = function () {
  95252. var size = this._LeafletMap.getSize();
  95253. return new external_function_try_return_echarts_catch_e_return_namespaceObject.graphic.BoundingRect(0, 0, size.x, size.y);
  95254. };
  95255. LeafletMapCoordSys.prototype.getRoamTransform = function () {
  95256. return external_function_try_return_echarts_catch_e_return_namespaceObject.matrix.create();
  95257. };
  95258. LeafletMapCoordSys.dimensions = LeafletMapCoordSys.prototype.dimensions;
  95259. LeafletMapCoordSys.create = function (ecModel) {
  95260. var coordSys;
  95261. var leafletMap = ecModel.scheduler.ecInstance.leafletMap;
  95262. ecModel.eachComponent('LeafletMap', function (leafletMapModel) {
  95263. if (!coordSys) {
  95264. coordSys = new LeafletMapCoordSys(leafletMap);
  95265. }
  95266. leafletMapModel.coordinateSystem = coordSys;
  95267. leafletMapModel.coordinateSystem.setMapOffset(leafletMapModel.__mapOffset || _getMapOffset(leafletMap));
  95268. });
  95269. ecModel.eachSeries(function (seriesModel) {
  95270. if (seriesModel.get('coordinateSystem') === 'leaflet') {
  95271. if (!coordSys) {
  95272. coordSys = new LeafletMapCoordSys(leafletMap);
  95273. }
  95274. seriesModel.coordinateSystem = coordSys;
  95275. seriesModel.animation = seriesModel.animation === true;
  95276. }
  95277. });
  95278. };
  95279. function _getMapOffset(map) {
  95280. var offset = map.containerPointToLayerPoint([0, 0]);
  95281. var mapOffset = [offset.x || 0, offset.y || 0];
  95282. return mapOffset;
  95283. }
  95284. function _setCanvasPosition(map, viewportRoot) {
  95285. var mapOffset = _getMapOffset(map);
  95286. viewportRoot.style.left = mapOffset[0] + 'px';
  95287. viewportRoot.style.top = mapOffset[1] + 'px';
  95288. return mapOffset;
  95289. }
  95290. var echartsLayer = function echartsLayer(echartsOptions, options) {
  95291. return new EchartsLayer(echartsOptions, options);
  95292. };
  95293. ;// CONCATENATED MODULE: ./src/leaflet/core/Detector.js
  95294. function Detector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  95295. function Detector_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  95296. function Detector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Detector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Detector_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  95297. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  95298. * This program are made available under the terms of the Apache License, Version 2.0
  95299. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  95300. var Detector = /*#__PURE__*/function () {
  95301. function Detector() {
  95302. Detector_classCallCheck(this, Detector);
  95303. }
  95304. Detector_createClass(Detector, null, [{
  95305. key: "supportWebGL",
  95306. value: function supportWebGL() {
  95307. return getContext('webgl');
  95308. }
  95309. }, {
  95310. key: "supportWebGL2",
  95311. value: function supportWebGL2() {
  95312. return getContext('webgl2');
  95313. }
  95314. }, {
  95315. key: "supportCanvas",
  95316. value: function supportCanvas() {
  95317. return getContext('2d');
  95318. }
  95319. }]);
  95320. return Detector;
  95321. }();
  95322. function getContext(context) {
  95323. var canvas = document.createElement('canvas');
  95324. return canvas && canvas.getContext(context);
  95325. }
  95326. ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/CloverStyle.js
  95327. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  95328. * This program are made available under the terms of the Apache License, Version 2.0
  95329. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  95330. /**
  95331. * @class CloverStyle
  95332. * @deprecatedclassinstance L.supermap.cloverStyle
  95333. * @classdesc 三叶草要素风格类。
  95334. * @category Visualization Graphic
  95335. * @modulecategory Overlay
  95336. * @extends {L.Class}
  95337. * @param {Object} options - 参数。
  95338. * @param {number} [options.angle=60] - 三叶草每个扇叶的圆心角,单位弧度。
  95339. * @param {number} [options.spaceAngle=0] - 扇叶间隔角度,通过计算获取。
  95340. * @param {number} [options.count=3] - 扇叶数量。
  95341. * @param {boolean} [options.stroke=true] - 是否描边。
  95342. * @param {number} [options.strokeWidth=1] - 边框宽度。
  95343. * @param {string} [options.color='#3388ff'] - 颜色。
  95344. * @param {number} [options.weight=1] - 线宽。
  95345. * @param {number} [options.opacity=1] - 透明度。
  95346. * @param {string} [options.lineCap='round'] - 线帽形状。
  95347. * @param {string} [options.lineJoin='round'] - 线条交汇边角形状。
  95348. * @param {boolean} [options.fill=false] - 是否填充。
  95349. * @param {string} [options.fillColor='#66ccff'] - 填充色。
  95350. * @param {number} [options.fillOpacity=0.2] - 填充透明度。
  95351. * @param {string} [options.fillRule='evenodd'] - 填充形状。
  95352. * @param {number} [options.radius=10] - 半径。
  95353. * @usage
  95354. */
  95355. var CloverStyle = external_L_default().Class.extend({
  95356. options: {
  95357. radius: 10,
  95358. angele: 60,
  95359. spaceAngle: 0,
  95360. count: 3,
  95361. fill: false,
  95362. stroke: true,
  95363. color: '#3388ff',
  95364. weight: 1,
  95365. lineCap: 'round',
  95366. lineJoin: 'round',
  95367. fillColor: '#66ccff',
  95368. fillOpacity: 0.2,
  95369. fillRule: 'evenodd',
  95370. opacity: 1,
  95371. strokeWidth: 1
  95372. },
  95373. initialize: function initialize(options) {
  95374. options = options || {};
  95375. external_L_default().Util.setOptions(this, options);
  95376. this._canvas = document.createElement('canvas');
  95377. this._canvas.width = 2 * (this.options.radius + this.options.weight);
  95378. this._canvas.height = 2 * (this.options.radius + this.options.weight);
  95379. this._ctx = this._canvas.getContext('2d');
  95380. var strokeWidth = this.options.strokeWidth === undefined ? 1 : this.options.strokeWidth;
  95381. this.options.width = 2 * (this.options.radius + strokeWidth) + 1;
  95382. this._initStyle();
  95383. },
  95384. /**
  95385. * @function CloverStyle.prototype.getStyle
  95386. * @description 获取画布。
  95387. */
  95388. getStyle: function getStyle() {
  95389. return this._canvas;
  95390. },
  95391. /**
  95392. * @function CloverStyle.prototype.drawSector
  95393. * @description 绘制扇形。
  95394. * @param {CanvasRenderingContext2D} ctx - context 对象。
  95395. * @param {number} x - 中心点 x。
  95396. * @param {number} y - 中心点 y。
  95397. * @param {number} r - 中心点 r。
  95398. * @param {number} sAngle - 扇叶起始角度。
  95399. * @param {number} eAngle - 扇叶终止角度。
  95400. */
  95401. drawSector: function drawSector(ctx, x, y, r, sAngle, eAngle) {
  95402. //角度转换
  95403. sAngle = sAngle / 180 * Math.PI;
  95404. eAngle = eAngle / 180 * Math.PI;
  95405. ctx.moveTo(x, y);
  95406. ctx.lineTo(x + r * Math.cos(sAngle), y + r * Math.sin(sAngle));
  95407. ctx.arc(x, y, r, sAngle, eAngle);
  95408. ctx.lineTo(x, y);
  95409. },
  95410. _initStyle: function _initStyle() {
  95411. //起始角度
  95412. var sAngle = 0;
  95413. var options = this.options;
  95414. var eAngle = options.angle;
  95415. options.spaceAngle = 360 / options.count - options.angle;
  95416. if (options.spaceAngle < 0) {
  95417. return;
  95418. }
  95419. this._ctx.beginPath();
  95420. this.anchor = [options.width / 2, options.width / 2];
  95421. for (var i = 0; i < options.count; i++) {
  95422. this.drawSector(this._ctx, this.anchor[0], this.anchor[1], options.radius, sAngle, eAngle);
  95423. sAngle = eAngle + options.spaceAngle;
  95424. eAngle = sAngle + options.angle;
  95425. }
  95426. this._fillStroke();
  95427. },
  95428. _fillStroke: function _fillStroke() {
  95429. var options = this.options;
  95430. if (options.fill) {
  95431. this._ctx.globalAlpha = options.fillOpacity;
  95432. this._ctx.fillStyle = options.fillColor || options.color;
  95433. this._ctx.fill(options.fillRule || 'evenodd');
  95434. }
  95435. if (options.stroke && options.weight !== 0) {
  95436. this._ctx.globalAlpha = options.opacity;
  95437. this._ctx.lineWidth = options.weight;
  95438. this._ctx.strokeStyle = options.color;
  95439. this._ctx.lineCap = options.lineCap;
  95440. this._ctx.lineJoin = options.lineJoin;
  95441. this._ctx.stroke();
  95442. }
  95443. }
  95444. });
  95445. var cloverStyle = function cloverStyle(options) {
  95446. return new CloverStyle(options);
  95447. };
  95448. ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/CircleStyle.js
  95449. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  95450. * This program are made available under the terms of the Apache License, Version 2.0
  95451. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  95452. /**
  95453. * @class CircleStyle
  95454. * @deprecatedclassinstance L.supermap.circleStyle
  95455. * @classdesc 圆形要素风格类。
  95456. * @category Visualization Graphic
  95457. * @modulecategory Overlay
  95458. * @extends {L.Class}
  95459. * @param {Object} options - 参数。
  95460. * @param {boolean} [options.stroke=true] - 是否描边。
  95461. * @param {string} [options.color='#3388ff'] - 颜色。
  95462. * @param {number} [options.weight=1] - 线宽。
  95463. * @param {number} [options.opacity=1] - 透明度。
  95464. * @param {string} [options.lineCap='round'] - 线帽形状。
  95465. * @param {string} [options.lineJoin='round'] - 线条交汇边角形状。
  95466. * @param {boolean} [options.fill=false] - 是否填充。
  95467. * @param {string} [options.fillColor] - 填充色。
  95468. * @param {number} [options.fillOpacity=0.2] - 填充透明度。
  95469. * @param {string} [options.fillRule='evenodd'] - 填充形状。
  95470. * @param {number} [options.radius=3] - 半径。
  95471. * @usage
  95472. */
  95473. var CircleStyle = external_L_default().Class.extend({
  95474. options: {
  95475. stroke: true,
  95476. color: '#3388ff',
  95477. weight: 1,
  95478. opacity: 1,
  95479. lineCap: 'round',
  95480. lineJoin: 'round',
  95481. fill: false,
  95482. fillColor: null,
  95483. fillOpacity: 0.2,
  95484. fillRule: 'evenodd',
  95485. radius: 3
  95486. },
  95487. initialize: function initialize(options) {
  95488. options = options || {};
  95489. external_L_default().Util.setOptions(this, options);
  95490. this._canvas = document.createElement('canvas');
  95491. this._canvas.width = 2 * (this.options.radius + this.options.weight);
  95492. this._canvas.height = 2 * (this.options.radius + this.options.weight);
  95493. this._ctx = this._canvas.getContext('2d');
  95494. this._initStyle();
  95495. },
  95496. /**
  95497. * @deprecated
  95498. * @function CircleStyle.prototype.getCanvas
  95499. * @description 获取画布,已弃用该设置,请使用 getStyle 接口。
  95500. */
  95501. getCanvas: function getCanvas() {
  95502. return this._canvas;
  95503. },
  95504. /**
  95505. * @function CircleStyle.prototype.getStyle
  95506. * @description 获取画布。
  95507. */
  95508. getStyle: function getStyle() {
  95509. return this._canvas;
  95510. },
  95511. _initStyle: function _initStyle() {
  95512. this._ctx.beginPath();
  95513. this._ctx.arc(this._canvas.width / 2, this._canvas.height / 2, this.options.radius, 0, Math.PI * 2);
  95514. this._fillStroke();
  95515. },
  95516. _fillStroke: function _fillStroke() {
  95517. var options = this.options;
  95518. if (options.fill) {
  95519. this._ctx.globalAlpha = options.fillOpacity;
  95520. this._ctx.fillStyle = options.fillColor || options.color;
  95521. this._ctx.fill(options.fillRule || 'evenodd');
  95522. }
  95523. if (options.stroke && options.weight !== 0) {
  95524. this._ctx.globalAlpha = options.opacity;
  95525. this._ctx.lineWidth = options.weight;
  95526. this._ctx.strokeStyle = options.color;
  95527. this._ctx.lineCap = options.lineCap;
  95528. this._ctx.lineJoin = options.lineJoin;
  95529. this._ctx.stroke();
  95530. }
  95531. }
  95532. });
  95533. var circleStyle = function circleStyle(options) {
  95534. return new CircleStyle(options);
  95535. };
  95536. ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/ImageStyle.js
  95537. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  95538. * This program are made available under the terms of the Apache License, Version 2.0
  95539. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  95540. /**
  95541. * @class ImageStyle
  95542. * @deprecatedclassinstance L.supermap.imageStyle
  95543. * @classdesc 自定义图形要素风格类。
  95544. * @category Visualization Graphic
  95545. * @modulecategory Overlay
  95546. * @extends {L.Class}
  95547. * @param {Object} options - 参数。
  95548. * @param {HTMLImageElement} options.img - image 对象。
  95549. * @param {Array.<number>} [options.origin=[0.0]] - 中心点。
  95550. * @param {Array} [options.anchor] - 偏移量。
  95551. * @param {Array} [options.size] - 图形大小,即高度和宽度[width,height]。
  95552. * @param {Array} [options.radius] - 半径。
  95553. * @param {Array} [options.weight] - 宽度。
  95554. * @usage
  95555. */
  95556. var ImageStyle = external_L_default().Class.extend({
  95557. options: {
  95558. img: null,
  95559. origin: [0, 0],
  95560. anchor: null,
  95561. size: null
  95562. },
  95563. initialize: function initialize(options) {
  95564. options = options || {};
  95565. external_L_default().Util.setOptions(this, options);
  95566. this._canvas = document.createElement('canvas');
  95567. this._canvas.width = 2 * (this.options.radius + this.options.weight);
  95568. this._canvas.height = 2 * (this.options.radius + this.options.weight);
  95569. this._ctx = this._canvas.getContext('2d');
  95570. },
  95571. /**
  95572. * @function ImageStyle.prototype.getStyle
  95573. * @description 获取样式。
  95574. */
  95575. getStyle: function getStyle() {
  95576. return this.options;
  95577. }
  95578. });
  95579. var imageStyle = function imageStyle(options) {
  95580. return new ImageStyle(options);
  95581. };
  95582. ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/CanvasRenderer.js
  95583. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  95584. * This program are made available under the terms of the Apache License, Version 2.0
  95585. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  95586. var emptyFunc = (external_L_default()).Util.falseFn;
  95587. var GraphicCanvasRenderer = external_L_default().Class.extend({
  95588. initialize: function initialize(layer, options) {
  95589. this.layer = layer;
  95590. options = options || {};
  95591. external_L_default().Util.setOptions(this, options);
  95592. },
  95593. /**
  95594. * @private
  95595. * @function GraphicCanvasRenderer.prototype.getRenderer
  95596. * @description 返回渲染器,提供图层后续的数据增删改。
  95597. * @returns {L.Canvas}
  95598. */
  95599. getRenderer: function getRenderer() {
  95600. return this.options.renderer;
  95601. },
  95602. /**
  95603. * @private
  95604. * @function GraphicCanvasRenderer.prototype.update
  95605. * @description 更新图层,数据或者样式改变后调用。
  95606. */
  95607. update: function update() {
  95608. this.getRenderer()._clear();
  95609. this.getRenderer()._draw();
  95610. },
  95611. _getGraphicAtPoint: function _getGraphicAtPoint(p) {
  95612. var layer = this.layer;
  95613. var map = layer._map;
  95614. var graphics = layer._getGraphicsInBounds();
  95615. for (var i = graphics.length - 1; i >= 0; i--) {
  95616. var p1 = void 0,
  95617. p2 = void 0,
  95618. bounds = void 0;
  95619. var center = map.latLngToLayerPoint(graphics[i].getLatLng());
  95620. var style = graphics[i].getStyle();
  95621. if (!style && this.defaultStyle) {
  95622. style = this.defaultStyle;
  95623. }
  95624. if (style.img) {
  95625. var imgWidth = style.img.width;
  95626. var imgHeight = style.img.height;
  95627. if (style.size && style.size[0] && style.size[1]) {
  95628. imgWidth = style.size[0];
  95629. imgHeight = style.size[1];
  95630. }
  95631. var anchor = style.anchor || [imgWidth / 2, imgHeight / 2];
  95632. p1 = external_L_default().point(center.x - anchor[0], center.y - anchor[1]);
  95633. p2 = external_L_default().point(p1.x + imgWidth, p1.y + imgHeight);
  95634. } else {
  95635. p1 = external_L_default().point(center.x - style.width / 2, center.y - style.height / 2);
  95636. p2 = external_L_default().point(center.x + style.width / 2, center.y + style.height / 2);
  95637. }
  95638. bounds = external_L_default().bounds(p1, p2);
  95639. if (bounds.contains(p)) {
  95640. return graphics[i];
  95641. }
  95642. }
  95643. return null;
  95644. },
  95645. containsPoint: function containsPoint(p) {
  95646. return !!this._getGraphicAtPoint(p);
  95647. },
  95648. _handleClick: function _handleClick(evt) {
  95649. evt.target = null;
  95650. var layer = this.layer;
  95651. var map = layer._map;
  95652. var graphic = this._getGraphicAtPoint(map.latLngToLayerPoint(evt.latlng));
  95653. if (graphic) {
  95654. this.layer._renderer._ctx.canvas.style.cursor = 'pointer';
  95655. evt.target = graphic;
  95656. if (evt.type === 'click' && layer.options.onClick) {
  95657. layer.options.onClick.call(layer, graphic, evt);
  95658. }
  95659. return;
  95660. }
  95661. this.layer._renderer._ctx.canvas.style.cursor = 'auto';
  95662. },
  95663. //跟GraphicWebGLRenderer保持一致
  95664. _clearBuffer: emptyFunc
  95665. });
  95666. external_L_default().Canvas.include({
  95667. drawGraphics: function drawGraphics(graphics, defaultStyle) {
  95668. var me = this;
  95669. if (!me._drawing) {
  95670. return;
  95671. }
  95672. //this._ctx.clearRect(0, 0, this._ctx.canvas.width, me._ctx.canvas.height);
  95673. graphics.forEach(function (graphic) {
  95674. var style = graphic.getStyle();
  95675. if (!style && defaultStyle) {
  95676. style = defaultStyle;
  95677. }
  95678. if (style.img) {
  95679. //绘制图片
  95680. me._drawImage.call(me, me._ctx, style, graphic.getLatLng());
  95681. } else {
  95682. //绘制canvas
  95683. me._drawCanvas.call(me, me._ctx, style, graphic.getLatLng());
  95684. }
  95685. });
  95686. },
  95687. _drawCanvas: function _drawCanvas(ctx, style, latLng) {
  95688. var canvas = style;
  95689. var pt = this._map.latLngToLayerPoint(latLng);
  95690. var p0 = pt.x - canvas.width / 2;
  95691. var p1 = pt.y - canvas.height / 2;
  95692. var width = canvas.width;
  95693. var height = canvas.height;
  95694. ctx.drawImage(canvas, p0, p1, width, height);
  95695. },
  95696. _drawImage: function _drawImage(ctx, style, latLng) {
  95697. //设置图片的大小
  95698. var width, height;
  95699. if (style.size) {
  95700. var size = style.size;
  95701. width = size[0];
  95702. height = size[1];
  95703. } else {
  95704. width = style.img.width;
  95705. height = style.img.height;
  95706. }
  95707. //设置偏移
  95708. var point = this._coordinateToPoint(latLng);
  95709. var pt = external_L_default().point(point),
  95710. ac = external_L_default().point(style.anchor || [width / 2, height / 2]);
  95711. point = [pt.x - ac.x, pt.y - ac.y];
  95712. //参数分别为:图片,图片裁剪下x,y位置,裁剪长宽,放置在画布的位置x,y, 占取画布长宽
  95713. //ctx.drawImage(style.img, 0, 0, width, height, point[0], point[1], width, height);
  95714. ctx.drawImage(style.img, point[0], point[1], width, height);
  95715. },
  95716. _coordinateToPoint: function _coordinateToPoint(coordinate) {
  95717. if (!this._map) {
  95718. return coordinate;
  95719. }
  95720. var latLng = coordinate;
  95721. if (external_L_default().Util.isArray(coordinate)) {
  95722. latLng = external_L_default().latLng(coordinate[0], coordinate[1]);
  95723. } else if (coordinate instanceof (external_L_default()).LatLng) {
  95724. latLng = external_L_default().latLng(coordinate.lat, coordinate.lng);
  95725. }
  95726. var point = this._map.latLngToLayerPoint(latLng);
  95727. return [point.x, point.y];
  95728. }
  95729. });
  95730. ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/WebGLRenderer.js
  95731. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  95732. * This program are made available under the terms of the Apache License, Version 2.0
  95733. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  95734. var WebGLRenderer_emptyFunc = (external_L_default()).Util.falseFn;
  95735. /**
  95736. * @private
  95737. * @class GraphicWebGLRenderer
  95738. * @classdesc 高效率点图层 webgl 渲染器。
  95739. * @category Visualization Graphic
  95740. * @extends {L.Layer}
  95741. * @param {Array.<GraphicLayer>} layer - 高效率点图层。
  95742. * @param {Object} options - 参数。
  95743. * @param {number} options.width - 地图宽度。
  95744. * @param {number} options.height - 地图高度。
  95745. * @param {HTMLElement} options.container - 放置渲染器的父元素。
  95746. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 颜色,目前只支持 rgba 数组。
  95747. * @param {number} [options.radius=10] - 半径。
  95748. * @param {number} [options.opacity=0.8] - 不透明度。
  95749. * @param {Array} [options.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  95750. * @param {number} [options.radiusScale=1] - 点放大倍数。
  95751. * @param {number} [options.radiusMinPixels=0] - 半径最小值,单位为像素。
  95752. * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值,单位为像素。
  95753. * @param {number} [options.strokeWidth=1] - 边框大小。
  95754. * @param {boolean} [options.outline=false] - 是否显示边框。
  95755. * @param {function} [options.onClick] - 点击事件。
  95756. * @param {function} [options.onHover] - 悬停事件。
  95757. */
  95758. var CSS_TRANSFORM = function () {
  95759. var div = document.createElement('div');
  95760. var props = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
  95761. for (var i = 0; i < props.length; i++) {
  95762. var prop = props[i];
  95763. if (div.style[prop] !== undefined) {
  95764. return prop;
  95765. }
  95766. }
  95767. return props[0];
  95768. }();
  95769. var GraphicWebGLRenderer = external_L_default().Class.extend({
  95770. initialize: function initialize(layer, options) {
  95771. this.layer = layer;
  95772. var opt = options || {};
  95773. external_L_default().Util.setOptions(this, opt);
  95774. this.options.radius = this._pixelToMeter(this.options.radius);
  95775. this._initContainer();
  95776. },
  95777. /**
  95778. * @private
  95779. * @function GraphicWebGLRenderer.prototype.getRenderer
  95780. * @description 返回渲染器,可对图层数据增加、删除和修改。
  95781. * @returns {GraphicWebGLRenderer}
  95782. */
  95783. getRenderer: function getRenderer() {
  95784. return this;
  95785. },
  95786. /**
  95787. * @private
  95788. * @function GraphicWebGLRenderer.prototype.update
  95789. * @description 更新图层。
  95790. */
  95791. update: function update(graphics) {
  95792. if (graphics && graphics.length > -1) {
  95793. this._data = graphics;
  95794. }
  95795. this._renderLayer.setChangeFlags({
  95796. dataChanged: true,
  95797. propsChanged: true,
  95798. viewportChanged: true,
  95799. updateTriggersChanged: true
  95800. });
  95801. this._refreshData();
  95802. var state = this._getLayerState();
  95803. state.data = this._data || [];
  95804. this._layerDefaultStyleCache = null;
  95805. this._renderLayer.setNeedsRedraw(true);
  95806. this._renderLayer.setState(state);
  95807. },
  95808. /**
  95809. * @private
  95810. * @function GraphicWebGLRenderer.prototype.drawGraphics
  95811. * @description 绘制点要素。
  95812. */
  95813. drawGraphics: function drawGraphics(graphics) {
  95814. this._clearBuffer();
  95815. var size = this.layer._map.getSize();
  95816. if (this._container.width !== size.x) {
  95817. this._container.width = size.x;
  95818. }
  95819. if (this._container.height !== size.y) {
  95820. this._container.height = size.y;
  95821. }
  95822. var mapPane = this.layer._map.getPanes().mapPane;
  95823. var point = mapPane._leaflet_pos;
  95824. this._container.style[CSS_TRANSFORM] = 'translate(' + -Math.round(point.x) + 'px,' + -Math.round(point.y) + 'px)';
  95825. this._data = graphics || [];
  95826. if (!this._renderLayer) {
  95827. this._createInnerRender();
  95828. }
  95829. this._draw();
  95830. },
  95831. _initContainer: function _initContainer() {
  95832. this._container = this._createCanvas(this.options.width, this.options.height);
  95833. this._layerContainer = this.options.container;
  95834. this._wrapper = external_L_default().DomUtil.create('div', "deck-wrapper", this._layerContainer);
  95835. this._wrapper.appendChild(this._container);
  95836. },
  95837. _createCanvas: function _createCanvas(width, height) {
  95838. //leaflet-layer 对应的css会自动设置position
  95839. var canvas = external_L_default().DomUtil.create('canvas', 'graphicLayer leaflet-layer leaflet-zoom-hide');
  95840. canvas.oncontextmenu = (external_L_default()).Util.falseFn;
  95841. canvas.width = width;
  95842. canvas.height = height;
  95843. canvas.style.width = width + "px";
  95844. canvas.style.height = height + "px";
  95845. return canvas;
  95846. },
  95847. _pixelToMeter: function _pixelToMeter(pixel) {
  95848. var bounds = this.layer._map.getBounds();
  95849. var latlngRes = (bounds.getEast() - bounds.getWest()) / this.layer._map.getSize().x;
  95850. var meterRes = latlngRes * (Math.PI * 6378137 / 180);
  95851. return pixel * meterRes;
  95852. },
  95853. _createInnerRender: function _createInnerRender() {
  95854. var me = this;
  95855. var state = this._getLayerState();
  95856. var color = state.color,
  95857. radius = state.radius,
  95858. opacity = state.opacity,
  95859. highlightColor = state.highlightColor,
  95860. radiusScale = state.radiusScale,
  95861. radiusMinPixels = state.radiusMinPixels,
  95862. radiusMaxPixels = state.radiusMaxPixels,
  95863. strokeWidth = state.strokeWidth,
  95864. outline = state.outline;
  95865. var innerLayerOptions = {
  95866. id: 'scatter-plot',
  95867. data: me._data,
  95868. pickable: Boolean(this.options.onClick) || Boolean(this.options.onHover),
  95869. autoHighlight: true,
  95870. color: color,
  95871. opacity: opacity,
  95872. radius: radius,
  95873. radiusScale: radiusScale,
  95874. highlightColor: highlightColor,
  95875. radiusMinPixels: radiusMinPixels,
  95876. radiusMaxPixels: radiusMaxPixels,
  95877. strokeWidth: strokeWidth,
  95878. coordinateSystem: this._isWGS84() ? window.DeckGL.COORDINATE_SYSTEM.LNGLAT_OFFSETS : window.DeckGL.COORDINATE_SYSTEM.LNGLAT,
  95879. isGeographicCoordinateSystem: this._isWGS84(),
  95880. outline: outline,
  95881. getPosition: function getPosition(point) {
  95882. if (!point) {
  95883. return [0, 0, 0];
  95884. }
  95885. var lngLat = point.getLatLng();
  95886. return lngLat && [lngLat.lng, lngLat.lat, 0];
  95887. },
  95888. getColor: function getColor(point) {
  95889. var defaultStyle = me._getLayerDefaultStyle();
  95890. var style = point && point.options;
  95891. return style && style.color || defaultStyle.color;
  95892. },
  95893. getRadius: function getRadius(point) {
  95894. var defaultStyle = me._getLayerDefaultStyle();
  95895. var style = point && point.getStyle();
  95896. return style && style.radius || defaultStyle.radius;
  95897. },
  95898. updateTriggers: {
  95899. getColor: [color],
  95900. getRadius: [radius]
  95901. }
  95902. };
  95903. var _self = this;
  95904. if (this.options.onClick) {
  95905. innerLayerOptions.onClick = function () {
  95906. _self._container.style.cursor = "pointer";
  95907. _self.options.onClick.apply(_self, arguments);
  95908. };
  95909. }
  95910. if (this.options.onHover) {
  95911. innerLayerOptions.onHover = function () {
  95912. _self._container.style.cursor = "pointer";
  95913. _self.options.onHover.apply(_self, arguments);
  95914. };
  95915. }
  95916. me._renderLayer = new window.DeckGL.ScatterplotLayer(innerLayerOptions);
  95917. },
  95918. _getLayerDefaultStyle: function _getLayerDefaultStyle() {
  95919. if (this._layerDefaultStyleCache) {
  95920. return this._layerDefaultStyleCache;
  95921. }
  95922. var _this$layer$options = this.layer.options,
  95923. color = _this$layer$options.color,
  95924. opacity = _this$layer$options.opacity,
  95925. radius = _this$layer$options.radius,
  95926. radiusScale = _this$layer$options.radiusScale,
  95927. radiusMinPixels = _this$layer$options.radiusMinPixels,
  95928. radiusMaxPixels = _this$layer$options.radiusMaxPixels,
  95929. strokeWidth = _this$layer$options.strokeWidth,
  95930. outline = _this$layer$options.outline;
  95931. radius = this._pixelToMeter(radius);
  95932. this._layerDefaultStyleCache = {
  95933. color: color,
  95934. opacity: opacity,
  95935. radius: radius,
  95936. radiusScale: radiusScale,
  95937. radiusMinPixels: radiusMinPixels,
  95938. radiusMaxPixels: radiusMaxPixels,
  95939. strokeWidth: strokeWidth,
  95940. outline: outline
  95941. };
  95942. return this._layerDefaultStyleCache;
  95943. },
  95944. _getLayerState: function _getLayerState() {
  95945. var state = this.layer.getState();
  95946. state.zoom = state.zoom - 1;
  95947. return state;
  95948. },
  95949. _draw: function _draw() {
  95950. var state = this._getLayerState();
  95951. this._refreshData();
  95952. state.data = this._data || [];
  95953. var deckOptions = {};
  95954. for (var key in state) {
  95955. deckOptions[key] = state[key];
  95956. }
  95957. this._layerDefaultStyleCache = null;
  95958. this._renderLayer.setNeedsRedraw(true);
  95959. deckOptions.layers = [this._renderLayer];
  95960. deckOptions.canvas = this._container;
  95961. deckOptions.onBeforeRender = this._onBeforeRender.bind(this);
  95962. deckOptions.onAfterRender = this._onAfterRender.bind(this);
  95963. deckOptions.coordinateSystem = this._isWGS84() ? window.DeckGL.COORDINATE_SYSTEM.LNGLAT_OFFSETS : window.DeckGL.COORDINATE_SYSTEM.LNGLAT;
  95964. deckOptions.isGeographicCoordinateSystem = this._isWGS84();
  95965. if (!this.deckGL) {
  95966. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  95967. } else {
  95968. this.deckGL.setProps(deckOptions);
  95969. }
  95970. },
  95971. _clearBuffer: function _clearBuffer() {
  95972. if (this.deckGL) {
  95973. var lm = this.deckGL.layerManager;
  95974. lm && lm.context.gl.clear(lm.context.gl.COLOR_BUFFER_BIT);
  95975. }
  95976. return this;
  95977. },
  95978. _refreshData: function _refreshData() {
  95979. var graphics = this._data || [];
  95980. var sGraphics = !external_L_default().Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  95981. //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  95982. if (!this._renderLayer.props.data) {
  95983. this._renderLayer.props.data = [];
  95984. }
  95985. this._renderLayer.props.data.length = 0;
  95986. for (var i = 0; i < sGraphics.length; i++) {
  95987. this._renderLayer.props.data.push(sGraphics[i]);
  95988. }
  95989. this._data = this._renderLayer.props.data;
  95990. },
  95991. _handleClick: WebGLRenderer_emptyFunc,
  95992. //deck渲染开始前调用,可以重写
  95993. _onBeforeRender: WebGLRenderer_emptyFunc,
  95994. //deck渲染结束后调用,可以重写
  95995. _onAfterRender: WebGLRenderer_emptyFunc,
  95996. //以下为leaflet再带的renderer的方法,为了保持接口正常调用,故增加这几个方法
  95997. _removePath: function _removePath() {
  95998. this._wrapper.parentElement.removeChild(this._wrapper);
  95999. this._container = null;
  96000. this._wrapper = null;
  96001. return this;
  96002. },
  96003. _initPath: WebGLRenderer_emptyFunc,
  96004. _addPath: WebGLRenderer_emptyFunc,
  96005. containsPoint: WebGLRenderer_emptyFunc,
  96006. _isWGS84: function _isWGS84() {
  96007. return this.layer._map.options.crs.code === "EPSG:4326";
  96008. }
  96009. });
  96010. ;// CONCATENATED MODULE: ./src/leaflet/overlay/graphic/index.js
  96011. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  96012. * This program are made available under the terms of the Apache License, Version 2.0
  96013. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  96014. ;// CONCATENATED MODULE: ./src/leaflet/overlay/GraphicLayer.js
  96015. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  96016. * This program are made available under the terms of the Apache License, Version 2.0
  96017. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  96018. var Renderer = ['canvas', 'webgl'];
  96019. var defaultProps = {
  96020. color: [0, 0, 0, 255],
  96021. opacity: 0.8,
  96022. radius: 10,
  96023. radiusScale: 1,
  96024. radiusMinPixels: 0,
  96025. radiusMaxPixels: Number.MAX_SAFE_INTEGER,
  96026. strokeWidth: 1,
  96027. outline: false
  96028. };
  96029. var BASE_RESOLUTIONS = {
  96030. 'EPSG:4326': 360.0 / 256,
  96031. 'EPSG:3857': 20037508.34279 * 2 / 256
  96032. };
  96033. var DEFAULT_ZOOM_OFFSET = {
  96034. 'EPSG:4326': 1,
  96035. 'EPSG:3857': 0
  96036. };
  96037. /**
  96038. * @class GraphicLayer
  96039. * @deprecatedclassinstance L.supermap.graphicLayer
  96040. * @classdesc 高效率点图层类。
  96041. * @category Visualization Graphic
  96042. * @modulecategory Overlay
  96043. * @extends {L.Path}
  96044. * @param {Array.<Graphic>} graphics - 要素对象。
  96045. * @param {Object} options - 参数。
  96046. * @param {string} [options.render='canvas'] - 指定使用的渲染器。可选值:'webgl','canvas'( webgl 渲染目前只支持散点)。
  96047. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 要素颜色。
  96048. * @param {Array.<number>} [options.highlightColor] - webgl 渲染时要素高亮颜色。
  96049. * @param {number} [options.opacity=0.8] - 要素透明度。当 {@link Graphic} 的 style 参数传入设置了 fillOpacity 或 opacity 的 {@link CircleStyle} 或 {@link CloverStyle},此参数无效。{@link Graphic} 的 style 传入 {@link ImageStyle} 后不支持此参数。
  96050. * @param {number} [options.radius=10] - 要素半径,单位为像素。当 {@link Graphic} 的 style 参数传入了 radius,此参数无效。
  96051. * @param {number} [options.radiusScale=1] - webgl 渲染时的要素放大倍数。
  96052. * @param {number} [options.radiusMinPixels=0] - webgl 渲染时的要素半径最小值,单位为像素。
  96053. * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - webgl 渲染时的要素半径最大值,单位为像素。
  96054. * @param {number} [options.strokeWidth=1] - 边框大小。当 {@link Graphic} 的 style 参数传入了 weight,此参数无效。
  96055. * @param {boolean} [options.outline=false] - 是否显示边框。当 {@link Graphic} 的 style 参数传入设置了 stroke 的 {@link CircleStyle} 或 {@link CloverStyle},此参数无效。
  96056. * @param {function} [options.onClick] - 图层鼠标点击响应事件(支持 webgl、canvas 渲染)。
  96057. * @param {function} [options.onHover] - 图层鼠标悬停响应事件(只支持 webgl 渲染)。
  96058. * @usage
  96059. */
  96060. var GraphicLayer = external_L_default().Path.extend({
  96061. initialize: function initialize(graphics, options) {
  96062. this.graphics = [].concat(graphics);
  96063. var opt = options || {};
  96064. // 由于是canvas实现所以不能更改pane
  96065. opt.pane = 'overlayPane';
  96066. external_L_default().Util.setOptions(this, opt);
  96067. //因为跟基类的renderer冲突,所以采用render这个名字
  96068. this.options.render = this.options.render || Renderer[0];
  96069. //浏览器支持webgl并且指定使用webgl渲染才使用webgl渲染
  96070. if (!Detector.supportWebGL2()) {
  96071. this.options.render = Renderer[0];
  96072. }
  96073. if (this.options.interactive) {
  96074. this.on('click mousemove dblclick mousedown mouseup mouseout contextmenu', this._handleClick, this);
  96075. }
  96076. },
  96077. /**
  96078. * @private
  96079. * @function GraphicLayer.prototype.getEvents
  96080. * @description 获取事件。
  96081. * @returns {Object} 返回该图层支持的事件对象。
  96082. */
  96083. getEvents: function getEvents() {
  96084. var events = {
  96085. resize: this._resize.bind(this),
  96086. moveend: this._moveEnd.bind(this)
  96087. };
  96088. return events;
  96089. },
  96090. /**
  96091. * @private
  96092. * @function GraphicLayer.prototype.onAdd
  96093. * @description 添加图形。
  96094. */
  96095. onAdd: function onAdd(map) {
  96096. this._map = map;
  96097. this._crs = map.options.crs;
  96098. this.defaultStyle = this._getDefaultStyle(this.options);
  96099. this._renderer = this._createRenderer();
  96100. this._container = this._renderer._container;
  96101. // this.addInteractiveTarget(this._container);
  96102. external_L_default().Path.prototype.onAdd.call(this);
  96103. },
  96104. /**
  96105. * @private
  96106. * @override
  96107. * @function GraphicLayer.prototype.onRemove
  96108. * @description 移除图层。
  96109. */
  96110. onRemove: function onRemove() {
  96111. this.off('click mousemove dblclick mousedown mouseup contextmenu', this._handleClick, this);
  96112. this._renderer._removePath(this);
  96113. },
  96114. /**
  96115. * @function GraphicLayer.prototype.setGraphics
  96116. * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
  96117. * @param {Array.<Graphic>} graphics - 点要素对象数组。
  96118. */
  96119. setGraphics: function setGraphics(graphics) {
  96120. this.graphics = this.graphics || [];
  96121. this.graphics.length = 0;
  96122. var sGraphics = !external_L_default().Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  96123. this.graphics = [].concat(sGraphics);
  96124. this.update();
  96125. },
  96126. /**
  96127. * @function GraphicLayer.prototype.addGraphics
  96128. * @description 追加点要素,不会覆盖之前的要素。
  96129. * @param {Array.<Graphic>} graphics - 点要素对象数组。
  96130. */
  96131. addGraphics: function addGraphics(graphics) {
  96132. this.graphics = this.graphics || [];
  96133. var sGraphics = !external_L_default().Util.isArray(graphics) ? [graphics] : [].concat(graphics);
  96134. this.graphics = this.graphics.concat(sGraphics);
  96135. this.update();
  96136. },
  96137. /**
  96138. * @function GraphicLayer.prototype.getGraphicBy
  96139. * @description 指定属性名和属性值,获取第一个匹配的要素数组。
  96140. * @param {string} property - 属性名称。
  96141. * @param {string} value - 属性值。
  96142. * @returns {Graphic} 返回匹配的 graphic 。
  96143. */
  96144. getGraphicBy: function getGraphicBy(property, value) {
  96145. var graphic = null;
  96146. for (var index in this.graphics) {
  96147. if (this.graphics[index][property] === value) {
  96148. graphic = this.graphics[index];
  96149. break;
  96150. }
  96151. }
  96152. return graphic;
  96153. },
  96154. /**
  96155. * @function GraphicLayer.prototype.getGraphicById
  96156. * @description 获取指定 ID 的矢量要素。
  96157. * @param {string} graphicId - 矢量要素的属性 ID。
  96158. * @returns {Graphic} 返回匹配的 graphic。
  96159. */
  96160. getGraphicById: function getGraphicById(graphicId) {
  96161. return this.getGraphicBy('id', graphicId);
  96162. },
  96163. /**
  96164. * @function GraphicLayer.prototype.getGraphicsByAttribute
  96165. * @description 指定属性名和属性值,获取所有匹配的要素数组。
  96166. * @param {string} attrName - 属性名称。
  96167. * @param {string} attrValue - 属性值。
  96168. * @returns {Array.<Graphic>} 返回匹配的 graphic 数组。
  96169. */
  96170. getGraphicsByAttribute: function getGraphicsByAttribute(attrName, attrValue) {
  96171. var graphic,
  96172. foundgraphics = [];
  96173. for (var index in this.graphics) {
  96174. graphic = this.graphics[index];
  96175. if (graphic && graphic.attributes) {
  96176. if (graphic.attributes[attrName] === attrValue) {
  96177. foundgraphics.push(graphic);
  96178. }
  96179. }
  96180. }
  96181. return foundgraphics;
  96182. },
  96183. /**
  96184. * @function GraphicLayer.prototype.removeGraphics
  96185. * @description 删除要素数组,默认删除所有要素。
  96186. * @param {Array.<Graphic>} [graphics=null] - 删除的 graphics 数组。
  96187. */
  96188. removeGraphics: function removeGraphics() {
  96189. var graphics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  96190. //当 graphics 为 null 、为空数组,或 === this.graphics,则清除所有要素
  96191. if (!graphics || graphics.length === 0 || graphics === this.graphics) {
  96192. this.graphics.length = 0;
  96193. this.update();
  96194. return;
  96195. }
  96196. if (!Util_Util.isArray(graphics)) {
  96197. graphics = [graphics];
  96198. }
  96199. for (var i = graphics.length - 1; i >= 0; i--) {
  96200. var graphic = graphics[i];
  96201. //如果我们传入的grapchic在graphics数组中没有的话,则不进行删除,
  96202. //并将其放入未删除的数组中。
  96203. var findex = Util_Util.indexOf(this.graphics, graphic);
  96204. if (findex === -1) {
  96205. continue;
  96206. }
  96207. this.graphics.splice(findex, 1);
  96208. }
  96209. //删除完成后重新设置 setGraphics,以更新
  96210. this.update();
  96211. },
  96212. /**
  96213. * @function GraphicLayer.prototype.setStyle
  96214. * @description 设置图层要素整体样式。
  96215. * @param {Object} styleOptions - 样式对象。
  96216. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  96217. * @param {number} [styleOptions.radius=10] - 点半径。
  96218. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  96219. * @param {Array} [styleOptions.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  96220. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  96221. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值,单位为像素。
  96222. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值,单位为像素。
  96223. * @param {number} [styleOptions.strokeWidth=1] - 边框大小。
  96224. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  96225. */
  96226. setStyle: function setStyle(styleOptions) {
  96227. var _opt = this.options;
  96228. var styleOpt = {
  96229. color: _opt.color,
  96230. radius: _opt.radius,
  96231. opacity: _opt.opacity,
  96232. highlightColor: _opt.highlightColor,
  96233. radiusScale: _opt.radiusScale,
  96234. radiusMinPixels: _opt.radiusMinPixels,
  96235. radiusMaxPixels: _opt.radiusMaxPixels,
  96236. strokeWidth: _opt.strokeWidth,
  96237. outline: _opt.outline
  96238. };
  96239. this.options = external_L_default().Util.extend(this.options, styleOpt, styleOptions);
  96240. this.defaultStyle = this._getDefaultStyle(this.options);
  96241. this.update();
  96242. },
  96243. /**
  96244. * @function GraphicLayer.prototype.update
  96245. * @description 更新图层,数据或者样式改变后调用。
  96246. */
  96247. update: function update() {
  96248. this._layerRenderer.update(this.graphics);
  96249. },
  96250. /**
  96251. * @function GraphicLayer.prototype.clear
  96252. * @description 释放图层资源。
  96253. */
  96254. clear: function clear() {
  96255. this.removeGraphics();
  96256. },
  96257. /**
  96258. * @function GraphicLayer.prototype.getRenderer
  96259. * @description 获取渲染器。
  96260. * @returns {Object} 内部渲染器。
  96261. */
  96262. getRenderer: function getRenderer() {
  96263. return this._renderer;
  96264. },
  96265. /**
  96266. * @function GraphicLayer.prototype.getState
  96267. * @description 获取当前地图和图层状态。
  96268. * @returns {Object} 地图和图层状态,包含地图状态信息和本图层相关状态。
  96269. */
  96270. getState: function getState() {
  96271. var map = this._map;
  96272. var width = map.getSize().x;
  96273. var height = map.getSize().y;
  96274. var center = map.getCenter();
  96275. var longitude = center.lng;
  96276. var latitude = center.lat;
  96277. var zoomOffset = DEFAULT_ZOOM_OFFSET[this._crs.code] || 0;
  96278. if (BASE_RESOLUTIONS[this._crs.code] && this._crs.resolutions && this._crs.resolutions.length > 0) {
  96279. zoomOffset = Math.round(Math.log2(BASE_RESOLUTIONS[this._crs.code] / this._crs.resolutions[0]));
  96280. }
  96281. var zoom = map.getZoom() + zoomOffset;
  96282. var maxZoom = map.getMaxZoom() + zoomOffset;
  96283. var mapViewport = {
  96284. longitude: longitude,
  96285. latitude: latitude,
  96286. zoom: zoom,
  96287. maxZoom: maxZoom,
  96288. pitch: 0,
  96289. bearing: 0
  96290. };
  96291. var state = {};
  96292. for (var key in mapViewport) {
  96293. state[key] = mapViewport[key];
  96294. }
  96295. state.width = width;
  96296. state.height = height;
  96297. var options = this.options;
  96298. state.color = options.color;
  96299. state.radius = options.radius;
  96300. state.opacity = options.opacity;
  96301. state.highlightColor = options.highlightColor;
  96302. state.radiusScale = options.radiusScale;
  96303. state.radiusMinPixels = options.radiusMinPixels;
  96304. state.radiusMaxPixels = options.radiusMaxPixels;
  96305. state.strokeWidth = options.strokeWidth;
  96306. state.outline = options.outline;
  96307. return state;
  96308. },
  96309. _resize: function _resize() {
  96310. var size = this._map.getSize();
  96311. this._container.width = size.x;
  96312. this._container.height = size.y;
  96313. this._container.style.width = size.x + 'px';
  96314. this._container.style.height = size.y + 'px';
  96315. var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
  96316. external_L_default().DomUtil.setPosition(this._container, mapOffset);
  96317. this._update();
  96318. },
  96319. _moveEnd: function _moveEnd() {
  96320. if (this._layerRenderer instanceof GraphicWebGLRenderer) {
  96321. this._update();
  96322. }
  96323. },
  96324. //使用canvas渲染或webgl渲染
  96325. _createRenderer: function _createRenderer() {
  96326. var map = this._map;
  96327. var width = map.getSize().x;
  96328. var height = map.getSize().y;
  96329. var _renderer;
  96330. if (this.options.render === Renderer[0]) {
  96331. _renderer = new GraphicCanvasRenderer(this, {
  96332. width: width,
  96333. height: height,
  96334. renderer: map.getRenderer(this)
  96335. });
  96336. } else {
  96337. var optDefault = external_L_default().Util.setOptions({}, defaultProps);
  96338. var opt = external_L_default().Util.setOptions({
  96339. options: optDefault
  96340. }, this.options);
  96341. opt = external_L_default().Util.setOptions(this, opt);
  96342. opt.container = map.getPane('overlayPane');
  96343. opt.width = width;
  96344. opt.height = height;
  96345. _renderer = new GraphicWebGLRenderer(this, opt);
  96346. }
  96347. _renderer.defaultStyle = this.defaultStyle;
  96348. this._layerRenderer = _renderer;
  96349. return this._layerRenderer.getRenderer();
  96350. },
  96351. /**
  96352. * @private
  96353. * @override
  96354. */
  96355. _update: function _update() {
  96356. if (this._map) {
  96357. this._updatePath();
  96358. }
  96359. },
  96360. /**
  96361. * @private
  96362. * @override
  96363. */
  96364. _updatePath: function _updatePath() {
  96365. var graphics = this._getGraphicsInBounds();
  96366. this._renderer.drawGraphics(graphics, this.defaultStyle);
  96367. },
  96368. /**
  96369. * @private
  96370. * @override
  96371. */
  96372. _project: function _project() {
  96373. var me = this;
  96374. me._getGraphicsInBounds().map(function (graphic) {
  96375. var point = me._map.latLngToLayerPoint(graphic.getLatLng());
  96376. var w = me._clickTolerance();
  96377. var p = [graphic._anchor + w, graphic._anchor + w];
  96378. graphic._pxBounds = new (external_L_default()).Bounds(point.subtract(p), point.add(p));
  96379. return graphic;
  96380. });
  96381. me._pxBounds = external_L_default().bounds(external_L_default().point(0, 0), external_L_default().point(this._container.width, this._container.height));
  96382. },
  96383. _getDefaultStyle: function _getDefaultStyle(options) {
  96384. var target = {};
  96385. if (options.color) {
  96386. target.fill = true;
  96387. var color = this.toRGBA(options.color);
  96388. target.color = color;
  96389. target.fillColor = color;
  96390. }
  96391. if (options.opacity) {
  96392. target.opacity = options.opacity;
  96393. target.fillOpacity = options.opacity;
  96394. }
  96395. if (options.radius) {
  96396. target.radius = options.radius;
  96397. }
  96398. if (options.strokeWidth) {
  96399. target.weight = options.strokeWidth;
  96400. }
  96401. if (options.outline) {
  96402. target.stroke = options.outline;
  96403. }
  96404. return new CircleStyle(target).getStyle();
  96405. },
  96406. toRGBA: function toRGBA(colorArray) {
  96407. return "rgba(".concat(colorArray[0], ",").concat(colorArray[1], ",").concat(colorArray[2], ",").concat((colorArray[3] || 255) / 255, ")");
  96408. },
  96409. _getGraphicsInBounds: function _getGraphicsInBounds() {
  96410. var me = this;
  96411. var graphicsInBounds = [];
  96412. var viewBounds = me._map.getBounds();
  96413. this.graphics.map(function (graphic) {
  96414. if (viewBounds.contains(graphic.getLatLng())) {
  96415. graphicsInBounds.push(graphic);
  96416. }
  96417. return graphic;
  96418. });
  96419. return graphicsInBounds;
  96420. },
  96421. _handleClick: function _handleClick(evt) {
  96422. this._layerRenderer._handleClick(evt);
  96423. },
  96424. /**
  96425. * @private
  96426. * @override
  96427. */
  96428. beforeAdd: (external_L_default()).Util.falseFn,
  96429. /**
  96430. * @private
  96431. * @override
  96432. */
  96433. _containsPoint: function _containsPoint(p) {
  96434. return this._layerRenderer.containsPoint(p);
  96435. }
  96436. });
  96437. var graphicLayer = function graphicLayer(graphics, options) {
  96438. return new GraphicLayer(graphics, options);
  96439. };
  96440. ;// CONCATENATED MODULE: ./src/leaflet/overlay/GraphThemeLayer.js
  96441. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  96442. * This program are made available under the terms of the Apache License, Version 2.0
  96443. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  96444. /**
  96445. * @class GraphThemeLayer
  96446. * @deprecatedclassinstance L.supermap.graphThemeLayer
  96447. * @category Visualization Theme
  96448. * @modulecategory Overlay
  96449. * @classdesc 统计专题图图层类。统计专题图通过为每个要素绘制统计图表来反映其对应的专题值的大小。它可同时表示多个字段属性信息,在区域本身与各区域之间形成横向和纵向的对比。
  96450. * 统计专题图多用于具有相关数量特征的地图上,比如表示不同地区多年的粮食产量、GDP、人口等,不同时段客运量、地铁流量等。
  96451. * 目前提供的统计图类型有:柱状图(Bar),折线图(Line),饼图(Pie),三维柱状图(Bar3D),点状图(Point),环状图(Ring)。
  96452. * @extends ThemeLayer
  96453. * @param {string} name - 专题图表名称。
  96454. * @param {string} chartsType - 图表类型。目前可用:"Bar","Bar3D","Line","Point","Pie","Ring"。
  96455. * @param {Object} options - 参数。
  96456. * @param {boolean} [options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  96457. * @param {string} options.themeFields - 指定创建专题图字段。
  96458. * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
  96459. * @param {Object} [options.cache] - 缓存。
  96460. * @param {Object} [options.charts] - 图表。
  96461. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  96462. * @param {number} [options.opacity=1] - 图层透明度。
  96463. * @param {Array} [options.TFEvents] - 专题要素事件临时存储。专题要素事件临时存储。
  96464. * @param {Object} options.chartsSetting - 各类型图表的 chartsSetting 对象可设属性请参考具体图表模型类的注释中对 chartsSetting 对象可设属性的描述。chartsSetting 对象通常都具有以下 5 个基础可设属性:</br>
  96465. * @param {number} options.chartsSetting.width - 专题要素(图表)宽度。
  96466. * @param {number} options.chartsSetting.height - 专题要素(图表)高度。
  96467. * @param {Array.<number>} options.chartsSetting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  96468. * @param {number} [options.chartsSetting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位为像素。
  96469. * @param {number} [options.chartsSetting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位为像素。
  96470. * @param {Array.<number>} [options.chartsSetting.dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值,长度为 4 的一维数组。
  96471. * @param {number} [options.chartsSetting.decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  96472. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
  96473. * @usage
  96474. */
  96475. var GraphThemeLayer = ThemeLayer.extend({
  96476. options: {
  96477. //是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表,默认值:true。
  96478. isOverLay: true
  96479. },
  96480. initialize: function initialize(name, chartsType, options) {
  96481. var newArgs = [];
  96482. newArgs.push(name);
  96483. newArgs.push(options);
  96484. ThemeLayer.prototype.initialize.apply(this, newArgs);
  96485. this.chartsType = chartsType;
  96486. this.themeFields = options && options.themeFields ? options.themeFields : null;
  96487. this.charts = options && options.charts ? options.charts : [];
  96488. this.cache = options && options.cache ? options.cache : {};
  96489. this.chartsSetting = options && options.chartsSetting ? options.chartsSetting : {};
  96490. },
  96491. /**
  96492. * @function GraphThemeLayer.prototype.setChartsType
  96493. * @description 设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。图表类型,目前支持:"Bar", "Bar3D", "Line","Point","Pie","Ring"。
  96494. * @param {string} chartsType - 图表类型。目前可用:"Bar", "Bar3D", "Line","Point","Pie","Ring"。
  96495. */
  96496. setChartsType: function setChartsType(chartsType) {
  96497. this.chartsType = chartsType;
  96498. this.redraw();
  96499. },
  96500. /**
  96501. * @function GraphThemeLayer.prototype.addFeatures
  96502. * @description 向专题图图层中添加数据。
  96503. * @param {(Array.<ServerFeature>|Array.<ThemeFeature>|Array.<GeoJSONObject>|ServerFeature|ThemeFeature|GeoJSONObject)} features - 待添加的要素。
  96504. */
  96505. addFeatures: function addFeatures(features) {
  96506. var me = this;
  96507. /**
  96508. * @event GraphThemeLayer#beforefeaturesadded
  96509. * @description 向专题图图层中添加数据之前触发。
  96510. * @property {(Array.<ServerFeature>|Array.<ThemeFeature>|Array.<GeoJSONObject>|ServerFeature|ThemeFeature|GeoJSONObject)} features - 待添加的要素。
  96511. */
  96512. me.fire("beforefeaturesadded", {
  96513. features: features
  96514. });
  96515. //转换 features 形式
  96516. this.features = this.toiClientFeature(features);
  96517. //绘制专题要素
  96518. if (!me.renderer) {
  96519. return;
  96520. }
  96521. if (me._map) {
  96522. me.redrawThematicFeatures(me._map.getBounds());
  96523. } else {
  96524. me.redrawThematicFeatures();
  96525. }
  96526. },
  96527. /**
  96528. * @function GraphThemeLayer.prototype.redrawThematicFeatures
  96529. * @description 重绘所有专题要素。此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,压盖处理,缓存等步骤。地图漫游时调用此方法进行图层刷新。
  96530. * @param {L.Bounds} bounds - 重绘的范围。
  96531. */
  96532. redrawThematicFeatures: function redrawThematicFeatures(bounds) {
  96533. var me = this;
  96534. //清除当前所有可视元素
  96535. me.renderer.clearAll();
  96536. var features = me.features;
  96537. if (this.options.alwaysMapCRS && bounds && bounds instanceof (external_L_default()).LatLngBounds) {
  96538. var crs = this._map.options.crs;
  96539. bounds = external_L_default().bounds(crs.project(bounds.getSouthWest()), crs.project(bounds.getNorthEast()));
  96540. }
  96541. bounds = CommontypesConversion.toSuperMapBounds(bounds);
  96542. for (var i = 0, len = features.length; i < len; i++) {
  96543. var feature = features[i];
  96544. // 要素范围判断
  96545. var feaBounds = feature.geometry.getBounds();
  96546. //剔除当前视图(地理)范围以外的数据
  96547. if (bounds && !bounds.intersectsBounds(feaBounds)) {
  96548. continue;
  96549. }
  96550. var cache = me.cache;
  96551. // 用feature id 做缓存标识
  96552. var cacheField = feature.id;
  96553. // 数据对应的图表是否已缓存,没缓存则重新创建图表
  96554. if (!cache[cacheField]) {
  96555. cache[cacheField] = cacheField;
  96556. var chart = me.createThematicFeature(feature);
  96557. // 压盖处理权重值
  96558. var isValidOverlayWeightField = me.overlayWeightField && feature.attributes[me.overlayWeightField] && !isNaN(feature.attributes[me.overlayWeightField]);
  96559. if (chart && isValidOverlayWeightField) {
  96560. chart["__overlayWeight"] = feature.attributes[me.overlayWeightField];
  96561. }
  96562. if (chart) {
  96563. me.charts.push(chart);
  96564. }
  96565. }
  96566. }
  96567. me.drawCharts();
  96568. },
  96569. /**
  96570. * @function GraphThemeLayer.prototype.createThematicFeature
  96571. * @description 创建专题要素(图表)。
  96572. * @param {Object} feature - 待创建的要素。
  96573. */
  96574. createThematicFeature: function createThematicFeature(feature) {
  96575. var me = this;
  96576. var thematicFeature;
  96577. // 检查图表创建条件并创建图形
  96578. if (Theme_Theme[me.chartsType] && me.themeFields && me.chartsSetting) {
  96579. thematicFeature = new Theme_Theme[me.chartsType](feature, me, me.themeFields, me.chartsSetting);
  96580. }
  96581. // thematicFeature 是否创建成功
  96582. if (!thematicFeature) {
  96583. return false;
  96584. }
  96585. // 对专题要素执行图形装载
  96586. thematicFeature.assembleShapes();
  96587. return thematicFeature;
  96588. },
  96589. /**
  96590. * @function GraphThemeLayer.prototype.drawCharts
  96591. * @description 绘制图表。包含压盖处理。
  96592. */
  96593. drawCharts: function drawCharts() {
  96594. var me = this;
  96595. if (!me.renderer) {
  96596. return;
  96597. }
  96598. // 图表权重值处理
  96599. if (me.overlayWeightField) {
  96600. me._sortChart();
  96601. }
  96602. if (me.options && !me.options.isOverLay) {
  96603. // 不进行避让
  96604. me._addOverlayShape();
  96605. } else {
  96606. //进行避让
  96607. me._addNoOverlayShape();
  96608. }
  96609. // 绘制图形
  96610. me.renderer.render();
  96611. },
  96612. /**
  96613. * @function GraphThemeLayer.prototype.getShapesByFeatureID
  96614. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  96615. * @param {number} featureID - 要素 ID。
  96616. */
  96617. getShapesByFeatureID: function getShapesByFeatureID(featureID) {
  96618. var me = this,
  96619. list = [];
  96620. var shapeList = me.renderer.getAllShapes();
  96621. if (!featureID) {
  96622. return shapeList;
  96623. }
  96624. for (var i = 0, len = shapeList.length; i < len; i++) {
  96625. var si = shapeList[i];
  96626. if (si.refDataID && featureID === si.refDataID) {
  96627. list.push(si);
  96628. }
  96629. }
  96630. return list;
  96631. },
  96632. /**
  96633. * @function GraphThemeLayer.prototype.isQuadrilateralOverLap
  96634. * @description 判断两个四边形是否有压盖。
  96635. * @param {Array.<Object>} quadrilateral - 四边形节点数组。
  96636. * @example
  96637. * [{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}];
  96638. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  96639. */
  96640. isQuadrilateralOverLap: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  96641. var me = this;
  96642. var quadLen = quadrilateral.length,
  96643. quad2Len = quadrilateral2.length;
  96644. if (quadLen !== 5 || quad2Len !== 5) {
  96645. return null;
  96646. } //不是四边形
  96647. var OverLap = false;
  96648. //如果两四边形互不包含对方的节点,则两个四边形不相交
  96649. for (var i = 0; i < quadLen; i++) {
  96650. if (me.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  96651. OverLap = true;
  96652. break;
  96653. }
  96654. }
  96655. for (var _i2 = 0; _i2 < quad2Len; _i2++) {
  96656. if (me.isPointInPoly(quadrilateral2[_i2], quadrilateral)) {
  96657. OverLap = true;
  96658. break;
  96659. }
  96660. }
  96661. //加上两矩形十字相交的情况
  96662. for (var _i4 = 0; _i4 < quadLen - 1; _i4++) {
  96663. if (OverLap) {
  96664. break;
  96665. }
  96666. for (var j = 0; j < quad2Len - 1; j++) {
  96667. var isLineIn = Util_Util.lineIntersection(quadrilateral[_i4], quadrilateral[_i4 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  96668. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  96669. OverLap = true;
  96670. break;
  96671. }
  96672. }
  96673. }
  96674. return OverLap;
  96675. },
  96676. /**
  96677. * @function GraphThemeLayer.prototype.isPointInPoly
  96678. * @description 判断一个点是否在多边形里面(射线法)。
  96679. * @param {Object} pt - 需要判定的点对象,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  96680. * @param {Array.<Object>} poly - 多边形节点数组。
  96681. * 例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  96682. */
  96683. isPointInPoly: function isPointInPoly(pt, poly) {
  96684. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  96685. (poly[i].y <= pt.y && pt.y < poly[j].y || poly[j].y <= pt.y && pt.y < poly[i].y) && pt.x < (poly[j].x - poly[i].x) * (pt.y - poly[i].y) / (poly[j].y - poly[i].y) + poly[i].x && (isIn = !isIn);
  96686. }
  96687. return isIn;
  96688. },
  96689. /**
  96690. * @function GraphThemeLayer.prototype.isChartInMap
  96691. * @description 判断图表是否在地图里。
  96692. * @param {Bounds} mapPxBounds - 地图像素范围。
  96693. * @param {Array.<Object>} chartPxBounds - 图表范围的四边形节点数组。
  96694. * 例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  96695. */
  96696. isChartInMap: function isChartInMap(mapPxBounds, chartPxBounds) {
  96697. var mb = mapPxBounds;
  96698. var isIn = false;
  96699. for (var i = 0, len = chartPxBounds.length; i < len; i++) {
  96700. var cb = chartPxBounds[i];
  96701. if (cb.x >= mb.left && cb.x <= mb.right && cb.y >= mb.top && cb.y <= mb.bottom) {
  96702. isIn = true;
  96703. break;
  96704. }
  96705. }
  96706. return isIn;
  96707. },
  96708. /**
  96709. * @function GraphThemeLayer.prototype.clearCache
  96710. * @description 清除缓存数据。
  96711. */
  96712. clearCache: function clearCache() {
  96713. this.cache = {};
  96714. this.charts = [];
  96715. },
  96716. /**
  96717. * @function GraphThemeLayer.prototype.removeFeatures
  96718. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素(数据)。
  96719. * @param {(Array.<FeatureVector>|FeatureVector|Function)} features - 待删除的要素或用于条件删除的回调函数。
  96720. */
  96721. removeFeatures: function removeFeatures(features) {
  96722. // eslint-disable-line no-unused-vars
  96723. var me = this;
  96724. me.clearCache();
  96725. ThemeLayer.prototype.removeFeatures.call(me, features);
  96726. },
  96727. /**
  96728. * @function GraphThemeLayer.prototype.removeAllFeatures
  96729. * @description 清除当前图层所有的矢量要素。
  96730. */
  96731. removeAllFeatures: function removeAllFeatures() {
  96732. var me = this;
  96733. me.clearCache();
  96734. ThemeLayer.prototype.removeAllFeatures.apply(me, arguments);
  96735. },
  96736. /**
  96737. * @function GraphThemeLayer.prototype.redraw
  96738. * @description 重绘该图层,成功则返回 true,否则返回 false。
  96739. */
  96740. redraw: function redraw() {
  96741. var me = this;
  96742. me.clearCache();
  96743. return ThemeLayer.prototype.redraw.apply(me, arguments);
  96744. },
  96745. /**
  96746. * @function GraphThemeLayer.prototype.clear
  96747. * @description 清除图层。清除的内容包括数据(features)、专题要素、缓存。
  96748. */
  96749. clear: function clear() {
  96750. var me = this;
  96751. if (me.renderer) {
  96752. me.renderer.clearAll();
  96753. me.renderer.refresh();
  96754. }
  96755. me.removeAllFeatures();
  96756. me.clearCache();
  96757. },
  96758. /**
  96759. * @function GraphThemeLayer.prototype.getWeightFieldValue
  96760. * @description 获取权重字段的值。
  96761. * @param {FeatureVector} feature - 矢量要素。
  96762. * @param {Array.<string>} weightField - 字段名数组。
  96763. * @param {number} defaultValue - 当通过 weightField 获取不到权重值时,使用 defaultValue 作为权重值。
  96764. */
  96765. getWeightFieldValue: function getWeightFieldValue(feature, weightField, defaultValue) {
  96766. if (typeof defaultValue === "undefined" || isNaN(defaultValue)) {
  96767. defaultValue = 0;
  96768. }
  96769. if (!feature.attributes) {
  96770. return defaultValue;
  96771. }
  96772. var fieldValue = feature.attributes[weightField];
  96773. if (typeof fieldValue === "undefined" || isNaN(fieldValue)) {
  96774. fieldValue = defaultValue;
  96775. }
  96776. return fieldValue;
  96777. },
  96778. _sortChart: function _sortChart() {
  96779. var me = this;
  96780. if (!me.charts) {
  96781. return;
  96782. }
  96783. me.charts.sort(function (cs, ce) {
  96784. if (typeof cs["__overlayWeight"] === "undefined" && typeof ce["__overlayWeight"] === "undefined") {
  96785. return 0;
  96786. } else if (typeof cs["__overlayWeight"] !== "undefined" && typeof ce["__overlayWeight"] === "undefined") {
  96787. return -1;
  96788. } else if (typeof cs["__overlayWeight"] === "undefined" && typeof ce["__overlayWeight"] !== "undefined") {
  96789. return 1;
  96790. } else if (typeof cs["__overlayWeight"] !== "undefined" && typeof ce["__overlayWeight"] !== "undefined") {
  96791. return parseFloat(cs["__overlayWeight"]) < parseFloat(ce["__overlayWeight"]) ? 1 : -1;
  96792. }
  96793. return 0;
  96794. });
  96795. },
  96796. _addOverlayShape: function _addOverlayShape() {
  96797. var me = this;
  96798. var charts = me.charts;
  96799. for (var m = 0, len_m = charts.length; m < len_m; m++) {
  96800. var chart_m = charts[m];
  96801. // 图形参考位置 (reSetLocation 会更新 chartBounds)
  96802. var shapeROP_m = chart_m.resetLocation();
  96803. // 添加图形
  96804. var shapes_m = chart_m.shapes;
  96805. for (var n = 0, slen_n = shapes_m.length; n < slen_n; n++) {
  96806. shapes_m[n].refOriginalPosition = shapeROP_m;
  96807. me.renderer.addShape(shapes_m[n]);
  96808. }
  96809. }
  96810. },
  96811. _addNoOverlayShape: function _addNoOverlayShape() {
  96812. var me = this;
  96813. // 压盖判断所需 chartsBounds 集合
  96814. var mapBounds = me._map.getBounds();
  96815. var crs = this._map.options.crs;
  96816. if (this.options.alwaysMapCRS) {
  96817. mapBounds = external_L_default().bounds(crs.project(mapBounds.getSouthWest()), crs.project(mapBounds.getNorthEast()));
  96818. }
  96819. mapBounds = CommontypesConversion.toSuperMapBounds(mapBounds);
  96820. var charts = me.charts;
  96821. var chartsBounds = [];
  96822. // 获取地图像素 bounds
  96823. var mapPxLT = me.getLocalXY(new LonLat(mapBounds.left, mapBounds.top));
  96824. var mapPxRB = me.getLocalXY(new LonLat(mapBounds.right, mapBounds.bottom));
  96825. var mBounds = new Bounds(mapPxLT[0], mapPxRB[1], mapPxRB[0], mapPxLT[1]);
  96826. // 压盖处理 & 添加图形
  96827. for (var i = 0, len = charts.length; i < len; i++) {
  96828. var chart = charts[i];
  96829. // 图形参考位置 (reSetLocation 会更新 chartBounds)
  96830. var shapeROP = chart.resetLocation();
  96831. // 图表框
  96832. var cbs = chart.chartBounds;
  96833. var cBounds = [{
  96834. "x": cbs.left,
  96835. "y": cbs.top
  96836. }, {
  96837. "x": cbs.left,
  96838. "y": cbs.bottom
  96839. }, {
  96840. "x": cbs.right,
  96841. "y": cbs.bottom
  96842. }, {
  96843. "x": cbs.right,
  96844. "y": cbs.top
  96845. }, {
  96846. "x": cbs.left,
  96847. "y": cbs.top
  96848. }];
  96849. // 地图范围外不绘制
  96850. if (mBounds && !me.isChartInMap(mBounds, cBounds)) {
  96851. continue;
  96852. }
  96853. // 是否压盖
  96854. var isOverlay = false;
  96855. for (var j = 0; j < chartsBounds.length; j++) {
  96856. //压盖判断
  96857. if (me.isQuadrilateralOverLap(cBounds, chartsBounds[j])) {
  96858. isOverlay = true;
  96859. break;
  96860. }
  96861. }
  96862. if (isOverlay) {
  96863. continue;
  96864. } else {
  96865. chartsBounds.push(cBounds);
  96866. }
  96867. // 添加图形
  96868. var shapes = chart.shapes;
  96869. for (var _j2 = 0, slen = shapes.length; _j2 < slen; _j2++) {
  96870. shapes[_j2].refOriginalPosition = shapeROP;
  96871. me.renderer.addShape(shapes[_j2]);
  96872. }
  96873. }
  96874. }
  96875. });
  96876. var graphThemeLayer = function graphThemeLayer(name, chartsType, options) {
  96877. return new GraphThemeLayer(name, chartsType, options);
  96878. };
  96879. ;// CONCATENATED MODULE: ./src/leaflet/overlay/RankSymbolThemeLayer.js
  96880. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  96881. * This program are made available under the terms of the Apache License, Version 2.0
  96882. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  96883. /**
  96884. * @class RankSymbolThemeLayer
  96885. * @deprecatedclassinstance L.supermap.rankSymbolThemeLayer
  96886. * @category Visualization Theme
  96887. * @classdesc 符号专题图图层类。符号专题图通过为每个要素绘制符号大小来反映其对应的专题值的大小;它只能表示单个字段属性信息。
  96888. * 符号专题图多用于具有相关数量特征的地图上,比如表示不同地区粮食产量、GDP、人口等。
  96889. * 即通过制作一个符号专题图,就可以清晰展示各个区域相关 Value 的分布差异等。
  96890. * 目前提供的符号图形有:圆形(后续进行扩展:心形、五角星、多角星、图片等)。
  96891. * @modulecategory Overlay
  96892. * @extends {GraphThemeLayer}
  96893. * @param {string} name - 专题图层名。
  96894. * @param {ChartType} symbolType - 符号类型。目前支持:'Circle'。
  96895. * @param {Object} options - 参数。
  96896. * @param {boolean} [options.isOverLay=true] - 是否进行压盖处理,如果设为 true,表示在图表绘制过程中隐藏对已存在的图表产生压盖的图表。
  96897. * @param {string} options.themeFields - 指定创建专题图字段。
  96898. * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
  96899. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  96900. * @param {number} [options.opacity=1] - 图层透明度。
  96901. * @param {Array} [options.TFEvents] - 专题要素事件临时存储。
  96902. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权描述信息。
  96903. * @usage
  96904. */
  96905. var RankSymbolThemeLayer = GraphThemeLayer.extend({
  96906. /**
  96907. * @member {Object} RankSymbolThemeLayer.prototype.symbolSetting
  96908. * @description 符号 Circle 配置对象。
  96909. * @property {Array} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  96910. * @property {number} [maxR] - 圆形的最大半径。
  96911. * @property {number} [minR] - 圆形的最小半径。
  96912. * @property {string} [fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
  96913. * @property {Object} [circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
  96914. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  96915. * @property {Object} [circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
  96916. * @property {boolean} [circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  96917. * @property {boolean} [circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  96918. */
  96919. initialize: function initialize(name, symbolType, options) {
  96920. // eslint-disable-line no-unused-vars
  96921. GraphThemeLayer.prototype.initialize.apply(this, arguments);
  96922. this.symbolType = symbolType;
  96923. this.symbolSetting = {};
  96924. },
  96925. /**
  96926. * @function RankSymbolThemeLayer.prototype.setSymbolType
  96927. * @description 设置符号类型,此函数可动态改变图表类型。在调用此函数前请通过 symbolSetting 为新类型的图表做相关配置。
  96928. * @param {ChartType} symbolType - 目前支持:'Circle'。
  96929. *
  96930. */
  96931. //todo 这里怎么又是supermap的类型
  96932. setSymbolType: function setSymbolType(symbolType) {
  96933. this.symbolType = symbolType;
  96934. this.redraw();
  96935. },
  96936. /**
  96937. * @private
  96938. * @function RankSymbolThemeLayer.prototype.createThematicFeature
  96939. * @description 创建专题要素(图形)。
  96940. * @param {FeatureVector} feature - 要创建的专题图形要素。
  96941. * @returns {FeatureTheme} 专题图形。
  96942. */
  96943. createThematicFeature: function createThematicFeature(feature) {
  96944. var me = this;
  96945. var thematicFeature;
  96946. // 检查图形创建条件并创建图形
  96947. if (Theme_Theme[me.symbolType] && me.themeField && me.symbolSetting) {
  96948. thematicFeature = new Theme_Theme[me.symbolType](feature, me, [me.themeField], me.symbolSetting);
  96949. }
  96950. // thematicFeature 是否创建成功
  96951. if (!thematicFeature) {
  96952. return false;
  96953. }
  96954. // 对专题要素执行图形装载
  96955. thematicFeature.assembleShapes();
  96956. return thematicFeature;
  96957. }
  96958. });
  96959. var rankSymbolThemeLayer = function rankSymbolThemeLayer(name, symbolType, options) {
  96960. return new RankSymbolThemeLayer(name, symbolType, options);
  96961. };
  96962. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/SVGRenderer.js
  96963. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  96964. * This program are made available under the terms of the Apache License, Version 2.0
  96965. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  96966. /**
  96967. * @class SVGRenderer
  96968. * @classdesc 矢量图层缩放渲染器类。
  96969. * @category Visualization VectorTile
  96970. * @private
  96971. * @extends {L.SVG}
  96972. * @param {Object} tileCoord - 切片坐标系。
  96973. * @param {number} tileSize - 切片大小。
  96974. * @param {Object} options - 渲染器参数。
  96975. */
  96976. var SVGRenderer = external_L_default().SVG.extend({
  96977. initialize: function initialize(tileCoord, tileSize, options) {
  96978. external_L_default().SVG.prototype.initialize.call(this, options);
  96979. this._tileCoord = tileCoord;
  96980. this._size = tileSize;
  96981. this._initContainer();
  96982. this._container.setAttribute('width', this._size.x);
  96983. this._container.setAttribute('height', this._size.y);
  96984. this._container.setAttribute('viewBox', [0, 0, this._size.x, this._size.y].join(' '));
  96985. this._layers = {};
  96986. },
  96987. /**
  96988. * @function SVGRenderer.prototype.getCoord
  96989. * @description 获取坐标。
  96990. */
  96991. getCoord: function getCoord() {
  96992. return this._tileCoord;
  96993. },
  96994. /**
  96995. * @function SVGRenderer.prototype.getContainer
  96996. * @description 获取容器。
  96997. */
  96998. getContainer: function getContainer() {
  96999. return this._container;
  97000. },
  97001. onAdd: (external_L_default()).Util.falseFn,
  97002. /**
  97003. * @function SVGRenderer.prototype.addTo
  97004. * @description 添加到地图。
  97005. * @param {L.Map} map - Leaflet Map 对象。
  97006. */
  97007. addTo: function addTo(map) {
  97008. this._map = map;
  97009. if (this.options.interactive) {
  97010. for (var i in this._layers) {
  97011. var layer = this._layers[i];
  97012. layer._path.style.pointerEvents = 'auto';
  97013. this._map._targets[external_L_default().stamp(layer._path)] = layer;
  97014. }
  97015. }
  97016. },
  97017. /**
  97018. * @function SVGRenderer.prototype.removeFrom
  97019. * @description 从地图移除。
  97020. * @param {L.Map} map - Leaflet Map 对象。
  97021. */
  97022. removeFrom: function removeFrom(map) {
  97023. var _map = map || this._map;
  97024. if (this.options.interactive) {
  97025. for (var i in this._layers) {
  97026. var layer = this._layers[i];
  97027. delete _map._targets[external_L_default().stamp(layer._path)];
  97028. }
  97029. }
  97030. delete this._map;
  97031. },
  97032. _addPath: function _addPath(layer) {
  97033. if (!this._rootGroup) {
  97034. this._initContainer();
  97035. }
  97036. if (!this._rootGroup) {
  97037. this._rootGroup = this._container;
  97038. }
  97039. this._rootGroup.appendChild(layer._path);
  97040. this._layers[external_L_default().stamp(layer)] = layer;
  97041. },
  97042. _updateIcon: function _updateIcon(layer) {
  97043. var path = layer._path = external_L_default().SVG.create('image'),
  97044. options = layer.options,
  97045. iconUrl = options.iconUrl;
  97046. if (options.iconSize) {
  97047. var size = external_L_default().point(options.iconSize),
  97048. anchor = size && size.divideBy(2, true),
  97049. p = layer._point.subtract(anchor);
  97050. path.setAttribute('x', p.x);
  97051. path.setAttribute('y', p.y);
  97052. path.setAttribute('width', size.x + 'px');
  97053. path.setAttribute('height', size.y + 'px');
  97054. } else {
  97055. var img = new Image();
  97056. img.src = iconUrl;
  97057. external_L_default().DomEvent.on(img, 'load', function () {
  97058. var size = external_L_default().point([img.width, img.height]),
  97059. anchor = size && size.divideBy(2, true),
  97060. p = layer._point.subtract(anchor);
  97061. path.setAttribute('x', p.x);
  97062. path.setAttribute('y', p.y);
  97063. path.setAttribute('width', size.x + 'px');
  97064. path.setAttribute('height', size.y + 'px');
  97065. });
  97066. }
  97067. path.setAttribute('href', iconUrl);
  97068. }
  97069. });
  97070. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/CanvasRenderer.js
  97071. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97072. * This program are made available under the terms of the Apache License, Version 2.0
  97073. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97074. /**
  97075. * @class CanvasRenderer
  97076. * @private
  97077. * @classdesc 画布渲染器。
  97078. * @category Visualization VectorTile
  97079. * @extends {L.Canvas}
  97080. * @param {Object} tileCoord - 切片坐标系。
  97081. * @param {number} tileSize - 切片大小。
  97082. * @param {Object} options - 渲染器参数。
  97083. */
  97084. var CanvasRenderer = external_L_default().Canvas.extend({
  97085. initialize: function initialize(tileCoord, tileSize, options) {
  97086. external_L_default().Canvas.prototype.initialize.call(this, options);
  97087. this._tileCoord = tileCoord;
  97088. this._size = tileSize;
  97089. this._initContainer();
  97090. this._container.setAttribute('width', this._size.x);
  97091. this._container.setAttribute('height', this._size.y);
  97092. this._layers = {};
  97093. this._drawnLayers = {};
  97094. this._drawing = true;
  97095. if (options.interactive) {
  97096. this._container.style.pointerEvents = 'auto';
  97097. }
  97098. },
  97099. /**
  97100. * @function CanvasRenderer.prototype.getCoord
  97101. * @description 获取坐标。
  97102. */
  97103. getCoord: function getCoord() {
  97104. return this._tileCoord;
  97105. },
  97106. /**
  97107. * @function CanvasRenderer.prototype.getContainer
  97108. * @description 获取容器。
  97109. */
  97110. getContainer: function getContainer() {
  97111. return this._container;
  97112. },
  97113. /**
  97114. * @function CanvasRenderer.prototype.getOffset
  97115. * @description 停止渲染。
  97116. */
  97117. getOffset: function getOffset() {
  97118. return this._tileCoord.scaleBy(this._size).subtract(this._map.getPixelOrigin());
  97119. },
  97120. onAdd: (external_L_default()).Util.falseFn,
  97121. /**
  97122. * @function CanvasRenderer.prototype.addTo
  97123. * @description 添加到地图。
  97124. * @param {L.Map} map - Leaflet Map 对象。
  97125. */
  97126. addTo: function addTo(map) {
  97127. this._map = map;
  97128. },
  97129. /**
  97130. * @function CanvasRenderer.prototype.removeFrom
  97131. * @description 从地图移除。
  97132. * @param {L.Map} map - Leaflet Map 对象。
  97133. */
  97134. removeFrom: function removeFrom(map) {
  97135. // eslint-disable-line no-unused-vars
  97136. delete this._map;
  97137. },
  97138. _updateDashArray: function _updateDashArray(layer) {
  97139. var array = layer.options.dashArray;
  97140. if (array && typeof array === "string") {
  97141. var parts = array.split(','),
  97142. dashArray = [],
  97143. i;
  97144. for (i = 0; i < parts.length; i++) {
  97145. dashArray.push(Number(parts[i]));
  97146. }
  97147. layer.options._dashArray = dashArray;
  97148. } else {
  97149. layer.options._dashArray = array;
  97150. }
  97151. },
  97152. _onClick: function _onClick(e) {
  97153. var point = this._map.mouseEventToLayerPoint(e).subtract(this.getOffset()),
  97154. layer,
  97155. clickedLayer;
  97156. for (var id in this._layers) {
  97157. layer = this._layers[id];
  97158. if (layer.options.interactive && layer._containsPoint(point) && !this._map._draggableMoved(layer)) {
  97159. clickedLayer = layer;
  97160. }
  97161. }
  97162. if (clickedLayer) {
  97163. external_L_default().DomEvent.stop(e);
  97164. this._fireEvent([clickedLayer], e);
  97165. }
  97166. },
  97167. _onMouseMove: function _onMouseMove(e) {
  97168. if (!this._map || this._map.dragging.moving() || this._map._animatingZoom) {
  97169. return;
  97170. }
  97171. var point = this._map.mouseEventToLayerPoint(e).subtract(this.getOffset());
  97172. this._handleMouseHover(e, point);
  97173. },
  97174. _updateIcon: function _updateIcon(layer) {
  97175. if (!this._drawing) {
  97176. return;
  97177. }
  97178. var options = layer.options,
  97179. ctx = this._ctx,
  97180. img = layer._getImage();
  97181. if (options.iconSize && img.complete) {
  97182. var size = external_L_default().point(options.iconSize),
  97183. anchor = size && size.divideBy(2, true),
  97184. p = layer._point.subtract(anchor);
  97185. ctx.drawImage(img, p.x, p.y, size.x, size.y);
  97186. } else {
  97187. external_L_default().DomEvent.on(img, 'load', function () {
  97188. var size = external_L_default().point([img.width, img.height]),
  97189. anchor = size && size.divideBy(2, true),
  97190. p = layer._point.subtract(anchor);
  97191. ctx.drawImage(img, p.x, p.y, size.x, size.y);
  97192. });
  97193. }
  97194. this._drawnLayers[layer._leaflet_id] = layer;
  97195. }
  97196. });
  97197. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorFeatureType.js
  97198. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97199. * This program are made available under the terms of the Apache License, Version 2.0
  97200. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97201. /**
  97202. * @constant VectorFeatureType
  97203. * @description 矢量图层要素类型,和 SuperMap.CartoStyleMap 中的类型相对应。
  97204. * @category Visualization VectorTile
  97205. * @private
  97206. */
  97207. var VectorFeatureType = {
  97208. LABEL: "LABEL",
  97209. //label实际处理成TEXT
  97210. TEXT: "TEXT",
  97211. POINT: "POINT",
  97212. LINE: "LINE",
  97213. REGION: "REGION"
  97214. };
  97215. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/Symbolizer.js
  97216. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97217. * This program are made available under the terms of the Apache License, Version 2.0
  97218. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97219. /**
  97220. * @class Symbolizer
  97221. * @description 符号类。
  97222. * @category Visualization VectorTile
  97223. * @private
  97224. * @extends {L.Class}
  97225. * @param {Object} feature — 要素。
  97226. */
  97227. var Symbolizer = external_L_default().Class.extend({
  97228. initialize: function initialize(feature) {
  97229. this.properties = feature.properties;
  97230. this.type = feature.type;
  97231. this.layerName = feature.layerName;
  97232. },
  97233. /**
  97234. * @function Symbolizer.prototype.render
  97235. * @description 绘制线符号。
  97236. * @param {Object} renderer - 渲染器。
  97237. * @param {string} style - 符号样式。
  97238. */
  97239. render: function render(renderer, style) {
  97240. this._renderer = renderer;
  97241. this._container = renderer._container;
  97242. this.options = style;
  97243. renderer._initPath(this);
  97244. renderer._updateStyle(this);
  97245. var elem = this.getElement();
  97246. if (elem && this.layerName) {
  97247. external_L_default().DomUtil.addClass(elem, this.layerName);
  97248. }
  97249. },
  97250. /**
  97251. * @function Symbolizer.prototype.updateStyle
  97252. * @description 更新符号样式。
  97253. * @param {Object} renderer - 渲染器。
  97254. * @param {string} style - 符号样式。
  97255. */
  97256. updateStyle: function updateStyle(renderer, style) {
  97257. this.options = style;
  97258. renderer._updateStyle(this);
  97259. },
  97260. /**
  97261. * @function Symbolizer.prototype.getElement
  97262. * @description 获取文本信息。
  97263. */
  97264. getElement: function getElement() {
  97265. return this._path || this._renderer._container;
  97266. },
  97267. _getPixelBounds: function _getPixelBounds() {
  97268. var parts = this._parts;
  97269. var bounds = external_L_default().bounds([]);
  97270. for (var i = 0; i < parts.length; i++) {
  97271. var part = parts[i];
  97272. for (var j = 0; j < part.length; j++) {
  97273. bounds.extend(part[j]);
  97274. }
  97275. }
  97276. var w = this._clickTolerance(),
  97277. p = new (external_L_default()).Point(w, w);
  97278. bounds.min._subtract(p);
  97279. bounds.max._add(p);
  97280. return bounds;
  97281. },
  97282. _clickTolerance: (external_L_default()).Path.prototype._clickTolerance
  97283. });
  97284. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/TextSymbolizer.js
  97285. function TextSymbolizer_typeof(obj) { "@babel/helpers - typeof"; return TextSymbolizer_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; }, TextSymbolizer_typeof(obj); }
  97286. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97287. * This program are made available under the terms of the Apache License, Version 2.0
  97288. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97289. /**
  97290. * @class TextSymbolizer
  97291. * @classdesc 文本符号类。
  97292. * @category Visualization VectorTile
  97293. * @private
  97294. * @extends {L.Path}
  97295. * @param {Object} feature - 要素。
  97296. * @param {number} pxPerExtent - 文本符号大小。
  97297. */
  97298. var TextSymbolizer = external_L_default().Path.extend({
  97299. /**
  97300. * @member TextSymbolizer.prototype.includes
  97301. * @description 包含的符号。
  97302. */
  97303. includes: Symbolizer.prototype,
  97304. options: {
  97305. color: 'white',
  97306. fillColor: 'black',
  97307. fill: true,
  97308. fillOpacity: 1,
  97309. opacity: 0.6,
  97310. weight: 1,
  97311. rotation: 0.0,
  97312. stroke: true,
  97313. fontFamily: "Arial Unicode MS Regular",
  97314. fontSize: 14,
  97315. fontWeight: 'normal',
  97316. textAlign: 'center',
  97317. offsetX: 1,
  97318. offsetY: 1
  97319. },
  97320. initialize: function initialize(feature, pxPerExtent) {
  97321. Symbolizer.prototype.initialize.call(this, feature);
  97322. this._makeFeatureParts(feature, pxPerExtent);
  97323. this.options.offsetX = pxPerExtent || 1;
  97324. this.options.offsetY = pxPerExtent || 1;
  97325. },
  97326. /**
  97327. * @function TextSymbolizer.prototype.render
  97328. * @description 绘制点符号。
  97329. * @param {Object} renderer - 渲染器。
  97330. * @param {string} style - 符号样式。
  97331. */
  97332. render: function render(renderer, style) {
  97333. //原本类型就是text的情况
  97334. if (this.properties.texts) {
  97335. this._text = this.properties.texts[0];
  97336. }
  97337. //类型是label的情况
  97338. if (!this._text) {
  97339. var attributes = this.properties.attributes;
  97340. this._text = attributes && this.properties.textField ? attributes[this.properties.textField] || "" : "";
  97341. }
  97342. var options = this.options;
  97343. this._pxBounds = external_L_default().bounds(this._point, this._point);
  97344. Symbolizer.prototype.render.apply(this, [renderer, style]);
  97345. this.options = external_L_default().Util.extend(options, style);
  97346. this._updatePath();
  97347. },
  97348. _makeFeatureParts: function _makeFeatureParts(feat, pxPerExtent) {
  97349. pxPerExtent = pxPerExtent || {
  97350. x: 1,
  97351. y: 1
  97352. };
  97353. var coord = feat.geometry[0];
  97354. if (TextSymbolizer_typeof(coord[0]) === 'object' && 'x' in coord[0]) {
  97355. this._point = external_L_default().point(coord[0]).scaleBy(pxPerExtent);
  97356. this._empty = (external_L_default()).Util.falseFn;
  97357. } else {
  97358. this._point = external_L_default().point(coord).scaleBy(pxPerExtent);
  97359. this._empty = (external_L_default()).Util.falseFn;
  97360. }
  97361. },
  97362. /**
  97363. * @function TextSymbolizer.prototype.makeInteractive
  97364. * @description 设置交互。
  97365. */
  97366. makeInteractive: function makeInteractive() {
  97367. this._updateBounds();
  97368. },
  97369. /**
  97370. * @function TextSymbolizer.prototype.updateStyle
  97371. * @description 更新符号样式。
  97372. * @param {Object} renderer - 渲染器。
  97373. * @param {string} style - 符号样式。
  97374. */
  97375. updateStyle: function updateStyle(renderer, style) {
  97376. this._updateBounds();
  97377. return Symbolizer.prototype.updateStyle.call(this, renderer, style);
  97378. },
  97379. _updateBounds: function _updateBounds() {
  97380. var w = this._renderer._getTextWidth(this);
  97381. var p = [w / 2, w / 2];
  97382. this._pxBounds = external_L_default().bounds(this._point.subtract(p), this._point.add(p));
  97383. },
  97384. _updatePath: function _updatePath() {
  97385. this._renderer._updateText(this);
  97386. },
  97387. _containsPoint: function _containsPoint(point) {
  97388. // eslint-disable-line no-unused-vars
  97389. return false;
  97390. }
  97391. });
  97392. CanvasRenderer.include({
  97393. _getTextWidth: function _getTextWidth(layer) {
  97394. return this._ctx.measureText(layer._text).width;
  97395. },
  97396. _updateText: function _updateText(layer) {
  97397. if (!this._drawing || layer._empty()) {
  97398. return;
  97399. }
  97400. var container = this.getContainer();
  97401. var size = this._map.getSize();
  97402. container.width = size.x;
  97403. container.height = size.y;
  97404. container.style.width = size.x + 'px';
  97405. container.style.height = size.y + 'px';
  97406. var ctx = this._ctx,
  97407. options = layer.options,
  97408. offsetX = options.offsetX || 1,
  97409. offsetY = options.offsetY || 1,
  97410. p = layer._point.subtract(external_L_default().point(offsetX, offsetY));
  97411. if (!options.fill) {
  97412. return;
  97413. }
  97414. this._drawnLayers[layer._leaflet_id] = layer;
  97415. ctx.fillRect(0, 0, size.x, size.y);
  97416. ctx.font = [options.fontWeight ? options.fontWeight : "normal", options.fontSize ? options.fontSize : "14px", options.fontFamily ? options.fontFamily : "Arial Unicode MS Regular,Microsoft Yahei"].join(" ");
  97417. ctx.textAlign = options.textAlign;
  97418. ctx.lineWidth = options.weight;
  97419. ctx.fillStyle = options.fillColor;
  97420. ctx.fillText(layer._text, p.x, p.y);
  97421. ctx.strokeStyle = options.color;
  97422. ctx.strokeText(layer._text, p.x, p.y);
  97423. ctx.rotate(options.rotation);
  97424. }
  97425. });
  97426. SVGRenderer.include({
  97427. _getTextWidth: function _getTextWidth(layer) {
  97428. return layer._path.getComputedTextLength() || 0;
  97429. },
  97430. _initPath: function _initPath(layer) {
  97431. var path;
  97432. if (TextSymbolizer && layer instanceof TextSymbolizer) {
  97433. path = layer._path = external_L_default().SVG.create("text");
  97434. path.textContent = layer._text;
  97435. } else {
  97436. path = layer._path = external_L_default().SVG.create("path");
  97437. }
  97438. if (layer.options.className) {
  97439. external_L_default().DomUtil.addClass(path, layer.options.className);
  97440. }
  97441. if (layer.options.interactive) {
  97442. external_L_default().DomUtil.addClass(path, 'leaflet-interactive');
  97443. }
  97444. this._updateStyle(layer);
  97445. this._layers[external_L_default().stamp(layer)] = layer;
  97446. },
  97447. _updateText: function _updateText(layer) {
  97448. var path = layer._path,
  97449. options = layer.options,
  97450. offsetX = options.offsetX || 1,
  97451. offsetY = options.offsetY || 1,
  97452. p = layer._point.subtract(external_L_default().point(offsetX, offsetY));
  97453. path.setAttribute('x', p.x);
  97454. path.setAttribute('y', p.y);
  97455. options.rotation = options.rotation || 0;
  97456. path.setAttribute('transform', 'rotate(' + options.rotation / Math.PI * 180 + ' ' + p.x + ' ' + p.y + ')');
  97457. path.setAttribute('text-anchor', options.textAlign === 'center' ? 'middle' : options.textAlign);
  97458. path.style.fontSize = options.fontSize;
  97459. path.style.fontFamily = options.fontFamily;
  97460. path.style.fontWeight = options.fontWeight || "normal";
  97461. path.style.glyphOrientationVertical = options.rotation || '';
  97462. if (options.stroke) {
  97463. path.setAttribute('stroke', options.color);
  97464. path.setAttribute('stroke-linecap', 'round');
  97465. path.setAttribute('stroke-linejoin', 'round');
  97466. path.setAttribute('stroke-opacity', options.opacity);
  97467. path.setAttribute('stroke-width', options.weight > 1 ? options.weight / 10 : options.weight);
  97468. } else {
  97469. path.setAttribute('stroke', 'none');
  97470. }
  97471. if (options.fill) {
  97472. path.setAttribute('fill', options.fillColor || options.color);
  97473. path.setAttribute('fill-opacity', options.fillOpacity);
  97474. } else {
  97475. path.setAttribute('fill', 'none');
  97476. }
  97477. }
  97478. });
  97479. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/PointSymbolizer.js
  97480. function PointSymbolizer_typeof(obj) { "@babel/helpers - typeof"; return PointSymbolizer_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; }, PointSymbolizer_typeof(obj); }
  97481. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97482. * This program are made available under the terms of the Apache License, Version 2.0
  97483. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97484. /**
  97485. * @class PointSymbolizer
  97486. * @classdesc 点符号类。
  97487. * @category Visualization VectorTile
  97488. * @private
  97489. * @extends {L.CircleMarker}
  97490. * @param {Object} feature - 点要素。
  97491. * @param {number} pxPerExtent - 点符号大小。
  97492. */
  97493. var PointSymbolizer = external_L_default().CircleMarker.extend({
  97494. /**
  97495. * @member PointSymbolizer.prototype.includes
  97496. * @description 包含的符号。
  97497. */
  97498. includes: Symbolizer.prototype,
  97499. statics: {
  97500. iconCache: {}
  97501. },
  97502. initialize: function initialize(feature, pxPerExtent) {
  97503. Symbolizer.prototype.initialize.call(this, feature);
  97504. this._makeFeatureParts(feature, pxPerExtent);
  97505. },
  97506. getLatLng: undefined,
  97507. /**
  97508. * @function PointSymbolizer.prototype.render
  97509. * @description 绘制点符号。
  97510. * @param {Object} renderer - 渲染器。
  97511. * @param {string} style - 符号样式。
  97512. */
  97513. render: function render(renderer, style) {
  97514. Symbolizer.prototype.render.call(this, renderer, style);
  97515. this._radius = style.radius || (external_L_default()).CircleMarker.prototype.options.radius;
  97516. this._updatePath();
  97517. },
  97518. _makeFeatureParts: function _makeFeatureParts(feat, pxPerExtent) {
  97519. pxPerExtent = pxPerExtent || {
  97520. x: 1,
  97521. y: 1
  97522. };
  97523. var coord = feat.geometry[0];
  97524. if (PointSymbolizer_typeof(coord[0]) === 'object' && 'x' in coord[0]) {
  97525. this._point = external_L_default().point(coord[0]).scaleBy(pxPerExtent);
  97526. this._empty = (external_L_default()).Util.falseFn;
  97527. } else {
  97528. this._point = external_L_default().point(coord).scaleBy(pxPerExtent);
  97529. this._empty = (external_L_default()).Util.falseFn;
  97530. }
  97531. },
  97532. /**
  97533. * @function PointSymbolizer.prototype.makeInteractive
  97534. * @description 设置交互。
  97535. */
  97536. makeInteractive: function makeInteractive() {
  97537. this._updateBounds();
  97538. },
  97539. /**
  97540. * @function PointSymbolizer.prototype.updateStyle
  97541. * @description 更新符号样式。
  97542. * @param {Object} renderer - 渲染器。
  97543. * @param {string} style - 符号样式。
  97544. */
  97545. updateStyle: function updateStyle(renderer, style) {
  97546. this._radius = style.radius || this._radius;
  97547. this._updateBounds();
  97548. return Symbolizer.prototype.updateStyle.call(this, renderer, style);
  97549. },
  97550. _updateBounds: function _updateBounds() {
  97551. var icon = this.options.iconUrl;
  97552. if (icon && this.options.iconSize) {
  97553. var size = external_L_default().point(this.options.iconSize),
  97554. anchor = size && size.divideBy(2, true),
  97555. p = this._point.subtract(anchor);
  97556. this._pxBounds = new (external_L_default()).Bounds(p, p.add(size));
  97557. } else {
  97558. external_L_default().CircleMarker.prototype._updateBounds.call(this);
  97559. }
  97560. },
  97561. _updatePath: function _updatePath() {
  97562. if (this.options.iconUrl) {
  97563. this._renderer._updateIcon(this);
  97564. } else {
  97565. external_L_default().CircleMarker.prototype._updatePath.call(this);
  97566. }
  97567. },
  97568. _getImage: function _getImage() {
  97569. if (!this.options.iconUrl) {
  97570. return null;
  97571. }
  97572. var url = this.options.iconUrl,
  97573. img = PointSymbolizer.iconCache[url];
  97574. if (!img) {
  97575. var iconSize = this.options.iconSize || [50, 50];
  97576. img = PointSymbolizer.iconCache[url] = this._createIcon(url, iconSize);
  97577. }
  97578. return img;
  97579. },
  97580. _createIcon: function _createIcon(url, iconSize) {
  97581. var src = url;
  97582. if (!src) {
  97583. throw new Error('iconUrl not set in Icon options (see the docs).');
  97584. }
  97585. var img = document.createElement('img'),
  97586. name = "icon";
  97587. img.src = src;
  97588. img.className = 'leaflet-marker-' + name + ' ' + (this.layerName || '');
  97589. // var options = this.options;
  97590. var sizeOption = iconSize;
  97591. if (typeof sizeOption === 'number') {
  97592. sizeOption = [sizeOption, sizeOption];
  97593. }
  97594. if (sizeOption) {
  97595. var size = external_L_default().point(sizeOption),
  97596. anchor = external_L_default().point(size && size.divideBy(2, true));
  97597. if (size) {
  97598. img.style.width = size.x + 'px';
  97599. img.style.height = size.y + 'px';
  97600. }
  97601. if (anchor) {
  97602. img.style.marginLeft = -anchor.x + 'px';
  97603. img.style.marginTop = -anchor.y + 'px';
  97604. }
  97605. }
  97606. img.onload = function () {
  97607. if (!sizeOption) {
  97608. img.style.width = this.width + 'px';
  97609. img.style.height = this.height + 'px';
  97610. }
  97611. };
  97612. return img;
  97613. },
  97614. _containsPoint: function _containsPoint(p) {
  97615. var icon = this.options.iconUrl;
  97616. if (icon) {
  97617. return this._pxBounds.contains(p);
  97618. } else {
  97619. return external_L_default().CircleMarker.prototype._containsPoint.call(this, p);
  97620. }
  97621. }
  97622. });
  97623. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/SymbolizerPolyBase.js
  97624. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97625. * This program are made available under the terms of the Apache License, Version 2.0
  97626. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97627. /**
  97628. * @class PolyBase
  97629. * @classdesc 多边形基类。
  97630. * @category Visualization VectorTile
  97631. * @private
  97632. */
  97633. //@type {{_makeFeatureParts: PolyBase._makeFeatureParts, makeInteractive: PolyBase.makeInteractive}}
  97634. var PolyBase = {
  97635. _makeFeatureParts: function _makeFeatureParts(feat, pxPerExtent) {
  97636. pxPerExtent = pxPerExtent || {
  97637. x: 1,
  97638. y: 1
  97639. };
  97640. var rings = feat.geometry;
  97641. var coord;
  97642. this._parts = [];
  97643. for (var i = 0; i < rings.length; i++) {
  97644. var ring = rings[i];
  97645. var part = [];
  97646. for (var j = 0; j < ring.length; j++) {
  97647. coord = ring[j];
  97648. part.push(external_L_default().point(coord).scaleBy(pxPerExtent));
  97649. }
  97650. this._parts.push(part);
  97651. }
  97652. },
  97653. /**
  97654. * @function PolyBase.prototype.makeInteractive
  97655. * @description 设置交互。
  97656. */
  97657. makeInteractive: function makeInteractive() {
  97658. this._pxBounds = this._getPixelBounds();
  97659. }
  97660. };
  97661. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/LineSymbolizer.js
  97662. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97663. * This program are made available under the terms of the Apache License, Version 2.0
  97664. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97665. /**
  97666. * @class LineSymbolizer
  97667. * @classdesc 线符号类。
  97668. * @category Visualization VectorTile
  97669. * @private
  97670. * @extends {L.Polyline}
  97671. * @param {Object} feature - 线要素。
  97672. * @param {number} pxPerExtent - 线长。
  97673. */
  97674. var LineSymbolizer = external_L_default().Polyline.extend({
  97675. /**
  97676. * @member LineSymbolizer.prototype.includes
  97677. * @description 包含符号。
  97678. */
  97679. includes: [Symbolizer.prototype, PolyBase],
  97680. initialize: function initialize(feature, pxPerExtent) {
  97681. Symbolizer.prototype.initialize.call(this, feature);
  97682. this._makeFeatureParts(feature, pxPerExtent);
  97683. },
  97684. /**
  97685. * @function LineSymbolizer.prototype.render
  97686. * @description 绘制线符号。
  97687. * @param {Object} renderer - 渲染器。
  97688. * @param {string} style - 符号样式。
  97689. */
  97690. render: function render(renderer, style) {
  97691. style.fill = false;
  97692. Symbolizer.prototype.render.call(this, renderer, style);
  97693. this._updatePath();
  97694. },
  97695. /**
  97696. * @function LineSymbolizer.prototype.updateStyle
  97697. * @description 更新符号样式。
  97698. * @param {Object} renderer - 渲染器。
  97699. * @param {string} style - 符号样式。
  97700. */
  97701. updateStyle: function updateStyle(renderer, style) {
  97702. style.fill = false;
  97703. Symbolizer.prototype.updateStyle.call(this, renderer, style);
  97704. }
  97705. });
  97706. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/RegionSymbolizer.js
  97707. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97708. * This program are made available under the terms of the Apache License, Version 2.0
  97709. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97710. /**
  97711. * @class RegionSymbolizer
  97712. * @classdesc 面符号类。
  97713. * @category Visualization VectorTile
  97714. * @private
  97715. * @extends {L.Polygon}
  97716. * @param {Object} feature - 面要素。
  97717. * @param {number} pxPerExtent - 面积像素大小。
  97718. */
  97719. var RegionSymbolizer = external_L_default().Polygon.extend({
  97720. /**
  97721. * @member RegionSymbolizer.prototype.includes
  97722. * @description 包含的符号。
  97723. */
  97724. includes: [Symbolizer.prototype, PolyBase],
  97725. initialize: function initialize(feature, pxPerExtent) {
  97726. Symbolizer.prototype.initialize.call(this, feature);
  97727. this._makeFeatureParts(feature, pxPerExtent);
  97728. },
  97729. /**
  97730. * @function RegionSymbolizer.prototype.render
  97731. * @description 绘制面符号。
  97732. * @param {Object} renderer - 渲染器。
  97733. * @param {string} style - 符号样式。
  97734. */
  97735. render: function render(renderer, style) {
  97736. Symbolizer.prototype.render.call(this, renderer, style);
  97737. this._updatePath();
  97738. }
  97739. });
  97740. // EXTERNAL MODULE: ./node_modules/pbf/index.js
  97741. var node_modules_pbf = __webpack_require__(1943);
  97742. var pbf_default = /*#__PURE__*/__webpack_require__.n(node_modules_pbf);
  97743. // EXTERNAL MODULE: ./node_modules/@mapbox/vector-tile/index.js
  97744. var vector_tile = __webpack_require__(4721);
  97745. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorTilePBF.js
  97746. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97747. * This program are made available under the terms of the Apache License, Version 2.0
  97748. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97749. /**
  97750. * @class VectorTilePBF
  97751. * @classdesc 矢量瓦片 PBF(MVT) 表述出图。
  97752. * @category Visualization VectorTile
  97753. * @private
  97754. * @extends {L.Class}
  97755. * @param {string} url - 服务地址。
  97756. */
  97757. var VectorTilePBF = external_L_default().Class.extend({
  97758. initialize: function initialize(url) {
  97759. this.url = url;
  97760. },
  97761. /**
  97762. * @function VectorTilePBF.prototype.getTile
  97763. * @description 获取瓦片 PBF(MVT)。
  97764. * @returns {Promise} 返回包含矢量瓦片信息的 Promise 对象。
  97765. */
  97766. getTile: function getTile() {
  97767. var me = this;
  97768. return FetchRequest.get(me.url, null, {
  97769. timeout: 10000
  97770. }).then(function (response) {
  97771. if (!response.ok) {
  97772. return {
  97773. layers: []
  97774. };
  97775. }
  97776. return response.blob().then(function (blob) {
  97777. var reader = new FileReader();
  97778. return new Promise(function (resolve) {
  97779. reader.addEventListener("loadend", function () {
  97780. var pbf = new (pbf_default())(reader.result);
  97781. return resolve(new vector_tile.VectorTile(pbf));
  97782. });
  97783. reader.readAsArrayBuffer(blob);
  97784. });
  97785. });
  97786. }).then(function (json) {
  97787. return me._processVectorTileSpec(json);
  97788. });
  97789. },
  97790. _processVectorTileSpec: function _processVectorTileSpec(vectorTile) {
  97791. var layers = [];
  97792. for (var layerName in vectorTile.layers) {
  97793. var feats = [];
  97794. for (var i = 0; i < vectorTile.layers[layerName].length; i++) {
  97795. var feat = vectorTile.layers[layerName].feature(i);
  97796. feat.geometry = feat.loadGeometry();
  97797. feat.layerName = layerName;
  97798. feat.properties = {
  97799. attributes: external_L_default().Util.extend({}, feat.properties),
  97800. id: feat.id
  97801. };
  97802. switch (feat.type) {
  97803. case 1:
  97804. feat.type = VectorFeatureType.POINT;
  97805. break;
  97806. case 2:
  97807. feat.type = VectorFeatureType.LINE;
  97808. break;
  97809. case 3:
  97810. feat.type = VectorFeatureType.REGION;
  97811. break;
  97812. default:
  97813. break;
  97814. }
  97815. feats.push(feat);
  97816. }
  97817. var layer = {};
  97818. layer.features = feats;
  97819. layer.layerName = layerName;
  97820. layer.extent = vectorTile.layers[layerName].extent;
  97821. layers.push(layer);
  97822. }
  97823. return layers;
  97824. }
  97825. });
  97826. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorTileJSON.js
  97827. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97828. * This program are made available under the terms of the Apache License, Version 2.0
  97829. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97830. /**
  97831. * @class VectorTileJSON
  97832. * @classdesc iServer 矢量瓦片 JSON 表述出图。
  97833. * @category Visualization VectorTile
  97834. * @private
  97835. * @extends {L.Class}
  97836. * @param {string} url - 服务地址。
  97837. */
  97838. var VectorTileJSON = external_L_default().Class.extend({
  97839. initialize: function initialize(url) {
  97840. this.url = url;
  97841. },
  97842. /**
  97843. * @function VectorTileJSON.prototype.getTile
  97844. * @description 获取瓦片。
  97845. * @returns {Promise} 返回包含矢量瓦片信息的 Promise 对象。
  97846. */
  97847. getTile: function getTile() {
  97848. var me = this;
  97849. return FetchRequest.get(me.url, null, {
  97850. timeout: 10000
  97851. }).then(function (response) {
  97852. return response.json();
  97853. }).then(function (json) {
  97854. return me._processRecordSets(json, me);
  97855. });
  97856. },
  97857. _processRecordSets: function _processRecordSets(records, scope) {
  97858. var recordsets = records.recordsets;
  97859. // 如果iServer支持了tileFeature geojson表述则不需要此步骤
  97860. recordsets = scope._convertToGeoJSON(recordsets);
  97861. if (!recordsets) {
  97862. return null;
  97863. }
  97864. //类似VT标准的数据格式,并为每个要素添加一个layerName字段
  97865. for (var i = 0; i < recordsets.length; i++) {
  97866. var recordset = recordsets[i];
  97867. for (var j = 0; j < recordset.features.length; j++) {
  97868. var feature = recordset.features[j];
  97869. feature = scope._convertToVectorLayerFeature(feature, scope);
  97870. feature.layerName = recordset.layerName;
  97871. recordset.features[j] = feature;
  97872. }
  97873. recordset.extent = 256;
  97874. delete recordset.fieldTypes;
  97875. delete recordset.fields;
  97876. }
  97877. return recordsets;
  97878. },
  97879. _convertToVectorLayerFeature: function _convertToVectorLayerFeature(feature, scope) {
  97880. if (!feature.geometry) {
  97881. return;
  97882. }
  97883. var newFeature = {};
  97884. var geom = feature.geometry,
  97885. type = geom.type,
  97886. coords = geom.coordinates,
  97887. tags = feature.properties,
  97888. id = tags.id,
  97889. i,
  97890. j,
  97891. rings,
  97892. projectedRing;
  97893. if (type === 'Point') {
  97894. newFeature = tags && tags.texts ? scope._createFeature(id, VectorFeatureType.TEXT, [coords], tags) : scope._createFeature(id, VectorFeatureType.POINT, [coords], tags);
  97895. } else if (type === 'MultiPoint') {
  97896. newFeature = scope._createFeature(id, VectorFeatureType.POINT, coords, tags);
  97897. } else if (type === 'LineString') {
  97898. newFeature = scope._createFeature(id, VectorFeatureType.LINE, [coords], tags);
  97899. } else if (type === 'MultiLineString' || type === 'Polygon') {
  97900. rings = [];
  97901. for (i = 0; i < coords.length; i++) {
  97902. projectedRing = coords[i];
  97903. if (type === 'Polygon') {
  97904. projectedRing.outer = i === 0;
  97905. }
  97906. rings.push(projectedRing);
  97907. }
  97908. var featureType = type === 'Polygon' ? VectorFeatureType.REGION : VectorFeatureType.LINE;
  97909. newFeature = scope._createFeature(id, featureType, rings, tags);
  97910. } else if (type === 'MultiPolygon') {
  97911. rings = [];
  97912. for (i = 0; i < coords.length; i++) {
  97913. for (j = 0; j < coords[i].length; j++) {
  97914. projectedRing = coords[i][j];
  97915. projectedRing.outer = j === 0;
  97916. rings.push(projectedRing);
  97917. }
  97918. }
  97919. newFeature = scope._createFeature(id, VectorFeatureType.REGION, rings, tags);
  97920. } else {
  97921. throw new Error('Illegal GeoJSON object');
  97922. }
  97923. return newFeature;
  97924. },
  97925. _convertToGeoJSON: function _convertToGeoJSON(recordsets) {
  97926. if (!recordsets) {
  97927. return;
  97928. }
  97929. for (var i = 0; i < recordsets.length; i++) {
  97930. var recordset = recordsets[i];
  97931. for (var j = 0; j < recordset.features.length; j++) {
  97932. var feature = recordset.features[j];
  97933. var points = [];
  97934. var startIndex = 0;
  97935. for (var k = 0; k < feature.geometry.parts.length; k++) {
  97936. var partPointsLength = feature.geometry.parts[k] * 2;
  97937. for (var l = 0, index = startIndex; l < partPointsLength; l += 2, index += 2) {
  97938. var x = feature.geometry.points[index];
  97939. var y = feature.geometry.points[index + 1];
  97940. points.push({
  97941. x: x,
  97942. y: y
  97943. });
  97944. }
  97945. startIndex += partPointsLength;
  97946. }
  97947. feature.geometry.points = points;
  97948. }
  97949. recordset.features = toGeoJSON(recordset.features).features;
  97950. }
  97951. return recordsets;
  97952. },
  97953. _createFeature: function _createFeature(id, type, geometry, properties) {
  97954. return {
  97955. id: id,
  97956. type: type,
  97957. geometry: geometry,
  97958. properties: properties
  97959. };
  97960. }
  97961. });
  97962. ;// CONCATENATED MODULE: ./src/leaflet/overlay/VectorTileFormat.js
  97963. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97964. * This program are made available under the terms of the Apache License, Version 2.0
  97965. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97966. /**
  97967. * @enum VectorTileFormat
  97968. * @category BaseTypes Constant
  97969. * @description 矢量瓦片格式。
  97970. * @type {string}
  97971. * @usage
  97972. * ```
  97973. * // 浏览器
  97974. * <script type="text/javascript" src="{cdn}"></script>
  97975. * <script>
  97976. * const result = {namespace}.VectorTileFormat.JSON;
  97977. *
  97978. * </script>
  97979. * // ES6 Import
  97980. * import { VectorTileFormat } from '{npm}';
  97981. *
  97982. * const result = VectorTileFormat.JSON;
  97983. * ```
  97984. */
  97985. var VectorTileFormat = {
  97986. /** JSON */
  97987. JSON: "JSON",
  97988. /** MVT */
  97989. MVT: "MVT",
  97990. /** PBF */
  97991. PBF: "PBF"
  97992. };
  97993. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorTile.js
  97994. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  97995. * This program are made available under the terms of the Apache License, Version 2.0
  97996. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  97997. /**
  97998. * @class VectorTile
  97999. * @classdesc 矢量瓦片图层基类。
  98000. * @category Visualization VectorTile
  98001. * @private
  98002. * @extends {L.Class}
  98003. * @param {Object} options - 参数。
  98004. * @param {string} [options.layer] - 图层名称。
  98005. * @param {(number|L.Point)} [options.tileSize=256] - 瓦片大小。
  98006. * @param {string} [options.format] - 返回值类型。
  98007. * @param {Object} [options.coords] - 坐标系统对象。
  98008. * @param {Object} [options.renderer] - 渲染器对象。
  98009. * @param {function} done - 回调函数。
  98010. */
  98011. var VectorTile = external_L_default().Class.extend({
  98012. initialize: function initialize(options, done) {
  98013. this.layer = options.layer;
  98014. this.tileSize = options.layer.getTileSize();
  98015. this.format = options.format;
  98016. this.coords = options.coords;
  98017. this.renderer = options.renderer;
  98018. this.done = done;
  98019. this.layer._textVectorTiles = {};
  98020. },
  98021. /**
  98022. * @function VectorTile.prototype.renderTile
  98023. * @description 渲染切片。
  98024. */
  98025. renderTile: function renderTile() {
  98026. var me = this,
  98027. layer = me.layer,
  98028. coords = me.coords;
  98029. var tileFeatureUrl = layer._getTileUrl(coords);
  98030. var format = [VectorTileFormat.MVT, VectorTileFormat.PBF];
  98031. var tileFeaturePromise;
  98032. if (format.indexOf(me.format.toUpperCase()) > -1) {
  98033. tileFeaturePromise = new VectorTilePBF(tileFeatureUrl);
  98034. } else {
  98035. tileFeaturePromise = new VectorTileJSON(tileFeatureUrl);
  98036. }
  98037. tileFeaturePromise.getTile().then(function (tileFeature) {
  98038. me.render(tileFeature, coords);
  98039. });
  98040. },
  98041. /**
  98042. * @function VectorTile.prototype.render
  98043. * @description 渲染切片要素。
  98044. * @param {Object} tileFeature - 需要渲染的切片要素。
  98045. * @param {Object} coords - 切片坐标参数对象。
  98046. */
  98047. render: function render(tileFeature, coords) {
  98048. if (!tileFeature) {
  98049. return;
  98050. }
  98051. var me = this,
  98052. renderer = me.renderer,
  98053. tileLayer = me.layer;
  98054. for (var k = 0; k < tileFeature.length; k++) {
  98055. var layer = tileFeature[k],
  98056. layerName = layer.layerName;
  98057. tileLayer._dataLayerNames[layerName] = true;
  98058. var pxPerExtent = me.tileSize.divideBy(layer.extent);
  98059. var layerStyleInfo = tileLayer.getLayerStyleInfo(layer.layerName);
  98060. for (var i = 0; i < layer.features.length; i++) {
  98061. var feat = layer.features[i];
  98062. if (!feat) {
  98063. continue;
  98064. }
  98065. //标签图层处理为文本
  98066. if (layerStyleInfo && layerStyleInfo.type === VectorFeatureType.LABEL && feat.type === VectorFeatureType.POINT && feat.properties.attributes) {
  98067. feat.type = VectorFeatureType.TEXT;
  98068. }
  98069. var styleOptions = me._getStyleOptions(coords, feat, layerName, me);
  98070. if (!styleOptions.length) {
  98071. continue;
  98072. }
  98073. var featureLayer = me._createFeatureLayer(feat, pxPerExtent);
  98074. if (!featureLayer) {
  98075. continue;
  98076. }
  98077. // 保存文本图层单独绘制,避免被压盖
  98078. var param = {
  98079. scope: me,
  98080. coords: coords,
  98081. renderer: renderer
  98082. };
  98083. if (me._extractTextLayer(feat, featureLayer, styleOptions, param)) {
  98084. continue;
  98085. }
  98086. for (var j = 0; j < styleOptions.length; j++) {
  98087. var style = me._validateStyle(styleOptions[j], feat.type);
  98088. featureLayer.render(renderer, style);
  98089. renderer._addPath(featureLayer);
  98090. }
  98091. if (tileLayer.options.interactive) {
  98092. featureLayer.makeInteractive();
  98093. }
  98094. var featureKey = tileLayer._getFeatureKey(feat.id, layerName);
  98095. renderer._features[featureKey] = {
  98096. layerName: layerName,
  98097. feature: featureLayer
  98098. };
  98099. }
  98100. }
  98101. if (tileLayer._map) {
  98102. renderer.addTo(tileLayer._map);
  98103. }
  98104. external_L_default().Util.requestAnimFrame(me.done.bind(coords, null, me.layer._vectorTiles[me.layer._tileCoordsToKey(coords)]));
  98105. },
  98106. // 保存文本图层单独绘制,避免被压盖
  98107. _extractTextLayer: function _extractTextLayer(feat, featureLayer, style, param) {
  98108. if (feat.type !== VectorFeatureType.TEXT) {
  98109. return false;
  98110. }
  98111. var me = param.scope,
  98112. coords = param.coords,
  98113. tileLayer = me.layer,
  98114. key = tileLayer._tileCoordsToKey(coords);
  98115. var id = feat.id,
  98116. layerName = feat.layerName;
  98117. var textTileLayers = tileLayer._textVectorTiles[key];
  98118. if (!textTileLayers) {
  98119. textTileLayers = {
  98120. layers: {},
  98121. coords: coords,
  98122. renderer: param.renderer
  98123. };
  98124. }
  98125. // 不同瓦片可能请求到同一个文本图层,为避免重复绘制,只保存绘制最后一个
  98126. textTileLayers.layers[id] = {
  98127. layer: featureLayer,
  98128. style: style,
  98129. layerName: layerName
  98130. };
  98131. tileLayer._textVectorTiles[key] = textTileLayers;
  98132. return true;
  98133. },
  98134. _getStyleOptions: function _getStyleOptions(coords, feature, layerName, scope) {
  98135. var me = scope;
  98136. var tileLayer = me.layer;
  98137. var styleOptions = tileLayer.getVectorTileLayerStyle(coords, feature) || me._defaultStyle(feature.type);
  98138. //根据id和layerName识别唯一要素
  98139. var id = feature.id,
  98140. styleKey = tileLayer._getFeatureKey(id, layerName),
  98141. styleOverride = tileLayer._overriddenStyles[styleKey];
  98142. styleOptions = styleOverride ? styleOverride : styleOptions;
  98143. styleOptions = styleOptions instanceof Function ? styleOptions(feature.properties, coords.z) : styleOptions;
  98144. styleOptions = !(styleOptions instanceof Array) ? [styleOptions] : styleOptions;
  98145. return styleOptions;
  98146. },
  98147. _createFeatureLayer: function _createFeatureLayer(feat, pxPerExtent) {
  98148. var layer;
  98149. switch (feat.type) {
  98150. case VectorFeatureType.POINT:
  98151. layer = new PointSymbolizer(feat, pxPerExtent);
  98152. break;
  98153. case VectorFeatureType.LINE:
  98154. layer = new LineSymbolizer(feat, pxPerExtent);
  98155. break;
  98156. case VectorFeatureType.REGION:
  98157. layer = new RegionSymbolizer(feat, pxPerExtent);
  98158. break;
  98159. case VectorFeatureType.TEXT:
  98160. layer = new TextSymbolizer(feat, pxPerExtent);
  98161. break;
  98162. default:
  98163. break;
  98164. }
  98165. var vectorLayer = this.layer;
  98166. if (layer && vectorLayer.options.interactive) {
  98167. layer.addEventParent(vectorLayer);
  98168. }
  98169. return layer;
  98170. },
  98171. //矫正一些参数
  98172. _validateStyle: function _validateStyle(style, type) {
  98173. //默认leaflet path的边宽为3,矩形颜色填充透明度为0.2,跟iClient不一样,故作调整
  98174. (external_L_default()).Path.prototype.options.weight = 1;
  98175. (external_L_default()).Path.prototype.options.fillOpacity = 1;
  98176. switch (type) {
  98177. case VectorFeatureType.POINT:
  98178. return external_L_default().extend({}, (external_L_default()).CircleMarker.prototype.options, style);
  98179. case VectorFeatureType.LINE:
  98180. return external_L_default().extend({}, (external_L_default()).Polyline.prototype.options, style);
  98181. case VectorFeatureType.REGION:
  98182. return external_L_default().extend({}, (external_L_default()).Polygon.prototype.options, style);
  98183. case VectorFeatureType.TEXT:
  98184. return external_L_default().extend({}, TextSymbolizer.prototype.options, style);
  98185. default:
  98186. break;
  98187. }
  98188. },
  98189. //如果cartoCSS和layerInfo都没有得到样式,则使用该默认样式
  98190. _defaultStyle: function _defaultStyle(type) {
  98191. var defaultOptions = (external_L_default()).Path.prototype.options;
  98192. defaultOptions.weight = 1;
  98193. defaultOptions.fillOpacity = 1;
  98194. defaultOptions.radius = 3;
  98195. switch (type) {
  98196. case VectorFeatureType.POINT:
  98197. return external_L_default().extend({}, defaultOptions, (external_L_default()).CircleMarker.prototype.options);
  98198. case VectorFeatureType.LINE:
  98199. return external_L_default().extend({}, defaultOptions, (external_L_default()).Polyline.prototype.options);
  98200. case VectorFeatureType.REGION:
  98201. return external_L_default().extend({}, defaultOptions, (external_L_default()).Polygon.prototype.options);
  98202. case VectorFeatureType.TEXT:
  98203. return external_L_default().extend({}, defaultOptions, TextSymbolizer.prototype.options);
  98204. default:
  98205. break;
  98206. }
  98207. }
  98208. });
  98209. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/VectorGrid.js
  98210. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  98211. * This program are made available under the terms of the Apache License, Version 2.0
  98212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  98213. /**
  98214. * Inspired by https://github.com/Leaflet/Leaflet.VectorGrid
  98215. */
  98216. /**
  98217. * @class VectorGrid
  98218. * @classdesc 矢量瓦片图层基类。
  98219. * @category Visualization VectorTile
  98220. * @extends {L.GridLayer}
  98221. * @param {Object} options - 参数。
  98222. * @param {Object} [options.vectorTileLayerStyles] - 矢量网片图层风格。
  98223. * @param {string} [options.renderer='SVG'] - 渲染器类型。
  98224. * @param {VectorTileFormat} [options.format=VectorTileFormat.JSON] - 矢量瓦片格式。
  98225. * @param {boolean} [options.interactive=true] - 是否可交互。
  98226. * @param {number} [options.maxZoom=23] - 最大缩放级别。
  98227. * @usage
  98228. */
  98229. var VectorGrid = external_L_default().GridLayer.extend({
  98230. options: {
  98231. vectorTileLayerStyles: null,
  98232. //SVG or Canvas
  98233. renderer: "SVG",
  98234. format: VectorTileFormat.JSON,
  98235. interactive: true,
  98236. maxZoom: 23
  98237. },
  98238. initialize: function initialize(options) {
  98239. var me = this;
  98240. external_L_default().setOptions(me, options);
  98241. external_L_default().GridLayer.prototype.initialize.call(me, options);
  98242. me._vectorTiles = {};
  98243. //交互事件使用,键值为id_layerName
  98244. me._overriddenStyles = {};
  98245. me.vectorTileLayerStyles = me.options.vectorTileLayerStyles;
  98246. me.on('tileunload', function (e) {
  98247. var key = me._tileCoordsToKey(e.coords),
  98248. tile = me._vectorTiles[key];
  98249. if (tile && me._map) {
  98250. tile.removeFrom(me._map);
  98251. }
  98252. delete me._vectorTiles[key];
  98253. }, me);
  98254. me.on('tileerror ', me._renderText, me);
  98255. me.on('load', me._renderText, me);
  98256. me._dataLayerNames = {};
  98257. },
  98258. /**
  98259. * @private
  98260. * @function VectorGrid.prototype.createTile
  98261. * @description 创建切片图层。
  98262. * @param {Object} coords - 切片坐标参数对象。
  98263. * @param {function} done - todo。
  98264. */
  98265. createTile: function createTile(coords, done) {
  98266. var me = this;
  98267. var tileSize = me.getTileSize();
  98268. var renderer = null;
  98269. if (me.options.renderer === "Canvas") {
  98270. renderer = new CanvasRenderer(coords, tileSize, me.options);
  98271. } else {
  98272. renderer = new SVGRenderer(coords, tileSize, me.options);
  98273. }
  98274. me._vectorTiles[me._tileCoordsToKey(coords)] = renderer;
  98275. renderer._features = {};
  98276. new VectorTile({
  98277. layer: me,
  98278. format: me.options.format,
  98279. coords: coords,
  98280. renderer: renderer
  98281. }, done).renderTile();
  98282. return renderer.getContainer();
  98283. },
  98284. /**
  98285. * @function VectorGrid.prototype.getStyles
  98286. * @description 获取图层样式。
  98287. * @returns {Object} 所有图层的样式。
  98288. */
  98289. getStyles: function getStyles() {
  98290. return this.vectorTileLayerStyles;
  98291. },
  98292. /**
  98293. * @function VectorGrid.prototype.getStyle
  98294. * @description 获取指定图层样式。
  98295. * @param {string} layerName - 图层名称。
  98296. * @returns {Object} 指定图层的样式。
  98297. */
  98298. getStyle: function getStyle(layerName) {
  98299. return this.vectorTileLayerStyles && this.vectorTileLayerStyles[layerName];
  98300. },
  98301. /**
  98302. * @function VectorGrid.prototype.setFeatureStyle
  98303. * @description 指定要素 ID 和图层名称设置要素风格。
  98304. * @param {number} id - 要素 ID。
  98305. * @param {string} layerName - 图层名称。
  98306. * @param {(Array|function)} layerStyle - 图层样式。
  98307. * @returns {VectorGrid} VectorGrid的实例对象。
  98308. */
  98309. setFeatureStyle: function setFeatureStyle(id, layerName, layerStyle) {
  98310. var featureKey = this._getFeatureKey(id, layerName);
  98311. this._overriddenStyles[featureKey] = layerStyle;
  98312. for (var tileKey in this._vectorTiles) {
  98313. var tile = this._vectorTiles[tileKey];
  98314. var features = tile._features;
  98315. var data = features[featureKey];
  98316. if (data) {
  98317. var feat = data.feature;
  98318. this._updateStyles(feat, tile, layerStyle);
  98319. }
  98320. }
  98321. return this;
  98322. },
  98323. /**
  98324. * @function VectorGrid.prototype.resetFeatureStyle
  98325. * @description 指定要素 ID 和图层名称重绘要素风格。
  98326. * @param {number} id - 要素 ID。
  98327. * @param {string} layerName - 图层名称。
  98328. * @returns {VectorGrid} VectorGrid的实例对象。
  98329. */
  98330. resetFeatureStyle: function resetFeatureStyle(id, layerName) {
  98331. var featureKey = this._getFeatureKey(id, layerName);
  98332. delete this._overriddenStyles[featureKey];
  98333. for (var tileKey in this._vectorTiles) {
  98334. var tile = this._vectorTiles[tileKey];
  98335. var data = tile._features[featureKey];
  98336. if (data) {
  98337. var feat = data.feature;
  98338. var styleOptions = this.vectorTileLayerStyles[data.layerName];
  98339. this._updateStyles(feat, tile, styleOptions);
  98340. }
  98341. }
  98342. return this;
  98343. },
  98344. /**
  98345. * @function VectorGrid.prototype.getDataLayerNames
  98346. * @description 获取数据图层名称。
  98347. * @returns {Array} 返回数据图层名称数组。
  98348. */
  98349. getDataLayerNames: function getDataLayerNames() {
  98350. return Object.keys(this._dataLayerNames);
  98351. },
  98352. _removeAllTiles: function _removeAllTiles() {
  98353. external_L_default().GridLayer.prototype._removeAllTiles.call(this);
  98354. this._textVectorTiles = {};
  98355. },
  98356. _renderText: function _renderText() {
  98357. var textVectorTiles = this._textVectorTiles;
  98358. for (var key in textVectorTiles) {
  98359. var textTiles = textVectorTiles[key];
  98360. var renderer = textTiles.renderer;
  98361. for (var layerId in textTiles.layers) {
  98362. var tile = textTiles.layers[layerId];
  98363. var styleOptions = tile.style,
  98364. featureLayer = tile.layer;
  98365. for (var j = 0; j < styleOptions.length; j++) {
  98366. featureLayer.render(renderer, styleOptions[j]);
  98367. renderer._addPath(featureLayer);
  98368. }
  98369. if (this.options.interactive) {
  98370. featureLayer.makeInteractive();
  98371. }
  98372. }
  98373. }
  98374. },
  98375. _getFeatureKey: function _getFeatureKey(id, layerName) {
  98376. id = id || 0;
  98377. layerName = layerName || "null";
  98378. return id + "_" + layerName;
  98379. },
  98380. _updateStyles: function _updateStyles(feat, renderer, styleOptions) {
  98381. styleOptions = styleOptions instanceof Function ? styleOptions(feat.properties, renderer.getCoord().z) : styleOptions;
  98382. if (!(styleOptions instanceof Array)) {
  98383. styleOptions = [styleOptions];
  98384. }
  98385. for (var j = 0; j < styleOptions.length; j++) {
  98386. var style = this._extendStyle(styleOptions[j], feat.type);
  98387. feat.updateStyle(renderer, style);
  98388. }
  98389. },
  98390. //矫正一些参数
  98391. _extendStyle: function _extendStyle(style, type) {
  98392. switch (type) {
  98393. case VectorFeatureType.POINT:
  98394. return external_L_default().extend({}, (external_L_default()).CircleMarker.prototype.options, style);
  98395. case VectorFeatureType.LINE:
  98396. return external_L_default().extend({}, (external_L_default()).Polyline.prototype.options, style);
  98397. case VectorFeatureType.REGION:
  98398. return external_L_default().extend({}, (external_L_default()).Polygon.prototype.options, style);
  98399. case VectorFeatureType.TEXT:
  98400. return external_L_default().extend({}, TextSymbolizer.prototype.options, style);
  98401. default:
  98402. break;
  98403. }
  98404. }
  98405. });
  98406. ;// CONCATENATED MODULE: ./src/leaflet/overlay/TiledVectorLayer.js
  98407. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  98408. * This program are made available under the terms of the Apache License, Version 2.0
  98409. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  98410. /**
  98411. * @class TiledVectorLayer
  98412. * @deprecatedclassinstance L.supermap.tiledVectorLayer
  98413. * @classdesc SuperMap iServer 的矢量瓦片图层。
  98414. * @category Visualization VectorTile
  98415. * @extends VectorGrid
  98416. * @example
  98417. * new TiledVectorLayer(url).addTo(map);
  98418. * @param {string} url - 服务地址。
  98419. * @param {Object} options - 参数。
  98420. * @param {string} options.layerNames - 指定图层的名称列表,支持的类型为矢量图层。
  98421. * @param {string} options.layersID - 获取进行切片的地图图层 ID。
  98422. * @param {string} [options.cartoCSS] - 客户端 CartoCSS 样式字符串。
  98423. * @param {boolean} [options.serverCartoCSSStyle=true] - 是否使用服务端 CartoCSS 样式。
  98424. * @param {boolean} [options.processCharacters=false] - 设置客户端 CartoCSS 样式时是否进行特定字符转换。
  98425. * @param {CRS} [options.crs] - 坐标系统类。
  98426. * @param {boolean} [options.returnAttributes=false] - 是否返回 attributes。
  98427. * @param {string} [options.expands] - expands。
  98428. * @param {boolean} [options.cacheEnabled=true] - 是否启用缓存。
  98429. * @param {Object} [options.tileTemplate] - 瓦片模板,如果设置了此参数,则按此模板出图。默认出图方式为 URL 对接的第三方瓦片。
  98430. * @param {string} [options.subdomains] - 子域名。
  98431. * @param {number} [options.timeout=10000] - 延时。
  98432. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>`] - 版权信息。
  98433. * @usage
  98434. */
  98435. var TiledVectorLayer = VectorGrid.extend({
  98436. options: {
  98437. crs: null,
  98438. //客户端cartocss样式
  98439. cartoCSS: null,
  98440. // 指定图层的名称列表。支持的类型为矢量图层
  98441. layerNames: null,
  98442. //获取进行切片的地图图层 ID
  98443. layersID: null,
  98444. //是否服务端CartoCSS样式,默认使用
  98445. serverCartoCSSStyle: true,
  98446. //设置客户端CartoCSS样式时是否进行特定字符转换
  98447. processCharacters: false,
  98448. returnAttributes: false,
  98449. /*各图层扩展的像素值。
  98450. *例如:
  98451. * 0_15:0_5,1_10:表示顶级0图层的0、1子图层扩展的像素分别为5、10像素;顶级0图层下,除0、1图层外的子图层的扩展像素都为15像素。
  98452. * 0:0_5,1_10:表示顶级0图层的0、1子图层扩展的像素分别为5、10像素;顶级0图层下,其他除0、1图层外的子图层的扩展像素为根据该图层默认样式计算得出的默认值。
  98453. */
  98454. expands: null,
  98455. cacheEnabled: false,
  98456. //瓦片模板,如果设置了此参数,则按此模板出图,url无效(对接第三方瓦片)
  98457. tileTemplate: null,
  98458. subdomains: 'abc',
  98459. timeout: 10000,
  98460. attribution: core_Attributions.Common.attribution
  98461. },
  98462. initialize: function initialize(url, options) {
  98463. options = options || {};
  98464. options.noWrap = options.noWrap == null ? true : options.noWrap;
  98465. external_L_default().setOptions(this, options);
  98466. VectorGrid.prototype.initialize.call(this, options);
  98467. external_L_default().stamp(this);
  98468. var me = this;
  98469. if (!url || url.indexOf("http") < 0) {
  98470. url = "";
  98471. return this;
  98472. }
  98473. me.url = url;
  98474. if (url.indexOf("/") === url.length - 1) {
  98475. url = url.substr(0, url.length - 1);
  98476. me.url = url;
  98477. }
  98478. this.cartoCSSToLeaflet = new CartoCSSToLeaflet(me.url);
  98479. me.initLayersInfo();
  98480. if (!me.options.serverCartoCSSStyle && me.options.cartoCSS) {
  98481. me.setClientCartoCSS(me.options.cartoCSS);
  98482. }
  98483. },
  98484. /**
  98485. * @private
  98486. * @function TiledVectorLayer.prototype.onAdd
  98487. * @description 添加地图。
  98488. * @param {L.Map} map - Leaflet Map 对象。
  98489. */
  98490. onAdd: function onAdd(map) {
  98491. this._crs = this.options.crs || map.options.crs;
  98492. this._map = map;
  98493. this._initLayerUrl();
  98494. if (this.options.tileTemplate || !this.options.serverCartoCSSStyle) {
  98495. this._initGrid();
  98496. }
  98497. },
  98498. /**
  98499. * @private
  98500. * @function TiledVectorLayer.prototype.initLayersInfo
  98501. * @description 获取服务器图层资源下的风格信息(当 CartoCSS 中不存在相应图层渲染信息时使用)。
  98502. */
  98503. initLayersInfo: function initLayersInfo() {
  98504. var me = this;
  98505. var layersUrl = Util_Util.urlPathAppend(me.url, "layers");
  98506. FetchRequest.get(SecurityManager.appendCredential(layersUrl), null, {
  98507. timeout: me.options.timeout
  98508. }).then(function (response) {
  98509. return response.json();
  98510. }).then(function (json) {
  98511. me.layersInfoInitialized = true;
  98512. me.layersInfo = json;
  98513. if (!me.layersInfo) {
  98514. return;
  98515. }
  98516. var layersInfo = {};
  98517. for (var i = 0, len = me.layersInfo.length; i < len; i++) {
  98518. var layers = me.layersInfo[i].subLayers.layers;
  98519. for (var j = 0, len1 = layers.length; j < len1; j++) {
  98520. layers[j].layerIndex = len1 - j;
  98521. layersInfo[layers[j].name] = layers[j];
  98522. }
  98523. }
  98524. me.layersInfo = layersInfo;
  98525. me.cartoCSSToLeaflet.layersInfo = layersInfo;
  98526. if (me.options.serverCartoCSSStyle) {
  98527. me.getVectorStylesFromServer();
  98528. }
  98529. })["catch"](function (ex) {
  98530. console.error('error', ex);
  98531. });
  98532. },
  98533. /**
  98534. * @function TiledVectorLayer.prototype.getLayerStyleInfo
  98535. * @description 获取图层样式信息。
  98536. * @param {string} layerName - 图层名称。
  98537. */
  98538. getLayerStyleInfo: function getLayerStyleInfo(layerName) {
  98539. var me = this,
  98540. layerInfo_simple;
  98541. me.layersStyles = me.layersStyles || {};
  98542. layerInfo_simple = me.layersStyles[layerName];
  98543. if (layerInfo_simple) {
  98544. return layerInfo_simple;
  98545. }
  98546. if (!me.layersInfo) {
  98547. return {};
  98548. }
  98549. var layerInfo = me.layersInfo[layerName];
  98550. if (!layerInfo) {
  98551. return null;
  98552. }
  98553. layerInfo_simple = {
  98554. layerIndex: layerInfo.layerIndex,
  98555. ugcLayerType: layerInfo.ugcLayerType
  98556. };
  98557. switch (layerInfo.ugcLayerType) {
  98558. case "VECTOR":
  98559. layerInfo_simple.layerStyle = layerInfo.style ? layerInfo.style : null;
  98560. break;
  98561. case "THEME":
  98562. var theme = layerInfo.theme;
  98563. //标注图层特别标明
  98564. layerInfo_simple.layerStyle = theme ? theme.defaultStyle : null;
  98565. if (theme && theme.type === "LABEL") {
  98566. layerInfo_simple.type = theme.type;
  98567. layerInfo_simple.textField = theme.labelExpression;
  98568. }
  98569. break;
  98570. default:
  98571. //SVTile发布出来的地图没有ugcLayerType属性
  98572. if (layerInfo.style) {
  98573. layerInfo_simple.layerStyle = layerInfo.style;
  98574. }
  98575. break;
  98576. }
  98577. me.layersStyles[layerName] = layerInfo_simple;
  98578. return layerInfo_simple;
  98579. },
  98580. /*
  98581. * @function TiledVectorLayer.prototype.getVectorStylesFromServer
  98582. * @description 等待服务器的 carto 返回之后拼接本地配置的 cartoCSS, 并调用 onAdd 出图。
  98583. */
  98584. getVectorStylesFromServer: function getVectorStylesFromServer() {
  98585. var me = this;
  98586. var vectorStyleUrl = Util_Util.urlPathAppend(me.url, "tileFeature/vectorstyles");
  98587. FetchRequest.get(SecurityManager.appendCredential(vectorStyleUrl), null, {
  98588. timeout: me.options.timeout
  98589. }).then(function (response) {
  98590. return response.json();
  98591. }).then(function (styles) {
  98592. if (!styles || !styles.style) {
  98593. return null;
  98594. }
  98595. if (styles.style && styles.type === 'cartoCSS') {
  98596. me.setServerCartoCSS(styles.style);
  98597. }
  98598. if (me.options) {
  98599. me.setClientCartoCSS(me.options.cartoCSS);
  98600. }
  98601. me._initGrid();
  98602. })["catch"](function (ex) {
  98603. console.error('error', ex);
  98604. });
  98605. },
  98606. /**
  98607. * @private
  98608. * @function TiledVectorLayer.prototype.setServerCartoCSS
  98609. * @description 设置服务端获取到的 cartoCSS 样式, cartoCSS 请求回来之后自动调用。
  98610. */
  98611. setServerCartoCSS: function setServerCartoCSS(cartoCSSStr) {
  98612. this.cartoCSSToLeaflet.pretreatedCartoCSS(cartoCSSStr, true);
  98613. },
  98614. /**
  98615. * @function TiledVectorLayer.prototype.setClientCartoCSS
  98616. * @description 客户端设置 cartoCSS 样式。
  98617. */
  98618. setClientCartoCSS: function setClientCartoCSS(cartoCSSStr) {
  98619. var processCharacters = false;
  98620. if (this.options.processCharacters) {
  98621. processCharacters = this.options.processCharacters;
  98622. }
  98623. this.cartoCSSToLeaflet.pretreatedCartoCSS(cartoCSSStr, processCharacters);
  98624. },
  98625. /**
  98626. * @private
  98627. * @function TiledVectorLayer.prototype.getVectorTileLayerStyle
  98628. * @description 获取图层风格信息,当 CartoCSS 中包含有对该图层的渲染信息时,优先获取,否则获取图层资源下图层样式的渲染信息。
  98629. * @param {Object} coords - 图层坐标参数对象。
  98630. * @param {Object} feature - 需要获取的要素。
  98631. */
  98632. getVectorTileLayerStyle: function getVectorTileLayerStyle(coords, feature) {
  98633. if (!feature) {
  98634. return null;
  98635. }
  98636. var me = this,
  98637. layerName = feature.layerName,
  98638. layerStyleInfo = me.getLayerStyleInfo(layerName);
  98639. //处理标签图层
  98640. if (layerStyleInfo && layerStyleInfo.textField) {
  98641. var textField = layerStyleInfo.textField;
  98642. if (textField && textField.indexOf('.')) {
  98643. var arr = textField.split('.');
  98644. textField = arr && arr.length > 0 && arr[arr.length - 1];
  98645. }
  98646. feature.properties.textField = textField;
  98647. }
  98648. me.vectorTileLayerStyles = me.vectorTileLayerStyles || {};
  98649. var style = me.vectorTileLayerStyles[layerName];
  98650. if (style) {
  98651. feature = this._mergeFeatureTextField(feature, style);
  98652. return style;
  98653. }
  98654. // CartoCSSToLeaflet内部做了客户端配置的cartoCSS和服务端cartoCSS的拼接处理
  98655. // 客户端配置的cartoCSS会覆盖相应图层的服务端cartoCSS
  98656. var scale = this.getScaleFromCoords(coords);
  98657. var shaders = this.cartoCSSToLeaflet.pickShader(layerName) || [];
  98658. style = [];
  98659. for (var itemKey in shaders) {
  98660. var shader = shaders[itemKey];
  98661. for (var j = 0; j < shader.length; j++) {
  98662. var serverStyle = this.cartoCSSToLeaflet.getValidStyleFromCarto(coords.z, scale, shader[j], feature, this.options.serverCartoCSSStyle);
  98663. if (serverStyle) {
  98664. style.push(serverStyle);
  98665. }
  98666. }
  98667. }
  98668. feature = this._mergeFeatureTextField(feature, style);
  98669. //次优先级是layers资源的默认的样式,最低优先级是CartoDefaultStyle的样式
  98670. if (feature.type === "TEXT" || style.length === 0) {
  98671. style = this.cartoCSSToLeaflet.getValidStyleFromLayerInfo(feature, layerStyleInfo);
  98672. if (feature.type === "TEXT") {
  98673. style.textName = "[" + feature.properties.textField + "]";
  98674. }
  98675. }
  98676. me.vectorTileLayerStyles[layerName] = style;
  98677. return style;
  98678. },
  98679. /**
  98680. * @function TiledVectorLayer.prototype.getScale
  98681. * @description 通过缩放级别获取比例尺。
  98682. * @param {number} zoom - 缩放级别。
  98683. * @returns {number} 比例尺。
  98684. */
  98685. getScale: function getScale(zoom) {
  98686. var me = this;
  98687. //返回当前比例尺
  98688. var z = zoom || me._map.getZoom();
  98689. return me.scales[z];
  98690. },
  98691. /**
  98692. * @function TiledVectorLayer.prototype.getScaleFromCoords
  98693. * @description 通过行列号获取比例尺。
  98694. * @param {Object} coords - 行列号。
  98695. * @returns {number} 比例尺。
  98696. */
  98697. getScaleFromCoords: function getScaleFromCoords(coords) {
  98698. var me = this,
  98699. scale;
  98700. if (me.scales && me.scales[coords.z]) {
  98701. return me.scales[coords.z];
  98702. }
  98703. me.scales = me.scales || {};
  98704. scale = me.getDefaultScale(coords);
  98705. me.scales[coords.z] = scale;
  98706. return scale;
  98707. },
  98708. /**
  98709. * @private
  98710. * @function TiledVectorLayer.prototype.getDefaultScale
  98711. * @description 根据行列号获取默认比例尺。
  98712. * @param {Object} coords - 行列号。
  98713. * @returns {number} 默认比例尺。
  98714. */
  98715. getDefaultScale: function getDefaultScale(coords) {
  98716. var me = this,
  98717. crs = me._crs;
  98718. if (crs.scales) {
  98719. return crs.scales[coords.z];
  98720. } else {
  98721. var tileBounds = me._tileCoordsToBounds(coords);
  98722. var ne = crs.project(tileBounds.getNorthEast());
  98723. var sw = crs.project(tileBounds.getSouthWest());
  98724. var tileSize = me.options.tileSize;
  98725. var resolution = Math.max(Math.abs(ne.x - sw.x) / tileSize, Math.abs(ne.y - sw.y) / tileSize);
  98726. var mapUnit = Unit.METER;
  98727. if (crs.code) {
  98728. var array = crs.code.split(':');
  98729. if (array && array.length > 1) {
  98730. var code = parseInt(array[1]);
  98731. mapUnit = code && code >= 4000 && code <= 5000 ? Unit.DEGREE : Unit.METER;
  98732. }
  98733. }
  98734. return resolutionToScale(resolution, 96, mapUnit);
  98735. }
  98736. },
  98737. _mergeFeatureTextField: function _mergeFeatureTextField(feature, style) {
  98738. //如果设置了使用服务端cartocss样式,则文本专题图图层优先从carto中读取文本字段的key
  98739. if (!this.options.serverCartoCSSStyle || !style || feature.type !== "TEXT") {
  98740. return feature;
  98741. }
  98742. var tempStyle = style;
  98743. if (!external_L_default().Util.isArray(style)) {
  98744. tempStyle = [style];
  98745. }
  98746. for (var i = 0; i < tempStyle.length; i++) {
  98747. var textName = tempStyle[i].textName;
  98748. if (textName && feature.properties) {
  98749. feature.properties.textField = textName.substring(1, textName.length - 1);
  98750. }
  98751. }
  98752. return feature;
  98753. },
  98754. _getTileUrl: function _getTileUrl(coords) {
  98755. var me = this,
  98756. tileTemplate = me.options.tileTemplate;
  98757. if (!tileTemplate) {
  98758. return me._getDefaultTileUrl(coords);
  98759. }
  98760. return me._getTileTemplateUrl(coords);
  98761. },
  98762. _getTileTemplateUrl: function _getTileTemplateUrl(coords) {
  98763. var me = this,
  98764. tileTemplate = me.options.tileTemplate;
  98765. var data = {
  98766. s: me._getSubdomain(coords),
  98767. x: coords.x,
  98768. y: coords.y,
  98769. z: coords.z
  98770. };
  98771. if (me._map && !me._map.options.crs.infinite) {
  98772. var invertedY = me._globalTileRange.max.y - coords.y;
  98773. if (me.options.tms) {
  98774. data['y'] = invertedY;
  98775. }
  98776. data['-y'] = invertedY;
  98777. }
  98778. var tileUrl = external_L_default().Util.template(tileTemplate, external_L_default().extend(data, me.options));
  98779. return tileUrl;
  98780. },
  98781. _initGrid: function _initGrid() {
  98782. VectorGrid.prototype.onAdd.call(this, this._map);
  98783. },
  98784. _getSubdomain: (external_L_default()).TileLayer.prototype._getSubdomain,
  98785. _getDefaultTileUrl: function _getDefaultTileUrl(coords) {
  98786. var x = coords.x,
  98787. y = coords.y;
  98788. var tileUrl = this._tileUrl + "&x=" + x + "&y=" + y;
  98789. var scale = this.getScaleFromCoords(coords);
  98790. tileUrl += "&scale=" + scale;
  98791. return tileUrl;
  98792. },
  98793. _initLayerUrl: function _initLayerUrl() {
  98794. var options = this.options;
  98795. if (!this.url) {
  98796. return;
  98797. }
  98798. var format = options.format.toString().toLowerCase();
  98799. this._tileUrl = Util_Util.urlPathAppend(this.url, "tileFeature." + format);
  98800. this._tileUrl = Util_Util.urlAppend(this._tileUrl, encodeURI(this._createURLParam(options)));
  98801. },
  98802. _createURLParam: function _createURLParam(options) {
  98803. var params = [];
  98804. //添加安全认证信息
  98805. var credential = this._getCredential(this._tileUrl);
  98806. if (credential) {
  98807. params.push(credential);
  98808. }
  98809. if (options.layersID) {
  98810. params.push("layersID=" + options.layersID);
  98811. }
  98812. if (options.layerNames) {
  98813. if (!external_L_default().Util.isArray(options.layerNames)) {
  98814. options.layerNames = [options.layerNames];
  98815. }
  98816. var layerNamesString = '[' + options.layerNames.join(',') + ']';
  98817. params.push("layerNames=" + layerNamesString);
  98818. }
  98819. //切片的起始参考点,默认为地图范围的左上角。
  98820. var crs = this._crs;
  98821. if (crs.options && crs.options.origin) {
  98822. params.push("origin=" + JSON.stringify({
  98823. x: crs.options.origin[0],
  98824. y: crs.options.origin[1]
  98825. }));
  98826. } else if (crs.projection && crs.projection.bounds) {
  98827. var bounds = crs.projection.bounds;
  98828. var tileOrigin = external_L_default().point(bounds.min.x, bounds.max.y);
  98829. params.push("origin=" + JSON.stringify({
  98830. x: tileOrigin.x,
  98831. y: tileOrigin.y
  98832. }));
  98833. }
  98834. if (options.expands) {
  98835. params.push("expands=" + options.expands);
  98836. }
  98837. params.push("returnAttributes=" + options.returnAttributes);
  98838. params.push("cacheEnabled=" + options.cacheEnabled);
  98839. var tileSize = this.options.tileSize;
  98840. params.push("width=" + tileSize);
  98841. params.push("height=" + tileSize);
  98842. return params.join("&");
  98843. },
  98844. //获取token或key表达式
  98845. _getCredential: function _getCredential(url) {
  98846. var value = SecurityManager.getToken(url);
  98847. var credential = value ? new Credential(value, 'token') || new Credential(value, 'key') : null;
  98848. if (credential) {
  98849. return credential.getUrlParameters();
  98850. }
  98851. return null;
  98852. }
  98853. });
  98854. var tiledVectorLayer = function tiledVectorLayer(url, options) {
  98855. return new TiledVectorLayer(url, options);
  98856. };
  98857. ;// CONCATENATED MODULE: external "function(){try{return turf}catch(e){return {}}}()"
  98858. var external_function_try_return_turf_catch_e_return_namespaceObject = function(){try{return turf}catch(e){return {}}}();
  98859. ;// CONCATENATED MODULE: ./src/leaflet/overlay/TurfLayer.js
  98860. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  98861. * This program are made available under the terms of the Apache License, Version 2.0
  98862. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  98863. /**
  98864. * @class TurfLayer
  98865. * @deprecatedclassinstance L.supermap.turfLayer
  98866. * @classdesc Turf 图层类。
  98867. * @category Visualization Turf
  98868. * @modulecategory Overlay
  98869. * @extends {L.Layer}
  98870. * @param {Object} options - 参数。
  98871. * @param {string} [options.attribution='<span>© <a href='https://turfjs.org/' title='turfjs' target='_blank'>turfjs</a></span>'] - 版权信息。
  98872. * @usage
  98873. */
  98874. var TurfLayer = external_L_default().GeoJSON.extend({
  98875. turfMap: {
  98876. "Measurement.along": ["line", "distance", "units"],
  98877. "Measurement.area": ["geojson"],
  98878. "Measurement.bbox": ["geojson"],
  98879. "Measurement.bboxPolygon": ["bbox"],
  98880. "Measurement.bearing": ["start", "end", "final"],
  98881. "Measurement.center": ["geojson", "properties"],
  98882. "Measurement.centerOfMass": ["geojson", "properties"],
  98883. "Measurement.centroid": ["geojson", "properties"],
  98884. "Measurement.destination": ["origin", "distance", "bearing", "units"],
  98885. "Measurement.distance": ["from", "to", "units"],
  98886. "Measurement.envelope": ["geojson"],
  98887. "Measurement.length": ["geojson", "units"],
  98888. "Measurement.midpoint": ["point1", "point2"],
  98889. "Measurement.pointOnFeature": ["geojson"],
  98890. "Measurement.polygonTangents": ["point", "polygon"],
  98891. "Measurement.rhumbBearing": ["start", "end", "final"],
  98892. "Measurement.rhumbDestination": ["origin", "distance", "bearing", "units"],
  98893. "Measurement.rhumbDistance": ["from", "to", "units"],
  98894. "Measurement.square": ["bbox"],
  98895. "Measurement.greatCircle": ["start", "end", "properties", "npoints", "offset"],
  98896. "CoordinateMutation.cleanCoords": ["geojson", "mutate"],
  98897. "CoordinateMutation.flip": ["geojson", "mutate"],
  98898. "CoordinateMutation.rewind": ["geojson", "reverse", "mutate"],
  98899. "CoordinateMutation.round": ["num", "precision"],
  98900. "CoordinateMutation.truncate": ["geojson", "precision", "coordinates", "mutate"],
  98901. "Transformation.bboxClip": ["feature", "bbox"],
  98902. "Transformation.bezierSpline": ["line", "resolution", "sharpness"],
  98903. "Transformation.buffer": ["geojson", "radius", "units", "steps"],
  98904. "Transformation.circle": ["center", "radius", "steps", "units", "properties"],
  98905. "Transformation.clone": ["geojson"],
  98906. "Transformation.concave": ["points", "maxEdge", "units"],
  98907. "Transformation.convex": ["geojson", "concavity"],
  98908. "Transformation.difference": ["polygon1", "polygon2"],
  98909. "Transformation.dissolve": ["featureCollection", "propertyName"],
  98910. "Transformation.intersect": ["poly1", "poly2"],
  98911. "Transformation.lineOffset": ["geojson", "distance", "units"],
  98912. "Transformation.simplify": ["feature", "tolerance", "highQuality"],
  98913. "Transformation.tesselate": ["poly"],
  98914. "Transformation.transformRotate": ["geojson", "angle", "pivot", "mutate"],
  98915. "Transformation.transformTranslate": ["geojson", "distance", "direction", "units", "zTranslation", "mutate"],
  98916. "Transformation.transformScale": ["geojson", "factor", "origin", "mutate"],
  98917. "Transformation.union": ["A"],
  98918. "Transformation.voronoi": ["points", "bbox"],
  98919. "featureConversion.combine": ["fc"],
  98920. "featureConversion.explode": ["geojson"],
  98921. "featureConversion.flatten": ["geojson"],
  98922. "featureConversion.lineStringToPolygon": ["lines", "properties", "autoComplete", "orderCoords"],
  98923. "featureConversion.polygonize": ["geojson"],
  98924. "featureConversion.polygonToLineString": ["polygon", "properties"],
  98925. "Misc.kinks": ["featureIn"],
  98926. "Misc.lineArc": ["center", "radius", "bearing1", "bearing2", "steps", "units"],
  98927. "Misc.lineChunk": ["geojson", "segmentLength", "units", "reverse"],
  98928. "Misc.lineIntersect": ["line1", "line2"],
  98929. "Misc.lineOverlap": ["line1", "line2"],
  98930. "Misc.lineSegment": ["geojson"],
  98931. "Misc.lineSlice": ["startPt", "stopPt", "line"],
  98932. "Misc.lineSliceAlong": ["line", "startDist", "stopDist", "units"],
  98933. "Misc.lineSplit": ["line", "splitter"],
  98934. "Misc.mask": ["polygon", "mask"],
  98935. "Misc.pointOnLine": ["lines", "pt", "units"],
  98936. "Misc.sector": ["center", "radius", "bearing1", "bearing2", "steps", "units"],
  98937. "Misc.shortestPath": ["start", "end", "obstacles", "units", "resolution"],
  98938. "Misc.unkinkPolygon": ["geojson"],
  98939. "Helper.featureCollection": ["features", "bbox", "id"],
  98940. "Helper.feature": ["geometry", "properties", "bbox", "id"],
  98941. "Helper.geometryCollection": ["geometries", "properties", "bbox", "id"],
  98942. "Helper.lineString": ["coordinates", "properties", "bbox", "id"],
  98943. "Helper.multiLineString": ["coordinates", "properties", "bbox", "id"],
  98944. "Helper.multiPoint": ["coordinates", "properties", "bbox", "id"],
  98945. "Helper.multiPolygon": ["coordinates", "properties", "bbox", "id"],
  98946. "Helper.point": ["coordinates", "properties", "bbox", "id"],
  98947. "Helper.polygon": ["coordinates", "properties", "bbox", "id"],
  98948. "Data.sample": ["featurecollection", "num"],
  98949. "Interpolation.interpolate": ["points", "cellSize", "gridType", "property", "units", "weight"],
  98950. "Interpolation.isobands": ["pointGrid", "breaks", "zProperty", "commonProperties", "breaksProperties"],
  98951. "Interpolation.isolines": ["pointGrid", "breaks", "zProperty", "commonProperties", "breaksProperties"],
  98952. "Interpolation.planepoint": ["point", "triangle"],
  98953. "Interpolation.tin": ["points", "z"],
  98954. "Joins.pointsWithinPolygon": ["points", "polygons"],
  98955. "Joins.tag": ["points", "polygons", "field", "outField", "mask", "properties"],
  98956. "Grids.hexGrid": ["bbox", "cellSide", "units", "triangles"],
  98957. "Grids.pointGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  98958. "Grids.squareGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  98959. "Grids.triangleGrid": ["bbox", "cellSide", "units", "mask", "properties"],
  98960. "Classification.nearestPoint": ["targetPoint", "points"],
  98961. "Aggregation.collect": ["polygons", "points", "inProperty", "outProperty"],
  98962. "Aggregation.clustersDbscan": ["points", "maxDistance", "units", "minPoints", "mutate"],
  98963. "Aggregation.clustersKmeans": ["points", "numberOfClusters", "mutate"],
  98964. "Meta.coordAll": ["geojson"],
  98965. "Meta.coordEach": ["geojson", "callback", "excludeWrapCoord"],
  98966. "Meta.coordReduce": ["geojson", "callback", "initialValue", "excludeWrapCoord"],
  98967. "Meta.featureEach": ["geojson", "callback"],
  98968. "Meta.featureReduce": ["geojson", "callback", "initialValue"],
  98969. "Meta.flattenEach": ["geojson", "callback"],
  98970. "Meta.flattenReduce": ["geojson", "callback", "initialValue"],
  98971. "Meta.getCoord": ["coord"],
  98972. "Meta.getCoords": ["coords"],
  98973. "Meta.getGeom": ["geojson"],
  98974. "Meta.getGeomType": ["geojson", "name"],
  98975. "Meta.geomEach": ["geojson", "callback"],
  98976. "Meta.geomReduce": ["geojson", "callback", "initialValue"],
  98977. "Meta.propEach": ["geojson", "callback"],
  98978. "Meta.propReduce": ["geojson", "callback", "initialValue"],
  98979. "Meta.segmentEach": ["geojson", "callback"],
  98980. "Meta.segmentReduce": ["geojson", "callback", "initialValue"],
  98981. "Meta.getCluster": ["geojson", "filter"],
  98982. "Meta.clusterEach": ["geojson", "property", "callback"],
  98983. "Meta.clusterReduce": ["geojson", "property", "callback", "initialValue"],
  98984. "Assertions.collectionOf": ["featureCollection", "type", "name"],
  98985. "Assertions.containsNumber": ["coordinates"],
  98986. "Assertions.geojsonType": ["value", "type", "name"],
  98987. "Assertions.featureOf": ["feature", "type", "name"],
  98988. "Booleans.booleanClockwise": ["line"],
  98989. "Booleans.booleanContains": ["feature1", "feature2"],
  98990. "Booleans.booleanCrosses": ["feature1", "feature2"],
  98991. "Booleans.booleanDisjoint": ["feature1", "feature2"],
  98992. "Booleans.booleanEqual": ["feature1", "feature2"],
  98993. "Booleans.booleanOverlap": ["feature1", "feature2"],
  98994. "Booleans.booleanParallel": ["feature1", "feature2"],
  98995. "Booleans.booleanPointInPolygon": ["point", "polygon", "ignoreBoundary"],
  98996. "Booleans.booleanPointOnLine": ["point", "linestring", "ignoreEndVertices"],
  98997. "UnitConversion.bearingToAngle": ["bearing"],
  98998. "UnitConversion.convertArea": ["area", "originalUnit", "finalUnit"],
  98999. "UnitConversion.convertLength": ["length", "originalUnit", "finalUnit"],
  99000. "UnitConversion.degreesToradians": ["degrees"],
  99001. "UnitConversion.lengthToRadians": ["distance", "units"],
  99002. "UnitConversion.lengthToDegrees": ["distance", "units"],
  99003. "UnitConversion.radiansToLength": ["radians", "units"],
  99004. "UnitConversion.radiansToDegrees": ["radians"],
  99005. "UnitConversion.toMercator": ["geojson", "mutate"],
  99006. "UnitConversion.toWgs84": ["geojson", "mutate"]
  99007. },
  99008. options: {
  99009. attribution: core_Attributions.Turf.attribution
  99010. },
  99011. initialize: function initialize(options) {
  99012. options = options || {};
  99013. external_L_default().Util.setOptions(this, options);
  99014. external_L_default().stamp(this);
  99015. this._layers = {};
  99016. },
  99017. // 5.0.0 及以上版本参数配置
  99018. turfOptionMap: {
  99019. "Measurement.along": ["line", "distance", {
  99020. units: ""
  99021. }],
  99022. "Measurement.bboxPolygon": ["bbox", {
  99023. properties: "",
  99024. id: ""
  99025. }],
  99026. "Measurement.bearing": ["start", "end", {
  99027. "final": ""
  99028. }],
  99029. "Measurement.center": ["geojson", {
  99030. properties: ""
  99031. }],
  99032. "Measurement.destination": ["origin", "distance", "bearing", {
  99033. units: "",
  99034. properties: ""
  99035. }],
  99036. "Measurement.distance": ["from", "to", {
  99037. units: ""
  99038. }],
  99039. "Measurement.length": ["geojson", {
  99040. units: ""
  99041. }],
  99042. "Measurement.rhumbBearing": ["start", "end", {
  99043. "final": ""
  99044. }],
  99045. "Measurement.rhumbDestination": ["origin", "distance", "bearing", {
  99046. units: "",
  99047. properties: ""
  99048. }],
  99049. "Measurement.rhumbDistance": ["from", "to", {
  99050. units: ""
  99051. }],
  99052. "Measurement.greatCircle": ["start", "end", {
  99053. properties: "",
  99054. npoints: "",
  99055. offset: ""
  99056. }],
  99057. "CoordinateMutation.cleanCoords": ["geojson", {
  99058. mutate: ""
  99059. }],
  99060. "CoordinateMutation.flip": ["geojson", {
  99061. mutate: ""
  99062. }],
  99063. "CoordinateMutation.rewind": ["geojson", {
  99064. mutate: "",
  99065. reverse: ""
  99066. }],
  99067. "CoordinateMutation.truncate": ["geojson", {
  99068. precision: "",
  99069. coordinates: "",
  99070. mutate: ""
  99071. }],
  99072. "Transformation.bezierSpline": ["line", {
  99073. resolution: "",
  99074. sharpness: ""
  99075. }],
  99076. "Transformation.buffer": ["geojson", "radius", {
  99077. units: "",
  99078. steps: ""
  99079. }],
  99080. "Transformation.circle": ["center", "radius", {
  99081. units: "",
  99082. steps: "",
  99083. properties: ""
  99084. }],
  99085. "Transformation.concave": ["points", {
  99086. maxEdge: "",
  99087. units: ""
  99088. }],
  99089. "Transformation.convex": ["geojson", {
  99090. concavity: ""
  99091. }],
  99092. "Transformation.dissolve": ["featureCollection", {
  99093. propertyName: ""
  99094. }],
  99095. "Transformation.lineOffset": ["geojson", "distance", {
  99096. units: ""
  99097. }],
  99098. "Transformation.simplify": ["geojson", {
  99099. tolerance: "",
  99100. highQuality: ""
  99101. }],
  99102. "Transformation.transformRotate": ["geojson", "angle", {
  99103. pivot: "",
  99104. mutate: ""
  99105. }],
  99106. "Transformation.transformTranslate": ["geojson", "distance", "direction", {
  99107. units: "",
  99108. zTranslation: "",
  99109. mutate: ""
  99110. }],
  99111. "Transformation.transformScale": ["geojson", "factor", {
  99112. origin: "",
  99113. mutate: ""
  99114. }],
  99115. "Transformation.voronoi": ["points", {
  99116. bbox: ""
  99117. }],
  99118. "featureConversion.lineStringToPolygon": ["lines", {
  99119. properties: "",
  99120. autoComplete: "",
  99121. orderCoords: ""
  99122. }],
  99123. "featureConversion.polygonToLineString": ["polygon", {
  99124. properties: ""
  99125. }],
  99126. "Misc.lineArc": ["center", "radius", "bearing1", "bearing2", {
  99127. steps: "",
  99128. units: ""
  99129. }],
  99130. "Misc.lineChunk": ["geojson", "segmentLength", {
  99131. units: "",
  99132. reverse: ""
  99133. }],
  99134. "Misc.lineOverlap": ["line1", "line2", {
  99135. tolerance: ""
  99136. }],
  99137. "Misc.lineSliceAlong": ["line", "startDist", "stopDist", {
  99138. units: ""
  99139. }],
  99140. "Misc.pointOnLine": ["lines", "pt", {
  99141. units: ""
  99142. }],
  99143. "Misc.sector": ["center", "radius", "bearing1", "bearing2", {
  99144. units: "",
  99145. steps: "",
  99146. properties: ""
  99147. }],
  99148. "Misc.shortestPath": ["start", "end", {
  99149. obstacles: "",
  99150. units: "",
  99151. resolution: ""
  99152. }],
  99153. "Helper.feature": ["geometry", "properties", {
  99154. bbox: "",
  99155. id: ""
  99156. }],
  99157. "Helper.geometryCollection": ["geometries", "properties", {
  99158. bbox: "",
  99159. id: ""
  99160. }],
  99161. "Helper.lineString": ["coordinates", "properties", {
  99162. bbox: "",
  99163. id: ""
  99164. }],
  99165. "Helper.multiLineString": ["coordinates", "properties", {
  99166. bbox: "",
  99167. id: ""
  99168. }],
  99169. "Helper.multiPoint": ["coordinates", "properties", {
  99170. bbox: "",
  99171. id: ""
  99172. }],
  99173. "Helper.multiPolygon": ["coordinates", "properties", {
  99174. bbox: "",
  99175. id: ""
  99176. }],
  99177. "Helper.point": ["coordinates", "properties", {
  99178. bbox: "",
  99179. id: ""
  99180. }],
  99181. "Helper.polygon": ["coordinates", "properties", {
  99182. bbox: "",
  99183. id: ""
  99184. }],
  99185. "Interpolation.interpolate": ["points", "cellSize", {
  99186. gridType: "",
  99187. property: "",
  99188. units: "",
  99189. weight: ""
  99190. }],
  99191. "Interpolation.isobands": ["pointGrid", "breaks", {
  99192. zProperty: "",
  99193. commonProperties: "",
  99194. breaksProperties: ""
  99195. }],
  99196. "Interpolation.isolines": ["pointGrid", "breaks", {
  99197. zProperty: "",
  99198. commonProperties: "",
  99199. breaksProperties: ""
  99200. }],
  99201. "Grids.hexGrid": ["bbox", "cellSide", {
  99202. units: "",
  99203. triangles: "",
  99204. properties: "",
  99205. mask: ""
  99206. }],
  99207. "Grids.pointGrid": ["bbox", "cellSide", {
  99208. units: "",
  99209. mask: "",
  99210. properties: ""
  99211. }],
  99212. "Grids.squareGrid": ["bbox", "cellSide", {
  99213. units: "",
  99214. mask: "",
  99215. properties: ""
  99216. }],
  99217. "Grids.triangleGrid": ["bbox", "cellSide", {
  99218. units: "",
  99219. mask: "",
  99220. properties: ""
  99221. }],
  99222. "Aggregation.clustersDbscan": ["points", "maxDistance", {
  99223. units: "",
  99224. minPoints: "",
  99225. mutate: ""
  99226. }],
  99227. "Aggregation.clustersKmeans": ["points", {
  99228. numberOfClusters: "",
  99229. mutate: ""
  99230. }],
  99231. "Booleans.booleanPointInPolygon": ["point", "polygon", {
  99232. ignoreBoundary: ""
  99233. }],
  99234. "Booleans.booleanPointOnLine": ["point", "linestring", {
  99235. ignoreEndVertices: ""
  99236. }],
  99237. "UnitConversion.toMercator": ["geojson", {
  99238. mutate: ""
  99239. }],
  99240. "UnitConversion.toWgs84": ["geojson", {
  99241. mutate: ""
  99242. }]
  99243. },
  99244. /**
  99245. * @function TurfLayer.prototype.process
  99246. * @description 执行 Turf.js 提供的相关空间分析方法。
  99247. * @param {string} type - Turf.js 提供的空间分析方法名。
  99248. * @param {Object} args - Turf.js 提供的空间分析方法对应的参数对象。
  99249. * @param {function} callback - 空间分析完成执行的回调函数,返回执行的结果。
  99250. * @param {boolean} [addFeaturesToMap=true] - 是否添加到地图。
  99251. */
  99252. process: function process(type, args, callback, addFeaturesToMap) {
  99253. // 兼容版本4到5
  99254. var result;
  99255. try {
  99256. result = external_function_try_return_turf_catch_e_return_namespaceObject[type.split('.')[1]].apply(this, this.parse(type, args));
  99257. } catch (e) {
  99258. result = external_function_try_return_turf_catch_e_return_namespaceObject[type.split('.')[1]].apply(this, this.parseOption(type, args));
  99259. }
  99260. addFeaturesToMap = addFeaturesToMap == null ? true : addFeaturesToMap;
  99261. if (addFeaturesToMap) {
  99262. this.addData([result]);
  99263. }
  99264. if (callback) {
  99265. callback(result);
  99266. }
  99267. },
  99268. parse: function parse(type, args) {
  99269. if (type === 'Transformation.union') {
  99270. return args['A'];
  99271. }
  99272. var result = [];
  99273. var tempArgs = this.turfMap[type];
  99274. if (tempArgs) {
  99275. tempArgs.map(function (key) {
  99276. result.push(args[key]);
  99277. return args[key];
  99278. });
  99279. }
  99280. return result;
  99281. },
  99282. parseOption: function parseOption(type, args) {
  99283. var result = [];
  99284. var tempArgs = this.turfOptionMap[type];
  99285. tempArgs.map(function (key) {
  99286. if (key instanceof Object) {
  99287. var options = key;
  99288. Object.keys(options).forEach(function (k) {
  99289. options[k] = args[k];
  99290. });
  99291. result.push(options);
  99292. } else {
  99293. result.push(args[key]);
  99294. }
  99295. return args;
  99296. });
  99297. return result;
  99298. }
  99299. });
  99300. var turfLayer = function turfLayer(options) {
  99301. return new TurfLayer(options);
  99302. };
  99303. ;// CONCATENATED MODULE: ./src/leaflet/overlay/HeatMapLayer.js
  99304. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  99305. * This program are made available under the terms of the Apache License, Version 2.0
  99306. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  99307. /**
  99308. * @class HeatMapFeature
  99309. * @deprecatedclassinstance L.supermap.heatMapFeature
  99310. * @category Visualization HeatMap
  99311. * @classdesc 客户端专题图要素类。
  99312. * 支持的 geometry 参数类型为 {@link L.Point}、{@link L.LatLng}、{@link L.CircleMarker}。
  99313. * @modulecategory Overlay
  99314. * @extends {L.Class}
  99315. * @param {(L.Point|L.LatLng|L.CircleMarker)} geometry - 要素图形。
  99316. * @param {Object} attributes - 要素属性。
  99317. * @usage
  99318. */
  99319. var HeatMapFeature = external_L_default().Class.extend({
  99320. initialize: function initialize(geometry, attributes) {
  99321. this.geometry = geometry;
  99322. this.attributes = attributes;
  99323. },
  99324. /**
  99325. * @function HeatMapFeature.prototype.toFeature
  99326. * @description 转为内部矢量要素。
  99327. * @returns {FeatureVector} 内部矢量要素。
  99328. */
  99329. toFeature: function toFeature() {
  99330. var geometry = this.geometry;
  99331. var points = [];
  99332. if (geometry instanceof (external_L_default()).LatLng) {
  99333. points = [geometry.lng, geometry.lat];
  99334. } else if (geometry instanceof (external_L_default()).Point) {
  99335. points = [geometry.x, geometry.y];
  99336. } else if (geometry instanceof (external_L_default()).CircleMarker) {
  99337. var latLng = geometry.getLatLng();
  99338. points = [latLng.lng, latLng.lat];
  99339. } else {
  99340. points = geometry;
  99341. }
  99342. if (points.length === 2) {
  99343. geometry = new Point(points[0], points[1]);
  99344. }
  99345. return new Vector(geometry, this.attributes);
  99346. }
  99347. });
  99348. var heatMapFeature = function heatMapFeature(geometry, attributes) {
  99349. return new HeatMapFeature(geometry, attributes);
  99350. };
  99351. /**
  99352. * @class HeatMapLayer
  99353. * @classdesc 热力图层类。
  99354. * @category Visualization HeatMap
  99355. * @param {string} name - 图层名称。
  99356. * @param {boolean} [loadWhileAnimating=true] - 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为 false)。
  99357. * @param {Object} options - 构造参数。
  99358. * @param {L.Map} options.map - Leaflet Map 对象。
  99359. * @param {string} [options.id] - 专题图层 ID,默认使用 CommonUtil.createUniqueID("heatMapLayer_") 创建专题图层 ID。
  99360. * @param {boolean} [options.alwaysMapCRS=false] - 要素坐标是否和地图坐标系一致,要素默认是经纬度坐标。
  99361. * @param {string} [options.featureWeight] - 对应 feature 属性中的热点权重字段名称,权重值类型为 number。
  99362. * @param {number} [options.radius=50] - 热点渲染的最大半径(热点像素半径),单位为 px,当 useGeoUnit 参数 为 true 时,单位使用当前图层地理坐标单位。热点显示的时候以精确点为中心点开始往四周辐射衰减,其衰减半径和权重值成比列。
  99363. * @param {number} [options.opacity=1] - 图层透明度。
  99364. * @param {Array.<string>} [options.colors=['blue', 'cyan', 'lime', 'yellow', 'red']] - 颜色线性渐变数组,颜色值必须为 canvas 所支持的。
  99365. * @param {boolean} [options.useGeoUnit=false] - 使用地理单位,即默认热点半径默认使用像素单位。当设置为 true 时,热点半径和图层地理坐标保持一致。
  99366. * @param {number} [options.blur] - 模糊量,单位为 px。默认值为半径的二分之一。
  99367. * @param {string} [options.attribution='Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' title='SuperMap iServer' target='_blank'>SuperMap iServer</a></span>'] - 版权信息。
  99368. *
  99369. * @extends {L.Layer}
  99370. * @fires HeatMapLayer#featuresremoved
  99371. * @fires HeatMapLayer#changelayer
  99372. * @usage
  99373. */
  99374. var HeatMapLayer = external_L_default().Layer.extend({
  99375. options: {
  99376. //要素坐标是否和地图坐标系一致,默认为false,要素默认是经纬度坐标。
  99377. alwaysMapCRS: false,
  99378. //热力图默认参数:
  99379. id: Util_Util.createUniqueID("heatMapLayer_"),
  99380. featureWeight: null,
  99381. opacity: 1,
  99382. colors: ['blue', 'cyan', 'lime', 'yellow', 'red'],
  99383. useGeoUnit: false,
  99384. radius: 50,
  99385. attribution: core_Attributions.Common.attribution
  99386. },
  99387. initialize: function initialize(name, options) {
  99388. external_L_default().Util.setOptions(this, options);
  99389. this.name = name;
  99390. this.features = [];
  99391. this.maxWeight = null;
  99392. this.minWeight = null;
  99393. this.rootCanvas = null;
  99394. this.canvasContext = null;
  99395. this.maxWidth = null;
  99396. this.maxHeight = null;
  99397. //热力图参数:
  99398. this.id = this.options.id;
  99399. /*
  99400. * options.featureWeight对应 feature 属性中的热点权重字段名称,权重值类型为float
  99401. * //例如:
  99402. * //feature.attributes中表示权重的字段为height,则在HeatMapLayer的featureWeight参数赋值为"height"
  99403. * feature1.attributes.height = 7.0;
  99404. * feature2.attributes.height = 6.0;
  99405. * var heatMapLayer = new HeatMapLayer("heatmaplayer",{"featureWeight":"height"});
  99406. * heatMapLayer.addFeatures([feature1,feature2]);
  99407. * @type {null}
  99408. */
  99409. this.featureWeight = this.options.featureWeight;
  99410. this.colors = this.options.colors;
  99411. this.useGeoUnit = this.options.useGeoUnit;
  99412. this.opacity = this.options.opacity;
  99413. this.radius = this.options.radius;
  99414. this.blur = this.options.blur;
  99415. this.movingOffset = [0, 0];
  99416. },
  99417. /**
  99418. * @function HeatMapLayer.prototype.onRemove
  99419. * @description 删除某个地图。
  99420. * @param {L.Map} map - Leaflet Map 对象。
  99421. * @private
  99422. */
  99423. onRemove: function onRemove(map) {
  99424. var me = this;
  99425. external_L_default().DomUtil.remove(me.rootCanvas);
  99426. map.off("mousemove", me.mouseMoveHandler);
  99427. },
  99428. /**
  99429. * @function HeatMapLayer.prototype.onAdd
  99430. * @description 添加专题图。
  99431. * @param {L.Map} map - Leaflet Map 对象。
  99432. * @private
  99433. */
  99434. onAdd: function onAdd(map) {
  99435. var me = this;
  99436. me._map = map;
  99437. me._createCanvasContainer();
  99438. if (!me.rootCanvas) {
  99439. map.removeLayer(me);
  99440. return;
  99441. }
  99442. //初始化渲染器
  99443. var size = map.getSize();
  99444. me.rootCanvas.width = me.maxWidth = size.x;
  99445. me.rootCanvas.height = me.maxHeight = size.y;
  99446. me._updateOpacity();
  99447. me.mouseMoveHandler = function (e) {
  99448. var xy = e.layerPoint;
  99449. me.currentMousePosition = external_L_default().point(xy.x + me.movingOffset[0], xy.y + me.movingOffset[1]);
  99450. };
  99451. map.on("mousemove", me.mouseMoveHandler);
  99452. me.update();
  99453. },
  99454. /**
  99455. * @function HeatMapLayer.prototype.addFeatures
  99456. * @description 添加热点信息。
  99457. * @param {(GeoJSONObject|HeatMapFeature)} features - 待添加的要素数组。
  99458. *
  99459. * @example
  99460. * var geojson = {
  99461. * "type": "FeatureCollection",
  99462. * "features": [
  99463. * {
  99464. * "type": "feature",
  99465. * "geometry": {
  99466. * "type": "Point", //只支持point类型
  99467. * "coordinates": [0, 0]
  99468. * },
  99469. * "properties": {
  99470. * "height": Math.random()*9,
  99471. * "geoRadius": useGeoRadius?radius:null
  99472. * }
  99473. * }
  99474. * ]
  99475. * };
  99476. * var heatMapLayer = new HeatMapLayer("heatmaplayer",{"id":"heatmap"});
  99477. * heatMapLayer.addFeatures(geojson);
  99478. */
  99479. addFeatures: function addFeatures(features) {
  99480. this.features = this.toiClientFeature(features);
  99481. this.refresh();
  99482. },
  99483. /**
  99484. * @function HeatMapLayer.prototype.refresh
  99485. * @description 强制刷新当前热点显示,在图层热点数组发生变化后调用,更新显示。
  99486. */
  99487. refresh: function refresh() {
  99488. if (this.features.length === 0) {
  99489. return;
  99490. }
  99491. if (this._map) {
  99492. var extent = this._map.getBounds();
  99493. this.updateHeatPoints(extent);
  99494. }
  99495. },
  99496. /**
  99497. * @function HeatMapLayer.prototype.updateHeatPoints
  99498. * @description 刷新热点图显示。
  99499. * @param {L.LatLngBounds} bounds - 当前显示范围。
  99500. */
  99501. updateHeatPoints: function updateHeatPoints(bounds) {
  99502. if (this.features && this.features.length > 0) {
  99503. this.convertFastToPixelPoints(bounds);
  99504. } else {
  99505. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxWidth);
  99506. }
  99507. },
  99508. /**
  99509. * @function HeatMapLayer.prototype.convertFastToPixelPoints
  99510. * @description 过滤位于当前显示范围内的热点,并转换其为当前分辨率下的像素坐标。
  99511. * @param {L.LatLngBounds} bounds - 当前显示范围。
  99512. * @private
  99513. */
  99514. convertFastToPixelPoints: function convertFastToPixelPoints(bounds) {
  99515. var data = [],
  99516. x,
  99517. y,
  99518. k,
  99519. resolution,
  99520. maxTemp,
  99521. minTemp,
  99522. maxWeightTemp;
  99523. //获取当前像素下的地理范围
  99524. var dw = bounds.getEast() - bounds.getWest();
  99525. var dh = bounds.getNorth() - bounds.getSouth();
  99526. var mapCanvas = this._map.getSize();
  99527. if (dw / mapCanvas.x > dh / mapCanvas.y) {
  99528. resolution = dw / mapCanvas.x;
  99529. } else {
  99530. resolution = dh / mapCanvas.y;
  99531. }
  99532. //热点半径
  99533. this.useRadius = this.useGeoUnit ? parseInt(this.radius / resolution) : this.radius;
  99534. for (var i = 0; i < this.features.length; i++) {
  99535. var feature = this.features[i];
  99536. var point = feature.geometry;
  99537. var pixelPoint = this.getLocalXY(new LonLat(point.x, point.y));
  99538. if (this.featureWeight) {
  99539. pixelPoint.weight = feature.attributes[this.featureWeight]; //point.value;
  99540. if (!this.maxWeight) {
  99541. //找出最大最小权重值
  99542. maxTemp = maxTemp ? maxTemp : pixelPoint.weight;
  99543. minTemp = minTemp ? minTemp : pixelPoint.weight;
  99544. maxTemp = Math.max(maxTemp, pixelPoint.weight);
  99545. minTemp = Math.min(minTemp, pixelPoint.weight);
  99546. }
  99547. } else {
  99548. pixelPoint.weight = 1;
  99549. }
  99550. x = Math.floor(pixelPoint[0]);
  99551. y = Math.floor(pixelPoint[1]);
  99552. k = pixelPoint.weight;
  99553. data.push([x, y, k]);
  99554. }
  99555. //无最大权重设置
  99556. if (!this.maxWeight) {
  99557. if (maxTemp && minTemp) {
  99558. maxWeightTemp = (maxTemp + minTemp) / 2;
  99559. } else {
  99560. maxWeightTemp = 1;
  99561. }
  99562. this.draw(data, maxWeightTemp);
  99563. } else {
  99564. this.draw(data, this.maxWeight);
  99565. }
  99566. },
  99567. /**
  99568. * @function HeatMapLayer.prototype.draw
  99569. * @description 绘制热点图。
  99570. * @param {Array} data - convertToPixelPoints 方法计算出的点。
  99571. * @param {number} maxWeight - 最大权重。
  99572. * @private
  99573. */
  99574. draw: function draw(data, maxWeight) {
  99575. if (this.maxHeight > 0 && this.maxWidth > 0) {
  99576. var ctx = this.canvasContext;
  99577. //清空
  99578. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxHeight);
  99579. this.drawCircle(this.useRadius);
  99580. this.createGradient();
  99581. for (var i = 0; i < data.length; i++) {
  99582. var p = data[i];
  99583. this.canvasContext.globalAlpha = Math.max(p[2] / maxWeight, 0.05);
  99584. this.canvasContext.drawImage(this.circle, p[0] - this.useRadius, p[1] - this.useRadius);
  99585. }
  99586. var colored = ctx.getImageData(0, 0, this.maxWidth, this.maxHeight);
  99587. this.colorize(colored.data, this.grad);
  99588. ctx.putImageData(colored, 0, 0);
  99589. } else {
  99590. return false;
  99591. }
  99592. },
  99593. /**
  99594. * @function HeatMapLayer.prototype.colorize
  99595. * @description 根据渐变色重置热点图 rgb 值。
  99596. * @param {Array} pixels 像素 RGBA 值。
  99597. * @param {Array} gradient 渐变 canvas.getImageData.data。
  99598. * @private
  99599. */
  99600. colorize: function colorize(pixels, gradient) {
  99601. for (var i = 0, j; i < pixels.length; i += 4) {
  99602. j = pixels[i + 3] * 4;
  99603. if (j) {
  99604. pixels[i] = gradient[j];
  99605. pixels[i + 1] = gradient[j + 1];
  99606. pixels[i + 2] = gradient[j + 2];
  99607. }
  99608. }
  99609. },
  99610. /**
  99611. * @function HeatMapLayer.drawCircle
  99612. * @description 绘制热点半径圆。
  99613. * @param {number} r - 热点半径。
  99614. * @private
  99615. */
  99616. drawCircle: function drawCircle(r) {
  99617. var blur = this.blur || r / 2;
  99618. var circle = this.circle = document.createElement('canvas'),
  99619. ctx = circle.getContext("2d");
  99620. circle.height = 2 * r;
  99621. circle.width = 2 * r;
  99622. ctx.shadowOffsetX = ctx.shadowOffsetY = 2 * r;
  99623. ctx.shadowBlur = blur;
  99624. ctx.shadowColor = "#000000";
  99625. ctx.beginPath();
  99626. ctx.arc(-r, -r, r / 2, 0, Math.PI * 2, true);
  99627. ctx.closePath();
  99628. ctx.fill();
  99629. },
  99630. /**
  99631. * @function HeatMapLayer.createGradient
  99632. * @description 根据 this.canvasColors 设置渐变并 getImageData。
  99633. * @private
  99634. */
  99635. createGradient: function createGradient() {
  99636. var colors = this.colors;
  99637. var canvas = document.createElement('canvas'),
  99638. ctx = canvas.getContext("2d"),
  99639. gradient = ctx.createLinearGradient(0, 0, 0, 256);
  99640. canvas.height = 256;
  99641. canvas.width = 1;
  99642. var index = 1;
  99643. for (var i = 0, len = colors.length; i < len; i++) {
  99644. gradient.addColorStop(index / len, colors[i]);
  99645. index++;
  99646. }
  99647. ctx.fillStyle = gradient;
  99648. ctx.fillRect(0, 0, 1, 256);
  99649. this.grad = ctx.getImageData(0, 0, 1, 256).data;
  99650. },
  99651. /**
  99652. * @function HeatMapLayer.prototype.update
  99653. * @description 更新图层。
  99654. */
  99655. update: function update() {
  99656. var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
  99657. external_L_default().DomUtil.setPosition(this.rootCanvas, mapOffset);
  99658. var me = this;
  99659. me.refresh();
  99660. if (me.currentMousePosition) {
  99661. me.currentMousePosition = external_L_default().point(me.currentMousePosition.x - me.movingOffset[0], me.currentMousePosition.y - me.movingOffset[1]);
  99662. }
  99663. me.movingOffset = [0, 0];
  99664. me._zoom = me._map.getZoom();
  99665. me._center = me._map.getCenter();
  99666. },
  99667. /**
  99668. * @function HeatMapLayer.prototype.getLocalXY
  99669. * @description 地理坐标转为像素坐标。
  99670. * @param {Array} coordinate - 地理坐标。
  99671. */
  99672. getLocalXY: function getLocalXY(coordinate) {
  99673. if (!this._map) {
  99674. return coordinate;
  99675. }
  99676. var coor = coordinate;
  99677. if (external_L_default().Util.isArray(coordinate)) {
  99678. coor = external_L_default().point(coordinate[0], coordinate[1]);
  99679. }
  99680. if (!(coordinate instanceof (external_L_default()).Point)) {
  99681. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  99682. coor = external_L_default().point(coordinate.x, coordinate.y);
  99683. } else {
  99684. coor = external_L_default().point(coordinate.lon, coordinate.lat);
  99685. }
  99686. }
  99687. var point = this._map.latLngToContainerPoint(!this.options.alwaysMapCRS ? external_L_default().latLng(coor.y, coor.x) : this._map.options.crs.unproject(coor));
  99688. return [point.x, point.y];
  99689. },
  99690. /**
  99691. * @function HeatMapLayer.prototype.setOpacity
  99692. * @description 设置图层的不透明度,取值 [0-1] 之间。
  99693. * @param {number} opacity - 不透明度。
  99694. */
  99695. setOpacity: function setOpacity(opacity) {
  99696. var me = this;
  99697. if (opacity === me.options.opacity) {
  99698. return;
  99699. }
  99700. if (opacity) {
  99701. me.options.opacity = opacity;
  99702. }
  99703. me._updateOpacity();
  99704. },
  99705. /**
  99706. * @function HeatMapLayer.prototype.removeFeatures
  99707. * @description 移除指定的热点信息。
  99708. * @param {Array.<FeatureVector>} features - 热点信息数组。
  99709. */
  99710. removeFeatures: function removeFeatures(features) {
  99711. if (!features || features.length === 0 || !this.features || this.features.length === 0) {
  99712. return;
  99713. }
  99714. if (features === this.features) {
  99715. return this.removeAllFeatures();
  99716. }
  99717. if (!Util_Util.isArray(features)) {
  99718. features = [features];
  99719. }
  99720. var heatPoint,
  99721. index,
  99722. heatPointsFailedRemoved = [];
  99723. for (var i = 0, len = features.length; i < len; i++) {
  99724. heatPoint = features[i];
  99725. index = Util_Util.indexOf(this.features, heatPoint);
  99726. //找不到视为删除失败
  99727. if (index === -1) {
  99728. heatPointsFailedRemoved.push(heatPoint);
  99729. continue;
  99730. }
  99731. //删除热点
  99732. this.features.splice(index, 1);
  99733. }
  99734. var succeed = heatPointsFailedRemoved.length == 0 ? true : false;
  99735. //派发删除features成功的事件
  99736. /**
  99737. * @event HeatMapLayer#featuresremoved
  99738. * @description 删除features成功后触发。
  99739. * @property {Array.<FeatureVector>} features - 事件对象。
  99740. * @property {boolean} succeed - 删除是否成功,false 为失败,true 为成功。
  99741. */
  99742. this._map.fire("featuresremoved", {
  99743. features: heatPointsFailedRemoved,
  99744. succeed: succeed
  99745. });
  99746. this.refresh();
  99747. },
  99748. /**
  99749. * @function HeatMapLayer.prototype.removeAllFeatures
  99750. * @description 移除全部的热点信息。
  99751. */
  99752. removeAllFeatures: function removeAllFeatures() {
  99753. this.features = [];
  99754. this.refresh();
  99755. },
  99756. /**
  99757. * @function HeatMapLayer.prototype._createCanvasContainer
  99758. * @description 创建热力图绘制容器。
  99759. * @private
  99760. */
  99761. _createCanvasContainer: function _createCanvasContainer() {
  99762. //构建绘图面板
  99763. var parentContainer = this.getPane();
  99764. var animated = this._map.options.zoomAnimation && (external_L_default()).Browser.any3d;
  99765. var className = 'heatMapLayer leaflet-layer leaflet-zoom-' + (animated ? 'animated' : 'hide');
  99766. this.rootCanvas = external_L_default().DomUtil.create("canvas", className, parentContainer);
  99767. var originProp = external_L_default().DomUtil.testProp(['transformOrigin', 'WebkitTransformOrigin', 'msTransformOrigin']);
  99768. this.rootCanvas.id = this.id;
  99769. this.rootCanvas.style[originProp] = '50% 50%';
  99770. this.rootCanvas.style.position = "absolute";
  99771. this.rootCanvas.style.zIndex = 200;
  99772. Util_Util.modifyDOMElement(this.rootCanvas, null, null, null, null, null, null, this.opacity);
  99773. this.canvasContext = this.rootCanvas.getContext('2d');
  99774. },
  99775. _updateOpacity: function _updateOpacity() {
  99776. var me = this;
  99777. Util_Util.modifyDOMElement(me.rootCanvas, null, null, null, null, null, null, me.options.opacity);
  99778. if (me._map !== null) {
  99779. /**
  99780. * @event HeatMapLayer#changelayer
  99781. * @description 图层透明度更新成功之后触发。
  99782. * @property {HeatMapLayer} layer - 图层。
  99783. * @property {string} property - 改变的图层属性。
  99784. */
  99785. me._map.fire("changelayer", {
  99786. layer: me,
  99787. property: "opacity"
  99788. });
  99789. }
  99790. },
  99791. /**
  99792. * @function HeatMapLayer.prototype.getEvents
  99793. * @description 获取图层事件。
  99794. * @returns {Object} 返回图层支持的事件。
  99795. * @private
  99796. */
  99797. getEvents: function getEvents() {
  99798. var me = this;
  99799. var events = {
  99800. zoomend: me._reset,
  99801. moveend: me._reset,
  99802. resize: me._resize
  99803. };
  99804. if (this._map._zoomAnimated) {
  99805. events.zoomanim = me._zoomAnim;
  99806. }
  99807. return events;
  99808. },
  99809. /**
  99810. * @function HeatMapLayer.prototype.toiClientFeature
  99811. * @description 转为 iClient 要素。
  99812. * @param {(GeoJSONObject|HeatMapFeature)} features - 待添加的要素数组。
  99813. * @returns {FeatureVector} 转换后的 iClient 要素。
  99814. */
  99815. toiClientFeature: function toiClientFeature(features) {
  99816. if (!external_L_default().Util.isArray(features)) {
  99817. features = [features];
  99818. }
  99819. var featuresTemp = [];
  99820. for (var i = 0, len = features.length; i < len; i++) {
  99821. //支持ThemeFeature类型的feature
  99822. //支持传入ThemeFeature类型,ThemeFeature.geometry instanceof L.LatLng | ThemeFeature.geometry instanceof L.Point
  99823. if (features[i] instanceof HeatMapFeature) {
  99824. featuresTemp.push(features[i].toFeature());
  99825. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  99826. var format = new GeoJSON();
  99827. featuresTemp = featuresTemp.concat(format.read(features[i]));
  99828. } else if (features[i].geometry && features[i].geometry.parts) {
  99829. //iServer服务器返回数据格式 todo 暂未找到更好的参数判断,暂用 geometry.parts 试用
  99830. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  99831. } else {
  99832. throw new Error("Features's type does not match, please check.");
  99833. }
  99834. }
  99835. return featuresTemp;
  99836. },
  99837. _zoomAnim: function _zoomAnim(e) {
  99838. var scale = this._map.getZoomScale(e.zoom),
  99839. offset = this._map._getCenterOffset(e.center)._multiplyBy(-scale).subtract(this._map._getMapPanePos());
  99840. if ((external_L_default()).DomUtil.setTransform) {
  99841. external_L_default().DomUtil.setTransform(this.rootCanvas, offset, scale);
  99842. } else {
  99843. this.rootCanvas.style[(external_L_default()).DomUtil.TRANSFORM] = external_L_default().DomUtil.getTranslateString(offset) + ' scale(' + scale + ')';
  99844. }
  99845. },
  99846. //缩放移动重绘
  99847. _reset: function _reset() {
  99848. var me = this;
  99849. me.update();
  99850. var size = me._map.getSize();
  99851. var mapOffset = this._map.containerPointToLayerPoint([0, 0]);
  99852. external_L_default().DomUtil.setPosition(this.rootCanvas, mapOffset);
  99853. if (parseFloat(me.rootCanvas.width) !== parseFloat(size.x)) {
  99854. me.rootCanvas.width = size.x;
  99855. }
  99856. if (parseFloat(me.rootCanvas.height) !== parseFloat(size.y)) {
  99857. me.rootCanvas.height = size.y;
  99858. }
  99859. me.refresh();
  99860. },
  99861. //通知渲染器的尺寸变化
  99862. _resize: function _resize() {
  99863. var me = this;
  99864. var newSize = me._map.getSize();
  99865. me.maxWidth = newSize.x;
  99866. me.maxHeight = newSize.y;
  99867. }
  99868. });
  99869. var heatMapLayer = function heatMapLayer(name, options) {
  99870. return new HeatMapLayer(name, options);
  99871. };
  99872. // EXTERNAL MODULE: ./node_modules/rbush/index.js
  99873. var rbush = __webpack_require__(3861);
  99874. var rbush_default = /*#__PURE__*/__webpack_require__.n(rbush);
  99875. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/geometry-type.js
  99876. var geometry_type_GeometryType;
  99877. (function (GeometryType) {
  99878. GeometryType[GeometryType["Unknown"] = 0] = "Unknown";
  99879. GeometryType[GeometryType["Point"] = 1] = "Point";
  99880. GeometryType[GeometryType["LineString"] = 2] = "LineString";
  99881. GeometryType[GeometryType["Polygon"] = 3] = "Polygon";
  99882. GeometryType[GeometryType["MultiPoint"] = 4] = "MultiPoint";
  99883. GeometryType[GeometryType["MultiLineString"] = 5] = "MultiLineString";
  99884. GeometryType[GeometryType["MultiPolygon"] = 6] = "MultiPolygon";
  99885. GeometryType[GeometryType["GeometryCollection"] = 7] = "GeometryCollection";
  99886. GeometryType[GeometryType["CircularString"] = 8] = "CircularString";
  99887. GeometryType[GeometryType["CompoundCurve"] = 9] = "CompoundCurve";
  99888. GeometryType[GeometryType["CurvePolygon"] = 10] = "CurvePolygon";
  99889. GeometryType[GeometryType["MultiCurve"] = 11] = "MultiCurve";
  99890. GeometryType[GeometryType["MultiSurface"] = 12] = "MultiSurface";
  99891. GeometryType[GeometryType["Curve"] = 13] = "Curve";
  99892. GeometryType[GeometryType["Surface"] = 14] = "Surface";
  99893. GeometryType[GeometryType["PolyhedralSurface"] = 15] = "PolyhedralSurface";
  99894. GeometryType[GeometryType["TIN"] = 16] = "TIN";
  99895. GeometryType[GeometryType["Triangle"] = 17] = "Triangle";
  99896. })(geometry_type_GeometryType || (geometry_type_GeometryType = {}));
  99897. // EXTERNAL MODULE: ./node_modules/flatbuffers/js/flatbuffers.js
  99898. var js_flatbuffers = __webpack_require__(1095);
  99899. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/geometry.js
  99900. function geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  99901. 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); } }
  99902. 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; }
  99903. var geometry_Geometry = /*#__PURE__*/function () {
  99904. function Geometry() {
  99905. geometry_classCallCheck(this, Geometry);
  99906. this.bb = null;
  99907. this.bb_pos = 0;
  99908. }
  99909. geometry_createClass(Geometry, [{
  99910. key: "__init",
  99911. value: function __init(i, bb) {
  99912. this.bb_pos = i;
  99913. this.bb = bb;
  99914. return this;
  99915. }
  99916. }, {
  99917. key: "ends",
  99918. value: function ends(index) {
  99919. var offset = this.bb.__offset(this.bb_pos, 4);
  99920. return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
  99921. }
  99922. }, {
  99923. key: "endsLength",
  99924. value: function endsLength() {
  99925. var offset = this.bb.__offset(this.bb_pos, 4);
  99926. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99927. }
  99928. }, {
  99929. key: "endsArray",
  99930. value: function endsArray() {
  99931. var offset = this.bb.__offset(this.bb_pos, 4);
  99932. 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;
  99933. }
  99934. }, {
  99935. key: "xy",
  99936. value: function xy(index) {
  99937. var offset = this.bb.__offset(this.bb_pos, 6);
  99938. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  99939. }
  99940. }, {
  99941. key: "xyLength",
  99942. value: function xyLength() {
  99943. var offset = this.bb.__offset(this.bb_pos, 6);
  99944. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99945. }
  99946. }, {
  99947. key: "xyArray",
  99948. value: function xyArray() {
  99949. var offset = this.bb.__offset(this.bb_pos, 6);
  99950. 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;
  99951. }
  99952. }, {
  99953. key: "z",
  99954. value: function z(index) {
  99955. var offset = this.bb.__offset(this.bb_pos, 8);
  99956. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  99957. }
  99958. }, {
  99959. key: "zLength",
  99960. value: function zLength() {
  99961. var offset = this.bb.__offset(this.bb_pos, 8);
  99962. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99963. }
  99964. }, {
  99965. key: "zArray",
  99966. value: function zArray() {
  99967. var offset = this.bb.__offset(this.bb_pos, 8);
  99968. 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;
  99969. }
  99970. }, {
  99971. key: "m",
  99972. value: function m(index) {
  99973. var offset = this.bb.__offset(this.bb_pos, 10);
  99974. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  99975. }
  99976. }, {
  99977. key: "mLength",
  99978. value: function mLength() {
  99979. var offset = this.bb.__offset(this.bb_pos, 10);
  99980. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99981. }
  99982. }, {
  99983. key: "mArray",
  99984. value: function mArray() {
  99985. var offset = this.bb.__offset(this.bb_pos, 10);
  99986. 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;
  99987. }
  99988. }, {
  99989. key: "t",
  99990. value: function t(index) {
  99991. var offset = this.bb.__offset(this.bb_pos, 12);
  99992. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  99993. }
  99994. }, {
  99995. key: "tLength",
  99996. value: function tLength() {
  99997. var offset = this.bb.__offset(this.bb_pos, 12);
  99998. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  99999. }
  100000. }, {
  100001. key: "tArray",
  100002. value: function tArray() {
  100003. var offset = this.bb.__offset(this.bb_pos, 12);
  100004. 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;
  100005. }
  100006. }, {
  100007. key: "tm",
  100008. value: function tm(index) {
  100009. var offset = this.bb.__offset(this.bb_pos, 14);
  100010. return offset ? this.bb.readUint64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);
  100011. }
  100012. }, {
  100013. key: "tmLength",
  100014. value: function tmLength() {
  100015. var offset = this.bb.__offset(this.bb_pos, 14);
  100016. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  100017. }
  100018. }, {
  100019. key: "type",
  100020. value: function type() {
  100021. var offset = this.bb.__offset(this.bb_pos, 16);
  100022. return offset ? this.bb.readUint8(this.bb_pos + offset) : geometry_type_GeometryType.Unknown;
  100023. }
  100024. }, {
  100025. key: "parts",
  100026. value: function parts(index, obj) {
  100027. var offset = this.bb.__offset(this.bb_pos, 18);
  100028. return offset ? (obj || new Geometry()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  100029. }
  100030. }, {
  100031. key: "partsLength",
  100032. value: function partsLength() {
  100033. var offset = this.bb.__offset(this.bb_pos, 18);
  100034. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  100035. }
  100036. }], [{
  100037. key: "getRootAsGeometry",
  100038. value: function getRootAsGeometry(bb, obj) {
  100039. return (obj || new Geometry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100040. }
  100041. }, {
  100042. key: "getSizePrefixedRootAsGeometry",
  100043. value: function getSizePrefixedRootAsGeometry(bb, obj) {
  100044. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  100045. return (obj || new Geometry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100046. }
  100047. }, {
  100048. key: "startGeometry",
  100049. value: function startGeometry(builder) {
  100050. builder.startObject(8);
  100051. }
  100052. }, {
  100053. key: "addEnds",
  100054. value: function addEnds(builder, endsOffset) {
  100055. builder.addFieldOffset(0, endsOffset, 0);
  100056. }
  100057. }, {
  100058. key: "createEndsVector",
  100059. value: function createEndsVector(builder, data) {
  100060. builder.startVector(4, data.length, 4);
  100061. for (var i = data.length - 1; i >= 0; i--) {
  100062. builder.addInt32(data[i]);
  100063. }
  100064. return builder.endVector();
  100065. }
  100066. }, {
  100067. key: "startEndsVector",
  100068. value: function startEndsVector(builder, numElems) {
  100069. builder.startVector(4, numElems, 4);
  100070. }
  100071. }, {
  100072. key: "addXy",
  100073. value: function addXy(builder, xyOffset) {
  100074. builder.addFieldOffset(1, xyOffset, 0);
  100075. }
  100076. }, {
  100077. key: "createXyVector",
  100078. value: function createXyVector(builder, data) {
  100079. builder.startVector(8, data.length, 8);
  100080. for (var i = data.length - 1; i >= 0; i--) {
  100081. builder.addFloat64(data[i]);
  100082. }
  100083. return builder.endVector();
  100084. }
  100085. }, {
  100086. key: "startXyVector",
  100087. value: function startXyVector(builder, numElems) {
  100088. builder.startVector(8, numElems, 8);
  100089. }
  100090. }, {
  100091. key: "addZ",
  100092. value: function addZ(builder, zOffset) {
  100093. builder.addFieldOffset(2, zOffset, 0);
  100094. }
  100095. }, {
  100096. key: "createZVector",
  100097. value: function createZVector(builder, data) {
  100098. builder.startVector(8, data.length, 8);
  100099. for (var i = data.length - 1; i >= 0; i--) {
  100100. builder.addFloat64(data[i]);
  100101. }
  100102. return builder.endVector();
  100103. }
  100104. }, {
  100105. key: "startZVector",
  100106. value: function startZVector(builder, numElems) {
  100107. builder.startVector(8, numElems, 8);
  100108. }
  100109. }, {
  100110. key: "addM",
  100111. value: function addM(builder, mOffset) {
  100112. builder.addFieldOffset(3, mOffset, 0);
  100113. }
  100114. }, {
  100115. key: "createMVector",
  100116. value: function createMVector(builder, data) {
  100117. builder.startVector(8, data.length, 8);
  100118. for (var i = data.length - 1; i >= 0; i--) {
  100119. builder.addFloat64(data[i]);
  100120. }
  100121. return builder.endVector();
  100122. }
  100123. }, {
  100124. key: "startMVector",
  100125. value: function startMVector(builder, numElems) {
  100126. builder.startVector(8, numElems, 8);
  100127. }
  100128. }, {
  100129. key: "addT",
  100130. value: function addT(builder, tOffset) {
  100131. builder.addFieldOffset(4, tOffset, 0);
  100132. }
  100133. }, {
  100134. key: "createTVector",
  100135. value: function createTVector(builder, data) {
  100136. builder.startVector(8, data.length, 8);
  100137. for (var i = data.length - 1; i >= 0; i--) {
  100138. builder.addFloat64(data[i]);
  100139. }
  100140. return builder.endVector();
  100141. }
  100142. }, {
  100143. key: "startTVector",
  100144. value: function startTVector(builder, numElems) {
  100145. builder.startVector(8, numElems, 8);
  100146. }
  100147. }, {
  100148. key: "addTm",
  100149. value: function addTm(builder, tmOffset) {
  100150. builder.addFieldOffset(5, tmOffset, 0);
  100151. }
  100152. }, {
  100153. key: "createTmVector",
  100154. value: function createTmVector(builder, data) {
  100155. builder.startVector(8, data.length, 8);
  100156. for (var i = data.length - 1; i >= 0; i--) {
  100157. builder.addInt64(data[i]);
  100158. }
  100159. return builder.endVector();
  100160. }
  100161. }, {
  100162. key: "startTmVector",
  100163. value: function startTmVector(builder, numElems) {
  100164. builder.startVector(8, numElems, 8);
  100165. }
  100166. }, {
  100167. key: "addType",
  100168. value: function addType(builder, type) {
  100169. builder.addFieldInt8(6, type, geometry_type_GeometryType.Unknown);
  100170. }
  100171. }, {
  100172. key: "addParts",
  100173. value: function addParts(builder, partsOffset) {
  100174. builder.addFieldOffset(7, partsOffset, 0);
  100175. }
  100176. }, {
  100177. key: "createPartsVector",
  100178. value: function createPartsVector(builder, data) {
  100179. builder.startVector(4, data.length, 4);
  100180. for (var i = data.length - 1; i >= 0; i--) {
  100181. builder.addOffset(data[i]);
  100182. }
  100183. return builder.endVector();
  100184. }
  100185. }, {
  100186. key: "startPartsVector",
  100187. value: function startPartsVector(builder, numElems) {
  100188. builder.startVector(4, numElems, 4);
  100189. }
  100190. }, {
  100191. key: "endGeometry",
  100192. value: function endGeometry(builder) {
  100193. var offset = builder.endObject();
  100194. return offset;
  100195. }
  100196. }, {
  100197. key: "createGeometry",
  100198. value: function createGeometry(builder, endsOffset, xyOffset, zOffset, mOffset, tOffset, tmOffset, type, partsOffset) {
  100199. Geometry.startGeometry(builder);
  100200. Geometry.addEnds(builder, endsOffset);
  100201. Geometry.addXy(builder, xyOffset);
  100202. Geometry.addZ(builder, zOffset);
  100203. Geometry.addM(builder, mOffset);
  100204. Geometry.addT(builder, tOffset);
  100205. Geometry.addTm(builder, tmOffset);
  100206. Geometry.addType(builder, type);
  100207. Geometry.addParts(builder, partsOffset);
  100208. return Geometry.endGeometry(builder);
  100209. }
  100210. }]);
  100211. return Geometry;
  100212. }();
  100213. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/geometry.js
  100214. function geometry_toConsumableArray(arr) { return geometry_arrayWithoutHoles(arr) || geometry_iterableToArray(arr) || geometry_unsupportedIterableToArray(arr) || geometry_nonIterableSpread(); }
  100215. 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."); }
  100216. function geometry_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  100217. function geometry_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return geometry_arrayLikeToArray(arr); }
  100218. function geometry_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; } } }; }
  100219. 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); }
  100220. 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; }
  100221. function geometry_buildGeometry(builder, parsedGeometry) {
  100222. var xy = parsedGeometry.xy,
  100223. z = parsedGeometry.z,
  100224. ends = parsedGeometry.ends,
  100225. parts = parsedGeometry.parts,
  100226. type = parsedGeometry.type;
  100227. if (parts) {
  100228. var partOffsets = parts.map(function (part) {
  100229. return geometry_buildGeometry(builder, part);
  100230. });
  100231. var partsOffset = Geometry.createPartsVector(builder, partOffsets);
  100232. Geometry.startGeometry(builder);
  100233. Geometry.addParts(builder, partsOffset);
  100234. Geometry.addType(builder, type);
  100235. return Geometry.endGeometry(builder);
  100236. }
  100237. var xyOffset = Geometry.createXyVector(builder, xy);
  100238. var zOffset;
  100239. if (z) zOffset = Geometry.createZVector(builder, z);
  100240. var endsOffset;
  100241. if (ends) endsOffset = Geometry.createEndsVector(builder, ends);
  100242. Geometry.startGeometry(builder);
  100243. if (endsOffset) Geometry.addEnds(builder, endsOffset);
  100244. Geometry.addXy(builder, xyOffset);
  100245. if (zOffset) Geometry.addZ(builder, zOffset);
  100246. Geometry.addType(builder, type);
  100247. return Geometry.endGeometry(builder);
  100248. }
  100249. function geometry_flat(a, xy, z) {
  100250. if (a.length === 0) return;
  100251. if (Array.isArray(a[0])) {
  100252. var _iterator = geometry_createForOfIteratorHelper(a),
  100253. _step;
  100254. try {
  100255. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  100256. var sa = _step.value;
  100257. geometry_flat(sa, xy, z);
  100258. }
  100259. } catch (err) {
  100260. _iterator.e(err);
  100261. } finally {
  100262. _iterator.f();
  100263. }
  100264. } else {
  100265. if (a.length === 2) xy.push.apply(xy, geometry_toConsumableArray(a));else {
  100266. xy.push(a[0], a[1]);
  100267. z.push(a[2]);
  100268. }
  100269. }
  100270. }
  100271. function geometry_parseGeometry(geometry, headerGeomType) {
  100272. var xy;
  100273. var ends;
  100274. var parts;
  100275. var type = headerGeomType;
  100276. if (type === GeometryType.Unknown) {
  100277. type = geometry_toGeometryType(geometry.getType());
  100278. }
  100279. if (type === GeometryType.MultiLineString) {
  100280. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  100281. var mlsEnds = geometry.getEnds();
  100282. if (mlsEnds.length > 1) ends = mlsEnds.map(function (e) {
  100283. return e >> 1;
  100284. });
  100285. } else if (type === GeometryType.Polygon) {
  100286. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  100287. var pEnds = geometry.getEnds();
  100288. if (pEnds.length > 1) ends = pEnds.map(function (e) {
  100289. return e >> 1;
  100290. });
  100291. } else if (type === GeometryType.MultiPolygon) {
  100292. var mp = geometry;
  100293. parts = mp.getPolygons().map(function (p) {
  100294. return geometry_parseGeometry(p, GeometryType.Polygon);
  100295. });
  100296. } else {
  100297. if (geometry.getFlatCoordinates) xy = geometry.getFlatCoordinates();
  100298. }
  100299. return {
  100300. xy: xy,
  100301. ends: ends,
  100302. type: type,
  100303. parts: parts
  100304. };
  100305. }
  100306. function pairFlatCoordinates(xy, z) {
  100307. var newArray = [];
  100308. for (var i = 0; i < xy.length; i += 2) {
  100309. var a = [xy[i], xy[i + 1]];
  100310. if (z) a.push(z[i >> 1]);
  100311. newArray.push(a);
  100312. }
  100313. return newArray;
  100314. }
  100315. function geometry_toGeometryType(name) {
  100316. if (!name) return GeometryType.Unknown;
  100317. var type = GeometryType[name];
  100318. return type;
  100319. }
  100320. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/geometry.js
  100321. function geojson_geometry_parseGeometry(geometry) {
  100322. var cs = geometry.coordinates;
  100323. var xy = [];
  100324. var z = [];
  100325. var ends;
  100326. var parts;
  100327. var type = toGeometryType(geometry.type);
  100328. var end = 0;
  100329. switch (geometry.type) {
  100330. case 'Point':
  100331. flat(cs, xy, z);
  100332. break;
  100333. case 'MultiPoint':
  100334. case 'LineString':
  100335. flat(cs, xy, z);
  100336. break;
  100337. case 'MultiLineString':
  100338. case 'Polygon':
  100339. {
  100340. var css = cs;
  100341. flat(css, xy, z);
  100342. if (css.length > 1) ends = css.map(function (c) {
  100343. return end += c.length;
  100344. });
  100345. break;
  100346. }
  100347. case 'MultiPolygon':
  100348. {
  100349. var csss = cs;
  100350. var geometries = csss.map(function (coordinates) {
  100351. return {
  100352. type: 'Polygon',
  100353. coordinates: coordinates
  100354. };
  100355. });
  100356. parts = geometries.map(geojson_geometry_parseGeometry);
  100357. break;
  100358. }
  100359. }
  100360. return {
  100361. xy: xy,
  100362. z: z.length > 0 ? z : undefined,
  100363. ends: ends,
  100364. type: type,
  100365. parts: parts
  100366. };
  100367. }
  100368. function geometry_parseGC(geometry) {
  100369. var type = toGeometryType(geometry.type);
  100370. var parts = [];
  100371. for (var i = 0; i < geometry.geometries.length; i++) {
  100372. var g = geometry.geometries[i];
  100373. if (g.type === 'GeometryCollection') parts.push(geometry_parseGC(g));else parts.push(geojson_geometry_parseGeometry(g));
  100374. }
  100375. return {
  100376. type: type,
  100377. parts: parts
  100378. };
  100379. }
  100380. function extractParts(xy, z, ends) {
  100381. if (!ends || ends.length === 0) return [pairFlatCoordinates(xy, z)];
  100382. var s = 0;
  100383. var xySlices = Array.from(ends).map(function (e) {
  100384. return xy.slice(s, s = e << 1);
  100385. });
  100386. var zSlices;
  100387. if (z) {
  100388. s = 0;
  100389. zSlices = Array.from(ends).map(function (e) {
  100390. return z.slice(s, s = e);
  100391. });
  100392. }
  100393. return xySlices.map(function (xy, i) {
  100394. return pairFlatCoordinates(xy, zSlices ? zSlices[i] : undefined);
  100395. });
  100396. }
  100397. function toGeoJsonCoordinates(geometry, type) {
  100398. var xy = geometry.xyArray();
  100399. var z = geometry.zArray();
  100400. switch (type) {
  100401. case geometry_type_GeometryType.Point:
  100402. {
  100403. var a = Array.from(xy);
  100404. if (z) a.push(z[0]);
  100405. return a;
  100406. }
  100407. case geometry_type_GeometryType.MultiPoint:
  100408. case geometry_type_GeometryType.LineString:
  100409. return pairFlatCoordinates(xy, z);
  100410. case geometry_type_GeometryType.MultiLineString:
  100411. return extractParts(xy, z, geometry.endsArray());
  100412. case geometry_type_GeometryType.Polygon:
  100413. return extractParts(xy, z, geometry.endsArray());
  100414. }
  100415. }
  100416. function fromGeometry(geometry, headerType) {
  100417. var type = headerType;
  100418. if (type === geometry_type_GeometryType.Unknown) {
  100419. type = geometry.type();
  100420. }
  100421. if (type === geometry_type_GeometryType.GeometryCollection) {
  100422. var geometries = [];
  100423. for (var i = 0; i < geometry.partsLength(); i++) {
  100424. var part = geometry.parts(i);
  100425. var partType = part.type();
  100426. geometries.push(fromGeometry(part, partType));
  100427. }
  100428. return {
  100429. type: geometry_type_GeometryType[type],
  100430. geometries: geometries
  100431. };
  100432. } else if (type === geometry_type_GeometryType.MultiPolygon) {
  100433. var _geometries = [];
  100434. for (var _i2 = 0; _i2 < geometry.partsLength(); _i2++) _geometries.push(fromGeometry(geometry.parts(_i2), geometry_type_GeometryType.Polygon));
  100435. return {
  100436. type: geometry_type_GeometryType[type],
  100437. coordinates: _geometries.map(function (g) {
  100438. return g.coordinates;
  100439. })
  100440. };
  100441. }
  100442. var coordinates = toGeoJsonCoordinates(geometry, type);
  100443. return {
  100444. type: geometry_type_GeometryType[type],
  100445. coordinates: coordinates
  100446. };
  100447. }
  100448. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/column-type.js
  100449. var column_type_ColumnType;
  100450. (function (ColumnType) {
  100451. ColumnType[ColumnType["Byte"] = 0] = "Byte";
  100452. ColumnType[ColumnType["UByte"] = 1] = "UByte";
  100453. ColumnType[ColumnType["Bool"] = 2] = "Bool";
  100454. ColumnType[ColumnType["Short"] = 3] = "Short";
  100455. ColumnType[ColumnType["UShort"] = 4] = "UShort";
  100456. ColumnType[ColumnType["Int"] = 5] = "Int";
  100457. ColumnType[ColumnType["UInt"] = 6] = "UInt";
  100458. ColumnType[ColumnType["Long"] = 7] = "Long";
  100459. ColumnType[ColumnType["ULong"] = 8] = "ULong";
  100460. ColumnType[ColumnType["Float"] = 9] = "Float";
  100461. ColumnType[ColumnType["Double"] = 10] = "Double";
  100462. ColumnType[ColumnType["String"] = 11] = "String";
  100463. ColumnType[ColumnType["Json"] = 12] = "Json";
  100464. ColumnType[ColumnType["DateTime"] = 13] = "DateTime";
  100465. ColumnType[ColumnType["Binary"] = 14] = "Binary";
  100466. })(column_type_ColumnType || (column_type_ColumnType = {}));
  100467. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/column.js
  100468. function column_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  100469. 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); } }
  100470. 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; }
  100471. var column_Column = /*#__PURE__*/function () {
  100472. function Column() {
  100473. column_classCallCheck(this, Column);
  100474. this.bb = null;
  100475. this.bb_pos = 0;
  100476. }
  100477. column_createClass(Column, [{
  100478. key: "__init",
  100479. value: function __init(i, bb) {
  100480. this.bb_pos = i;
  100481. this.bb = bb;
  100482. return this;
  100483. }
  100484. }, {
  100485. key: "name",
  100486. value: function name(optionalEncoding) {
  100487. var offset = this.bb.__offset(this.bb_pos, 4);
  100488. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100489. }
  100490. }, {
  100491. key: "type",
  100492. value: function type() {
  100493. var offset = this.bb.__offset(this.bb_pos, 6);
  100494. return offset ? this.bb.readUint8(this.bb_pos + offset) : column_type_ColumnType.Byte;
  100495. }
  100496. }, {
  100497. key: "title",
  100498. value: function title(optionalEncoding) {
  100499. var offset = this.bb.__offset(this.bb_pos, 8);
  100500. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100501. }
  100502. }, {
  100503. key: "description",
  100504. value: function description(optionalEncoding) {
  100505. var offset = this.bb.__offset(this.bb_pos, 10);
  100506. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100507. }
  100508. }, {
  100509. key: "width",
  100510. value: function width() {
  100511. var offset = this.bb.__offset(this.bb_pos, 12);
  100512. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  100513. }
  100514. }, {
  100515. key: "precision",
  100516. value: function precision() {
  100517. var offset = this.bb.__offset(this.bb_pos, 14);
  100518. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  100519. }
  100520. }, {
  100521. key: "scale",
  100522. value: function scale() {
  100523. var offset = this.bb.__offset(this.bb_pos, 16);
  100524. return offset ? this.bb.readInt32(this.bb_pos + offset) : -1;
  100525. }
  100526. }, {
  100527. key: "nullable",
  100528. value: function nullable() {
  100529. var offset = this.bb.__offset(this.bb_pos, 18);
  100530. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : true;
  100531. }
  100532. }, {
  100533. key: "unique",
  100534. value: function unique() {
  100535. var offset = this.bb.__offset(this.bb_pos, 20);
  100536. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  100537. }
  100538. }, {
  100539. key: "primaryKey",
  100540. value: function primaryKey() {
  100541. var offset = this.bb.__offset(this.bb_pos, 22);
  100542. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  100543. }
  100544. }, {
  100545. key: "metadata",
  100546. value: function metadata(optionalEncoding) {
  100547. var offset = this.bb.__offset(this.bb_pos, 24);
  100548. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  100549. }
  100550. }], [{
  100551. key: "getRootAsColumn",
  100552. value: function getRootAsColumn(bb, obj) {
  100553. return (obj || new Column()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100554. }
  100555. }, {
  100556. key: "getSizePrefixedRootAsColumn",
  100557. value: function getSizePrefixedRootAsColumn(bb, obj) {
  100558. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  100559. return (obj || new Column()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100560. }
  100561. }, {
  100562. key: "startColumn",
  100563. value: function startColumn(builder) {
  100564. builder.startObject(11);
  100565. }
  100566. }, {
  100567. key: "addName",
  100568. value: function addName(builder, nameOffset) {
  100569. builder.addFieldOffset(0, nameOffset, 0);
  100570. }
  100571. }, {
  100572. key: "addType",
  100573. value: function addType(builder, type) {
  100574. builder.addFieldInt8(1, type, column_type_ColumnType.Byte);
  100575. }
  100576. }, {
  100577. key: "addTitle",
  100578. value: function addTitle(builder, titleOffset) {
  100579. builder.addFieldOffset(2, titleOffset, 0);
  100580. }
  100581. }, {
  100582. key: "addDescription",
  100583. value: function addDescription(builder, descriptionOffset) {
  100584. builder.addFieldOffset(3, descriptionOffset, 0);
  100585. }
  100586. }, {
  100587. key: "addWidth",
  100588. value: function addWidth(builder, width) {
  100589. builder.addFieldInt32(4, width, -1);
  100590. }
  100591. }, {
  100592. key: "addPrecision",
  100593. value: function addPrecision(builder, precision) {
  100594. builder.addFieldInt32(5, precision, -1);
  100595. }
  100596. }, {
  100597. key: "addScale",
  100598. value: function addScale(builder, scale) {
  100599. builder.addFieldInt32(6, scale, -1);
  100600. }
  100601. }, {
  100602. key: "addNullable",
  100603. value: function addNullable(builder, nullable) {
  100604. builder.addFieldInt8(7, +nullable, +true);
  100605. }
  100606. }, {
  100607. key: "addUnique",
  100608. value: function addUnique(builder, unique) {
  100609. builder.addFieldInt8(8, +unique, +false);
  100610. }
  100611. }, {
  100612. key: "addPrimaryKey",
  100613. value: function addPrimaryKey(builder, primaryKey) {
  100614. builder.addFieldInt8(9, +primaryKey, +false);
  100615. }
  100616. }, {
  100617. key: "addMetadata",
  100618. value: function addMetadata(builder, metadataOffset) {
  100619. builder.addFieldOffset(10, metadataOffset, 0);
  100620. }
  100621. }, {
  100622. key: "endColumn",
  100623. value: function endColumn(builder) {
  100624. var offset = builder.endObject();
  100625. builder.requiredField(offset, 4);
  100626. return offset;
  100627. }
  100628. }, {
  100629. key: "createColumn",
  100630. value: function createColumn(builder, nameOffset, type, titleOffset, descriptionOffset, width, precision, scale, nullable, unique, primaryKey, metadataOffset) {
  100631. Column.startColumn(builder);
  100632. Column.addName(builder, nameOffset);
  100633. Column.addType(builder, type);
  100634. Column.addTitle(builder, titleOffset);
  100635. Column.addDescription(builder, descriptionOffset);
  100636. Column.addWidth(builder, width);
  100637. Column.addPrecision(builder, precision);
  100638. Column.addScale(builder, scale);
  100639. Column.addNullable(builder, nullable);
  100640. Column.addUnique(builder, unique);
  100641. Column.addPrimaryKey(builder, primaryKey);
  100642. Column.addMetadata(builder, metadataOffset);
  100643. return Column.endColumn(builder);
  100644. }
  100645. }]);
  100646. return Column;
  100647. }();
  100648. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/feature.js
  100649. function feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  100650. 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); } }
  100651. 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; }
  100652. var feature_Feature = /*#__PURE__*/function () {
  100653. function Feature() {
  100654. feature_classCallCheck(this, Feature);
  100655. this.bb = null;
  100656. this.bb_pos = 0;
  100657. }
  100658. feature_createClass(Feature, [{
  100659. key: "__init",
  100660. value: function __init(i, bb) {
  100661. this.bb_pos = i;
  100662. this.bb = bb;
  100663. return this;
  100664. }
  100665. }, {
  100666. key: "geometry",
  100667. value: function geometry(obj) {
  100668. var offset = this.bb.__offset(this.bb_pos, 4);
  100669. return offset ? (obj || new geometry_Geometry()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  100670. }
  100671. }, {
  100672. key: "properties",
  100673. value: function properties(index) {
  100674. var offset = this.bb.__offset(this.bb_pos, 6);
  100675. return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
  100676. }
  100677. }, {
  100678. key: "propertiesLength",
  100679. value: function propertiesLength() {
  100680. var offset = this.bb.__offset(this.bb_pos, 6);
  100681. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  100682. }
  100683. }, {
  100684. key: "propertiesArray",
  100685. value: function propertiesArray() {
  100686. var offset = this.bb.__offset(this.bb_pos, 6);
  100687. 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;
  100688. }
  100689. }, {
  100690. key: "columns",
  100691. value: function columns(index, obj) {
  100692. var offset = this.bb.__offset(this.bb_pos, 8);
  100693. return offset ? (obj || new column_Column()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  100694. }
  100695. }, {
  100696. key: "columnsLength",
  100697. value: function columnsLength() {
  100698. var offset = this.bb.__offset(this.bb_pos, 8);
  100699. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  100700. }
  100701. }], [{
  100702. key: "getRootAsFeature",
  100703. value: function getRootAsFeature(bb, obj) {
  100704. return (obj || new Feature()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100705. }
  100706. }, {
  100707. key: "getSizePrefixedRootAsFeature",
  100708. value: function getSizePrefixedRootAsFeature(bb, obj) {
  100709. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  100710. return (obj || new Feature()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  100711. }
  100712. }, {
  100713. key: "startFeature",
  100714. value: function startFeature(builder) {
  100715. builder.startObject(3);
  100716. }
  100717. }, {
  100718. key: "addGeometry",
  100719. value: function addGeometry(builder, geometryOffset) {
  100720. builder.addFieldOffset(0, geometryOffset, 0);
  100721. }
  100722. }, {
  100723. key: "addProperties",
  100724. value: function addProperties(builder, propertiesOffset) {
  100725. builder.addFieldOffset(1, propertiesOffset, 0);
  100726. }
  100727. }, {
  100728. key: "createPropertiesVector",
  100729. value: function createPropertiesVector(builder, data) {
  100730. builder.startVector(1, data.length, 1);
  100731. for (var i = data.length - 1; i >= 0; i--) {
  100732. builder.addInt8(data[i]);
  100733. }
  100734. return builder.endVector();
  100735. }
  100736. }, {
  100737. key: "startPropertiesVector",
  100738. value: function startPropertiesVector(builder, numElems) {
  100739. builder.startVector(1, numElems, 1);
  100740. }
  100741. }, {
  100742. key: "addColumns",
  100743. value: function addColumns(builder, columnsOffset) {
  100744. builder.addFieldOffset(2, columnsOffset, 0);
  100745. }
  100746. }, {
  100747. key: "createColumnsVector",
  100748. value: function createColumnsVector(builder, data) {
  100749. builder.startVector(4, data.length, 4);
  100750. for (var i = data.length - 1; i >= 0; i--) {
  100751. builder.addOffset(data[i]);
  100752. }
  100753. return builder.endVector();
  100754. }
  100755. }, {
  100756. key: "startColumnsVector",
  100757. value: function startColumnsVector(builder, numElems) {
  100758. builder.startVector(4, numElems, 4);
  100759. }
  100760. }, {
  100761. key: "endFeature",
  100762. value: function endFeature(builder) {
  100763. var offset = builder.endObject();
  100764. return offset;
  100765. }
  100766. }, {
  100767. key: "finishFeatureBuffer",
  100768. value: function finishFeatureBuffer(builder, offset) {
  100769. builder.finish(offset);
  100770. }
  100771. }, {
  100772. key: "finishSizePrefixedFeatureBuffer",
  100773. value: function finishSizePrefixedFeatureBuffer(builder, offset) {
  100774. builder.finish(offset, undefined, true);
  100775. }
  100776. }, {
  100777. key: "createFeature",
  100778. value: function createFeature(builder, geometryOffset, propertiesOffset, columnsOffset) {
  100779. Feature.startFeature(builder);
  100780. Feature.addGeometry(builder, geometryOffset);
  100781. Feature.addProperties(builder, propertiesOffset);
  100782. Feature.addColumns(builder, columnsOffset);
  100783. return Feature.endFeature(builder);
  100784. }
  100785. }]);
  100786. return Feature;
  100787. }();
  100788. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/feature.js
  100789. var textEncoder = new TextEncoder();
  100790. var textDecoder = new TextDecoder();
  100791. function fromFeature(feature, header, createGeometry, createFeature) {
  100792. var columns = header.columns;
  100793. var geometry = feature.geometry();
  100794. var simpleGeometry = createGeometry(geometry, header.geometryType);
  100795. var properties = parseProperties(feature, columns);
  100796. return createFeature(simpleGeometry, properties);
  100797. }
  100798. function feature_buildFeature(geometry, properties, header) {
  100799. var columns = header.columns;
  100800. var builder = new flatbuffers.Builder();
  100801. var offset = 0;
  100802. var capacity = 1024;
  100803. var bytes = new Uint8Array(capacity);
  100804. var view = new DataView(bytes.buffer);
  100805. var prep = function prep(size) {
  100806. if (offset + size < capacity) return;
  100807. capacity = Math.max(capacity + size, capacity * 2);
  100808. var newBytes = new Uint8Array(capacity);
  100809. newBytes.set(bytes);
  100810. bytes = newBytes;
  100811. view = new DataView(bytes.buffer);
  100812. };
  100813. if (columns) {
  100814. for (var i = 0; i < columns.length; i++) {
  100815. var column = columns[i];
  100816. var value = properties[column.name];
  100817. if (value === null) continue;
  100818. prep(2);
  100819. view.setUint16(offset, i, true);
  100820. offset += 2;
  100821. switch (column.type) {
  100822. case ColumnType.Bool:
  100823. prep(1);
  100824. view.setUint8(offset, value);
  100825. offset += 1;
  100826. break;
  100827. case ColumnType.Short:
  100828. prep(2);
  100829. view.setInt16(offset, value, true);
  100830. offset += 2;
  100831. break;
  100832. case ColumnType.UShort:
  100833. prep(2);
  100834. view.setUint16(offset, value, true);
  100835. offset += 2;
  100836. break;
  100837. case ColumnType.Int:
  100838. prep(4);
  100839. view.setInt32(offset, value, true);
  100840. offset += 4;
  100841. break;
  100842. case ColumnType.UInt:
  100843. prep(4);
  100844. view.setUint32(offset, value, true);
  100845. offset += 4;
  100846. break;
  100847. case ColumnType.Long:
  100848. prep(8);
  100849. view.setBigInt64(offset, BigInt(value), true);
  100850. offset += 8;
  100851. break;
  100852. case ColumnType.Float:
  100853. prep(4);
  100854. view.setFloat32(offset, value, true);
  100855. offset += 4;
  100856. break;
  100857. case ColumnType.Double:
  100858. prep(8);
  100859. view.setFloat64(offset, value, true);
  100860. offset += 8;
  100861. break;
  100862. case ColumnType.DateTime:
  100863. case ColumnType.String:
  100864. {
  100865. var str = textEncoder.encode(value);
  100866. prep(4);
  100867. view.setUint32(offset, str.length, true);
  100868. offset += 4;
  100869. prep(str.length);
  100870. bytes.set(str, offset);
  100871. offset += str.length;
  100872. break;
  100873. }
  100874. case ColumnType.Json:
  100875. {
  100876. var _str = textEncoder.encode(JSON.stringify(value));
  100877. prep(4);
  100878. view.setUint32(offset, _str.length, true);
  100879. offset += 4;
  100880. prep(_str.length);
  100881. bytes.set(_str, offset);
  100882. offset += _str.length;
  100883. break;
  100884. }
  100885. default:
  100886. throw new Error('Unknown type ' + column.type);
  100887. }
  100888. }
  100889. }
  100890. var propertiesOffset = null;
  100891. if (offset > 0) propertiesOffset = Feature.createPropertiesVector(builder, bytes.slice(0, offset));
  100892. var geometryOffset = buildGeometry(builder, geometry);
  100893. Feature.startFeature(builder);
  100894. Feature.addGeometry(builder, geometryOffset);
  100895. if (propertiesOffset) Feature.addProperties(builder, propertiesOffset);
  100896. var featureOffset = Feature.endFeature(builder);
  100897. builder.finishSizePrefixed(featureOffset);
  100898. return builder.asUint8Array();
  100899. }
  100900. function parseProperties(feature, columns) {
  100901. var properties = {};
  100902. if (!columns || columns.length === 0) return properties;
  100903. var array = feature.propertiesArray();
  100904. if (!array) return properties;
  100905. var view = new DataView(array.buffer, array.byteOffset);
  100906. var length = feature.propertiesLength();
  100907. var offset = 0;
  100908. while (offset < length) {
  100909. var i = view.getUint16(offset, true);
  100910. offset += 2;
  100911. var column = columns[i];
  100912. var name = column.name;
  100913. switch (column.type) {
  100914. case column_type_ColumnType.Bool:
  100915. {
  100916. properties[name] = !!view.getUint8(offset);
  100917. offset += 1;
  100918. break;
  100919. }
  100920. case column_type_ColumnType.Byte:
  100921. {
  100922. properties[name] = view.getInt8(offset);
  100923. offset += 1;
  100924. break;
  100925. }
  100926. case column_type_ColumnType.UByte:
  100927. {
  100928. properties[name] = view.getUint8(offset);
  100929. offset += 1;
  100930. break;
  100931. }
  100932. case column_type_ColumnType.Short:
  100933. {
  100934. properties[name] = view.getInt16(offset, true);
  100935. offset += 2;
  100936. break;
  100937. }
  100938. case column_type_ColumnType.UShort:
  100939. {
  100940. properties[name] = view.getUint16(offset, true);
  100941. offset += 2;
  100942. break;
  100943. }
  100944. case column_type_ColumnType.Int:
  100945. {
  100946. properties[name] = view.getInt32(offset, true);
  100947. offset += 4;
  100948. break;
  100949. }
  100950. case column_type_ColumnType.UInt:
  100951. {
  100952. properties[name] = view.getUint32(offset, true);
  100953. offset += 4;
  100954. break;
  100955. }
  100956. case column_type_ColumnType.Long:
  100957. {
  100958. properties[name] = Number(view.getBigInt64(offset, true));
  100959. offset += 8;
  100960. break;
  100961. }
  100962. case column_type_ColumnType.ULong:
  100963. {
  100964. properties[name] = Number(view.getBigUint64(offset, true));
  100965. offset += 8;
  100966. break;
  100967. }
  100968. case column_type_ColumnType.Float:
  100969. {
  100970. properties[name] = view.getFloat32(offset, true);
  100971. offset += 4;
  100972. break;
  100973. }
  100974. case column_type_ColumnType.Double:
  100975. {
  100976. properties[name] = view.getFloat64(offset, true);
  100977. offset += 8;
  100978. break;
  100979. }
  100980. case column_type_ColumnType.DateTime:
  100981. case column_type_ColumnType.String:
  100982. {
  100983. var _length = view.getUint32(offset, true);
  100984. offset += 4;
  100985. properties[name] = textDecoder.decode(array.subarray(offset, offset + _length));
  100986. offset += _length;
  100987. break;
  100988. }
  100989. case column_type_ColumnType.Json:
  100990. {
  100991. var _length2 = view.getUint32(offset, true);
  100992. offset += 4;
  100993. var str = textDecoder.decode(array.subarray(offset, offset + _length2));
  100994. properties[name] = JSON.parse(str);
  100995. offset += _length2;
  100996. break;
  100997. }
  100998. default:
  100999. throw new Error('Unknown type ' + column.type);
  101000. }
  101001. }
  101002. return properties;
  101003. }
  101004. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/feature.js
  101005. function feature_fromFeature(feature, header) {
  101006. var columns = header.columns;
  101007. var geometry = fromGeometry(feature.geometry(), header.geometryType);
  101008. var geoJsonfeature = {
  101009. type: 'Feature',
  101010. geometry: geometry,
  101011. properties: parseProperties(feature, columns)
  101012. };
  101013. return geoJsonfeature;
  101014. }
  101015. // EXTERNAL MODULE: ./node_modules/slice-source/dist/slice-source.js
  101016. var slice_source = __webpack_require__(3425);
  101017. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/crs.js
  101018. function crs_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101019. 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); } }
  101020. 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; }
  101021. var Crs = /*#__PURE__*/function () {
  101022. function Crs() {
  101023. crs_classCallCheck(this, Crs);
  101024. this.bb = null;
  101025. this.bb_pos = 0;
  101026. }
  101027. crs_createClass(Crs, [{
  101028. key: "__init",
  101029. value: function __init(i, bb) {
  101030. this.bb_pos = i;
  101031. this.bb = bb;
  101032. return this;
  101033. }
  101034. }, {
  101035. key: "org",
  101036. value: function org(optionalEncoding) {
  101037. var offset = this.bb.__offset(this.bb_pos, 4);
  101038. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101039. }
  101040. }, {
  101041. key: "code",
  101042. value: function code() {
  101043. var offset = this.bb.__offset(this.bb_pos, 6);
  101044. return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
  101045. }
  101046. }, {
  101047. key: "name",
  101048. value: function name(optionalEncoding) {
  101049. var offset = this.bb.__offset(this.bb_pos, 8);
  101050. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101051. }
  101052. }, {
  101053. key: "description",
  101054. value: function description(optionalEncoding) {
  101055. var offset = this.bb.__offset(this.bb_pos, 10);
  101056. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101057. }
  101058. }, {
  101059. key: "wkt",
  101060. value: function wkt(optionalEncoding) {
  101061. var offset = this.bb.__offset(this.bb_pos, 12);
  101062. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101063. }
  101064. }, {
  101065. key: "codeString",
  101066. value: function codeString(optionalEncoding) {
  101067. var offset = this.bb.__offset(this.bb_pos, 14);
  101068. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101069. }
  101070. }], [{
  101071. key: "getRootAsCrs",
  101072. value: function getRootAsCrs(bb, obj) {
  101073. return (obj || new Crs()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  101074. }
  101075. }, {
  101076. key: "getSizePrefixedRootAsCrs",
  101077. value: function getSizePrefixedRootAsCrs(bb, obj) {
  101078. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  101079. return (obj || new Crs()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  101080. }
  101081. }, {
  101082. key: "startCrs",
  101083. value: function startCrs(builder) {
  101084. builder.startObject(6);
  101085. }
  101086. }, {
  101087. key: "addOrg",
  101088. value: function addOrg(builder, orgOffset) {
  101089. builder.addFieldOffset(0, orgOffset, 0);
  101090. }
  101091. }, {
  101092. key: "addCode",
  101093. value: function addCode(builder, code) {
  101094. builder.addFieldInt32(1, code, 0);
  101095. }
  101096. }, {
  101097. key: "addName",
  101098. value: function addName(builder, nameOffset) {
  101099. builder.addFieldOffset(2, nameOffset, 0);
  101100. }
  101101. }, {
  101102. key: "addDescription",
  101103. value: function addDescription(builder, descriptionOffset) {
  101104. builder.addFieldOffset(3, descriptionOffset, 0);
  101105. }
  101106. }, {
  101107. key: "addWkt",
  101108. value: function addWkt(builder, wktOffset) {
  101109. builder.addFieldOffset(4, wktOffset, 0);
  101110. }
  101111. }, {
  101112. key: "addCodeString",
  101113. value: function addCodeString(builder, codeStringOffset) {
  101114. builder.addFieldOffset(5, codeStringOffset, 0);
  101115. }
  101116. }, {
  101117. key: "endCrs",
  101118. value: function endCrs(builder) {
  101119. var offset = builder.endObject();
  101120. return offset;
  101121. }
  101122. }, {
  101123. key: "createCrs",
  101124. value: function createCrs(builder, orgOffset, code, nameOffset, descriptionOffset, wktOffset, codeStringOffset) {
  101125. Crs.startCrs(builder);
  101126. Crs.addOrg(builder, orgOffset);
  101127. Crs.addCode(builder, code);
  101128. Crs.addName(builder, nameOffset);
  101129. Crs.addDescription(builder, descriptionOffset);
  101130. Crs.addWkt(builder, wktOffset);
  101131. Crs.addCodeString(builder, codeStringOffset);
  101132. return Crs.endCrs(builder);
  101133. }
  101134. }]);
  101135. return Crs;
  101136. }();
  101137. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/flat-geobuf/header.js
  101138. function header_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101139. 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); } }
  101140. 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; }
  101141. var header_Header = /*#__PURE__*/function () {
  101142. function Header() {
  101143. header_classCallCheck(this, Header);
  101144. this.bb = null;
  101145. this.bb_pos = 0;
  101146. }
  101147. header_createClass(Header, [{
  101148. key: "__init",
  101149. value: function __init(i, bb) {
  101150. this.bb_pos = i;
  101151. this.bb = bb;
  101152. return this;
  101153. }
  101154. }, {
  101155. key: "name",
  101156. value: function name(optionalEncoding) {
  101157. var offset = this.bb.__offset(this.bb_pos, 4);
  101158. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101159. }
  101160. }, {
  101161. key: "envelope",
  101162. value: function envelope(index) {
  101163. var offset = this.bb.__offset(this.bb_pos, 6);
  101164. return offset ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + offset) + index * 8) : 0;
  101165. }
  101166. }, {
  101167. key: "envelopeLength",
  101168. value: function envelopeLength() {
  101169. var offset = this.bb.__offset(this.bb_pos, 6);
  101170. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  101171. }
  101172. }, {
  101173. key: "envelopeArray",
  101174. value: function envelopeArray() {
  101175. var offset = this.bb.__offset(this.bb_pos, 6);
  101176. 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;
  101177. }
  101178. }, {
  101179. key: "geometryType",
  101180. value: function geometryType() {
  101181. var offset = this.bb.__offset(this.bb_pos, 8);
  101182. return offset ? this.bb.readUint8(this.bb_pos + offset) : geometry_type_GeometryType.Unknown;
  101183. }
  101184. }, {
  101185. key: "hasZ",
  101186. value: function hasZ() {
  101187. var offset = this.bb.__offset(this.bb_pos, 10);
  101188. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  101189. }
  101190. }, {
  101191. key: "hasM",
  101192. value: function hasM() {
  101193. var offset = this.bb.__offset(this.bb_pos, 12);
  101194. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  101195. }
  101196. }, {
  101197. key: "hasT",
  101198. value: function hasT() {
  101199. var offset = this.bb.__offset(this.bb_pos, 14);
  101200. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  101201. }
  101202. }, {
  101203. key: "hasTm",
  101204. value: function hasTm() {
  101205. var offset = this.bb.__offset(this.bb_pos, 16);
  101206. return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
  101207. }
  101208. }, {
  101209. key: "columns",
  101210. value: function columns(index, obj) {
  101211. var offset = this.bb.__offset(this.bb_pos, 18);
  101212. return offset ? (obj || new column_Column()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
  101213. }
  101214. }, {
  101215. key: "columnsLength",
  101216. value: function columnsLength() {
  101217. var offset = this.bb.__offset(this.bb_pos, 18);
  101218. return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
  101219. }
  101220. }, {
  101221. key: "featuresCount",
  101222. value: function featuresCount() {
  101223. var offset = this.bb.__offset(this.bb_pos, 20);
  101224. return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
  101225. }
  101226. }, {
  101227. key: "indexNodeSize",
  101228. value: function indexNodeSize() {
  101229. var offset = this.bb.__offset(this.bb_pos, 22);
  101230. return offset ? this.bb.readUint16(this.bb_pos + offset) : 16;
  101231. }
  101232. }, {
  101233. key: "crs",
  101234. value: function crs(obj) {
  101235. var offset = this.bb.__offset(this.bb_pos, 24);
  101236. return offset ? (obj || new Crs()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
  101237. }
  101238. }, {
  101239. key: "title",
  101240. value: function title(optionalEncoding) {
  101241. var offset = this.bb.__offset(this.bb_pos, 26);
  101242. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101243. }
  101244. }, {
  101245. key: "description",
  101246. value: function description(optionalEncoding) {
  101247. var offset = this.bb.__offset(this.bb_pos, 28);
  101248. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101249. }
  101250. }, {
  101251. key: "metadata",
  101252. value: function metadata(optionalEncoding) {
  101253. var offset = this.bb.__offset(this.bb_pos, 30);
  101254. return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
  101255. }
  101256. }], [{
  101257. key: "getRootAsHeader",
  101258. value: function getRootAsHeader(bb, obj) {
  101259. return (obj || new Header()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  101260. }
  101261. }, {
  101262. key: "getSizePrefixedRootAsHeader",
  101263. value: function getSizePrefixedRootAsHeader(bb, obj) {
  101264. bb.setPosition(bb.position() + js_flatbuffers/* SIZE_PREFIX_LENGTH */.XU);
  101265. return (obj || new Header()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
  101266. }
  101267. }, {
  101268. key: "startHeader",
  101269. value: function startHeader(builder) {
  101270. builder.startObject(14);
  101271. }
  101272. }, {
  101273. key: "addName",
  101274. value: function addName(builder, nameOffset) {
  101275. builder.addFieldOffset(0, nameOffset, 0);
  101276. }
  101277. }, {
  101278. key: "addEnvelope",
  101279. value: function addEnvelope(builder, envelopeOffset) {
  101280. builder.addFieldOffset(1, envelopeOffset, 0);
  101281. }
  101282. }, {
  101283. key: "createEnvelopeVector",
  101284. value: function createEnvelopeVector(builder, data) {
  101285. builder.startVector(8, data.length, 8);
  101286. for (var i = data.length - 1; i >= 0; i--) {
  101287. builder.addFloat64(data[i]);
  101288. }
  101289. return builder.endVector();
  101290. }
  101291. }, {
  101292. key: "startEnvelopeVector",
  101293. value: function startEnvelopeVector(builder, numElems) {
  101294. builder.startVector(8, numElems, 8);
  101295. }
  101296. }, {
  101297. key: "addGeometryType",
  101298. value: function addGeometryType(builder, geometryType) {
  101299. builder.addFieldInt8(2, geometryType, geometry_type_GeometryType.Unknown);
  101300. }
  101301. }, {
  101302. key: "addHasZ",
  101303. value: function addHasZ(builder, hasZ) {
  101304. builder.addFieldInt8(3, +hasZ, +false);
  101305. }
  101306. }, {
  101307. key: "addHasM",
  101308. value: function addHasM(builder, hasM) {
  101309. builder.addFieldInt8(4, +hasM, +false);
  101310. }
  101311. }, {
  101312. key: "addHasT",
  101313. value: function addHasT(builder, hasT) {
  101314. builder.addFieldInt8(5, +hasT, +false);
  101315. }
  101316. }, {
  101317. key: "addHasTm",
  101318. value: function addHasTm(builder, hasTm) {
  101319. builder.addFieldInt8(6, +hasTm, +false);
  101320. }
  101321. }, {
  101322. key: "addColumns",
  101323. value: function addColumns(builder, columnsOffset) {
  101324. builder.addFieldOffset(7, columnsOffset, 0);
  101325. }
  101326. }, {
  101327. key: "createColumnsVector",
  101328. value: function createColumnsVector(builder, data) {
  101329. builder.startVector(4, data.length, 4);
  101330. for (var i = data.length - 1; i >= 0; i--) {
  101331. builder.addOffset(data[i]);
  101332. }
  101333. return builder.endVector();
  101334. }
  101335. }, {
  101336. key: "startColumnsVector",
  101337. value: function startColumnsVector(builder, numElems) {
  101338. builder.startVector(4, numElems, 4);
  101339. }
  101340. }, {
  101341. key: "addFeaturesCount",
  101342. value: function addFeaturesCount(builder, featuresCount) {
  101343. builder.addFieldInt64(8, featuresCount, BigInt('0'));
  101344. }
  101345. }, {
  101346. key: "addIndexNodeSize",
  101347. value: function addIndexNodeSize(builder, indexNodeSize) {
  101348. builder.addFieldInt16(9, indexNodeSize, 16);
  101349. }
  101350. }, {
  101351. key: "addCrs",
  101352. value: function addCrs(builder, crsOffset) {
  101353. builder.addFieldOffset(10, crsOffset, 0);
  101354. }
  101355. }, {
  101356. key: "addTitle",
  101357. value: function addTitle(builder, titleOffset) {
  101358. builder.addFieldOffset(11, titleOffset, 0);
  101359. }
  101360. }, {
  101361. key: "addDescription",
  101362. value: function addDescription(builder, descriptionOffset) {
  101363. builder.addFieldOffset(12, descriptionOffset, 0);
  101364. }
  101365. }, {
  101366. key: "addMetadata",
  101367. value: function addMetadata(builder, metadataOffset) {
  101368. builder.addFieldOffset(13, metadataOffset, 0);
  101369. }
  101370. }, {
  101371. key: "endHeader",
  101372. value: function endHeader(builder) {
  101373. var offset = builder.endObject();
  101374. return offset;
  101375. }
  101376. }, {
  101377. key: "finishHeaderBuffer",
  101378. value: function finishHeaderBuffer(builder, offset) {
  101379. builder.finish(offset);
  101380. }
  101381. }, {
  101382. key: "finishSizePrefixedHeaderBuffer",
  101383. value: function finishSizePrefixedHeaderBuffer(builder, offset) {
  101384. builder.finish(offset, undefined, true);
  101385. }
  101386. }]);
  101387. return Header;
  101388. }();
  101389. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/header-meta.js
  101390. function fromByteBuffer(bb) {
  101391. var header = header_Header.getRootAsHeader(bb);
  101392. var featuresCount = header.featuresCount();
  101393. var indexNodeSize = header.indexNodeSize();
  101394. var columns = [];
  101395. for (var j = 0; j < header.columnsLength(); j++) {
  101396. var column = header.columns(j);
  101397. if (!column) throw new Error('Column unexpectedly missing');
  101398. if (!column.name()) throw new Error('Column name unexpectedly missing');
  101399. columns.push({
  101400. name: column.name(),
  101401. type: column.type(),
  101402. title: column.title(),
  101403. description: column.description(),
  101404. width: column.width(),
  101405. precision: column.precision(),
  101406. scale: column.scale(),
  101407. nullable: column.nullable(),
  101408. unique: column.unique(),
  101409. primary_key: column.primaryKey()
  101410. });
  101411. }
  101412. var crs = header.crs();
  101413. var crsMeta = crs ? {
  101414. org: crs.org(),
  101415. code: crs.code(),
  101416. name: crs.name(),
  101417. description: crs.description(),
  101418. wkt: crs.wkt(),
  101419. code_string: crs.codeString()
  101420. } : null;
  101421. var headerMeta = {
  101422. geometryType: header.geometryType(),
  101423. columns: columns,
  101424. envelope: null,
  101425. featuresCount: Number(featuresCount),
  101426. indexNodeSize: indexNodeSize,
  101427. crs: crsMeta,
  101428. title: header.title(),
  101429. description: header.description(),
  101430. metadata: header.metadata()
  101431. };
  101432. return headerMeta;
  101433. }
  101434. // EXTERNAL MODULE: ./node_modules/@repeaterjs/repeater/cjs/repeater.js
  101435. var repeater = __webpack_require__(1351);
  101436. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/config.js
  101437. function config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101438. 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); } }
  101439. 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; }
  101440. var config_Config = /*#__PURE__*/function () {
  101441. function Config() {
  101442. config_classCallCheck(this, Config);
  101443. this._extraRequestThreshold = 256 * 1024;
  101444. }
  101445. config_createClass(Config, [{
  101446. key: "extraRequestThreshold",
  101447. value: function extraRequestThreshold() {
  101448. return this._extraRequestThreshold;
  101449. }
  101450. }, {
  101451. key: "setExtraRequestThreshold",
  101452. value: function setExtraRequestThreshold(bytes) {
  101453. if (bytes < 0) {
  101454. throw new Error('extraRequestThreshold cannot be negative');
  101455. }
  101456. this._extraRequestThreshold = bytes;
  101457. }
  101458. }]);
  101459. return Config;
  101460. }();
  101461. config_Config.global = new config_Config();
  101462. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/logger.js
  101463. function logger_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101464. 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); } }
  101465. 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; }
  101466. var LogLevel;
  101467. (function (LogLevel) {
  101468. LogLevel[LogLevel["Debug"] = 0] = "Debug";
  101469. LogLevel[LogLevel["Info"] = 1] = "Info";
  101470. LogLevel[LogLevel["Warn"] = 2] = "Warn";
  101471. LogLevel[LogLevel["Error"] = 3] = "Error";
  101472. })(LogLevel || (LogLevel = {}));
  101473. var Logger = /*#__PURE__*/function () {
  101474. function Logger() {
  101475. logger_classCallCheck(this, Logger);
  101476. }
  101477. logger_createClass(Logger, null, [{
  101478. key: "debug",
  101479. value: function debug() {
  101480. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  101481. args[_key] = arguments[_key];
  101482. }
  101483. this.log.apply(this, [LogLevel.Debug].concat(args));
  101484. }
  101485. }, {
  101486. key: "info",
  101487. value: function info() {
  101488. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  101489. args[_key2] = arguments[_key2];
  101490. }
  101491. this.log.apply(this, [LogLevel.Info].concat(args));
  101492. }
  101493. }, {
  101494. key: "warn",
  101495. value: function warn() {
  101496. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  101497. args[_key3] = arguments[_key3];
  101498. }
  101499. this.log.apply(this, [LogLevel.Warn].concat(args));
  101500. }
  101501. }, {
  101502. key: "error",
  101503. value: function error() {
  101504. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  101505. args[_key4] = arguments[_key4];
  101506. }
  101507. this.log.apply(this, [LogLevel.Error].concat(args));
  101508. }
  101509. }, {
  101510. key: "log",
  101511. value: function log(level) {
  101512. if (this.logLevel > level) {
  101513. return;
  101514. }
  101515. for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
  101516. args[_key5 - 1] = arguments[_key5];
  101517. }
  101518. switch (level) {
  101519. case LogLevel.Debug:
  101520. {
  101521. var _console;
  101522. (_console = console).debug.apply(_console, args);
  101523. break;
  101524. }
  101525. case LogLevel.Info:
  101526. {
  101527. var _console2;
  101528. (_console2 = console).info.apply(_console2, args);
  101529. break;
  101530. }
  101531. case LogLevel.Warn:
  101532. {
  101533. var _console3;
  101534. (_console3 = console).warn.apply(_console3, args);
  101535. break;
  101536. }
  101537. case LogLevel.Error:
  101538. {
  101539. var _console4;
  101540. (_console4 = console).error.apply(_console4, args);
  101541. break;
  101542. }
  101543. }
  101544. }
  101545. }]);
  101546. return Logger;
  101547. }();
  101548. Logger.logLevel = LogLevel.Info;
  101549. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/packedrtree.js
  101550. 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); }
  101551. 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; }
  101552. function packedrtree_slicedToArray(arr, i) { return packedrtree_arrayWithHoles(arr) || packedrtree_iterableToArrayLimit(arr, i) || packedrtree_unsupportedIterableToArray(arr, i) || packedrtree_nonIterableRest(); }
  101553. function packedrtree_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."); }
  101554. 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); }
  101555. 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; }
  101556. function packedrtree_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; }
  101557. function packedrtree_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  101558. function packedrtree_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101559. 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); } }
  101560. 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; }
  101561. function _awaitAsyncGenerator(value) { return new _OverloadYield(value, 0); }
  101562. function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
  101563. 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); }
  101564. _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); };
  101565. function _OverloadYield(value, kind) { this.v = value, this.k = kind; }
  101566. var NODE_ITEM_LEN = 8 * 4 + 8;
  101567. var DEFAULT_NODE_SIZE = 16;
  101568. function calcTreeSize(numItems, nodeSize) {
  101569. nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);
  101570. var n = numItems;
  101571. var numNodes = n;
  101572. do {
  101573. n = Math.ceil(n / nodeSize);
  101574. numNodes += n;
  101575. } while (n !== 1);
  101576. return numNodes * NODE_ITEM_LEN;
  101577. }
  101578. function generateLevelBounds(numItems, nodeSize) {
  101579. if (nodeSize < 2) throw new Error('Node size must be at least 2');
  101580. if (numItems === 0) throw new Error('Number of items must be greater than 0');
  101581. var n = numItems;
  101582. var numNodes = n;
  101583. var levelNumNodes = [n];
  101584. do {
  101585. n = Math.ceil(n / nodeSize);
  101586. numNodes += n;
  101587. levelNumNodes.push(n);
  101588. } while (n !== 1);
  101589. var levelOffsets = [];
  101590. n = numNodes;
  101591. for (var _i = 0, _levelNumNodes = levelNumNodes; _i < _levelNumNodes.length; _i++) {
  101592. var size = _levelNumNodes[_i];
  101593. levelOffsets.push(n - size);
  101594. n -= size;
  101595. }
  101596. levelOffsets.reverse();
  101597. levelNumNodes.reverse();
  101598. var levelBounds = [];
  101599. for (var i = 0; i < levelNumNodes.length; i++) levelBounds.push([levelOffsets[i], levelOffsets[i] + levelNumNodes[i]]);
  101600. levelBounds.reverse();
  101601. return levelBounds;
  101602. }
  101603. function streamSearch(_x, _x2, _x3, _x4) {
  101604. return _streamSearch.apply(this, arguments);
  101605. }
  101606. function _streamSearch() {
  101607. _streamSearch = _wrapAsyncGenerator( /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _callee(numItems, nodeSize, rect, readNode) {
  101608. var NodeRange, minX, minY, maxX, maxY, levelBounds, leafNodesOffset, rootNodeRange, queue, _loop;
  101609. return packedrtree_regeneratorRuntime().wrap(function _callee$(_context3) {
  101610. while (1) switch (_context3.prev = _context3.next) {
  101611. case 0:
  101612. NodeRange = /*#__PURE__*/function () {
  101613. function NodeRange(nodes, level) {
  101614. packedrtree_classCallCheck(this, NodeRange);
  101615. this._level = level;
  101616. this.nodes = nodes;
  101617. }
  101618. packedrtree_createClass(NodeRange, [{
  101619. key: "level",
  101620. value: function level() {
  101621. return this._level;
  101622. }
  101623. }, {
  101624. key: "startNode",
  101625. value: function startNode() {
  101626. return this.nodes[0];
  101627. }
  101628. }, {
  101629. key: "endNode",
  101630. value: function endNode() {
  101631. return this.nodes[1];
  101632. }
  101633. }, {
  101634. key: "extendEndNodeToNewOffset",
  101635. value: function extendEndNodeToNewOffset(newOffset) {
  101636. console.assert(newOffset > this.nodes[1]);
  101637. this.nodes[1] = newOffset;
  101638. }
  101639. }, {
  101640. key: "toString",
  101641. value: function toString() {
  101642. return "[NodeRange level: ".concat(this._level, ", nodes: ").concat(this.nodes[0], "-").concat(this.nodes[1], "]");
  101643. }
  101644. }]);
  101645. return NodeRange;
  101646. }();
  101647. minX = rect.minX, minY = rect.minY, maxX = rect.maxX, maxY = rect.maxY;
  101648. Logger.info("tree items: ".concat(numItems, ", nodeSize: ").concat(nodeSize));
  101649. levelBounds = generateLevelBounds(numItems, nodeSize);
  101650. leafNodesOffset = levelBounds[0][0];
  101651. rootNodeRange = function () {
  101652. var range = [0, 1];
  101653. var level = levelBounds.length - 1;
  101654. return new NodeRange(range, level);
  101655. }();
  101656. queue = [rootNodeRange];
  101657. Logger.debug("starting stream search with queue: ".concat(queue, ", numItems: ").concat(numItems, ", nodeSize: ").concat(nodeSize, ", levelBounds: ").concat(levelBounds));
  101658. _loop = /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _loop() {
  101659. var nodeRange, nodeIndex, isLeafNode, _levelBounds$nodeRang, levelBound, end, length, buffer, float64Array, uint32Array, _loop2, _ret, pos;
  101660. return packedrtree_regeneratorRuntime().wrap(function _loop$(_context2) {
  101661. while (1) switch (_context2.prev = _context2.next) {
  101662. case 0:
  101663. nodeRange = queue.shift();
  101664. Logger.debug("popped node: ".concat(nodeRange, ", queueLength: ").concat(queue.length));
  101665. nodeIndex = nodeRange.startNode();
  101666. isLeafNode = nodeIndex >= leafNodesOffset;
  101667. _levelBounds$nodeRang = packedrtree_slicedToArray(levelBounds[nodeRange.level()], 2), levelBound = _levelBounds$nodeRang[1];
  101668. end = Math.min(nodeRange.endNode() + nodeSize, levelBound);
  101669. length = end - nodeIndex;
  101670. _context2.next = 9;
  101671. return _awaitAsyncGenerator(readNode(nodeIndex * NODE_ITEM_LEN, length * NODE_ITEM_LEN));
  101672. case 9:
  101673. buffer = _context2.sent;
  101674. float64Array = new Float64Array(buffer);
  101675. uint32Array = new Uint32Array(buffer);
  101676. _loop2 = /*#__PURE__*/packedrtree_regeneratorRuntime().mark(function _loop2(pos) {
  101677. var nodePos, low32Offset, high32Offset, offset, featureLength, extraRequestThresholdNodes, nearestNodeRange, newNodeRange;
  101678. return packedrtree_regeneratorRuntime().wrap(function _loop2$(_context) {
  101679. while (1) switch (_context.prev = _context.next) {
  101680. case 0:
  101681. nodePos = (pos - nodeIndex) * 5;
  101682. if (!(maxX < float64Array[nodePos + 0])) {
  101683. _context.next = 3;
  101684. break;
  101685. }
  101686. return _context.abrupt("return", 0);
  101687. case 3:
  101688. if (!(maxY < float64Array[nodePos + 1])) {
  101689. _context.next = 5;
  101690. break;
  101691. }
  101692. return _context.abrupt("return", 0);
  101693. case 5:
  101694. if (!(minX > float64Array[nodePos + 2])) {
  101695. _context.next = 7;
  101696. break;
  101697. }
  101698. return _context.abrupt("return", 0);
  101699. case 7:
  101700. if (!(minY > float64Array[nodePos + 3])) {
  101701. _context.next = 9;
  101702. break;
  101703. }
  101704. return _context.abrupt("return", 0);
  101705. case 9:
  101706. low32Offset = uint32Array[(nodePos << 1) + 8];
  101707. high32Offset = uint32Array[(nodePos << 1) + 9];
  101708. offset = readUint52(high32Offset, low32Offset);
  101709. if (!isLeafNode) {
  101710. _context.next = 17;
  101711. break;
  101712. }
  101713. featureLength = function () {
  101714. if (pos < numItems - 1) {
  101715. var nextPos = (pos - nodeIndex + 1) * 5;
  101716. var _low32Offset = uint32Array[(nextPos << 1) + 8];
  101717. var _high32Offset = uint32Array[(nextPos << 1) + 9];
  101718. var nextOffset = readUint52(_high32Offset, _low32Offset);
  101719. return nextOffset - offset;
  101720. } else {
  101721. return null;
  101722. }
  101723. }();
  101724. _context.next = 16;
  101725. return [offset, pos - leafNodesOffset, featureLength];
  101726. case 16:
  101727. return _context.abrupt("return", 0);
  101728. case 17:
  101729. extraRequestThresholdNodes = config_Config.global.extraRequestThreshold() / NODE_ITEM_LEN;
  101730. nearestNodeRange = queue[queue.length - 1];
  101731. if (!(nearestNodeRange !== undefined && nearestNodeRange.level() == nodeRange.level() - 1 && offset < nearestNodeRange.endNode() + extraRequestThresholdNodes)) {
  101732. _context.next = 23;
  101733. break;
  101734. }
  101735. Logger.debug("Merging \"nodeRange\" request into existing range: ".concat(nearestNodeRange, ", newOffset: ").concat(nearestNodeRange.endNode(), " -> ").concat(offset));
  101736. nearestNodeRange.extendEndNodeToNewOffset(offset);
  101737. return _context.abrupt("return", 0);
  101738. case 23:
  101739. newNodeRange = function () {
  101740. var level = nodeRange.level() - 1;
  101741. var range = [offset, offset + 1];
  101742. return new NodeRange(range, level);
  101743. }();
  101744. if (nearestNodeRange !== undefined && nearestNodeRange.level() == newNodeRange.level()) {
  101745. Logger.info("Same level, but too far away. Pushing new request at offset: ".concat(offset, " rather than merging with distant ").concat(nearestNodeRange));
  101746. } else {
  101747. Logger.info("Pushing new level for ".concat(newNodeRange, " onto queue with nearestNodeRange: ").concat(nearestNodeRange, " since there's not already a range for this level."));
  101748. }
  101749. queue.push(newNodeRange);
  101750. case 26:
  101751. case "end":
  101752. return _context.stop();
  101753. }
  101754. }, _loop2);
  101755. });
  101756. pos = nodeIndex;
  101757. case 14:
  101758. if (!(pos < end)) {
  101759. _context2.next = 22;
  101760. break;
  101761. }
  101762. return _context2.delegateYield(_loop2(pos), "t0", 16);
  101763. case 16:
  101764. _ret = _context2.t0;
  101765. if (!(_ret === 0)) {
  101766. _context2.next = 19;
  101767. break;
  101768. }
  101769. return _context2.abrupt("continue", 19);
  101770. case 19:
  101771. pos++;
  101772. _context2.next = 14;
  101773. break;
  101774. case 22:
  101775. case "end":
  101776. return _context2.stop();
  101777. }
  101778. }, _loop);
  101779. });
  101780. case 9:
  101781. if (!(queue.length != 0)) {
  101782. _context3.next = 13;
  101783. break;
  101784. }
  101785. return _context3.delegateYield(_loop(), "t0", 11);
  101786. case 11:
  101787. _context3.next = 9;
  101788. break;
  101789. case 13:
  101790. case "end":
  101791. return _context3.stop();
  101792. }
  101793. }, _callee);
  101794. }));
  101795. return _streamSearch.apply(this, arguments);
  101796. }
  101797. function readUint52(high32Bits, low32Bits) {
  101798. if ((high32Bits & 0xfff00000) != 0) {
  101799. throw Error('integer is too large to be safely represented');
  101800. }
  101801. var result = low32Bits + high32Bits * Math.pow(2, 32);
  101802. return result;
  101803. }
  101804. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/constants.js
  101805. var constants_magicbytes = new Uint8Array([0x66, 0x67, 0x62, 0x03, 0x66, 0x67, 0x62, 0x00]);
  101806. var SIZE_PREFIX_LEN = 4;
  101807. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/http-reader.js
  101808. 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); }
  101809. 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; } } }; }
  101810. function http_reader_slicedToArray(arr, i) { return http_reader_arrayWithHoles(arr) || http_reader_iterableToArrayLimit(arr, i) || http_reader_unsupportedIterableToArray(arr, i) || http_reader_nonIterableRest(); }
  101811. 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."); }
  101812. 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); }
  101813. 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; }
  101814. 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; }
  101815. function http_reader_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  101816. 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; }
  101817. 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); } }
  101818. 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); }); }; }
  101819. function http_reader_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  101820. 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); } }
  101821. 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; }
  101822. function http_reader_wrapAsyncGenerator(fn) { return function () { return new http_reader_AsyncGenerator(fn.apply(this, arguments)); }; }
  101823. 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); }
  101824. 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); };
  101825. function http_reader_awaitAsyncGenerator(value) { return new http_reader_OverloadYield(value, 0); }
  101826. 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; }
  101827. function http_reader_OverloadYield(value, kind) { this.v = value, this.k = kind; }
  101828. 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"); }
  101829. 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); }
  101830. var HttpReader = /*#__PURE__*/function () {
  101831. function HttpReader(headerClient, header, headerLength, indexLength) {
  101832. http_reader_classCallCheck(this, HttpReader);
  101833. this.headerClient = headerClient;
  101834. this.header = header;
  101835. this.headerLength = headerLength;
  101836. this.indexLength = indexLength;
  101837. }
  101838. http_reader_createClass(HttpReader, [{
  101839. key: "selectBbox",
  101840. value: function selectBbox(rect) {
  101841. var _this = this;
  101842. return http_reader_wrapAsyncGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee2() {
  101843. var lengthBeforeTree, bufferedClient, readNode, batches, currentBatch, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, searchResult, _searchResult2, featureOffset, _searchResult4, featureLength, guessLength, prevFeature, gap, promises;
  101844. return http_reader_regeneratorRuntime().wrap(function _callee2$(_context2) {
  101845. while (1) switch (_context2.prev = _context2.next) {
  101846. case 0:
  101847. lengthBeforeTree = _this.lengthBeforeTree();
  101848. bufferedClient = _this.headerClient;
  101849. readNode = /*#__PURE__*/function () {
  101850. var _ref = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee(offsetIntoTree, size) {
  101851. var minReqLength;
  101852. return http_reader_regeneratorRuntime().wrap(function _callee$(_context) {
  101853. while (1) switch (_context.prev = _context.next) {
  101854. case 0:
  101855. minReqLength = 0;
  101856. return _context.abrupt("return", bufferedClient.getRange(lengthBeforeTree + offsetIntoTree, size, minReqLength, 'index'));
  101857. case 2:
  101858. case "end":
  101859. return _context.stop();
  101860. }
  101861. }, _callee);
  101862. }));
  101863. return function readNode(_x, _x2) {
  101864. return _ref.apply(this, arguments);
  101865. };
  101866. }();
  101867. batches = [];
  101868. currentBatch = [];
  101869. _iteratorAbruptCompletion = false;
  101870. _didIteratorError = false;
  101871. _context2.prev = 7;
  101872. _iterator = _asyncIterator(streamSearch(_this.header.featuresCount, _this.header.indexNodeSize, rect, readNode));
  101873. case 9:
  101874. _context2.next = 11;
  101875. return http_reader_awaitAsyncGenerator(_iterator.next());
  101876. case 11:
  101877. if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
  101878. _context2.next = 26;
  101879. break;
  101880. }
  101881. searchResult = _step.value;
  101882. _searchResult2 = http_reader_slicedToArray(searchResult, 2), featureOffset = _searchResult2[0];
  101883. _searchResult4 = http_reader_slicedToArray(searchResult, 3), featureLength = _searchResult4[2];
  101884. if (!featureLength) {
  101885. Logger.info('final feature');
  101886. guessLength = config_Config.global.extraRequestThreshold();
  101887. featureLength = guessLength;
  101888. }
  101889. if (!(currentBatch.length == 0)) {
  101890. _context2.next = 19;
  101891. break;
  101892. }
  101893. currentBatch.push([featureOffset, featureLength]);
  101894. return _context2.abrupt("continue", 23);
  101895. case 19:
  101896. prevFeature = currentBatch[currentBatch.length - 1];
  101897. gap = featureOffset - (prevFeature[0] + prevFeature[1]);
  101898. if (gap > config_Config.global.extraRequestThreshold()) {
  101899. Logger.info("Pushing new feature batch, since gap ".concat(gap, " was too large"));
  101900. batches.push(currentBatch);
  101901. currentBatch = [];
  101902. }
  101903. currentBatch.push([featureOffset, featureLength]);
  101904. case 23:
  101905. _iteratorAbruptCompletion = false;
  101906. _context2.next = 9;
  101907. break;
  101908. case 26:
  101909. _context2.next = 32;
  101910. break;
  101911. case 28:
  101912. _context2.prev = 28;
  101913. _context2.t0 = _context2["catch"](7);
  101914. _didIteratorError = true;
  101915. _iteratorError = _context2.t0;
  101916. case 32:
  101917. _context2.prev = 32;
  101918. _context2.prev = 33;
  101919. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  101920. _context2.next = 37;
  101921. break;
  101922. }
  101923. _context2.next = 37;
  101924. return http_reader_awaitAsyncGenerator(_iterator["return"]());
  101925. case 37:
  101926. _context2.prev = 37;
  101927. if (!_didIteratorError) {
  101928. _context2.next = 40;
  101929. break;
  101930. }
  101931. throw _iteratorError;
  101932. case 40:
  101933. return _context2.finish(37);
  101934. case 41:
  101935. return _context2.finish(32);
  101936. case 42:
  101937. _this.headerClient.logUsage('header+index');
  101938. if (currentBatch.length > 0) {
  101939. batches.push(currentBatch);
  101940. }
  101941. promises = batches.flatMap(function (batch) {
  101942. return _this.readFeatureBatch(batch);
  101943. });
  101944. return _context2.delegateYield(_asyncGeneratorDelegate(_asyncIterator(repeater/* Repeater */.ZN.merge(promises)), http_reader_awaitAsyncGenerator), "t1", 46);
  101945. case 46:
  101946. case "end":
  101947. return _context2.stop();
  101948. }
  101949. }, _callee2, null, [[7, 28, 32, 42], [33,, 37, 41]]);
  101950. }))();
  101951. }
  101952. }, {
  101953. key: "lengthBeforeTree",
  101954. value: function lengthBeforeTree() {
  101955. return constants_magicbytes.length + SIZE_PREFIX_LEN + this.headerLength;
  101956. }
  101957. }, {
  101958. key: "lengthBeforeFeatures",
  101959. value: function lengthBeforeFeatures() {
  101960. return this.lengthBeforeTree() + this.indexLength;
  101961. }
  101962. }, {
  101963. key: "buildFeatureClient",
  101964. value: function buildFeatureClient() {
  101965. return new BufferedHttpRangeClient(this.headerClient.httpClient);
  101966. }
  101967. }, {
  101968. key: "readFeatureBatch",
  101969. value: function readFeatureBatch(batch) {
  101970. var _this2 = this;
  101971. return http_reader_wrapAsyncGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee3() {
  101972. var _batch$, firstFeatureOffset, _batch, lastFeatureOffset, lastFeatureLength, batchStart, batchEnd, batchSize, featureClient, _iterator2, _step2, _step2$value2, featureOffset;
  101973. return http_reader_regeneratorRuntime().wrap(function _callee3$(_context3) {
  101974. while (1) switch (_context3.prev = _context3.next) {
  101975. case 0:
  101976. _batch$ = http_reader_slicedToArray(batch[0], 1), firstFeatureOffset = _batch$[0];
  101977. _batch = http_reader_slicedToArray(batch[batch.length - 1], 2), lastFeatureOffset = _batch[0], lastFeatureLength = _batch[1];
  101978. batchStart = firstFeatureOffset;
  101979. batchEnd = lastFeatureOffset + lastFeatureLength;
  101980. batchSize = batchEnd - batchStart;
  101981. featureClient = _this2.buildFeatureClient();
  101982. _iterator2 = http_reader_createForOfIteratorHelper(batch);
  101983. _context3.prev = 7;
  101984. _iterator2.s();
  101985. case 9:
  101986. if ((_step2 = _iterator2.n()).done) {
  101987. _context3.next = 17;
  101988. break;
  101989. }
  101990. _step2$value2 = http_reader_slicedToArray(_step2.value, 1), featureOffset = _step2$value2[0];
  101991. _context3.next = 13;
  101992. return http_reader_awaitAsyncGenerator(_this2.readFeature(featureClient, featureOffset, batchSize));
  101993. case 13:
  101994. _context3.next = 15;
  101995. return _context3.sent;
  101996. case 15:
  101997. _context3.next = 9;
  101998. break;
  101999. case 17:
  102000. _context3.next = 22;
  102001. break;
  102002. case 19:
  102003. _context3.prev = 19;
  102004. _context3.t0 = _context3["catch"](7);
  102005. _iterator2.e(_context3.t0);
  102006. case 22:
  102007. _context3.prev = 22;
  102008. _iterator2.f();
  102009. return _context3.finish(22);
  102010. case 25:
  102011. featureClient.logUsage('feature');
  102012. case 26:
  102013. case "end":
  102014. return _context3.stop();
  102015. }
  102016. }, _callee3, null, [[7, 19, 22, 25]]);
  102017. }))();
  102018. }
  102019. }, {
  102020. key: "readFeature",
  102021. value: function () {
  102022. var _readFeature = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee4(featureClient, featureOffset, minFeatureReqLength) {
  102023. var offset, featureLength, _bytes, byteBuffer, bytes, bytesAligned, bb;
  102024. return http_reader_regeneratorRuntime().wrap(function _callee4$(_context4) {
  102025. while (1) switch (_context4.prev = _context4.next) {
  102026. case 0:
  102027. offset = featureOffset + this.lengthBeforeFeatures();
  102028. _context4.next = 3;
  102029. return featureClient.getRange(offset, 4, minFeatureReqLength, 'feature length');
  102030. case 3:
  102031. _bytes = _context4.sent;
  102032. featureLength = new DataView(_bytes).getUint32(0, true);
  102033. _context4.next = 7;
  102034. return featureClient.getRange(offset + 4, featureLength, minFeatureReqLength, 'feature data');
  102035. case 7:
  102036. byteBuffer = _context4.sent;
  102037. bytes = new Uint8Array(byteBuffer);
  102038. bytesAligned = new Uint8Array(featureLength + SIZE_PREFIX_LEN);
  102039. bytesAligned.set(bytes, SIZE_PREFIX_LEN);
  102040. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytesAligned);
  102041. bb.setPosition(SIZE_PREFIX_LEN);
  102042. return _context4.abrupt("return", feature_Feature.getRootAsFeature(bb));
  102043. case 14:
  102044. case "end":
  102045. return _context4.stop();
  102046. }
  102047. }, _callee4, this);
  102048. }));
  102049. function readFeature(_x3, _x4, _x5) {
  102050. return _readFeature.apply(this, arguments);
  102051. }
  102052. return readFeature;
  102053. }()
  102054. }], [{
  102055. key: "open",
  102056. value: function () {
  102057. var _open = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee5(url) {
  102058. var assumedHeaderLength, headerClient, assumedIndexLength, minReqLength, _bytes2, headerLength, _bytes3, HEADER_MAX_BUFFER_SIZE, bytes, bb, header, indexLength;
  102059. return http_reader_regeneratorRuntime().wrap(function _callee5$(_context5) {
  102060. while (1) switch (_context5.prev = _context5.next) {
  102061. case 0:
  102062. assumedHeaderLength = 2024;
  102063. headerClient = new BufferedHttpRangeClient(url);
  102064. assumedIndexLength = function () {
  102065. var assumedBranchingFactor = DEFAULT_NODE_SIZE;
  102066. var prefetchedLayers = 3;
  102067. var result = 0;
  102068. var i;
  102069. for (i = 0; i < prefetchedLayers; i++) {
  102070. var layer_width = Math.pow(assumedBranchingFactor, i) * NODE_ITEM_LEN;
  102071. result += layer_width;
  102072. }
  102073. return result;
  102074. }();
  102075. minReqLength = assumedHeaderLength + assumedIndexLength;
  102076. Logger.debug("fetching header. minReqLength: ".concat(minReqLength, " (assumedHeaderLength: ").concat(assumedHeaderLength, ", assumedIndexLength: ").concat(assumedIndexLength, ")"));
  102077. _context5.t0 = Uint8Array;
  102078. _context5.next = 8;
  102079. return headerClient.getRange(0, 8, minReqLength, 'header');
  102080. case 8:
  102081. _context5.t1 = _context5.sent;
  102082. _bytes2 = new _context5.t0(_context5.t1);
  102083. if (_bytes2.subarray(0, 3).every(function (v, i) {
  102084. return constants_magicbytes[i] === v;
  102085. })) {
  102086. _context5.next = 13;
  102087. break;
  102088. }
  102089. Logger.error("bytes: ".concat(_bytes2, " != ").concat(constants_magicbytes));
  102090. throw new Error('Not a FlatGeobuf file');
  102091. case 13:
  102092. Logger.debug('magic bytes look good');
  102093. _context5.next = 16;
  102094. return headerClient.getRange(8, 4, minReqLength, 'header');
  102095. case 16:
  102096. _bytes3 = _context5.sent;
  102097. headerLength = new DataView(_bytes3).getUint32(0, true);
  102098. HEADER_MAX_BUFFER_SIZE = 1048576 * 10;
  102099. if (!(headerLength > HEADER_MAX_BUFFER_SIZE || headerLength < 8)) {
  102100. _context5.next = 21;
  102101. break;
  102102. }
  102103. throw new Error('Invalid header size');
  102104. case 21:
  102105. Logger.debug("headerLength: ".concat(headerLength));
  102106. _context5.next = 24;
  102107. return headerClient.getRange(12, headerLength, minReqLength, 'header');
  102108. case 24:
  102109. bytes = _context5.sent;
  102110. bb = new js_flatbuffers/* ByteBuffer */.cZ(new Uint8Array(bytes));
  102111. header = fromByteBuffer(bb);
  102112. indexLength = calcTreeSize(header.featuresCount, header.indexNodeSize);
  102113. Logger.debug('completed: opening http reader');
  102114. return _context5.abrupt("return", new HttpReader(headerClient, header, headerLength, indexLength));
  102115. case 30:
  102116. case "end":
  102117. return _context5.stop();
  102118. }
  102119. }, _callee5);
  102120. }));
  102121. function open(_x6) {
  102122. return _open.apply(this, arguments);
  102123. }
  102124. return open;
  102125. }()
  102126. }]);
  102127. return HttpReader;
  102128. }();
  102129. var BufferedHttpRangeClient = /*#__PURE__*/function () {
  102130. function BufferedHttpRangeClient(source) {
  102131. http_reader_classCallCheck(this, BufferedHttpRangeClient);
  102132. this.bytesEverUsed = 0;
  102133. this.bytesEverFetched = 0;
  102134. this.buffer = new ArrayBuffer(0);
  102135. this.head = 0;
  102136. if (typeof source === 'string') {
  102137. this.httpClient = new HttpRangeClient(source);
  102138. } else {
  102139. this.httpClient = source;
  102140. }
  102141. }
  102142. http_reader_createClass(BufferedHttpRangeClient, [{
  102143. key: "getRange",
  102144. value: function () {
  102145. var _getRange = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee6(start, length, minReqLength, purpose) {
  102146. var start_i, end_i, lengthToFetch;
  102147. return http_reader_regeneratorRuntime().wrap(function _callee6$(_context6) {
  102148. while (1) switch (_context6.prev = _context6.next) {
  102149. case 0:
  102150. this.bytesEverUsed += length;
  102151. start_i = start - this.head;
  102152. end_i = start_i + length;
  102153. if (!(start_i >= 0 && end_i <= this.buffer.byteLength)) {
  102154. _context6.next = 5;
  102155. break;
  102156. }
  102157. return _context6.abrupt("return", this.buffer.slice(start_i, end_i));
  102158. case 5:
  102159. lengthToFetch = Math.max(length, minReqLength);
  102160. this.bytesEverFetched += lengthToFetch;
  102161. Logger.debug("requesting for new Range: ".concat(start, "-").concat(start + length - 1));
  102162. _context6.next = 10;
  102163. return this.httpClient.getRange(start, lengthToFetch, purpose);
  102164. case 10:
  102165. this.buffer = _context6.sent;
  102166. this.head = start;
  102167. return _context6.abrupt("return", this.buffer.slice(0, length));
  102168. case 13:
  102169. case "end":
  102170. return _context6.stop();
  102171. }
  102172. }, _callee6, this);
  102173. }));
  102174. function getRange(_x7, _x8, _x9, _x10) {
  102175. return _getRange.apply(this, arguments);
  102176. }
  102177. return getRange;
  102178. }()
  102179. }, {
  102180. key: "logUsage",
  102181. value: function logUsage(purpose) {
  102182. var category = purpose.split(' ')[0];
  102183. var used = this.bytesEverUsed;
  102184. var requested = this.bytesEverFetched;
  102185. var efficiency = (100.0 * used / requested).toFixed(2);
  102186. Logger.info("".concat(category, " bytes used/requested: ").concat(used, " / ").concat(requested, " = ").concat(efficiency, "%"));
  102187. }
  102188. }]);
  102189. return BufferedHttpRangeClient;
  102190. }();
  102191. var HttpRangeClient = /*#__PURE__*/function () {
  102192. function HttpRangeClient(url) {
  102193. http_reader_classCallCheck(this, HttpRangeClient);
  102194. this.requestsEverMade = 0;
  102195. this.bytesEverRequested = 0;
  102196. this.url = url;
  102197. }
  102198. http_reader_createClass(HttpRangeClient, [{
  102199. key: "getRange",
  102200. value: function () {
  102201. var _getRange2 = http_reader_asyncToGenerator( /*#__PURE__*/http_reader_regeneratorRuntime().mark(function _callee7(begin, length, purpose) {
  102202. var range, response;
  102203. return http_reader_regeneratorRuntime().wrap(function _callee7$(_context7) {
  102204. while (1) switch (_context7.prev = _context7.next) {
  102205. case 0:
  102206. this.requestsEverMade += 1;
  102207. this.bytesEverRequested += length;
  102208. range = "bytes=".concat(begin, "-").concat(begin + length - 1);
  102209. Logger.info("request: #".concat(this.requestsEverMade, ", purpose: ").concat(purpose, "), bytes: (this_request: ").concat(length, ", ever: ").concat(this.bytesEverRequested, "), Range: ").concat(range));
  102210. _context7.next = 6;
  102211. return fetch(this.url, {
  102212. headers: {
  102213. Range: range
  102214. }
  102215. });
  102216. case 6:
  102217. response = _context7.sent;
  102218. return _context7.abrupt("return", response.arrayBuffer());
  102219. case 8:
  102220. case "end":
  102221. return _context7.stop();
  102222. }
  102223. }, _callee7, this);
  102224. }));
  102225. function getRange(_x11, _x12, _x13) {
  102226. return _getRange2.apply(this, arguments);
  102227. }
  102228. return getRange;
  102229. }()
  102230. }]);
  102231. return HttpRangeClient;
  102232. }();
  102233. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/header.js
  102234. 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; } } }; }
  102235. 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); }
  102236. 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; }
  102237. function featureGeomType(feature) {
  102238. if (feature.getGeometry) {
  102239. return toGeometryType(feature.getGeometry().getType());
  102240. } else {
  102241. return toGeometryType(feature.geometry.type);
  102242. }
  102243. }
  102244. function header_inferGeometryType(features) {
  102245. var geometryType = undefined;
  102246. var _iterator = header_createForOfIteratorHelper(features),
  102247. _step;
  102248. try {
  102249. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  102250. var f = _step.value;
  102251. if (geometryType === GeometryType.Unknown) {
  102252. break;
  102253. }
  102254. var gtype = featureGeomType(f);
  102255. if (geometryType === undefined) {
  102256. geometryType = gtype;
  102257. } else if (geometryType !== gtype) {
  102258. geometryType = GeometryType.Unknown;
  102259. }
  102260. }
  102261. } catch (err) {
  102262. _iterator.e(err);
  102263. } finally {
  102264. _iterator.f();
  102265. }
  102266. if (geometryType === undefined) {
  102267. throw new Error('Could not infer geometry type for collection of features.');
  102268. }
  102269. return geometryType;
  102270. }
  102271. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/generic/featurecollection.js
  102272. 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); }
  102273. 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; }
  102274. 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); } }
  102275. 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); }); }; }
  102276. 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; } } }; }
  102277. 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); }
  102278. 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; }
  102279. 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"); }
  102280. 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); }
  102281. function featurecollection_awaitAsyncGenerator(value) { return new featurecollection_OverloadYield(value, 0); }
  102282. function featurecollection_wrapAsyncGenerator(fn) { return function () { return new featurecollection_AsyncGenerator(fn.apply(this, arguments)); }; }
  102283. 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); }
  102284. 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); };
  102285. function featurecollection_OverloadYield(value, kind) { this.v = value, this.k = kind; }
  102286. function serialize(features) {
  102287. var headerMeta = introspectHeaderMeta(features);
  102288. var header = featurecollection_buildHeader(headerMeta);
  102289. var featureBuffers = features.map(function (f) {
  102290. if (!f.getGeometry) throw new Error('Missing getGeometry implementation');
  102291. if (!f.getProperties) throw new Error('Missing getProperties implementation');
  102292. return buildFeature(parseGeometry(f.getGeometry(), headerMeta.geometryType), f.getProperties(), headerMeta);
  102293. });
  102294. var featuresLength = featureBuffers.map(function (f) {
  102295. return f.length;
  102296. }).reduce(function (a, b) {
  102297. return a + b;
  102298. });
  102299. var uint8 = new Uint8Array(magicbytes.length + header.length + featuresLength);
  102300. uint8.set(header, magicbytes.length);
  102301. var offset = magicbytes.length + header.length;
  102302. var _iterator2 = featurecollection_createForOfIteratorHelper(featureBuffers),
  102303. _step2;
  102304. try {
  102305. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  102306. var feature = _step2.value;
  102307. uint8.set(feature, offset);
  102308. offset += feature.length;
  102309. }
  102310. } catch (err) {
  102311. _iterator2.e(err);
  102312. } finally {
  102313. _iterator2.f();
  102314. }
  102315. uint8.set(magicbytes);
  102316. return uint8;
  102317. }
  102318. function deserialize(bytes, fromFeature, headerMetaFn) {
  102319. if (!bytes.subarray(0, 3).every(function (v, i) {
  102320. return constants_magicbytes[i] === v;
  102321. })) throw new Error('Not a FlatGeobuf file');
  102322. var bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  102323. var headerLength = bb.readUint32(constants_magicbytes.length);
  102324. bb.setPosition(constants_magicbytes.length + SIZE_PREFIX_LEN);
  102325. var headerMeta = fromByteBuffer(bb);
  102326. if (headerMetaFn) headerMetaFn(headerMeta);
  102327. var offset = constants_magicbytes.length + SIZE_PREFIX_LEN + headerLength;
  102328. var indexNodeSize = headerMeta.indexNodeSize,
  102329. featuresCount = headerMeta.featuresCount;
  102330. if (indexNodeSize > 0) offset += calcTreeSize(featuresCount, indexNodeSize);
  102331. var features = [];
  102332. while (offset < bb.capacity()) {
  102333. var featureLength = bb.readUint32(offset);
  102334. bb.setPosition(offset + SIZE_PREFIX_LEN);
  102335. var feature = feature_Feature.getRootAsFeature(bb);
  102336. features.push(fromFeature(feature, headerMeta));
  102337. offset += SIZE_PREFIX_LEN + featureLength;
  102338. }
  102339. return features;
  102340. }
  102341. function deserializeStream(_x, _x2, _x3) {
  102342. return _deserializeStream.apply(this, arguments);
  102343. }
  102344. function _deserializeStream() {
  102345. _deserializeStream = featurecollection_wrapAsyncGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee2(stream, fromFeature, headerMetaFn) {
  102346. var reader, read, bytes, bb, headerLength, headerMeta, indexNodeSize, featuresCount, treeSize, feature;
  102347. return featurecollection_regeneratorRuntime().wrap(function _callee2$(_context2) {
  102348. while (1) switch (_context2.prev = _context2.next) {
  102349. case 0:
  102350. reader = slice_source(stream);
  102351. read = /*#__PURE__*/function () {
  102352. var _ref = featurecollection_asyncToGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee(size) {
  102353. return featurecollection_regeneratorRuntime().wrap(function _callee$(_context) {
  102354. while (1) switch (_context.prev = _context.next) {
  102355. case 0:
  102356. _context.next = 2;
  102357. return reader.slice(size);
  102358. case 2:
  102359. return _context.abrupt("return", _context.sent);
  102360. case 3:
  102361. case "end":
  102362. return _context.stop();
  102363. }
  102364. }, _callee);
  102365. }));
  102366. return function read(_x8) {
  102367. return _ref.apply(this, arguments);
  102368. };
  102369. }();
  102370. _context2.t0 = Uint8Array;
  102371. _context2.next = 5;
  102372. return featurecollection_awaitAsyncGenerator(read(8, 'magic bytes'));
  102373. case 5:
  102374. _context2.t1 = _context2.sent;
  102375. bytes = new _context2.t0(_context2.t1);
  102376. if (bytes.subarray(0, 3).every(function (v, i) {
  102377. return constants_magicbytes[i] === v;
  102378. })) {
  102379. _context2.next = 9;
  102380. break;
  102381. }
  102382. throw new Error('Not a FlatGeobuf file');
  102383. case 9:
  102384. _context2.t2 = Uint8Array;
  102385. _context2.next = 12;
  102386. return featurecollection_awaitAsyncGenerator(read(4, 'header length'));
  102387. case 12:
  102388. _context2.t3 = _context2.sent;
  102389. bytes = new _context2.t2(_context2.t3);
  102390. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  102391. headerLength = bb.readUint32(0);
  102392. _context2.t4 = Uint8Array;
  102393. _context2.next = 19;
  102394. return featurecollection_awaitAsyncGenerator(read(headerLength, 'header data'));
  102395. case 19:
  102396. _context2.t5 = _context2.sent;
  102397. bytes = new _context2.t4(_context2.t5);
  102398. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  102399. headerMeta = fromByteBuffer(bb);
  102400. if (headerMetaFn) headerMetaFn(headerMeta);
  102401. indexNodeSize = headerMeta.indexNodeSize, featuresCount = headerMeta.featuresCount;
  102402. if (!(indexNodeSize > 0)) {
  102403. _context2.next = 29;
  102404. break;
  102405. }
  102406. treeSize = calcTreeSize(featuresCount, indexNodeSize);
  102407. _context2.next = 29;
  102408. return featurecollection_awaitAsyncGenerator(read(treeSize, 'entire index, w/o rect'));
  102409. case 29:
  102410. _context2.next = 31;
  102411. return featurecollection_awaitAsyncGenerator(readFeature(read, headerMeta, fromFeature));
  102412. case 31:
  102413. if (!(feature = _context2.sent)) {
  102414. _context2.next = 36;
  102415. break;
  102416. }
  102417. _context2.next = 34;
  102418. return feature;
  102419. case 34:
  102420. _context2.next = 29;
  102421. break;
  102422. case 36:
  102423. case "end":
  102424. return _context2.stop();
  102425. }
  102426. }, _callee2);
  102427. }));
  102428. return _deserializeStream.apply(this, arguments);
  102429. }
  102430. function deserializeFiltered(_x4, _x5, _x6, _x7) {
  102431. return _deserializeFiltered.apply(this, arguments);
  102432. }
  102433. function _deserializeFiltered() {
  102434. _deserializeFiltered = featurecollection_wrapAsyncGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee3(url, rect, fromFeature, headerMetaFn) {
  102435. var reader, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, feature;
  102436. return featurecollection_regeneratorRuntime().wrap(function _callee3$(_context3) {
  102437. while (1) switch (_context3.prev = _context3.next) {
  102438. case 0:
  102439. _context3.next = 2;
  102440. return featurecollection_awaitAsyncGenerator(HttpReader.open(url));
  102441. case 2:
  102442. reader = _context3.sent;
  102443. Logger.debug('opened reader');
  102444. if (headerMetaFn) headerMetaFn(reader.header);
  102445. _iteratorAbruptCompletion = false;
  102446. _didIteratorError = false;
  102447. _context3.prev = 7;
  102448. _iterator = featurecollection_asyncIterator(reader.selectBbox(rect));
  102449. case 9:
  102450. _context3.next = 11;
  102451. return featurecollection_awaitAsyncGenerator(_iterator.next());
  102452. case 11:
  102453. if (!(_iteratorAbruptCompletion = !(_step = _context3.sent).done)) {
  102454. _context3.next = 18;
  102455. break;
  102456. }
  102457. feature = _step.value;
  102458. _context3.next = 15;
  102459. return fromFeature(feature, reader.header);
  102460. case 15:
  102461. _iteratorAbruptCompletion = false;
  102462. _context3.next = 9;
  102463. break;
  102464. case 18:
  102465. _context3.next = 24;
  102466. break;
  102467. case 20:
  102468. _context3.prev = 20;
  102469. _context3.t0 = _context3["catch"](7);
  102470. _didIteratorError = true;
  102471. _iteratorError = _context3.t0;
  102472. case 24:
  102473. _context3.prev = 24;
  102474. _context3.prev = 25;
  102475. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  102476. _context3.next = 29;
  102477. break;
  102478. }
  102479. _context3.next = 29;
  102480. return featurecollection_awaitAsyncGenerator(_iterator["return"]());
  102481. case 29:
  102482. _context3.prev = 29;
  102483. if (!_didIteratorError) {
  102484. _context3.next = 32;
  102485. break;
  102486. }
  102487. throw _iteratorError;
  102488. case 32:
  102489. return _context3.finish(29);
  102490. case 33:
  102491. return _context3.finish(24);
  102492. case 34:
  102493. case "end":
  102494. return _context3.stop();
  102495. }
  102496. }, _callee3, null, [[7, 20, 24, 34], [25,, 29, 33]]);
  102497. }));
  102498. return _deserializeFiltered.apply(this, arguments);
  102499. }
  102500. function readFeature(_x9, _x10, _x11) {
  102501. return _readFeature.apply(this, arguments);
  102502. }
  102503. function _readFeature() {
  102504. _readFeature = featurecollection_asyncToGenerator( /*#__PURE__*/featurecollection_regeneratorRuntime().mark(function _callee4(read, headerMeta, fromFeature) {
  102505. var bytes, bb, featureLength, bytesAligned, feature;
  102506. return featurecollection_regeneratorRuntime().wrap(function _callee4$(_context4) {
  102507. while (1) switch (_context4.prev = _context4.next) {
  102508. case 0:
  102509. _context4.t0 = Uint8Array;
  102510. _context4.next = 3;
  102511. return read(4, 'feature length');
  102512. case 3:
  102513. _context4.t1 = _context4.sent;
  102514. bytes = new _context4.t0(_context4.t1);
  102515. if (!(bytes.byteLength === 0)) {
  102516. _context4.next = 7;
  102517. break;
  102518. }
  102519. return _context4.abrupt("return");
  102520. case 7:
  102521. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytes);
  102522. featureLength = bb.readUint32(0);
  102523. _context4.t2 = Uint8Array;
  102524. _context4.next = 12;
  102525. return read(featureLength, 'feature data');
  102526. case 12:
  102527. _context4.t3 = _context4.sent;
  102528. bytes = new _context4.t2(_context4.t3);
  102529. bytesAligned = new Uint8Array(featureLength + 4);
  102530. bytesAligned.set(bytes, 4);
  102531. bb = new js_flatbuffers/* ByteBuffer */.cZ(bytesAligned);
  102532. bb.setPosition(SIZE_PREFIX_LEN);
  102533. feature = feature_Feature.getRootAsFeature(bb);
  102534. return _context4.abrupt("return", fromFeature(feature, headerMeta));
  102535. case 20:
  102536. case "end":
  102537. return _context4.stop();
  102538. }
  102539. }, _callee4);
  102540. }));
  102541. return _readFeature.apply(this, arguments);
  102542. }
  102543. function buildColumn(builder, column) {
  102544. var nameOffset = builder.createString(column.name);
  102545. Column.startColumn(builder);
  102546. Column.addName(builder, nameOffset);
  102547. Column.addType(builder, column.type);
  102548. return Column.endColumn(builder);
  102549. }
  102550. function featurecollection_buildHeader(header) {
  102551. var builder = new flatbuffers.Builder();
  102552. var columnOffsets = null;
  102553. if (header.columns) columnOffsets = Header.createColumnsVector(builder, header.columns.map(function (c) {
  102554. return buildColumn(builder, c);
  102555. }));
  102556. var nameOffset = builder.createString('L1');
  102557. Header.startHeader(builder);
  102558. Header.addFeaturesCount(builder, BigInt(header.featuresCount));
  102559. Header.addGeometryType(builder, header.geometryType);
  102560. Header.addIndexNodeSize(builder, 0);
  102561. if (columnOffsets) Header.addColumns(builder, columnOffsets);
  102562. Header.addName(builder, nameOffset);
  102563. var offset = Header.endHeader(builder);
  102564. builder.finishSizePrefixed(offset);
  102565. return builder.asUint8Array();
  102566. }
  102567. function valueToType(value) {
  102568. if (typeof value === 'boolean') return ColumnType.Bool;else if (typeof value === 'number') {
  102569. if (value % 1 === 0) return ColumnType.Int;else return ColumnType.Double;
  102570. } 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, "')"));
  102571. }
  102572. function featurecollection_mapColumn(properties, k) {
  102573. return {
  102574. name: k,
  102575. type: valueToType(properties[k]),
  102576. title: null,
  102577. description: null,
  102578. width: -1,
  102579. precision: -1,
  102580. scale: -1,
  102581. nullable: true,
  102582. unique: false,
  102583. primary_key: false
  102584. };
  102585. }
  102586. function introspectHeaderMeta(features) {
  102587. var sampleFeature = features[0];
  102588. var properties = sampleFeature.getProperties ? sampleFeature.getProperties() : {};
  102589. var columns = null;
  102590. if (properties) columns = Object.keys(properties).filter(function (key) {
  102591. return key !== 'geometry';
  102592. }).map(function (k) {
  102593. return featurecollection_mapColumn(properties, k);
  102594. });
  102595. var geometryType = inferGeometryType(features);
  102596. var headerMeta = {
  102597. geometryType: geometryType,
  102598. columns: columns,
  102599. envelope: null,
  102600. featuresCount: features.length,
  102601. indexNodeSize: 0,
  102602. crs: null,
  102603. title: null,
  102604. description: null,
  102605. metadata: null
  102606. };
  102607. return headerMeta;
  102608. }
  102609. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson/featurecollection.js
  102610. 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; } } }; }
  102611. 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); }
  102612. 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; }
  102613. function featurecollection_serialize(featurecollection) {
  102614. var headerMeta = featurecollection_introspectHeaderMeta(featurecollection);
  102615. var header = buildHeader(headerMeta);
  102616. var features = featurecollection.features.map(function (f) {
  102617. return buildFeature(f.geometry.type === 'GeometryCollection' ? parseGC(f.geometry) : parseGeometry(f.geometry), f.properties, headerMeta);
  102618. });
  102619. var featuresLength = features.map(function (f) {
  102620. return f.length;
  102621. }).reduce(function (a, b) {
  102622. return a + b;
  102623. });
  102624. var uint8 = new Uint8Array(magicbytes.length + header.length + featuresLength);
  102625. uint8.set(header, magicbytes.length);
  102626. var offset = magicbytes.length + header.length;
  102627. var _iterator = geojson_featurecollection_createForOfIteratorHelper(features),
  102628. _step;
  102629. try {
  102630. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  102631. var feature = _step.value;
  102632. uint8.set(feature, offset);
  102633. offset += feature.length;
  102634. }
  102635. } catch (err) {
  102636. _iterator.e(err);
  102637. } finally {
  102638. _iterator.f();
  102639. }
  102640. uint8.set(magicbytes);
  102641. return uint8;
  102642. }
  102643. function featurecollection_deserialize(bytes, headerMetaFn) {
  102644. var features = deserialize(bytes, feature_fromFeature, headerMetaFn);
  102645. return {
  102646. type: 'FeatureCollection',
  102647. features: features
  102648. };
  102649. }
  102650. function featurecollection_deserializeStream(stream, headerMetaFn) {
  102651. return deserializeStream(stream, feature_fromFeature, headerMetaFn);
  102652. }
  102653. function featurecollection_deserializeFiltered(url, rect, headerMetaFn) {
  102654. return deserializeFiltered(url, rect, feature_fromFeature, headerMetaFn);
  102655. }
  102656. function featurecollection_introspectHeaderMeta(featurecollection) {
  102657. var feature = featurecollection.features[0];
  102658. var properties = feature.properties;
  102659. var columns = null;
  102660. if (properties) columns = Object.keys(properties).map(function (k) {
  102661. return mapColumn(properties, k);
  102662. });
  102663. var geometryType = inferGeometryType(featurecollection.features);
  102664. var headerMeta = {
  102665. geometryType: geometryType,
  102666. columns: columns,
  102667. envelope: null,
  102668. featuresCount: featurecollection.features.length,
  102669. indexNodeSize: 0,
  102670. crs: null,
  102671. title: null,
  102672. description: null,
  102673. metadata: null
  102674. };
  102675. return headerMeta;
  102676. }
  102677. ;// CONCATENATED MODULE: ./node_modules/flatgeobuf/lib/mjs/geojson.js
  102678. function geojson_serialize(geojson) {
  102679. var bytes = fcSerialize(geojson);
  102680. return bytes;
  102681. }
  102682. function geojson_deserialize(input, rect, headerMetaFn) {
  102683. 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);
  102684. }
  102685. ;// CONCATENATED MODULE: ./src/leaflet/overlay/FGBLayer.js
  102686. 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); }
  102687. 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; }
  102688. 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); } }
  102689. 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); }); }; }
  102690. function FGBLayer_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 FGBLayer_AsyncFromSyncIterator(method.call(iterable)); async = "@@asyncIterator", sync = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
  102691. function FGBLayer_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 FGBLayer_AsyncFromSyncIterator = function AsyncFromSyncIterator(s) { this.s = s, this.n = s.next; }, FGBLayer_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 FGBLayer_AsyncFromSyncIterator(s); }
  102692. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102693. * This program are made available under the terms of the Apache License, Version 2.0
  102694. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102695. /**
  102696. * @class FGBLayer
  102697. * @deprecatedclassinstance L.supermap.FGBLayer
  102698. * @classdesc FGB 图层类。该图层把 {@link FlatGeobuf} 格式解析为点线面要素。
  102699. * @version 11.1.0
  102700. * @category Visualization FGB
  102701. * @modulecategory Overlay
  102702. * @extends {L.LayerGroup}
  102703. * @param {string} url - FGB 服务地址,例如:http://localhost:8090/iserver/services/xxx/rest/data/featureResults/newResourceId.fgb。
  102704. * @param {Object} options - 参数。
  102705. * @param {function} [options.pointToLayer] - 定义点要素如何绘制在地图上。
  102706. * @param {function} [options.style] - 定义点、线、面要素样式。参数为{@link L.Path-option}。
  102707. * @param {string} [options.strategy='bbox'] - all为全量加载,要素会以流的方式渲染到地图。 bbox为当前可见范围加载,当地图范围改变时会重新加载要素,此时可以通过idField 参数来标识已被加载过的要素,被标识的要素无需再次加载。idField 参数无效时会清空要素,重新加载。
  102708. * @param {Array} [options.extent] - 加载范围, 参数规范为: [minX, minY, maxX, maxY], 传递此参数后, 图层将使用局部加载。
  102709. * @param {boolean} [options.idField='SmID'] - 是否指定要素字段作为唯一id,当 strategy 为 bbox 时生效。
  102710. * @param {function} [options.featureLoader] - 要素自定义方法。
  102711. * @param {function} [options.onEachFeature] - 要素创建时调用
  102712. * @usage
  102713. * ```
  102714. * // 浏览器
  102715. * <script type="text/javascript" src="{cdn}"></script>
  102716. * <script>
  102717. * new {namespace}.FGBLayer(url, options);
  102718. *
  102719. * </script>
  102720. *
  102721. * // ES6 Import
  102722. * import { FGBLayer } from '{npm}';
  102723. *
  102724. * new FGBLayer(url, options);
  102725. *
  102726. * ```
  102727. */
  102728. var FGBLayer = external_L_default().LayerGroup.extend({
  102729. initialize: function initialize(url, options) {
  102730. this.options = options || {};
  102731. this.strategy = this.options.strategy || 'bbox';
  102732. this._layers = {};
  102733. this.url = url;
  102734. this.previousLayer = null;
  102735. this.loadedExtentsRtree_ = new (rbush_default())();
  102736. this.extent = this.options.extent;
  102737. this._cacheIds = [];
  102738. this._validatedId = false;
  102739. this._checked = false;
  102740. this.idField = this.options.idField || 'SmID';
  102741. this._updateFeaturesFn = this._updateFeatures.bind(this);
  102742. external_L_default().Util.setOptions(this, options);
  102743. },
  102744. onAdd: function onAdd(map) {
  102745. this.map = map;
  102746. var extent = [];
  102747. if (this.strategy === 'bbox') {
  102748. var bounds = map.getBounds();
  102749. extent = [bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth()];
  102750. map.on('moveend', this._updateFeaturesFn);
  102751. }
  102752. if (this.extent) {
  102753. var intersectExtent = getIntersection(this.extent, extent);
  102754. extent = intersectExtent && intersectExtent.length ? intersectExtent : this.extent;
  102755. }
  102756. this._handleFeatures(extent);
  102757. },
  102758. onRemove: function onRemove(map) {
  102759. this.loadedExtentsRtree_.clear();
  102760. this.loadedExtentsRtree_ = null;
  102761. if (this.strategy === 'bbox') {
  102762. map.off('moveend', this._updateFeaturesFn);
  102763. this._cacheIds = [];
  102764. }
  102765. },
  102766. _updateFeatures: function () {
  102767. var _updateFeatures2 = FGBLayer_asyncToGenerator( /*#__PURE__*/FGBLayer_regeneratorRuntime().mark(function _callee(e) {
  102768. var _this = this;
  102769. var map, extent, extentToLoad, alreadyLoaded;
  102770. return FGBLayer_regeneratorRuntime().wrap(function _callee$(_context) {
  102771. while (1) switch (_context.prev = _context.next) {
  102772. case 0:
  102773. map = e.target;
  102774. extent = [map.getBounds().getSouthWest(), map.getBounds().getNorthEast()];
  102775. extentToLoad = [extent[0].lng, extent[0].lat, extent[1].lng, extent[1].lat];
  102776. alreadyLoaded = this._forEachInExtent(extentToLoad, function (object) {
  102777. return _this._containsExtent(object.extent, extentToLoad);
  102778. });
  102779. if (!alreadyLoaded) {
  102780. this._handleFeatures(extentToLoad);
  102781. }
  102782. case 5:
  102783. case "end":
  102784. return _context.stop();
  102785. }
  102786. }, _callee, this);
  102787. }));
  102788. function _updateFeatures(_x) {
  102789. return _updateFeatures2.apply(this, arguments);
  102790. }
  102791. return _updateFeatures;
  102792. }(),
  102793. _handleFeatures: function () {
  102794. var _handleFeatures2 = FGBLayer_asyncToGenerator( /*#__PURE__*/FGBLayer_regeneratorRuntime().mark(function _callee2(extent) {
  102795. var fgbStream, rect, fgb, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, feature, id;
  102796. return FGBLayer_regeneratorRuntime().wrap(function _callee2$(_context2) {
  102797. while (1) switch (_context2.prev = _context2.next) {
  102798. case 0:
  102799. rect = {
  102800. minX: extent[0],
  102801. minY: extent[1],
  102802. maxX: extent[2],
  102803. maxY: extent[3]
  102804. };
  102805. if (extent.length) {
  102806. _context2.next = 7;
  102807. break;
  102808. }
  102809. _context2.next = 4;
  102810. return this._getStream(this.url);
  102811. case 4:
  102812. fgbStream = _context2.sent;
  102813. _context2.next = 9;
  102814. break;
  102815. case 7:
  102816. rect.value = {
  102817. extent: extent.slice()
  102818. };
  102819. this.loadedExtentsRtree_.insert(rect);
  102820. case 9:
  102821. fgb = geojson_deserialize(fgbStream && fgbStream.body || this.url, rect);
  102822. if (!this._validatedId) {
  102823. this.curLayer = external_L_default().geoJSON(null, this.options);
  102824. this.previousLayer && this.removeLayer(this.previousLayer);
  102825. this.previousLayer = this.curLayer;
  102826. this.curLayer.addTo(this);
  102827. }
  102828. _iteratorAbruptCompletion = false;
  102829. _didIteratorError = false;
  102830. _context2.prev = 13;
  102831. _iterator = FGBLayer_asyncIterator(fgb);
  102832. case 15:
  102833. _context2.next = 17;
  102834. return _iterator.next();
  102835. case 17:
  102836. if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
  102837. _context2.next = 31;
  102838. break;
  102839. }
  102840. feature = _step.value;
  102841. if (!(this.strategy === 'bbox')) {
  102842. _context2.next = 26;
  102843. break;
  102844. }
  102845. id = feature.properties[this.idField];
  102846. if (id && !this._validatedId) {
  102847. this._validatedId = true;
  102848. this._checked = true;
  102849. }
  102850. if (!(id && this._checked)) {
  102851. _context2.next = 26;
  102852. break;
  102853. }
  102854. if (!this._cacheIds.includes(id)) {
  102855. _context2.next = 25;
  102856. break;
  102857. }
  102858. return _context2.abrupt("continue", 28);
  102859. case 25:
  102860. this._cacheIds.push(id);
  102861. case 26:
  102862. if (this.options.featureLoader && typeof this.options.featureLoader === 'function') {
  102863. feature = this.options.featureLoader(feature);
  102864. }
  102865. this.curLayer.addData(feature);
  102866. case 28:
  102867. _iteratorAbruptCompletion = false;
  102868. _context2.next = 15;
  102869. break;
  102870. case 31:
  102871. _context2.next = 37;
  102872. break;
  102873. case 33:
  102874. _context2.prev = 33;
  102875. _context2.t0 = _context2["catch"](13);
  102876. _didIteratorError = true;
  102877. _iteratorError = _context2.t0;
  102878. case 37:
  102879. _context2.prev = 37;
  102880. _context2.prev = 38;
  102881. if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
  102882. _context2.next = 42;
  102883. break;
  102884. }
  102885. _context2.next = 42;
  102886. return _iterator["return"]();
  102887. case 42:
  102888. _context2.prev = 42;
  102889. if (!_didIteratorError) {
  102890. _context2.next = 45;
  102891. break;
  102892. }
  102893. throw _iteratorError;
  102894. case 45:
  102895. return _context2.finish(42);
  102896. case 46:
  102897. return _context2.finish(37);
  102898. case 47:
  102899. case "end":
  102900. return _context2.stop();
  102901. }
  102902. }, _callee2, this, [[13, 33, 37, 47], [38,, 42, 46]]);
  102903. }));
  102904. function _handleFeatures(_x2) {
  102905. return _handleFeatures2.apply(this, arguments);
  102906. }
  102907. return _handleFeatures;
  102908. }(),
  102909. _getStream: function _getStream(url) {
  102910. return FGBLayer_asyncToGenerator( /*#__PURE__*/FGBLayer_regeneratorRuntime().mark(function _callee3() {
  102911. return FGBLayer_regeneratorRuntime().wrap(function _callee3$(_context3) {
  102912. while (1) switch (_context3.prev = _context3.next) {
  102913. case 0:
  102914. _context3.next = 2;
  102915. return FetchRequest.get(url, {}, {
  102916. withoutFormatSuffix: true
  102917. }).then(function (response) {
  102918. return response;
  102919. });
  102920. case 2:
  102921. return _context3.abrupt("return", _context3.sent);
  102922. case 3:
  102923. case "end":
  102924. return _context3.stop();
  102925. }
  102926. }, _callee3);
  102927. }))();
  102928. },
  102929. _containsExtent: function _containsExtent(extent1, extent2) {
  102930. return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] && extent1[1] <= extent2[1] && extent2[3] <= extent1[3];
  102931. },
  102932. _getInExtent: function _getInExtent(extent) {
  102933. var bbox = {
  102934. minX: extent[0],
  102935. minY: extent[1],
  102936. maxX: extent[2],
  102937. maxY: extent[3]
  102938. };
  102939. var items = this.loadedExtentsRtree_.search(bbox);
  102940. return items.map(function (item) {
  102941. return item.value;
  102942. });
  102943. },
  102944. _forEachInExtent: function _forEachInExtent(extent, callback) {
  102945. return this._forEach(this._getInExtent(extent), callback);
  102946. },
  102947. _forEach: function _forEach(values, callback) {
  102948. var result;
  102949. for (var i = 0, l = values.length; i < l; i++) {
  102950. result = callback(values[i]);
  102951. if (result) {
  102952. return result;
  102953. }
  102954. }
  102955. return result;
  102956. }
  102957. });
  102958. var fgbLayer = function fgbLayer(url, options) {
  102959. return new FGBLayer(url, options);
  102960. };
  102961. ;// CONCATENATED MODULE: ./src/leaflet/overlay/carto/index.js
  102962. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102963. * This program are made available under the terms of the Apache License, Version 2.0
  102964. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102965. ;// CONCATENATED MODULE: ./src/leaflet/overlay/mapv/index.js
  102966. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102967. * This program are made available under the terms of the Apache License, Version 2.0
  102968. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102969. ;// CONCATENATED MODULE: ./src/leaflet/overlay/theme/index.js
  102970. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102971. * This program are made available under the terms of the Apache License, Version 2.0
  102972. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102973. ;// CONCATENATED MODULE: ./src/leaflet/overlay/vectortile/index.js
  102974. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102975. * This program are made available under the terms of the Apache License, Version 2.0
  102976. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102977. ;// CONCATENATED MODULE: ./src/leaflet/services/KnowledgeGraphService.js
  102978. 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); }
  102979. 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; }
  102980. 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); } }
  102981. 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); }); }; }
  102982. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  102983. * This program are made available under the terms of the Apache License, Version 2.0
  102984. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  102985. /**
  102986. * @class KnowledgeGraphService
  102987. * @category iServer KnowledgeGraph
  102988. * @classdesc 知识图谱服务类。
  102989. * @version 11.1.0
  102990. * @example
  102991. * new KnowledgeGraphService(url)
  102992. * .query(param,function(result){
  102993. * //doSomething
  102994. * })
  102995. * @extends {ServiceBase}
  102996. * @param {string} url - 服务地址。
  102997. * @param {Object} options -参数。
  102998. * @param {string} [options.proxy] - 服务代理地址。
  102999. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103000. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103001. * @param {Object} [options.headers] - 请求头。
  103002. * @usage
  103003. */
  103004. var KnowledgeGraphService_KnowledgeGraphService = ServiceBase.extend({
  103005. initialize: function initialize(url, options) {
  103006. ServiceBase.prototype.initialize.call(this, url, options);
  103007. this._knowledgeGraphService = new KnowledgeGraphService(this.url, options);
  103008. },
  103009. /**
  103010. * @function KnowledgeGraphService.prototype.query
  103011. * @description 通过查询语句查询知识图谱数据。
  103012. * @param {string} cypherQuery - 查询条件。
  103013. * @param {RequestCallback} callback - 回调函数。
  103014. */
  103015. query: function query(cypherQuery, callback) {
  103016. this._knowledgeGraphService.query(cypherQuery, callback);
  103017. },
  103018. // /**
  103019. // * @function KnowledgeGraphService.prototype.getMetaData
  103020. // * @description 获取元信息(展示所有实体类型和关系类型)。
  103021. // * @param {RequestCallback} callback 回调函数。
  103022. // */
  103023. // getMetaData(callback) {
  103024. // this._knowledgeGraphService.getMetaData(callback);
  103025. // },
  103026. /**
  103027. * @function KnowledgeGraphService.prototype.getGraphMaps
  103028. * @description 获取图谱列表。
  103029. * @param {RequestCallback} callback 回调函数。
  103030. */
  103031. getGraphMaps: function getGraphMaps(callback) {
  103032. this._knowledgeGraphService.getGraphMaps(callback);
  103033. },
  103034. /**
  103035. * @function KnowledgeGraphService.prototype.getGraphMap
  103036. * @description 获取图谱图序列化数据。
  103037. * @param {string} params 图谱名称。
  103038. * @param {RequestCallback} callback 回调函数。
  103039. */
  103040. getGraphMap: function getGraphMap(params, callback) {
  103041. this._knowledgeGraphService.getGraphMap(params, callback);
  103042. },
  103043. /**
  103044. * @function KnowledgeGraphService.prototype.getGraphMapData
  103045. * @description 将iServer GraphMap服务的数据格式转换为KnowledgeGraph的数据格式。
  103046. * @param {string} graphMapName - 图谱名称。
  103047. * @returns {Promise} Promise 对象。
  103048. */
  103049. getGraphMapData: function getGraphMapData(graphMapName) {
  103050. var _this = this;
  103051. return KnowledgeGraphService_asyncToGenerator( /*#__PURE__*/KnowledgeGraphService_regeneratorRuntime().mark(function _callee() {
  103052. var res;
  103053. return KnowledgeGraphService_regeneratorRuntime().wrap(function _callee$(_context) {
  103054. while (1) switch (_context.prev = _context.next) {
  103055. case 0:
  103056. _context.next = 2;
  103057. return _this._knowledgeGraphService.getGraphMapData(graphMapName);
  103058. case 2:
  103059. res = _context.sent;
  103060. return _context.abrupt("return", res);
  103061. case 4:
  103062. case "end":
  103063. return _context.stop();
  103064. }
  103065. }, _callee);
  103066. }))();
  103067. }
  103068. });
  103069. var knowledgeGraphService = function knowledgeGraphService(url, options) {
  103070. return new KnowledgeGraphService_KnowledgeGraphService(url, options);
  103071. };
  103072. ;// CONCATENATED MODULE: ./src/leaflet/overlay/GraphMap.js
  103073. 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); }
  103074. 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; }
  103075. 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); } }
  103076. 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); }); }; }
  103077. function GraphMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103078. 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); } }
  103079. 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; }
  103080. 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); }
  103081. 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); }
  103082. 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); }; }
  103083. 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); }
  103084. function GraphMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  103085. 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; } }
  103086. function GraphMap_getPrototypeOf(o) { GraphMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GraphMap_getPrototypeOf(o); }
  103087. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103088. * This program are made available under the terms of the Apache License, Version 2.0
  103089. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103090. /**
  103091. * @class GraphMap
  103092. * @classdesc 对接 iServer GraphMap。
  103093. * @category iServer KnowledgeGraph
  103094. * @version 11.1.0
  103095. * @extends {L.Evented}
  103096. * @param {string} serverUrl - GraphMap服务地址, 例如:http://{iserver}/services/{knowledgeGraph-provider}/restjsr/graph/graphmaps/{graphmap}。
  103097. * @param {Object} [options] - 参数。
  103098. * @param {KnowledgeGraph.Config} [options.config] - KnowledgeGraph的配置项。
  103099. * @param {string} [options.proxy] - 服务代理地址。
  103100. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103101. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103102. * @param {Object} [options.headers] - 请求头。
  103103. * @fires GraphMap#loaded
  103104. * @extends {L.Evented}
  103105. * @usage
  103106. */
  103107. var GraphMap = /*#__PURE__*/function (_L$Evented) {
  103108. GraphMap_inherits(GraphMap, _L$Evented);
  103109. var _super = GraphMap_createSuper(GraphMap);
  103110. function GraphMap() {
  103111. GraphMap_classCallCheck(this, GraphMap);
  103112. return _super.apply(this, arguments);
  103113. }
  103114. GraphMap_createClass(GraphMap, [{
  103115. key: "initialize",
  103116. value: function initialize(serverUrl, options) {
  103117. if (!serverUrl) {
  103118. return;
  103119. }
  103120. /**
  103121. * @member GraphMap.prototype.graph
  103122. * @description KnowledgeGraph的实例.
  103123. *
  103124. */
  103125. this.graph = null;
  103126. /**
  103127. * @member GraphMap.prototype.EVENT_TYPES
  103128. * @description 监听一个自定义事件可用如下方式:
  103129. *
  103130. * 支持的事件如下:
  103131. * loaded - 渲染完成时触发。
  103132. */
  103133. this.EVENT_TYPES = ['loaded'];
  103134. var graphMapName = serverUrl.split('/').pop();
  103135. this.url = serverUrl.replace("/graphmaps/".concat(graphMapName), '');
  103136. this.createGraphMap(graphMapName, options);
  103137. }
  103138. /**
  103139. * @private
  103140. * @function GraphMap.prototype.createGraphMap
  103141. * @description 创建图谱。
  103142. * @param {string} graphMapName - 图谱名称
  103143. * @param {Object} options - 配置项
  103144. * @param {string} [options.proxy] - 服务代理地址
  103145. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie
  103146. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求
  103147. * @param {Object} [options.headers] - 请求头。
  103148. * @param {KnowledgeGraph.Config} [options.config] - knowledgegrah配置项。
  103149. */
  103150. }, {
  103151. key: "createGraphMap",
  103152. value: function () {
  103153. var _createGraphMap = GraphMap_asyncToGenerator( /*#__PURE__*/GraphMap_regeneratorRuntime().mark(function _callee(graphMapName, options) {
  103154. var _this = this;
  103155. var res, result;
  103156. return GraphMap_regeneratorRuntime().wrap(function _callee$(_context) {
  103157. while (1) switch (_context.prev = _context.next) {
  103158. case 0:
  103159. this.knowledgeGraphService = this.createKnowledgeGraphService(this.url, options);
  103160. _context.next = 3;
  103161. return this.knowledgeGraphService.getGraphMapData(graphMapName);
  103162. case 3:
  103163. res = _context.sent;
  103164. result = KnowledgeGraph.dataFromGraphMap(res.data, res.graphMap);
  103165. this.graph = new KnowledgeGraph(options && options.config);
  103166. this.graph.on('beforelayout', function () {
  103167. /**
  103168. * @event GraphMap#loaded
  103169. * @description 渲染完成时触发。
  103170. */
  103171. _this.fire(_this.EVENT_TYPES[0]);
  103172. });
  103173. this.graph.setData(result);
  103174. this.graph.handleNodeStatus(transformExpandCollapseHiddenData(res.graphMap));
  103175. case 9:
  103176. case "end":
  103177. return _context.stop();
  103178. }
  103179. }, _callee, this);
  103180. }));
  103181. function createGraphMap(_x, _x2) {
  103182. return _createGraphMap.apply(this, arguments);
  103183. }
  103184. return createGraphMap;
  103185. }()
  103186. /**
  103187. * @private
  103188. * @function GraphMap.prototype.createKnowledgeGraphService
  103189. * @description 创建KnowledgeGraphService实例。
  103190. * @param {string} serverUrl - GraphMap服务地址, 例如:http://{iserver}/services/knowledgeGraph-test/restjsr/graph
  103191. * @param {Object} options - 参数。
  103192. * @param {string} [options.proxy] - 服务代理地址。
  103193. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103194. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103195. * @param {Object} [options.headers] - 请求头。
  103196. */
  103197. }, {
  103198. key: "createKnowledgeGraphService",
  103199. value: function createKnowledgeGraphService(serverUrl, options) {
  103200. return new KnowledgeGraphService_KnowledgeGraphService(serverUrl, options);
  103201. }
  103202. }]);
  103203. return GraphMap;
  103204. }((external_L_default()).Evented);
  103205. ;// CONCATENATED MODULE: ./src/leaflet/overlay/index.js
  103206. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103207. * This program are made available under the terms of the Apache License, Version 2.0
  103208. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103209. ;// CONCATENATED MODULE: ./src/leaflet/services/AddressMatchService.js
  103210. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103211. * This program are made available under the terms of the Apache License, Version 2.0
  103212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103213. /**
  103214. * @class AddressMatchService
  103215. * @deprecatedclassinstance L.supermap.addressMatchService
  103216. * @constructs AddressMatchService
  103217. * @classdesc 地址匹配服务类。
  103218. * @category iServer AddressMatch
  103219. * @modulecategory Services
  103220. * @extends {ServiceBase}
  103221. * @example
  103222. * new AddressMatchService(url,options)
  103223. * .code(function(result){
  103224. * //doSomething
  103225. * })
  103226. * @param {string} url - 服务地址。
  103227. * @param {Object} options - 参数。
  103228. * @param {string} [options.proxy] - 服务代理地址。
  103229. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103230. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103231. * @param {Object} [options.headers] - 请求头。
  103232. * @usage
  103233. */
  103234. var AddressMatchService_AddressMatchService = ServiceBase.extend({
  103235. initialize: function initialize(url, options) {
  103236. ServiceBase.prototype.initialize.call(this, url, options);
  103237. var me = this;
  103238. this._addressMatchService = new AddressMatchService(this.url, {
  103239. proxy: me.options.proxy,
  103240. withCredentials: me.options.withCredentials,
  103241. crossOrigin: me.options.crossOrigin,
  103242. headers: me.options.headers
  103243. });
  103244. },
  103245. /**
  103246. * @function AddressMatchService.prototype.code
  103247. * @description 获取正向地址匹配结果。
  103248. * @param {GeoCodingParameter} params - 正向匹配参数。
  103249. * @param {RequestCallback} callback - 回调函数。
  103250. */
  103251. code: function code(params, callback) {
  103252. this._addressMatchService.code(Util_Util.urlPathAppend(this.url, 'geocoding'), params, callback);
  103253. },
  103254. /**
  103255. * @function AddressMatchService.prototype.decode
  103256. * @description 获取反向地址匹配结果。
  103257. * @param {GeoDecodingParameter} params - 反向匹配参数。
  103258. * @param {RequestCallback} callback - 回调函数。
  103259. */
  103260. decode: function decode(params, callback) {
  103261. this._addressMatchService.decode(Util_Util.urlPathAppend(this.url, 'geodecoding'), params, callback);
  103262. }
  103263. });
  103264. var addressMatchService = function addressMatchService(url, options) {
  103265. return new AddressMatchService_AddressMatchService(url, options);
  103266. };
  103267. ;// CONCATENATED MODULE: ./src/common/iServer/ChartService.js
  103268. function ChartService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103269. 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); } }
  103270. 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; }
  103271. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103272. * This program are made available under the terms of the Apache License, Version 2.0
  103273. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103274. /**
  103275. * @class ChartService
  103276. * @category iServer Map Chart
  103277. * @classdesc 海图服务。
  103278. * @extends {ServiceBase}
  103279. * @example
  103280. * new ChartService(url).queryChart(param,function(result){
  103281. * //doSomething
  103282. * })
  103283. * @param {string} url - 服务地址。
  103284. * @param {Object} options - 参数。
  103285. * @param {string} [options.proxy] - 服务代理地址。
  103286. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103287. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103288. * @param {Object} [options.headers] - 请求头。
  103289. * @usage
  103290. */
  103291. var ChartService = /*#__PURE__*/function () {
  103292. function ChartService(url, options) {
  103293. ChartService_classCallCheck(this, ChartService);
  103294. this.url = url;
  103295. this.options = options || {};
  103296. }
  103297. /**
  103298. * @function ChartService.prototype.queryChart
  103299. * @description 查询海图服务。
  103300. * @param {ChartQueryParameters} params - 海图查询所需参数类。
  103301. * @param {RequestCallback} callback - 回调函数。
  103302. * @param {DataFormat} resultFormat - 返回结果类型。
  103303. */
  103304. ChartService_createClass(ChartService, [{
  103305. key: "queryChart",
  103306. value: function queryChart(params, callback, resultFormat) {
  103307. var me = this,
  103308. param = params,
  103309. format = me._processFormat(resultFormat);
  103310. var chartQueryService = new ChartQueryService(me.url, {
  103311. proxy: me.options.proxy,
  103312. withCredentials: me.options.withCredentials,
  103313. crossOrigin: me.options.crossOrigin,
  103314. headers: me.options.headers,
  103315. eventListeners: {
  103316. scope: me,
  103317. processCompleted: callback,
  103318. processFailed: callback
  103319. },
  103320. format: format
  103321. });
  103322. chartQueryService.processAsync(param);
  103323. }
  103324. /**
  103325. * @function ChartService.prototype.getChartFeatureInfo
  103326. * @description 获取海图物标信息服务。
  103327. * @param {RequestCallback} callback 回调函数。
  103328. */
  103329. }, {
  103330. key: "getChartFeatureInfo",
  103331. value: function getChartFeatureInfo(callback) {
  103332. var me = this;
  103333. var url = Util_Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  103334. var chartFeatureInfoSpecsService = new ChartFeatureInfoSpecsService(url, {
  103335. proxy: me.options.proxy,
  103336. withCredentials: me.options.withCredentials,
  103337. crossOrigin: me.options.crossOrigin,
  103338. headers: me.options.headers,
  103339. eventListeners: {
  103340. scope: me,
  103341. processCompleted: callback,
  103342. processFailed: callback
  103343. }
  103344. });
  103345. chartFeatureInfoSpecsService.processAsync();
  103346. }
  103347. }, {
  103348. key: "_processFormat",
  103349. value: function _processFormat(resultFormat) {
  103350. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  103351. }
  103352. }]);
  103353. return ChartService;
  103354. }();
  103355. ;// CONCATENATED MODULE: ./src/leaflet/services/ChartService.js
  103356. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103357. * This program are made available under the terms of the Apache License, Version 2.0
  103358. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103359. /**
  103360. * @class ChartService
  103361. * @deprecatedclassinstance L.supermap.chartService
  103362. * @classdesc 海图服务。
  103363. * @category iServer Map Chart
  103364. * @modulecategory Services
  103365. * @extends {ServiceBase}
  103366. * @example
  103367. * new ChartService(url)
  103368. * .queryChart(param,function(result){
  103369. * //doSomething
  103370. * })
  103371. * @param {string} url - 服务地址。
  103372. * @param {Object} options - 参数。
  103373. * @param {string} [options.proxy] - 服务代理地址。
  103374. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103375. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103376. * @param {Object} [options.headers] - 请求头。
  103377. * @usage
  103378. */
  103379. var ChartService_ChartService = ServiceBase.extend({
  103380. initialize: function initialize(url, options) {
  103381. ServiceBase.prototype.initialize.call(this, url, options);
  103382. this._chartServiceBase = new ChartService(url, options);
  103383. },
  103384. /**
  103385. * @function ChartService.prototype.queryChart
  103386. * @description 查询海图服务。
  103387. * @param {ChartQueryParameters} params - 海图查询参数类。
  103388. * @param {RequestCallback} callback - 回调函数。
  103389. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  103390. */
  103391. queryChart: function queryChart(params, callback, resultFormat) {
  103392. params = this._processParams(params);
  103393. this._chartServiceBase.queryChart(params, callback, resultFormat);
  103394. },
  103395. /**
  103396. * @function ChartService.prototype.getChartFeatureInfo
  103397. * @description 获取海图物标信息。
  103398. * @param {RequestCallback} callback - 回调函数。
  103399. */
  103400. getChartFeatureInfo: function getChartFeatureInfo(callback) {
  103401. this._chartServiceBase.getChartFeatureInfo(callback);
  103402. },
  103403. _processParams: function _processParams(params) {
  103404. if (!params) {
  103405. return {};
  103406. }
  103407. params.returnContent = params.returnContent == null ? true : params.returnContent;
  103408. if (params.chartQueryFilterParameters && !external_L_default().Util.isArray(params.chartQueryFilterParameters)) {
  103409. params.chartQueryFilterParameters = [params.chartQueryFilterParameters];
  103410. }
  103411. if (params.bounds) {
  103412. params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
  103413. }
  103414. },
  103415. _processFormat: function _processFormat(resultFormat) {
  103416. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  103417. }
  103418. });
  103419. var chartService = function chartService(url, options) {
  103420. return new ChartService_ChartService(url, options);
  103421. };
  103422. ;// CONCATENATED MODULE: ./src/leaflet/services/DatasetService.js
  103423. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103424. * This program are made available under the terms of the Apache License, Version 2.0
  103425. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103426. /**
  103427. * @class DatasetService
  103428. * @deprecatedclassinstance L.supermap.datasetService
  103429. * @classdesc 数据集信息服务类。
  103430. * @category iServer Data Dataset
  103431. * @modulecategory Services
  103432. * @extends {ServiceBase}
  103433. * @param {string} url - 服务地址。
  103434. * @param {Object} options - 参数。
  103435. * @param {string} [options.proxy] - 服务代理地址。
  103436. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103437. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103438. * @param {Object} [options.headers] - 请求头。
  103439. * @usage
  103440. */
  103441. var DatasetService_DatasetService = ServiceBase.extend({
  103442. initialize: function initialize(url, options) {
  103443. ServiceBase.prototype.initialize.call(this, url, options);
  103444. this._datasetService = new DatasetService(this.url, {
  103445. proxy: this.options.proxy,
  103446. withCredentials: this.options.withCredentials,
  103447. crossOrigin: this.options.crossOrigin,
  103448. headers: this.options.headers
  103449. });
  103450. },
  103451. /**
  103452. * @function DatasetService.prototype.getDatasets
  103453. * @description 数据集查询服务。
  103454. * @example
  103455. * new DatasetService(url).getDatasets(datasourceName,function(result){
  103456. * //doSomething
  103457. * });
  103458. * @param {string} datasourceName - 数据源名称。
  103459. * @param {RequestCallback} callback - 回调函数。
  103460. */
  103461. getDatasets: function getDatasets(datasourceName, callback) {
  103462. if (!datasourceName) {
  103463. return;
  103464. }
  103465. this._datasetService.getDatasetsService(datasourceName, callback);
  103466. },
  103467. /**
  103468. * @function DatasetService.prototype.getDataset
  103469. * @description 数据集信息查询服务。
  103470. * @example
  103471. * new DatasetService(url).getDataset(datasourceName, datasetName, function(result){
  103472. * //doSomething
  103473. * });
  103474. * @param {string} datasourceName - 数据源名称。
  103475. * @param {string} datasetName - 数据集名称。
  103476. * @param {RequestCallback} callback - 回调函数。
  103477. */
  103478. getDataset: function getDataset(datasourceName, datasetName, callback) {
  103479. if (!datasourceName || !datasetName) {
  103480. return;
  103481. }
  103482. this._datasetService.getDatasetService(datasourceName, datasetName, callback);
  103483. },
  103484. /**
  103485. * @function DatasetService.prototype.setDataset
  103486. * @description 数据集信息设置服务。可实现修改已存在数据集,新增不存在数据集。
  103487. * @example
  103488. * new DatasetService(url).setDataset(params, function(result){
  103489. * //doSomething
  103490. * });
  103491. * @param {CreateDatasetParameters | UpdateDatasetParameters } params - 数据集创建参数类(当前数据源下的数据集不存在时,新建数据集) || 数据集信息更改参数类(当前数据源下的数据集存在时,更改数据集信息)
  103492. * @param {RequestCallback} callback - 回调函数。
  103493. */
  103494. setDataset: function setDataset(params, callback) {
  103495. if (!(params instanceof CreateDatasetParameters) && !(params instanceof UpdateDatasetParameters)) {
  103496. return;
  103497. } else if (params instanceof CreateDatasetParameters) {
  103498. var datasetParams = {
  103499. "datasetType": params.datasetType,
  103500. "datasourceName": params.datasourceName,
  103501. "datasetName": params.datasetName
  103502. };
  103503. } else if (params instanceof UpdateDatasetParameters) {
  103504. datasetParams = {
  103505. "datasetName": params.datasetName,
  103506. "datasourceName": params.datasourceName,
  103507. "isFileCache": params.isFileCache,
  103508. "description": params.description,
  103509. "prjCoordSys": params.prjCoordSys,
  103510. "charset": params.charset
  103511. };
  103512. }
  103513. this._datasetService.setDatasetService(datasetParams, callback);
  103514. },
  103515. /**
  103516. * @function DatasetService.prototype.deleteDataset
  103517. * @description 指定数据源下的数据集删除服务。
  103518. * @example
  103519. * new DatasetService(url).deleteDataset(datasourceName, datasetName, function(result){
  103520. * //doSomething
  103521. * });
  103522. * @param {string} datasourceName - 数据源名称。
  103523. * @param {string} datasetName - 数据集名称。
  103524. * @param {RequestCallback} callback - 回调函数。
  103525. */
  103526. deleteDataset: function deleteDataset(datasourceName, datasetName, callback) {
  103527. this._datasetService.deleteDatasetService(datasourceName, datasetName, callback);
  103528. }
  103529. });
  103530. var datasetService = function datasetService(url, options) {
  103531. return new DatasetService_DatasetService(url, options);
  103532. };
  103533. ;// CONCATENATED MODULE: ./src/leaflet/services/DatasourceService.js
  103534. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103535. * This program are made available under the terms of the Apache License, Version 2.0
  103536. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103537. /**
  103538. * @class DatasourceService
  103539. * @deprecatedclassinstance L.supermap.datasourceService
  103540. * @classdesc 数据源服务类。
  103541. * @category iServer Data Datasource
  103542. * @modulecategory Services
  103543. * @extends {ServiceBase}
  103544. * @param {string} url - 服务地址。
  103545. * @param {Object} options - 参数。
  103546. * @param {string} [options.proxy] - 服务代理地址。
  103547. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103548. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103549. * @param {Object} [options.headers] - 请求头。
  103550. * @usage
  103551. */
  103552. var DatasourceService_DatasourceService = ServiceBase.extend({
  103553. initialize: function initialize(url, options) {
  103554. ServiceBase.prototype.initialize.call(this, url, options);
  103555. this._datasourceService = new DatasourceService(this.url, {
  103556. proxy: this.proxy,
  103557. withCredentials: this.withCredentials,
  103558. crossOrigin: this.crossOrigin,
  103559. headers: this.headers
  103560. });
  103561. },
  103562. /**
  103563. * @function DatasourceService.prototype.getDatasources
  103564. * @description 数据源集查询服务。
  103565. * @example
  103566. * new DatasourceService(url).getDatasources(function(result){
  103567. * //doSomething
  103568. * });
  103569. * @param {RequestCallback} callback - 回调函数。
  103570. */
  103571. getDatasources: function getDatasources(callback) {
  103572. this._datasourceService.getDatasourcesService(callback);
  103573. },
  103574. /**
  103575. * @function DatasourceService.prototype.getDatasource
  103576. * @description 数据源信息查询服务。
  103577. * @example
  103578. * new DatasourceService(url).getDatasource(datasourceName,function(result){
  103579. * //doSomething
  103580. * });
  103581. * @param datasourceName - 数据源名称。
  103582. * @param {RequestCallback} callback - 回调函数。
  103583. */
  103584. getDatasource: function getDatasource(datasourceName, callback) {
  103585. if (!datasourceName) {
  103586. return;
  103587. }
  103588. this._datasourceService.getDatasourceService(datasourceName, callback);
  103589. },
  103590. /**
  103591. * @function DatasourceService.prototype.setDatasource
  103592. * @description 数据源信息设置服务。可实现更改当前数据源信息。
  103593. * @example
  103594. * new DatasourceService(url).setDatasource(params, function(result){
  103595. * //doSomething
  103596. * });
  103597. * @param {SetDatasourceParameters} params - 数据源信息设置参数类。
  103598. * @param {RequestCallback} callback - 回调函数。
  103599. */
  103600. setDatasource: function setDatasource(params, callback) {
  103601. if (!(params instanceof SetDatasourceParameters)) {
  103602. return;
  103603. }
  103604. var datasourceParams = {
  103605. description: params.description,
  103606. coordUnit: params.coordUnit,
  103607. distanceUnit: params.distanceUnit,
  103608. datasourceName: params.datasourceName
  103609. };
  103610. this._datasourceService.setDatasourceService(datasourceParams, callback);
  103611. }
  103612. });
  103613. var datasourceService = function datasourceService(url, options) {
  103614. return new DatasourceService_DatasourceService(url, options);
  103615. };
  103616. ;// CONCATENATED MODULE: ./src/common/iServer/FieldService.js
  103617. function FieldService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103618. 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); } }
  103619. 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; }
  103620. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103621. * This program are made available under the terms of the Apache License, Version 2.0
  103622. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103623. /**
  103624. * @class FieldService
  103625. * @category iServer Data Field
  103626. * @classdesc 字段服务类。
  103627. * @example
  103628. * new FieldService(url).getFields(function(result){
  103629. * //doSomething
  103630. * });
  103631. * @param {string} url - 服务地址。
  103632. * @param {Object} options - 参数。
  103633. * @param {string} [options.proxy] - 服务代理地址。
  103634. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103635. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103636. * @param {Object} [options.headers] - 请求头。
  103637. * @extends {ServiceBase}
  103638. * @usage
  103639. */
  103640. var FieldService = /*#__PURE__*/function () {
  103641. function FieldService(url, options) {
  103642. FieldService_classCallCheck(this, FieldService);
  103643. this.url = url;
  103644. this.options = options || {};
  103645. }
  103646. /**
  103647. * @function FieldService.prototype.getFields
  103648. * @description 字段查询服务。
  103649. * @param {FieldParameters} params - 字段信息查询参数类。
  103650. * @param {RequestCallback} callback 回调函数。
  103651. */
  103652. FieldService_createClass(FieldService, [{
  103653. key: "getFields",
  103654. value: function getFields(params, callback) {
  103655. var me = this;
  103656. var getFieldsService = new GetFieldsService(me.url, {
  103657. proxy: me.options.proxy,
  103658. withCredentials: me.options.withCredentials,
  103659. crossOrigin: me.options.crossOrigin,
  103660. headers: me.options.headers,
  103661. eventListeners: {
  103662. scope: me,
  103663. processCompleted: callback,
  103664. processFailed: callback
  103665. },
  103666. datasource: params.datasource,
  103667. dataset: params.dataset
  103668. });
  103669. getFieldsService.processAsync();
  103670. }
  103671. /**
  103672. * @function FieldService.prototype.getFieldStatisticsInfo
  103673. * @description 字段统计服务。
  103674. * @param {FieldStatisticsParameters} params - 字段统计信息查询参数类。
  103675. * @param {RequestCallback} callback 回调函数。
  103676. */
  103677. }, {
  103678. key: "getFieldStatisticsInfo",
  103679. value: function getFieldStatisticsInfo(params, callback) {
  103680. if (!(params instanceof FieldStatisticsParameters)) {
  103681. return;
  103682. }
  103683. var me = this,
  103684. fieldName = params.fieldName,
  103685. modes = params.statisticMode;
  103686. if (modes && !Array.isArray(modes)) {
  103687. modes = [modes];
  103688. }
  103689. me.currentStatisticResult = {
  103690. fieldName: fieldName
  103691. };
  103692. me._statisticsCallback = callback;
  103693. //针对每种统计方式分别进行请求
  103694. modes.forEach(function (mode) {
  103695. me.currentStatisticResult[mode] = null;
  103696. me._fieldStatisticRequest(params.datasource, params.dataset, fieldName, mode);
  103697. });
  103698. }
  103699. }, {
  103700. key: "_fieldStatisticRequest",
  103701. value: function _fieldStatisticRequest(datasource, dataset, fieldName, statisticMode) {
  103702. var me = this;
  103703. var statisticService = new FieldStatisticService(me.url, {
  103704. eventListeners: {
  103705. scope: me,
  103706. processCompleted: me._processCompleted.bind(me),
  103707. processFailed: me._statisticsCallback
  103708. },
  103709. datasource: datasource,
  103710. dataset: dataset,
  103711. field: fieldName,
  103712. statisticMode: statisticMode,
  103713. crossOrigin: me.options.crossOrigin,
  103714. headers: me.options.headers
  103715. });
  103716. statisticService.processAsync();
  103717. }
  103718. }, {
  103719. key: "_processCompleted",
  103720. value: function _processCompleted(fieldStatisticResult, options) {
  103721. var me = this;
  103722. var getAll = true,
  103723. result = fieldStatisticResult.result;
  103724. if (this.currentStatisticResult) {
  103725. if (null == me.currentStatisticResult[result.mode]) {
  103726. this.currentStatisticResult[result.mode] = result.result;
  103727. }
  103728. }
  103729. for (var mode in me.currentStatisticResult) {
  103730. if (null == me.currentStatisticResult[mode]) {
  103731. getAll = false;
  103732. break;
  103733. }
  103734. }
  103735. if (getAll) {
  103736. me._statisticsCallback({
  103737. result: me.currentStatisticResult,
  103738. options: options
  103739. });
  103740. }
  103741. }
  103742. }]);
  103743. return FieldService;
  103744. }();
  103745. ;// CONCATENATED MODULE: ./src/leaflet/services/FieldService.js
  103746. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103747. * This program are made available under the terms of the Apache License, Version 2.0
  103748. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103749. /**
  103750. * @class FieldService
  103751. * @deprecatedclassinstance L.supermap.fieldService
  103752. * @classdesc 字段服务类。
  103753. * @category iServer Data Field
  103754. * @modulecategory Services
  103755. * @extends {ServiceBase}
  103756. * @example
  103757. * new FieldService(url).getFields(function(result){
  103758. * //doSomething
  103759. * });
  103760. * @param {string} url - 服务地址。
  103761. * @param {Object} options - 参数。
  103762. * @param {string} [options.proxy] - 服务代理地址。
  103763. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103764. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103765. * @param {Object} [options.headers] - 请求头。
  103766. * @usage
  103767. */
  103768. var FieldService_FieldService = ServiceBase.extend({
  103769. initialize: function initialize(url, options) {
  103770. ServiceBase.prototype.initialize.call(this, url, options);
  103771. this._fieldService = new FieldService(url, options);
  103772. },
  103773. /**
  103774. * @function FieldService.prototype.getFields
  103775. * @description 字段查询服务。
  103776. * @param {FieldParameters} params - 字段信息查询参数类。
  103777. * @param {RequestCallback} callback - 回调函数。
  103778. */
  103779. getFields: function getFields(params, callback) {
  103780. this._fieldService.getFields(params, callback);
  103781. },
  103782. /**
  103783. * @function FieldService.prototype.getFieldStatisticsInfo
  103784. * @description 字段统计服务。
  103785. * @param {FieldStatisticsParameters} params - 字段统计信息查询参数类。
  103786. * @param {RequestCallback} callback - 回调函数。
  103787. */
  103788. getFieldStatisticsInfo: function getFieldStatisticsInfo(params, callback) {
  103789. this._fieldService.getFieldStatisticsInfo(params, callback);
  103790. }
  103791. });
  103792. var fieldService = function fieldService(url, options) {
  103793. return new FieldService_FieldService(url, options);
  103794. };
  103795. ;// CONCATENATED MODULE: ./src/leaflet/services/GridCellInfosService.js
  103796. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103797. * This program are made available under the terms of the Apache License, Version 2.0
  103798. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103799. /**
  103800. * @class GridCellInfosService
  103801. * @deprecatedclassinstance L.supermap.gridCellInfosService
  103802. * @classdesc 数据栅格查询服务类。
  103803. * @category iServer Data Grid
  103804. * @modulecategory Services
  103805. * @extends {ServiceBase}
  103806. * @example
  103807. * new GridCellInfosService(url)
  103808. * .getGridCellInfos(param,function(result){
  103809. * //doSomething
  103810. * })
  103811. * @param {string} url - 服务地址。
  103812. * @param {Object} options - 参数。
  103813. * @param {string} [options.proxy] - 服务代理地址。
  103814. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  103815. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  103816. * @param {Object} [options.headers] - 请求头。
  103817. * @usage
  103818. */
  103819. var GridCellInfosService = ServiceBase.extend({
  103820. initialize: function initialize(url, options) {
  103821. ServiceBase.prototype.initialize.call(this, url, options);
  103822. this._gridCellQueryService = new GetGridCellInfosService(this.url, {
  103823. proxy: this.options.proxy,
  103824. withCredentials: this.options.withCredentials,
  103825. crossOrigin: this.options.crossOrigin,
  103826. headers: this.options.headers
  103827. });
  103828. },
  103829. /**
  103830. * @function GridCellInfosService.prototype.getGridCellInfos
  103831. * @param {GetGridCellInfosParameters} params - 数据服务栅格查询参数类。
  103832. * @param {RequestCallback} callback - 回调函数。
  103833. */
  103834. getGridCellInfos: function getGridCellInfos(params, callback) {
  103835. if (!params) {
  103836. return null;
  103837. }
  103838. this._gridCellQueryService.processAsync(params, callback);
  103839. }
  103840. });
  103841. var gridCellInfosService = function gridCellInfosService(url, options) {
  103842. return new GridCellInfosService(url, options);
  103843. };
  103844. ;// CONCATENATED MODULE: ./src/leaflet/services/GeoprocessingService.js
  103845. /**
  103846. * @class GeoprocessingService
  103847. * @deprecatedclassinstance L.supermap.geoprocessingService
  103848. * @classdesc 处理自动化服务接口类。
  103849. * @version 10.1.0
  103850. * @category iServer ProcessingAutomationService
  103851. * @modulecategory Services
  103852. * @extends ServiceBase
  103853. * @example
  103854. * //为了安全访问受保护的处理自动化服务,必须通过传递 iserver 令牌( token ),才能正确访问相关资源。
  103855. * SecurityManager.registerToken(serviceUrl, token);
  103856. * var geoprocessingService = new GeoprocessingService("http://localhost:8090/iserver/services/geoprocessing/restjsr/gp/v2")
  103857. geoprocessingService.submitJob(identifier,params, environments, function(serverResult) {
  103858. console.log(serverResult.result);
  103859. var jobID = serverResult.result.jobID;
  103860. var options = {
  103861. interval: 5000,
  103862. statusCallback: function(state) {
  103863. console.log("Job Status: ", state);
  103864. }
  103865. };
  103866. geoprocessingService.waitForJobCompletion(jobID, identifier, options, function(serverResult) {
  103867. console.log(serverResult);
  103868. })
  103869. })
  103870. *
  103871. * @param {string} url - 服务地址。
  103872. * @param {Object} options - 参数。
  103873. * @usage
  103874. */
  103875. var GeoprocessingService_GeoprocessingService = ServiceBase.extend({
  103876. initialize: function initialize(url, options) {
  103877. options = options || {};
  103878. external_L_default().setOptions(this, options);
  103879. ServiceBase.prototype.initialize.call(this, url, options);
  103880. this.headers = {};
  103881. this.crossOrigin = true;
  103882. this.withCredentials = true;
  103883. this.proxy = true;
  103884. this._geoprocessingJobsService = new GeoprocessingService(this.url, {
  103885. proxy: this.options.proxy,
  103886. withCredentials: this.options.withCredentials,
  103887. crossOrigin: this.options.crossOrigin,
  103888. headers: this.options.headers
  103889. });
  103890. },
  103891. /**
  103892. * @function GeoprocessingService.prototype.getTools
  103893. * @description 获取处理自动化工具列表。
  103894. * @param {RequestCallback} callback - 回调函数。
  103895. */
  103896. getTools: function getTools(callback) {
  103897. this._geoprocessingJobsService.getTools(callback);
  103898. },
  103899. /**
  103900. * @function GeoprocessingService.prototype.getTool
  103901. * @description 获取工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  103902. * @param {string} identifier - 处理自动化工具ID。
  103903. * @param {RequestCallback} callback - 回调函数。
  103904. */
  103905. getTool: function getTool(identifier, callback) {
  103906. this._geoprocessingJobsService.getTool(identifier, callback);
  103907. },
  103908. /**
  103909. * @function GeoprocessingService.prototype.execute
  103910. * @description 同步执行处理自动化工具。
  103911. * @param {string} identifier - 处理自动化工具 ID。
  103912. * @param {Object} parameter - 处理自动化工具的输入参数。
  103913. * @param {Object} environment - 处理自动化工具的环境参数。
  103914. * @param {RequestCallback} callback - 回调函数。
  103915. */
  103916. execute: function execute(identifier, parameter, environment, callback) {
  103917. this._geoprocessingJobsService.execute(identifier, parameter, environment, callback);
  103918. },
  103919. /**
  103920. * @function GeoprocessingService.prototype.submitJob
  103921. * @description 异步执行处理自动化工具。
  103922. * @param {string} identifier - 处理自动化工具ID。
  103923. * @param {Object} parameter - 处理自动化工具的输入参数。
  103924. * @param {Object} environment - 处理自动化工具的环境参数。
  103925. * @param {RequestCallback} callback - 回调函数。
  103926. */
  103927. submitJob: function submitJob(identifier, parameter, environment, callback) {
  103928. this._geoprocessingJobsService.submitJob(identifier, parameter, environment, callback);
  103929. },
  103930. /**
  103931. * @function GeoprocessingService.prototype.waitForJobCompletion
  103932. * @description 获取处理自动化异步执行状态信息。
  103933. * @param {string} jobId - 处理自动化任务ID。
  103934. * @param {string} identifier - 处理自动化工具ID。
  103935. * @param {Object} options - 参数。
  103936. * @param {number} options.interval - 定时器时间间隔。
  103937. * @param {RequestCallback} options.statusCallback - 任务状态的回调函数。
  103938. * @param {function} callback 回调函数。
  103939. */
  103940. waitForJobCompletion: function waitForJobCompletion(jobId, identifier, options, callback) {
  103941. this._geoprocessingJobsService.waitForJobCompletion(jobId, identifier, options, callback);
  103942. },
  103943. /**
  103944. * @function GeoprocessingService.prototype.getJobInfo
  103945. * @description 获取处理自动化任务的执行信息。
  103946. * @param {string} identifier - 处理自动化工具 ID。
  103947. * @param {string} jobId - 处理自动化任务 ID。
  103948. * @param {RequestCallback} callback - 回调函数。
  103949. */
  103950. getJobInfo: function getJobInfo(identifier, jobId, callback) {
  103951. this._geoprocessingJobsService.getJobInfo(identifier, jobId, callback);
  103952. },
  103953. /**
  103954. * @function GeoprocessingService.prototype.cancelJob
  103955. * @description 取消处理自动化任务的异步执行。
  103956. * @param {string} identifier - 处理自动化工具 ID。
  103957. * @param {string} jobId - 处理自动化任务 ID。
  103958. * @param {RequestCallback} callback - 回调函数。
  103959. */
  103960. cancelJob: function cancelJob(identifier, jobId, callback) {
  103961. this._geoprocessingJobsService.cancelJob(identifier, jobId, callback);
  103962. },
  103963. /**
  103964. * @function GeoprocessingService.prototype.getJobs
  103965. * @description 获取处理自动化服务任务列表。
  103966. * @param {string} identifier - 处理自动化工具 ID。(传参代表 identifier 算子的任务列表,不传参代表所有任务的列表)
  103967. * @param {RequestCallback} callback - 回调函数。
  103968. */
  103969. getJobs: function getJobs(identifier, callback) {
  103970. this._geoprocessingJobsService.getJobs(identifier, callback);
  103971. },
  103972. /**
  103973. * @function GeoprocessingService.prototype.getResults
  103974. * @description 处理自动化工具异步执行的结果,支持结果过滤。
  103975. * @param {string} identifier - 处理自动化工具 ID。
  103976. * @param {string} jobId - 处理自动化任务 ID。
  103977. * @param {string} filter - 输出异步结果的 ID。(可选,传入 filter 参数时对该处理自动化工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  103978. * @param {RequestCallback} callback - 回调函数。
  103979. */
  103980. getResults: function getResults(identifier, jobId, filter, callback) {
  103981. this._geoprocessingJobsService.getResults(identifier, jobId, filter, callback);
  103982. }
  103983. });
  103984. var geoprocessingService = function geoprocessingService(url, options) {
  103985. return new GeoprocessingService_GeoprocessingService(url, options);
  103986. };
  103987. ;// CONCATENATED MODULE: ./src/common/iServer/LayerInfoService.js
  103988. function LayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  103989. 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); } }
  103990. 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; }
  103991. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  103992. * This program are made available under the terms of the Apache License, Version 2.0
  103993. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  103994. /**
  103995. * @class LayerInfoService
  103996. * @category iServer Map Layer
  103997. * @classdesc 图层信息服务类。
  103998. * @extends {ServiceBase}
  103999. * @example
  104000. * new LayerInfoService(url).getLayersInfo(function(result){
  104001. * //doSomething
  104002. * })
  104003. * @param {string} url - 服务地址。请求地图服务,URL 应为:
  104004. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  104005. * @param {Object} options - 参数。
  104006. * @param {string} [options.proxy] - 服务代理地址。
  104007. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  104008. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104009. * @param {Object} [options.headers] - 请求头。
  104010. * @usage
  104011. */
  104012. var LayerInfoService = /*#__PURE__*/function () {
  104013. function LayerInfoService(url, options) {
  104014. LayerInfoService_classCallCheck(this, LayerInfoService);
  104015. this.url = url;
  104016. this.options = options || {};
  104017. }
  104018. /**
  104019. * @function LayerInfoService.prototype.getLayersInfo
  104020. * @description 获取图层信息服务。
  104021. * @param {RequestCallback} callback - 回调函数。
  104022. */
  104023. LayerInfoService_createClass(LayerInfoService, [{
  104024. key: "getLayersInfo",
  104025. value: function getLayersInfo(callback) {
  104026. var me = this;
  104027. var getLayersInfoService = new GetLayersInfoService(me.url, {
  104028. proxy: me.options.proxy,
  104029. withCredentials: me.options.withCredentials,
  104030. crossOrigin: me.options.crossOrigin,
  104031. headers: me.options.headers,
  104032. eventListeners: {
  104033. processCompleted: callback,
  104034. processFailed: callback
  104035. }
  104036. });
  104037. getLayersInfoService.processAsync();
  104038. }
  104039. /**
  104040. * @function LayerInfoService.prototype.setLayerInfo
  104041. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  104042. * @param {SetLayerInfoParameters} params - 设置图层信息参数类。
  104043. * @param {RequestCallback} callback - 回调函数。
  104044. */
  104045. }, {
  104046. key: "setLayerInfo",
  104047. value: function setLayerInfo(params, callback) {
  104048. if (!params) {
  104049. return;
  104050. }
  104051. var me = this,
  104052. resourceID = params.resourceID,
  104053. tempLayerName = params.tempLayerName,
  104054. layerInfoParams = params.layerInfo;
  104055. if (!resourceID || !tempLayerName) {
  104056. return;
  104057. }
  104058. var url = Util_Util.urlPathAppend(me.url, "tempLayersSet/" + resourceID + "/" + tempLayerName);
  104059. var setLayerInfoService = new SetLayerInfoService(url, {
  104060. proxy: me.options.proxy,
  104061. withCredentials: me.options.withCredentials,
  104062. crossOrigin: me.options.crossOrigin,
  104063. headers: me.options.headers,
  104064. eventListeners: {
  104065. processCompleted: callback,
  104066. processFailed: callback
  104067. }
  104068. });
  104069. setLayerInfoService.processAsync(layerInfoParams);
  104070. }
  104071. /**
  104072. * @function LayerInfoService.prototype.setLayersInfo
  104073. * @description 设置图层信息服务。可以创建新的临时图层和修改现有的临时图层。
  104074. * @param {SetLayersInfoParameters} params - 设置图层信息参数类。
  104075. * @param {RequestCallback} callback - 回调函数。
  104076. */
  104077. }, {
  104078. key: "setLayersInfo",
  104079. value: function setLayersInfo(params, callback) {
  104080. if (!params) {
  104081. return;
  104082. }
  104083. var me = this,
  104084. resourceID = params.resourceID,
  104085. isTempLayers = params.isTempLayers ? params.isTempLayers : false,
  104086. layersInfo = params.layersInfo;
  104087. if (isTempLayers && !resourceID || !layersInfo) {
  104088. return;
  104089. }
  104090. var setLayersInfoService = new SetLayersInfoService(me.url, {
  104091. proxy: me.options.proxy,
  104092. withCredentials: me.options.withCredentials,
  104093. crossOrigin: me.options.crossOrigin,
  104094. headers: me.options.headers,
  104095. eventListeners: {
  104096. processCompleted: callback,
  104097. processFailed: callback
  104098. },
  104099. resourceID: resourceID,
  104100. isTempLayers: isTempLayers
  104101. });
  104102. setLayersInfoService.processAsync(layersInfo);
  104103. }
  104104. /**
  104105. * @function LayerInfoService.prototype.setLayerStatus
  104106. * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  104107. * @param {SetLayerStatusParameters} params - 子图层显示控制参数类。
  104108. * @param {RequestCallback} callback - 回调函数。
  104109. */
  104110. }, {
  104111. key: "setLayerStatus",
  104112. value: function setLayerStatus(params, callback) {
  104113. if (!params) {
  104114. return;
  104115. }
  104116. var me = this;
  104117. var setLayerStatusService = new SetLayerStatusService(me.url, {
  104118. proxy: me.options.proxy,
  104119. withCredentials: me.options.withCredentials,
  104120. crossOrigin: me.options.crossOrigin,
  104121. headers: me.options.headers,
  104122. eventListeners: {
  104123. processCompleted: callback,
  104124. processFailed: callback
  104125. }
  104126. });
  104127. setLayerStatusService.processAsync(params);
  104128. }
  104129. }]);
  104130. return LayerInfoService;
  104131. }();
  104132. ;// CONCATENATED MODULE: ./src/leaflet/services/LayerInfoService.js
  104133. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104134. * This program are made available under the terms of the Apache License, Version 2.0
  104135. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104136. /**
  104137. * @class LayerInfoService
  104138. * @deprecatedclassinstance L.supermap.layerInfoService
  104139. * @classdesc 图层信息类。
  104140. * @category iServer Map Layer
  104141. * @modulecategory Services
  104142. * @extends {ServiceBase}
  104143. * @example
  104144. * new LayerInfoService(url).getLayersInfo(function(result){
  104145. * //doSomething
  104146. * })
  104147. * @param {string} url - 服务地址。
  104148. * @param {Object} options - 参数。
  104149. * @param {string} [options.proxy] - 服务代理地址。
  104150. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104151. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104152. * @param {Object} [options.headers] - 请求头。
  104153. * @usage
  104154. */
  104155. var LayerInfoService_LayerInfoService = ServiceBase.extend({
  104156. initialize: function initialize(url, options) {
  104157. ServiceBase.prototype.initialize.call(this, url, options);
  104158. this._layerInfoService = new LayerInfoService(url, options);
  104159. },
  104160. /**
  104161. * @function LayerInfoService.prototype.getLayersInfo
  104162. * @description 获取图层信息。
  104163. * @param {RequestCallback} callback - 回调函数。
  104164. */
  104165. getLayersInfo: function getLayersInfo(callback) {
  104166. this._layerInfoService.getLayersInfo(callback);
  104167. },
  104168. /**
  104169. * @function LayerInfoService.prototype.setLayerInfo
  104170. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  104171. * @param {SetLayerInfoParameters} params - 设置图层信息参数类。
  104172. * @param {RequestCallback} callback - 回调函数。
  104173. */
  104174. setLayerInfo: function setLayerInfo(params, callback) {
  104175. this._layerInfoService.setLayerInfo(params, callback);
  104176. },
  104177. /**
  104178. * @function LayerInfoService.prototype.setLayersInfo
  104179. * @description 设置图层信息。可以实现创建新的临时图层和修改现有的临时图层。
  104180. * @param {SetLayersInfoParameters} params - 设置图层信息参数类。
  104181. * @param {RequestCallback} callback - 回调函数。
  104182. */
  104183. setLayersInfo: function setLayersInfo(params, callback) {
  104184. this._layerInfoService.setLayersInfo(params, callback);
  104185. },
  104186. /**
  104187. * @function LayerInfoService.prototype.setLayerStatus
  104188. * @description 负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  104189. * @param {SetLayerStatusParameters} params - 子图层显示控制参数类。
  104190. * @param {RequestCallback} callback - 回调函数。
  104191. */
  104192. setLayerStatus: function setLayerStatus(params, callback) {
  104193. this._layerInfoService.setLayerStatus(params, callback);
  104194. }
  104195. });
  104196. var layerInfoService = function layerInfoService(url, options) {
  104197. return new LayerInfoService_LayerInfoService(url, options);
  104198. };
  104199. ;// CONCATENATED MODULE: ./src/leaflet/services/MeasureService.js
  104200. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104201. * This program are made available under the terms of the Apache License, Version 2.0
  104202. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104203. /**
  104204. * @class MeasureService
  104205. * @deprecatedclassinstance L.supermap.measureService
  104206. * @classdesc 量算服务类。
  104207. * @category iServer Map Measure
  104208. * @modulecategory Services
  104209. * @example
  104210. * 用法:
  104211. * new MeasureService(url).measureDistance({
  104212. * geometry:xxx
  104213. * },function(result){
  104214. * //doSomething
  104215. * })
  104216. * @param {string} url - 服务地址。
  104217. * @param {Object} options - 参数。
  104218. * @param {string} [options.proxy] - 服务代理地址。
  104219. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104220. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104221. * @param {Object} [options.headers] - 请求头。
  104222. * @extends {ServiceBase}
  104223. * @usage
  104224. */
  104225. var MeasureService_MeasureService = ServiceBase.extend({
  104226. initialize: function initialize(url, options) {
  104227. ServiceBase.prototype.initialize.call(this, url, options);
  104228. },
  104229. /**
  104230. * @function MeasureService.prototype.measureDistance
  104231. * @description 测距。
  104232. * @param {MeasureParameters} params - 量算参数类。
  104233. * @param {RequestCallback} callback - 回调函数。
  104234. */
  104235. measureDistance: function measureDistance(params, callback) {
  104236. this.measure(MeasureMode.DISTANCE, params, callback);
  104237. return this;
  104238. },
  104239. /**
  104240. * @function MeasureService.prototype.measureArea
  104241. * @description 测面积。
  104242. * @param {MeasureParameters} params - 量算参数类。
  104243. * @param {RequestCallback} callback - 回调函数。
  104244. */
  104245. measureArea: function measureArea(params, callback) {
  104246. this.measure(MeasureMode.AREA, params, callback);
  104247. return this;
  104248. },
  104249. /**
  104250. * @function MeasureService.measure
  104251. * @param {MeasureMode} [type=MeasureMode.DISTANCE] - 量算模式。
  104252. * @param {MeasureParameters} params - 量算参数类。
  104253. * @param {RequestCallback} callback - 回调函数。
  104254. */
  104255. measure: function measure(type, params, callback) {
  104256. if (!(params instanceof MeasureParameters)) {
  104257. return;
  104258. }
  104259. var me = this;
  104260. if (params.geometry) {
  104261. params.geometry = Util_toSuperMapGeometry(params.geometry);
  104262. }
  104263. var measureService = new MeasureService(me.url, {
  104264. proxy: me.options.proxy,
  104265. withCredentials: me.options.withCredentials,
  104266. crossOrigin: me.options.crossOrigin,
  104267. headers: me.options.headers,
  104268. measureMode: type
  104269. });
  104270. measureService.processAsync(params, callback);
  104271. }
  104272. });
  104273. var measureService = function measureService(url, options) {
  104274. return new MeasureService_MeasureService(url, options);
  104275. };
  104276. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalyst3DService.js
  104277. function NetworkAnalyst3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104278. 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); } }
  104279. 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; }
  104280. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104281. * This program are made available under the terms of the Apache License, Version 2.0
  104282. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104283. /**
  104284. * @class NetworkAnalyst3DService
  104285. * @category iServer FacilityAnalyst3D
  104286. * @classdesc 3D 网络分析服务类。
  104287. * @extends {ServiceBase}
  104288. * @example
  104289. * new NetworkAnalyst3DService(url).sinksFacilityAnalyst(params,function(result){
  104290. * //doSomething
  104291. * })
  104292. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL 应为:
  104293. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  104294. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  104295. * @param {Object} options - 参数。
  104296. * @param {string} [options.proxy] - 服务代理地址。
  104297. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104298. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104299. * @param {Object} [options.headers] - 请求头。
  104300. * @usage
  104301. */
  104302. var NetworkAnalyst3DService = /*#__PURE__*/function () {
  104303. function NetworkAnalyst3DService(url, options) {
  104304. NetworkAnalyst3DService_classCallCheck(this, NetworkAnalyst3DService);
  104305. this.url = url;
  104306. this.options = options || {};
  104307. }
  104308. /**
  104309. * @function NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  104310. * @description 汇查找服务
  104311. * @param {FacilityAnalystSinks3DParameters} params- 最近设施分析参数类(汇查找资源)。
  104312. * @param {RequestCallback} callback - 回调函数。
  104313. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104314. */
  104315. NetworkAnalyst3DService_createClass(NetworkAnalyst3DService, [{
  104316. key: "sinksFacilityAnalyst",
  104317. value: function sinksFacilityAnalyst(params, callback) {
  104318. var me = this;
  104319. var facilityAnalystSinks3DService = new FacilityAnalystSinks3DService(me.url, {
  104320. proxy: me.options.proxy,
  104321. withCredentials: me.options.withCredentials,
  104322. crossOrigin: me.options.crossOrigin,
  104323. headers: me.options.headers,
  104324. eventListeners: {
  104325. scope: me,
  104326. processCompleted: callback,
  104327. processFailed: callback
  104328. }
  104329. });
  104330. facilityAnalystSinks3DService.processAsync(params);
  104331. }
  104332. /**
  104333. * @function NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  104334. * @description 源查找服务。
  104335. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
  104336. * @param {RequestCallback} callback - 回调函数。
  104337. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104338. */
  104339. }, {
  104340. key: "sourcesFacilityAnalyst",
  104341. value: function sourcesFacilityAnalyst(params, callback) {
  104342. var me = this;
  104343. var facilityAnalystSources3DService = new FacilityAnalystSources3DService(me.url, {
  104344. proxy: me.options.proxy,
  104345. withCredentials: me.options.withCredentials,
  104346. crossOrigin: me.options.crossOrigin,
  104347. headers: me.options.headers,
  104348. eventListeners: {
  104349. scope: me,
  104350. processCompleted: callback,
  104351. processFailed: callback
  104352. }
  104353. });
  104354. facilityAnalystSources3DService.processAsync(params);
  104355. }
  104356. /**
  104357. * @function NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  104358. * @description 上游追踪资源服务。
  104359. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  104360. * @param {RequestCallback} callback - 回调函数。
  104361. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104362. */
  104363. }, {
  104364. key: "traceUpFacilityAnalyst",
  104365. value: function traceUpFacilityAnalyst(params, callback) {
  104366. var me = this;
  104367. var facilityAnalystTraceup3DService = new FacilityAnalystTraceup3DService(me.url, {
  104368. proxy: me.options.proxy,
  104369. withCredentials: me.options.withCredentials,
  104370. crossOrigin: me.options.crossOrigin,
  104371. headers: me.options.headers,
  104372. eventListeners: {
  104373. scope: me,
  104374. processCompleted: callback,
  104375. processFailed: callback
  104376. }
  104377. });
  104378. facilityAnalystTraceup3DService.processAsync(params);
  104379. }
  104380. /**
  104381. * @function NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  104382. * @description 下游追踪资源服务。
  104383. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
  104384. * @param {RequestCallback} callback - 回调函数。
  104385. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104386. */
  104387. }, {
  104388. key: "traceDownFacilityAnalyst",
  104389. value: function traceDownFacilityAnalyst(params, callback) {
  104390. var me = this;
  104391. var facilityAnalystTracedown3DService = new FacilityAnalystTracedown3DService(me.url, {
  104392. proxy: me.options.proxy,
  104393. withCredentials: me.options.withCredentials,
  104394. crossOrigin: me.options.crossOrigin,
  104395. headers: me.options.headers,
  104396. eventListeners: {
  104397. scope: me,
  104398. processCompleted: callback,
  104399. processFailed: callback
  104400. }
  104401. });
  104402. facilityAnalystTracedown3DService.processAsync(params);
  104403. }
  104404. /**
  104405. * @function NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  104406. * @description 上游关键设施查找服务。
  104407. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
  104408. * @param {RequestCallback} callback - 回调函数。
  104409. * @returns {NetworkAnalyst3DService} 3D 网络分析服务。
  104410. */
  104411. }, {
  104412. key: "upstreamFacilityAnalyst",
  104413. value: function upstreamFacilityAnalyst(params, callback) {
  104414. var me = this;
  104415. var facilityAnalystUpstream3DService = new FacilityAnalystUpstream3DService(me.url, {
  104416. proxy: me.options.proxy,
  104417. withCredentials: me.options.withCredentials,
  104418. crossOrigin: me.options.crossOrigin,
  104419. headers: me.options.headers,
  104420. eventListeners: {
  104421. scope: me,
  104422. processCompleted: callback,
  104423. processFailed: callback
  104424. }
  104425. });
  104426. facilityAnalystUpstream3DService.processAsync(params);
  104427. }
  104428. }]);
  104429. return NetworkAnalyst3DService;
  104430. }();
  104431. ;// CONCATENATED MODULE: ./src/leaflet/services/NetworkAnalyst3DService.js
  104432. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104433. * This program are made available under the terms of the Apache License, Version 2.0
  104434. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104435. /**
  104436. * @class NetworkAnalyst3DService
  104437. * @deprecatedclassinstance L.supermap.networkAnalyst3DService
  104438. * @classdesc 3D 网络分析服务类。
  104439. * @category iServer FacilityAnalyst3D
  104440. * @modulecategory Services
  104441. * @extends {ServiceBase}
  104442. * @example
  104443. * new NetworkAnalyst3DService(url)
  104444. * .sinksFacilityAnalyst(params,function(result){
  104445. * //doSomething
  104446. * })
  104447. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  104448. * "http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  104449. * @param {Object} options - 参数。
  104450. * @param {string} [options.proxy] - 服务代理地址。
  104451. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104452. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104453. * @param {Object} [options.headers] - 请求头。
  104454. * @usage
  104455. */
  104456. var NetworkAnalyst3DService_NetworkAnalyst3DService = ServiceBase.extend({
  104457. initialize: function initialize(url, options) {
  104458. ServiceBase.prototype.initialize.call(this, url, options);
  104459. this._networkAnalyst3DService = new NetworkAnalyst3DService(url, options);
  104460. },
  104461. /**
  104462. * @function NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  104463. * @description 汇查找服务。
  104464. * @param {FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)。
  104465. * @param {RequestCallback} callback - 回调函数。
  104466. */
  104467. sinksFacilityAnalyst: function sinksFacilityAnalyst(params, callback) {
  104468. this._networkAnalyst3DService.sinksFacilityAnalyst(params, callback);
  104469. },
  104470. /**
  104471. * @function NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  104472. * @description 源查找服务。
  104473. * @param {FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找资源)。
  104474. * @param {RequestCallback} callback - 回调函数。
  104475. * @returns {NetworkAnalyst3DService} NetworkAnalyst3DService的实例对象。
  104476. */
  104477. sourcesFacilityAnalyst: function sourcesFacilityAnalyst(params, callback) {
  104478. this._networkAnalyst3DService.sourcesFacilityAnalyst(params, callback);
  104479. },
  104480. /**
  104481. * @function NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  104482. * @description 上游追踪资源服务。
  104483. * @param {FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  104484. * @param {RequestCallback} callback - 回调函数。
  104485. * @returns {NetworkAnalyst3DService} NetworkAnalyst3DService的实例对象。
  104486. */
  104487. traceUpFacilityAnalyst: function traceUpFacilityAnalyst(params, callback) {
  104488. this._networkAnalyst3DService.traceUpFacilityAnalyst(params, callback);
  104489. },
  104490. /**
  104491. * @function NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  104492. * @description 下游追踪资源服务。
  104493. * @param {FacilityAnalystTracedown3DParameters} params - 下游追踪资源参数类。
  104494. * @param {RequestCallback} callback - 回调函数。
  104495. */
  104496. traceDownFacilityAnalyst: function traceDownFacilityAnalyst(params, callback) {
  104497. this._networkAnalyst3DService.traceDownFacilityAnalyst(params, callback);
  104498. },
  104499. /**
  104500. * @function NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  104501. * @description 上游关键设施查找服务。
  104502. * @param {FacilityAnalystUpstream3DParameters} params - 上游关键设施查找资源参数类。
  104503. * @param {RequestCallback} callback - 回调函数。
  104504. */
  104505. upstreamFacilityAnalyst: function upstreamFacilityAnalyst(params, callback) {
  104506. this._networkAnalyst3DService.upstreamFacilityAnalyst(params, callback);
  104507. }
  104508. });
  104509. var networkAnalyst3DService = function networkAnalyst3DService(url, options) {
  104510. return new NetworkAnalyst3DService_NetworkAnalyst3DService(url, options);
  104511. };
  104512. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystService.js
  104513. function NetworkAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  104514. 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); } }
  104515. 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; }
  104516. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104517. * This program are made available under the terms of the Apache License, Version 2.0
  104518. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104519. /**
  104520. * @class NetworkAnalystService
  104521. * @category iServer NetworkAnalyst
  104522. * @classdesc 网络分析服务类。
  104523. * @extends {ServiceBase}
  104524. * @example
  104525. * new NetworkAnalystService(url)
  104526. * .findPath(params,function(result){
  104527. * //doSomething
  104528. * })
  104529. * @param {string} url - 服务地址。请求网络分析服务,URL应为:</br>
  104530. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  104531. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  104532. * @param {Object} options - 参数。
  104533. * @param {string} [options.proxy] - 服务代理地址。
  104534. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104535. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104536. * @param {Object} [options.headers] - 请求头。
  104537. * @usage
  104538. */
  104539. var NetworkAnalystService = /*#__PURE__*/function () {
  104540. function NetworkAnalystService(url, options) {
  104541. NetworkAnalystService_classCallCheck(this, NetworkAnalystService);
  104542. this.url = url;
  104543. this.options = options || {};
  104544. }
  104545. /**
  104546. * @function NetworkAnalystService.prototype.burstPipelineAnalyst
  104547. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  104548. * @param {BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
  104549. * @param {RequestCallback} callback 回调函数。
  104550. */
  104551. NetworkAnalystService_createClass(NetworkAnalystService, [{
  104552. key: "burstPipelineAnalyst",
  104553. value: function burstPipelineAnalyst(params, callback) {
  104554. var me = this;
  104555. var burstPipelineAnalystService = new BurstPipelineAnalystService(me.url, {
  104556. proxy: me.options.proxy,
  104557. withCredentials: me.options.withCredentials,
  104558. crossOrigin: me.options.crossOrigin,
  104559. headers: me.options.headers,
  104560. eventListeners: {
  104561. scope: me,
  104562. processCompleted: callback,
  104563. processFailed: callback
  104564. }
  104565. });
  104566. burstPipelineAnalystService.processAsync(params);
  104567. }
  104568. /**
  104569. * @function NetworkAnalystService.prototype.computeWeightMatrix
  104570. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  104571. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
  104572. * @param {RequestCallback} callback - 回调函数。
  104573. */
  104574. }, {
  104575. key: "computeWeightMatrix",
  104576. value: function computeWeightMatrix(params, callback) {
  104577. var me = this;
  104578. var computeWeightMatrixService = new ComputeWeightMatrixService(me.url, {
  104579. proxy: me.options.proxy,
  104580. withCredentials: me.options.withCredentials,
  104581. crossOrigin: me.options.crossOrigin,
  104582. headers: me.options.headers,
  104583. eventListeners: {
  104584. scope: me,
  104585. processCompleted: callback,
  104586. processFailed: callback
  104587. }
  104588. });
  104589. computeWeightMatrixService.processAsync(params);
  104590. }
  104591. /**
  104592. * @function NetworkAnalystService.prototype.findClosestFacilities
  104593. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  104594. * @param {FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
  104595. * @param {RequestCallback} callback 回调函数。
  104596. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104597. */
  104598. }, {
  104599. key: "findClosestFacilities",
  104600. value: function findClosestFacilities(params, callback, resultFormat) {
  104601. var me = this;
  104602. var findClosestFacilitiesService = new FindClosestFacilitiesService(me.url, {
  104603. proxy: me.options.proxy,
  104604. withCredentials: me.options.withCredentials,
  104605. crossOrigin: me.options.crossOrigin,
  104606. headers: me.options.headers,
  104607. eventListeners: {
  104608. scope: me,
  104609. processCompleted: callback,
  104610. processFailed: callback
  104611. },
  104612. format: me._processFormat(resultFormat)
  104613. });
  104614. findClosestFacilitiesService.processAsync(params);
  104615. }
  104616. /**
  104617. * @function NetworkAnalystService.prototype.streamFacilityAnalyst
  104618. * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  104619. * @param {FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
  104620. * @param {RequestCallback} callback 回调函数。
  104621. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104622. */
  104623. }, {
  104624. key: "streamFacilityAnalyst",
  104625. value: function streamFacilityAnalyst(params, callback, resultFormat) {
  104626. var me = this;
  104627. var facilityAnalystStreamService = new FacilityAnalystStreamService(me.url, {
  104628. proxy: me.options.proxy,
  104629. withCredentials: me.options.withCredentials,
  104630. crossOrigin: me.options.crossOrigin,
  104631. headers: me.options.headers,
  104632. eventListeners: {
  104633. scope: me,
  104634. processCompleted: callback,
  104635. processFailed: callback
  104636. },
  104637. format: me._processFormat(resultFormat)
  104638. });
  104639. facilityAnalystStreamService.processAsync(params);
  104640. }
  104641. /**
  104642. * @function NetworkAnalystService.prototype.findLocation
  104643. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  104644. * @param {FindLocationParameters} params - 选址分区分析服务参数类。
  104645. * @param {RequestCallback} callback 回调函数。
  104646. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104647. */
  104648. }, {
  104649. key: "findLocation",
  104650. value: function findLocation(params, callback, resultFormat) {
  104651. var me = this;
  104652. var findLocationService = new FindLocationService(me.url, {
  104653. proxy: me.options.proxy,
  104654. withCredentials: me.options.withCredentials,
  104655. crossOrigin: me.options.crossOrigin,
  104656. headers: me.options.headers,
  104657. eventListeners: {
  104658. scope: me,
  104659. processCompleted: callback,
  104660. processFailed: callback
  104661. },
  104662. format: me._processFormat(resultFormat)
  104663. });
  104664. findLocationService.processAsync(params);
  104665. }
  104666. /**
  104667. * @function NetworkAnalystService.prototype.findPath
  104668. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  104669. * @param {FindPathParameters} params - 最佳路径分析服务参数类。
  104670. * @param {RequestCallback} callback - 回调函数。
  104671. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104672. */
  104673. }, {
  104674. key: "findPath",
  104675. value: function findPath(params, callback, resultFormat) {
  104676. var me = this;
  104677. var findPathService = new FindPathService(me.url, {
  104678. proxy: me.options.proxy,
  104679. withCredentials: me.options.withCredentials,
  104680. crossOrigin: me.options.crossOrigin,
  104681. headers: me.options.headers,
  104682. eventListeners: {
  104683. scope: me,
  104684. processCompleted: callback,
  104685. processFailed: callback
  104686. },
  104687. format: me._processFormat(resultFormat)
  104688. });
  104689. findPathService.processAsync(params);
  104690. }
  104691. /**
  104692. * @function NetworkAnalystService.prototype.findTSPPaths
  104693. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  104694. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  104695. * @param {RequestCallback} callback - 回调函数。
  104696. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104697. */
  104698. }, {
  104699. key: "findTSPPaths",
  104700. value: function findTSPPaths(params, callback, resultFormat) {
  104701. var me = this;
  104702. var findTSPPathsService = new FindTSPPathsService(me.url, {
  104703. proxy: me.options.proxy,
  104704. withCredentials: me.options.withCredentials,
  104705. crossOrigin: me.options.crossOrigin,
  104706. headers: me.options.headers,
  104707. eventListeners: {
  104708. scope: me,
  104709. processCompleted: callback,
  104710. processFailed: callback
  104711. },
  104712. format: me._processFormat(resultFormat)
  104713. });
  104714. findTSPPathsService.processAsync(params);
  104715. }
  104716. /**
  104717. * @function NetworkAnalystService.prototype.findMTSPPaths
  104718. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  104719. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  104720. * @param {RequestCallback} callback - 回调函数。
  104721. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104722. */
  104723. }, {
  104724. key: "findMTSPPaths",
  104725. value: function findMTSPPaths(params, callback, resultFormat) {
  104726. var me = this;
  104727. var findMTSPPathsService = new FindMTSPPathsService(me.url, {
  104728. proxy: me.options.proxy,
  104729. withCredentials: me.options.withCredentials,
  104730. crossOrigin: me.options.crossOrigin,
  104731. headers: me.options.headers,
  104732. eventListeners: {
  104733. scope: me,
  104734. processCompleted: callback,
  104735. processFailed: callback
  104736. },
  104737. format: me._processFormat(resultFormat)
  104738. });
  104739. findMTSPPathsService.processAsync(params);
  104740. }
  104741. /**
  104742. * @function NetworkAnalystService.prototype.findServiceAreas
  104743. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  104744. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类。
  104745. * @param {RequestCallback} callback 回调函数。
  104746. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104747. */
  104748. }, {
  104749. key: "findServiceAreas",
  104750. value: function findServiceAreas(params, callback, resultFormat) {
  104751. var me = this;
  104752. var findServiceAreasService = new FindServiceAreasService(me.url, {
  104753. proxy: me.options.proxy,
  104754. withCredentials: me.options.withCredentials,
  104755. crossOrigin: me.options.crossOrigin,
  104756. headers: me.options.headers,
  104757. eventListeners: {
  104758. scope: me,
  104759. processCompleted: callback,
  104760. processFailed: callback
  104761. },
  104762. format: me._processFormat(resultFormat)
  104763. });
  104764. findServiceAreasService.processAsync(params);
  104765. }
  104766. /**
  104767. * @function NetworkAnalystService.prototype.updateEdgeWeight
  104768. * @description 更新边的耗费权重服务。
  104769. * @param {UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  104770. * @param {RequestCallback} callback 回调函数。
  104771. */
  104772. }, {
  104773. key: "updateEdgeWeight",
  104774. value: function updateEdgeWeight(params, callback) {
  104775. var me = this;
  104776. var updateEdgeWeightService = new UpdateEdgeWeightService(me.url, {
  104777. proxy: me.options.proxy,
  104778. withCredentials: me.options.withCredentials,
  104779. crossOrigin: me.options.crossOrigin,
  104780. headers: me.options.headers,
  104781. eventListeners: {
  104782. scope: me,
  104783. processCompleted: callback,
  104784. processFailed: callback
  104785. }
  104786. });
  104787. updateEdgeWeightService.processAsync(params);
  104788. }
  104789. /**
  104790. * @function NetworkAnalystService.prototype.updateTurnNodeWeight
  104791. * @description 转向耗费权重更新服务。
  104792. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  104793. * @param {RequestCallback} callback - 回调函数。
  104794. */
  104795. }, {
  104796. key: "updateTurnNodeWeight",
  104797. value: function updateTurnNodeWeight(params, callback) {
  104798. var me = this;
  104799. var updateTurnNodeWeightService = new UpdateTurnNodeWeightService(me.url, {
  104800. proxy: me.options.proxy,
  104801. withCredentials: me.options.withCredentials,
  104802. crossOrigin: me.options.crossOrigin,
  104803. headers: me.options.headers,
  104804. eventListeners: {
  104805. scope: me,
  104806. processCompleted: callback,
  104807. processFailed: callback
  104808. }
  104809. });
  104810. updateTurnNodeWeightService.processAsync(params);
  104811. }
  104812. }, {
  104813. key: "_processFormat",
  104814. value: function _processFormat(resultFormat) {
  104815. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  104816. }
  104817. }]);
  104818. return NetworkAnalystService;
  104819. }();
  104820. ;// CONCATENATED MODULE: ./src/leaflet/services/NetworkAnalystService.js
  104821. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  104822. * This program are made available under the terms of the Apache License, Version 2.0
  104823. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  104824. /**
  104825. * @class NetworkAnalystService
  104826. * @deprecatedclassinstance L.supermap.networkAnalystService
  104827. * @classdesc 网络分析服务类。
  104828. * @category iServer NetworkAnalyst
  104829. * @modulecategory Services
  104830. * @example
  104831. * new NetworkAnalystService(url)
  104832. * .findPath(params,function(result){
  104833. * //doSomething
  104834. * })
  104835. * @param {string} url - 服务地址。请求网络分析服务,URL应为:
  104836. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。<br>
  104837. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  104838. * @param {Object} options - 参数。
  104839. * @param {string} [options.proxy] - 服务代理地址。
  104840. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  104841. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  104842. * @param {Object} [options.headers] - 请求头。
  104843. * @extends {ServiceBase}
  104844. * @usage
  104845. */
  104846. var NetworkAnalystService_NetworkAnalystService = ServiceBase.extend({
  104847. initialize: function initialize(url, options) {
  104848. ServiceBase.prototype.initialize.call(this, url, options);
  104849. this._networkAnalystService = new NetworkAnalystService(url, options);
  104850. },
  104851. /**
  104852. * @function NetworkAnalystService.prototype.burstPipelineAnalyst
  104853. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  104854. * @param {BurstPipelineAnalystParameters} params - 爆管分析参数类。
  104855. * @param {RequestCallback} callback - 回调函数。
  104856. */
  104857. burstPipelineAnalyst: function burstPipelineAnalyst(params, callback) {
  104858. params = this._processParams(params);
  104859. this._networkAnalystService.burstPipelineAnalyst(params, callback);
  104860. },
  104861. /**
  104862. * @function NetworkAnalystService.prototype.computeWeightMatrix
  104863. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  104864. * @param {ComputeWeightMatrixParameters} params - 耗费矩阵分析参数类。
  104865. * @param {RequestCallback} callback - 回调函数。
  104866. */
  104867. computeWeightMatrix: function computeWeightMatrix(params, callback) {
  104868. params = this._processParams(params);
  104869. this._networkAnalystService.computeWeightMatrix(params, callback);
  104870. },
  104871. /**
  104872. * @function NetworkAnalystService.prototype.findClosestFacilities
  104873. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  104874. * @param {FindClosestFacilitiesParameters} params - 最近设施分析参数类。
  104875. * @param {RequestCallback} callback - 回调函数。
  104876. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104877. */
  104878. findClosestFacilities: function findClosestFacilities(params, callback, resultFormat) {
  104879. params = this._processParams(params);
  104880. this._networkAnalystService.findClosestFacilities(params, callback, resultFormat);
  104881. },
  104882. /**
  104883. * @function NetworkAnalystService.prototype.streamFacilityAnalyst
  104884. * @description 上游/下游关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  104885. * @param {FacilityAnalystStreamParameters} params - 上游/下游关键设施查找资源参数类。
  104886. * @param {RequestCallback} callback - 回调函数。
  104887. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104888. */
  104889. streamFacilityAnalyst: function streamFacilityAnalyst(params, callback, resultFormat) {
  104890. params = this._processParams(params);
  104891. this._networkAnalystService.streamFacilityAnalyst(params, callback, resultFormat);
  104892. },
  104893. /**
  104894. * @function NetworkAnalystService.prototype.findLocation
  104895. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  104896. * @param {FindLocationParameters} params - 选址分区分析参数类。
  104897. * @param {RequestCallback} callback - 回调函数。
  104898. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104899. */
  104900. findLocation: function findLocation(params, callback, resultFormat) {
  104901. params = this._processParams(params);
  104902. this._networkAnalystService.findLocation(params, callback, resultFormat);
  104903. },
  104904. /**
  104905. * @function NetworkAnalystService.prototype.findPath
  104906. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  104907. * @param {FindPathParameters} params - 最佳路径分析服务参数类。
  104908. * @param {RequestCallback} callback - 回调函数。
  104909. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104910. */
  104911. findPath: function findPath(params, callback, resultFormat) {
  104912. params = this._processParams(params);
  104913. this._networkAnalystService.findPath(params, callback, resultFormat);
  104914. },
  104915. /**
  104916. * @function NetworkAnalystService.prototype.findTSPPaths
  104917. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  104918. * @param {FindTSPPathsParameters} params - 旅行商分析服务参数类。
  104919. * @param {RequestCallback} callback - 回调函数。
  104920. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104921. */
  104922. findTSPPaths: function findTSPPaths(params, callback, resultFormat) {
  104923. params = this._processParams(params);
  104924. this._networkAnalystService.findTSPPaths(params, callback, resultFormat);
  104925. },
  104926. /**
  104927. * @function NetworkAnalystService.prototype.findMTSPPaths
  104928. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  104929. * @param {FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  104930. * @param {RequestCallback} callback - 回调函数。
  104931. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104932. */
  104933. findMTSPPaths: function findMTSPPaths(params, callback, resultFormat) {
  104934. params = this._processParams(params);
  104935. this._networkAnalystService.findMTSPPaths(params, callback, resultFormat);
  104936. },
  104937. /**
  104938. * @function NetworkAnalystService.prototype.findServiceAreas
  104939. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  104940. * @param {FindServiceAreasParameters} params - 服务区分析服务参数类。
  104941. * @param {RequestCallback} callback - 回调函数。
  104942. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  104943. */
  104944. findServiceAreas: function findServiceAreas(params, callback, resultFormat) {
  104945. params = this._processParams(params);
  104946. this._networkAnalystService.findServiceAreas(params, callback, resultFormat);
  104947. },
  104948. /**
  104949. * @function NetworkAnalystService.prototype.updateEdgeWeight
  104950. * @description 更新边的耗费权重服务。
  104951. * @param {UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  104952. * @param {RequestCallback} callback -回调函数。
  104953. */
  104954. updateEdgeWeight: function updateEdgeWeight(params, callback) {
  104955. this._networkAnalystService.updateEdgeWeight(params, callback);
  104956. },
  104957. /**
  104958. * @function NetworkAnalystService.prototype.updateTurnNodeWeight
  104959. * @description 转向耗费权重更新服务。
  104960. * @param {UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  104961. * @param {RequestCallback} callback - 回调函数。
  104962. */
  104963. updateTurnNodeWeight: function updateTurnNodeWeight(params, callback) {
  104964. this._networkAnalystService.updateTurnNodeWeight(params, callback);
  104965. },
  104966. _processParams: function _processParams(params) {
  104967. if (!params) {
  104968. return {};
  104969. }
  104970. if (params.centers && external_L_default().Util.isArray(params.centers)) {
  104971. params.centers.map(function (point, key) {
  104972. params.centers[key] = point instanceof (external_L_default()).LatLng ? {
  104973. x: point.lng,
  104974. y: point.lat
  104975. } : point;
  104976. return params.centers[key];
  104977. });
  104978. }
  104979. if (params.nodes && external_L_default().Util.isArray(params.nodes)) {
  104980. params.nodes.map(function (point, key) {
  104981. params.nodes[key] = point instanceof (external_L_default()).LatLng ? {
  104982. x: point.lng,
  104983. y: point.lat
  104984. } : point;
  104985. return params.nodes[key];
  104986. });
  104987. }
  104988. if (params.event && params.event instanceof (external_L_default()).LatLng) {
  104989. params.event = {
  104990. x: params.event.lng,
  104991. y: params.event.lat
  104992. };
  104993. }
  104994. if (params.facilities && external_L_default().Util.isArray(params.facilities)) {
  104995. params.facilities.map(function (point, key) {
  104996. params.facilities[key] = point instanceof (external_L_default()).LatLng ? {
  104997. x: point.lng,
  104998. y: point.lat
  104999. } : point;
  105000. return params.facilities[key];
  105001. });
  105002. }
  105003. if (params.parameter && params.parameter.barrierPoints) {
  105004. var barrierPoints = params.parameter.barrierPoints;
  105005. if (external_L_default().Util.isArray(barrierPoints)) {
  105006. barrierPoints.map(function (point, key) {
  105007. params.parameter.barrierPoints[key] = point instanceof (external_L_default()).LatLng ? {
  105008. x: point.lng,
  105009. y: point.lat
  105010. } : point;
  105011. return params.parameter.barrierPoints[key];
  105012. });
  105013. } else {
  105014. params.parameter.barrierPoints = [barrierPoints instanceof (external_L_default()).LatLng ? {
  105015. x: barrierPoints.lng,
  105016. y: barrierPoints.lat
  105017. } : barrierPoints];
  105018. }
  105019. }
  105020. return params;
  105021. },
  105022. _processFormat: function _processFormat(resultFormat) {
  105023. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  105024. }
  105025. });
  105026. var networkAnalystService = function networkAnalystService(url, options) {
  105027. return new NetworkAnalystService_NetworkAnalystService(url, options);
  105028. };
  105029. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingService.js
  105030. function ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  105031. 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); } }
  105032. 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; }
  105033. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  105034. * This program are made available under the terms of the Apache License, Version 2.0
  105035. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  105036. /**
  105037. * @class ProcessingService
  105038. * @category iServer ProcessingService
  105039. * @classdesc 分布式分析相关服务类。
  105040. * @extends {ServiceBase}
  105041. * @example
  105042. * new ProcessingService(url,options)
  105043. * .getKernelDensityJobs(function(result){
  105044. * //doSomething
  105045. * })
  105046. * @param {string} url - 服务地址。
  105047. * @param {Object} options - 参数。
  105048. * @param {string} [options.proxy] - 服务代理地址。
  105049. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  105050. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  105051. * @param {Object} [options.headers] - 请求头。
  105052. * @usage
  105053. */
  105054. var ProcessingService = /*#__PURE__*/function () {
  105055. function ProcessingService(url, options) {
  105056. ProcessingService_classCallCheck(this, ProcessingService);
  105057. this.url = url;
  105058. this.options = options || {};
  105059. this.kernelDensityJobs = {};
  105060. this.summaryMeshJobs = {};
  105061. this.queryJobs = {};
  105062. this.summaryRegionJobs = {};
  105063. this.vectorClipJobs = {};
  105064. this.overlayGeoJobs = {};
  105065. this.buffersJobs = {};
  105066. this.topologyValidatorJobs = {};
  105067. this.summaryAttributesJobs = {};
  105068. }
  105069. /**
  105070. * @function ProcessingService.prototype.getKernelDensityJobs
  105071. * @description 获取密度分析的列表。
  105072. * @param {RequestCallback} callback - 回调函数。
  105073. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105074. */
  105075. ProcessingService_createClass(ProcessingService, [{
  105076. key: "getKernelDensityJobs",
  105077. value: function getKernelDensityJobs(callback, resultFormat) {
  105078. var me = this,
  105079. format = me._processFormat(resultFormat);
  105080. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  105081. proxy: me.options.proxy,
  105082. withCredentials: me.options.withCredentials,
  105083. crossOrigin: me.options.crossOrigin,
  105084. headers: me.options.headers,
  105085. eventListeners: {
  105086. scope: me,
  105087. processCompleted: callback,
  105088. processFailed: callback
  105089. },
  105090. format: format
  105091. });
  105092. kernelDensityJobsService.getKernelDensityJobs();
  105093. }
  105094. /**
  105095. * @function ProcessingService.prototype.getKernelDensityJob
  105096. * @description 获取某个密度分析。
  105097. * @param {string} id - 空间分析的ID。
  105098. * @param {RequestCallback} callback - 回调函数。
  105099. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105100. */
  105101. }, {
  105102. key: "getKernelDensityJob",
  105103. value: function getKernelDensityJob(id, callback, resultFormat) {
  105104. var me = this,
  105105. format = me._processFormat(resultFormat);
  105106. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  105107. proxy: me.options.proxy,
  105108. withCredentials: me.options.withCredentials,
  105109. crossOrigin: me.options.crossOrigin,
  105110. headers: me.options.headers,
  105111. eventListeners: {
  105112. scope: me,
  105113. processCompleted: callback,
  105114. processFailed: callback
  105115. },
  105116. format: format
  105117. });
  105118. kernelDensityJobsService.getKernelDensityJob(id);
  105119. }
  105120. /**
  105121. * @function ProcessingService.prototype.addKernelDensityJob
  105122. * @description 密度分析。
  105123. * @param {KernelDensityJobParameter} params -密度分析参数类。
  105124. * @param {RequestCallback} callback 回调函数。
  105125. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105126. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105127. */
  105128. }, {
  105129. key: "addKernelDensityJob",
  105130. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  105131. var me = this,
  105132. format = me._processFormat(resultFormat);
  105133. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  105134. proxy: me.options.proxy,
  105135. withCredentials: me.options.withCredentials,
  105136. crossOrigin: me.options.crossOrigin,
  105137. headers: me.options.headers,
  105138. eventListeners: {
  105139. scope: me,
  105140. processCompleted: callback,
  105141. processFailed: callback,
  105142. processRunning: function processRunning(job) {
  105143. me.kernelDensityJobs[job.id] = job.state;
  105144. }
  105145. },
  105146. format: format
  105147. });
  105148. kernelDensityJobsService.addKernelDensityJob(params, seconds);
  105149. }
  105150. /**
  105151. * @function ProcessingService.prototype.getKernelDensityJobState
  105152. * @description 获取密度分析的状态。
  105153. * @param {string} id - 密度分析的id。
  105154. * @returns {Object} 密度分析的状态。
  105155. */
  105156. }, {
  105157. key: "getKernelDensityJobState",
  105158. value: function getKernelDensityJobState(id) {
  105159. return this.kernelDensityJobs[id];
  105160. }
  105161. /**
  105162. * @function ProcessingService.prototype.getSummaryMeshJobs
  105163. * @description 获取点聚合分析的列表。
  105164. * @param {RequestCallback} callback - 回调函数。
  105165. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105166. */
  105167. }, {
  105168. key: "getSummaryMeshJobs",
  105169. value: function getSummaryMeshJobs(callback, resultFormat) {
  105170. var me = this,
  105171. format = me._processFormat(resultFormat);
  105172. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  105173. proxy: me.options.proxy,
  105174. withCredentials: me.options.withCredentials,
  105175. crossOrigin: me.options.crossOrigin,
  105176. headers: me.options.headers,
  105177. eventListeners: {
  105178. scope: me,
  105179. processCompleted: callback,
  105180. processFailed: callback
  105181. },
  105182. format: format
  105183. });
  105184. summaryMeshJobsService.getSummaryMeshJobs();
  105185. }
  105186. /**
  105187. * @function ProcessingService.prototype.getSummaryMeshJob
  105188. * @description 获取某个点聚合分析。
  105189. * @param {string} id - 空间分析的 ID。
  105190. * @param {RequestCallback} callback - 回调函数。
  105191. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105192. */
  105193. }, {
  105194. key: "getSummaryMeshJob",
  105195. value: function getSummaryMeshJob(id, callback, resultFormat) {
  105196. var me = this,
  105197. format = me._processFormat(resultFormat);
  105198. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  105199. proxy: me.options.proxy,
  105200. withCredentials: me.options.withCredentials,
  105201. crossOrigin: me.options.crossOrigin,
  105202. headers: me.options.headers,
  105203. eventListeners: {
  105204. scope: me,
  105205. processCompleted: callback,
  105206. processFailed: callback
  105207. },
  105208. format: format
  105209. });
  105210. summaryMeshJobsService.getSummaryMeshJob(id);
  105211. }
  105212. /**
  105213. * @function ProcessingService.prototype.addSummaryMeshJob
  105214. * @description 点聚合分析。
  105215. * @param {SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  105216. * @param {RequestCallback} callback 回调函数。
  105217. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105218. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105219. */
  105220. }, {
  105221. key: "addSummaryMeshJob",
  105222. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  105223. var me = this,
  105224. format = me._processFormat(resultFormat);
  105225. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  105226. proxy: me.options.proxy,
  105227. withCredentials: me.options.withCredentials,
  105228. crossOrigin: me.options.crossOrigin,
  105229. headers: me.options.headers,
  105230. eventListeners: {
  105231. scope: me,
  105232. processCompleted: callback,
  105233. processFailed: callback,
  105234. processRunning: function processRunning(job) {
  105235. me.summaryMeshJobs[job.id] = job.state;
  105236. }
  105237. },
  105238. format: format
  105239. });
  105240. summaryMeshJobsService.addSummaryMeshJob(params, seconds);
  105241. }
  105242. /**
  105243. * @function ProcessingService.prototype.getSummaryMeshJobState
  105244. * @description 获取点聚合分析的状态。
  105245. * @param {string} id - 点聚合分析的 ID。
  105246. * @returns {Object} 点聚合分析的状态。
  105247. */
  105248. }, {
  105249. key: "getSummaryMeshJobState",
  105250. value: function getSummaryMeshJobState(id) {
  105251. return this.summaryMeshJobs[id];
  105252. }
  105253. /**
  105254. * @function ProcessingService.prototype.getQueryJobs
  105255. * @description 获取单对象查询分析的列表。
  105256. * @param {RequestCallback} callback - 回调函数。
  105257. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105258. */
  105259. }, {
  105260. key: "getQueryJobs",
  105261. value: function getQueryJobs(callback, resultFormat) {
  105262. var me = this,
  105263. format = me._processFormat(resultFormat);
  105264. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  105265. proxy: me.options.proxy,
  105266. withCredentials: me.options.withCredentials,
  105267. crossOrigin: me.options.crossOrigin,
  105268. headers: me.options.headers,
  105269. eventListeners: {
  105270. scope: me,
  105271. processCompleted: callback,
  105272. processFailed: callback
  105273. },
  105274. format: format
  105275. });
  105276. singleObjectQueryJobsService.getQueryJobs();
  105277. }
  105278. /**
  105279. * @function ProcessingService.prototype.getQueryJob
  105280. * @description 获取某个单对象查询分析。
  105281. * @param {string} id - 空间分析的 ID。
  105282. * @param {RequestCallback} callback - 回调函数。
  105283. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105284. */
  105285. }, {
  105286. key: "getQueryJob",
  105287. value: function getQueryJob(id, callback, resultFormat) {
  105288. var me = this,
  105289. format = me._processFormat(resultFormat);
  105290. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  105291. proxy: me.options.proxy,
  105292. withCredentials: me.options.withCredentials,
  105293. crossOrigin: me.options.crossOrigin,
  105294. headers: me.options.headers,
  105295. eventListeners: {
  105296. scope: me,
  105297. processCompleted: callback,
  105298. processFailed: callback
  105299. },
  105300. format: format
  105301. });
  105302. singleObjectQueryJobsService.getQueryJob(id);
  105303. }
  105304. /**
  105305. * @function ProcessingService.prototype.addQueryJob
  105306. * @description 单对象查询分析。
  105307. * @param {SingleObjectQueryJobsParameter} params - 单对象查询分析的请求参数。
  105308. * @param {RequestCallback} callback - 回调函数。
  105309. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105310. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105311. */
  105312. }, {
  105313. key: "addQueryJob",
  105314. value: function addQueryJob(params, callback, seconds, resultFormat) {
  105315. var me = this,
  105316. format = me._processFormat(resultFormat);
  105317. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  105318. proxy: me.options.proxy,
  105319. withCredentials: me.options.withCredentials,
  105320. crossOrigin: me.options.crossOrigin,
  105321. headers: me.options.headers,
  105322. eventListeners: {
  105323. scope: me,
  105324. processCompleted: callback,
  105325. processFailed: callback,
  105326. processRunning: function processRunning(job) {
  105327. me.queryJobs[job.id] = job.state;
  105328. }
  105329. },
  105330. format: format
  105331. });
  105332. singleObjectQueryJobsService.addQueryJob(params, seconds);
  105333. }
  105334. /**
  105335. * @function ProcessingService.prototype.getQueryJobState
  105336. * @description 获取单对象查询分析的状态。
  105337. * @param {string} id - 单对象查询分析的 ID。
  105338. * @returns {Object} 单对象查询分析的状态。
  105339. */
  105340. }, {
  105341. key: "getQueryJobState",
  105342. value: function getQueryJobState(id) {
  105343. return this.queryJobs[id];
  105344. }
  105345. /**
  105346. * @function ProcessingService.prototype.getSummaryRegionJobs
  105347. * @description 获取区域汇总分析的列表。
  105348. * @param {RequestCallback} callback - 回调函数。
  105349. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105350. */
  105351. }, {
  105352. key: "getSummaryRegionJobs",
  105353. value: function getSummaryRegionJobs(callback, resultFormat) {
  105354. var me = this,
  105355. format = me._processFormat(resultFormat);
  105356. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  105357. proxy: me.options.proxy,
  105358. withCredentials: me.options.withCredentials,
  105359. crossOrigin: me.options.crossOrigin,
  105360. headers: me.options.headers,
  105361. eventListeners: {
  105362. scope: me,
  105363. processCompleted: callback,
  105364. processFailed: callback
  105365. },
  105366. format: format
  105367. });
  105368. summaryRegionJobsService.getSummaryRegionJobs();
  105369. }
  105370. /**
  105371. * @function ProcessingService.prototype.getSummaryRegionJob
  105372. * @description 获取某个区域汇总分析。
  105373. * @param {string} id - 区域汇总分析的 ID。
  105374. * @param {RequestCallback} callback - 回调函数。
  105375. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105376. */
  105377. }, {
  105378. key: "getSummaryRegionJob",
  105379. value: function getSummaryRegionJob(id, callback, resultFormat) {
  105380. var me = this,
  105381. format = me._processFormat(resultFormat);
  105382. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  105383. proxy: me.options.proxy,
  105384. withCredentials: me.options.withCredentials,
  105385. crossOrigin: me.options.crossOrigin,
  105386. headers: me.options.headers,
  105387. eventListeners: {
  105388. scope: me,
  105389. processCompleted: callback,
  105390. processFailed: callback
  105391. },
  105392. format: format
  105393. });
  105394. summaryRegionJobsService.getSummaryRegionJob(id);
  105395. }
  105396. /**
  105397. * @function ProcessingService.prototype.addSummaryRegionJob
  105398. * @description 区域汇总分析。
  105399. * @param {SummaryRegionJobParameter} params - 区域汇总分析参数类。
  105400. * @param {RequestCallback} callback - 回调函数。
  105401. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105402. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105403. */
  105404. }, {
  105405. key: "addSummaryRegionJob",
  105406. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  105407. var me = this,
  105408. format = me._processFormat(resultFormat);
  105409. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  105410. proxy: me.options.proxy,
  105411. withCredentials: me.options.withCredentials,
  105412. crossOrigin: me.options.crossOrigin,
  105413. headers: me.options.headers,
  105414. eventListeners: {
  105415. scope: me,
  105416. processCompleted: callback,
  105417. processFailed: callback,
  105418. processRunning: function processRunning(job) {
  105419. me.summaryRegionJobs[job.id] = job.state;
  105420. }
  105421. },
  105422. format: format
  105423. });
  105424. summaryRegionJobsService.addSummaryRegionJob(params, seconds);
  105425. }
  105426. /**
  105427. * @function ProcessingService.prototype.getSummaryRegionJobState
  105428. * @description 获取区域汇总分析的状态。
  105429. * @param {string} id - 生成区域汇总分析的 ID。
  105430. * @returns {Object} 区域汇总分析的状态。
  105431. */
  105432. }, {
  105433. key: "getSummaryRegionJobState",
  105434. value: function getSummaryRegionJobState(id) {
  105435. return this.summaryRegionJobs[id];
  105436. }
  105437. /**
  105438. * @function ProcessingService.prototype.getVectorClipJobs
  105439. * @description 获取矢量裁剪分析的列表。
  105440. * @param {RequestCallback} callback - 回调函数。
  105441. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105442. */
  105443. }, {
  105444. key: "getVectorClipJobs",
  105445. value: function getVectorClipJobs(callback, resultFormat) {
  105446. var me = this,
  105447. format = me._processFormat(resultFormat);
  105448. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  105449. proxy: me.options.proxy,
  105450. withCredentials: me.options.withCredentials,
  105451. crossOrigin: me.options.crossOrigin,
  105452. headers: me.options.headers,
  105453. eventListeners: {
  105454. scope: me,
  105455. processCompleted: callback,
  105456. processFailed: callback
  105457. },
  105458. format: format
  105459. });
  105460. vectorClipJobsService.getVectorClipJobs();
  105461. }
  105462. /**
  105463. * @function ProcessingService.prototype.getVectorClipJob
  105464. * @description 获取某个矢量裁剪分析。
  105465. * @param {string} id - 空间分析的 ID。
  105466. * @param {RequestCallback} callback - 回调函数。
  105467. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105468. */
  105469. }, {
  105470. key: "getVectorClipJob",
  105471. value: function getVectorClipJob(id, callback, resultFormat) {
  105472. var me = this,
  105473. format = me._processFormat(resultFormat);
  105474. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  105475. proxy: me.options.proxy,
  105476. withCredentials: me.options.withCredentials,
  105477. crossOrigin: me.options.crossOrigin,
  105478. headers: me.options.headers,
  105479. eventListeners: {
  105480. scope: me,
  105481. processCompleted: callback,
  105482. processFailed: callback
  105483. },
  105484. format: format
  105485. });
  105486. vectorClipJobsService.getVectorClipJob(id);
  105487. }
  105488. /**
  105489. * @function ProcessingService.prototype.addVectorClipJob
  105490. * @description 矢量裁剪分析。
  105491. * @param {VectorClipJobsParameter} params - 矢量裁剪分析请求参数类。
  105492. * @param {RequestCallback} callback - 回调函数。
  105493. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105494. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105495. */
  105496. }, {
  105497. key: "addVectorClipJob",
  105498. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  105499. var me = this,
  105500. format = me._processFormat(resultFormat);
  105501. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  105502. proxy: me.options.proxy,
  105503. withCredentials: me.options.withCredentials,
  105504. crossOrigin: me.options.crossOrigin,
  105505. headers: me.options.headers,
  105506. eventListeners: {
  105507. scope: me,
  105508. processCompleted: callback,
  105509. processFailed: callback,
  105510. processRunning: function processRunning(job) {
  105511. me.vectorClipJobs[job.id] = job.state;
  105512. }
  105513. },
  105514. format: format
  105515. });
  105516. vectorClipJobsService.addVectorClipJob(params, seconds);
  105517. }
  105518. /**
  105519. * @function ProcessingService.prototype.getVectorClipJobState
  105520. * @description 获取矢量裁剪分析的状态。
  105521. * @param {number} id - 矢量裁剪分析的ID。
  105522. * @returns {Object} 矢量裁剪分析的状态。
  105523. */
  105524. }, {
  105525. key: "getVectorClipJobState",
  105526. value: function getVectorClipJobState(id) {
  105527. return this.vectorClipJobs[id];
  105528. }
  105529. /**
  105530. * @function ProcessingService.prototype.getOverlayGeoJobs
  105531. * @description 获取叠加分析的列表。
  105532. * @param {RequestCallback} callback - 回调函数。
  105533. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105534. */
  105535. }, {
  105536. key: "getOverlayGeoJobs",
  105537. value: function getOverlayGeoJobs(callback, resultFormat) {
  105538. var me = this,
  105539. format = me._processFormat(resultFormat);
  105540. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  105541. proxy: me.options.proxy,
  105542. withCredentials: me.options.withCredentials,
  105543. crossOrigin: me.options.crossOrigin,
  105544. headers: me.options.headers,
  105545. eventListeners: {
  105546. scope: me,
  105547. processCompleted: callback,
  105548. processFailed: callback
  105549. },
  105550. format: format
  105551. });
  105552. overlayGeoJobsService.getOverlayGeoJobs();
  105553. }
  105554. /**
  105555. * @function ProcessingService.prototype.getOverlayGeoJob
  105556. * @description 获取某个叠加分析。
  105557. * @param {string} id - 空间分析的 ID。
  105558. * @param {RequestCallback} callback - 回调函数。
  105559. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105560. */
  105561. }, {
  105562. key: "getOverlayGeoJob",
  105563. value: function getOverlayGeoJob(id, callback, resultFormat) {
  105564. var me = this,
  105565. format = me._processFormat(resultFormat);
  105566. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  105567. proxy: me.options.proxy,
  105568. withCredentials: me.options.withCredentials,
  105569. crossOrigin: me.options.crossOrigin,
  105570. headers: me.options.headers,
  105571. eventListeners: {
  105572. scope: me,
  105573. processCompleted: callback,
  105574. processFailed: callback
  105575. },
  105576. format: format
  105577. });
  105578. overlayGeoJobsService.getOverlayGeoJob(id);
  105579. }
  105580. /**
  105581. * @function ProcessingService.prototype.addOverlayGeoJob
  105582. * @description 叠加分析。
  105583. * @param {OverlayGeoJobParameter} params - 叠加分析请求参数类。
  105584. * @param {RequestCallback} callback - 回调函数。
  105585. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105586. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105587. */
  105588. }, {
  105589. key: "addOverlayGeoJob",
  105590. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  105591. var me = this,
  105592. format = me._processFormat(resultFormat);
  105593. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  105594. proxy: me.options.proxy,
  105595. withCredentials: me.options.withCredentials,
  105596. crossOrigin: me.options.crossOrigin,
  105597. headers: me.options.headers,
  105598. eventListeners: {
  105599. scope: me,
  105600. processCompleted: callback,
  105601. processFailed: callback,
  105602. processRunning: function processRunning(job) {
  105603. me.overlayGeoJobs[job.id] = job.state;
  105604. }
  105605. },
  105606. format: format
  105607. });
  105608. overlayGeoJobsService.addOverlayGeoJob(params, seconds);
  105609. }
  105610. /**
  105611. * @function ProcessingService.prototype.getoverlayGeoJobState
  105612. * @description 获取叠加分析的状态。
  105613. * @param {string} id - 叠加分析的 ID。
  105614. * @returns {Object} 叠加分析的状态。
  105615. */
  105616. }, {
  105617. key: "getoverlayGeoJobState",
  105618. value: function getoverlayGeoJobState(id) {
  105619. return this.overlayGeoJobs[id];
  105620. }
  105621. /**
  105622. * @function ProcessingService.prototype.getBuffersJobs
  105623. * @description 获取缓冲区分析的列表。
  105624. * @param {RequestCallback} callback - 回调函数。
  105625. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105626. */
  105627. }, {
  105628. key: "getBuffersJobs",
  105629. value: function getBuffersJobs(callback, resultFormat) {
  105630. var me = this,
  105631. format = me._processFormat(resultFormat);
  105632. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  105633. proxy: me.options.proxy,
  105634. withCredentials: me.options.withCredentials,
  105635. crossOrigin: me.options.crossOrigin,
  105636. headers: me.options.headers,
  105637. eventListeners: {
  105638. scope: me,
  105639. processCompleted: callback,
  105640. processFailed: callback
  105641. },
  105642. format: format
  105643. });
  105644. buffersAnalystJobsService.getBuffersJobs();
  105645. }
  105646. /**
  105647. * @function ProcessingService.prototype.getBuffersJob
  105648. * @description 获取某个缓冲区分析。
  105649. * @param {string} id - 空间分析的 ID。
  105650. * @param {RequestCallback} callback - 回调函数。
  105651. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105652. */
  105653. }, {
  105654. key: "getBuffersJob",
  105655. value: function getBuffersJob(id, callback, resultFormat) {
  105656. var me = this,
  105657. format = me._processFormat(resultFormat);
  105658. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  105659. proxy: me.options.proxy,
  105660. withCredentials: me.options.withCredentials,
  105661. crossOrigin: me.options.crossOrigin,
  105662. headers: me.options.headers,
  105663. eventListeners: {
  105664. scope: me,
  105665. processCompleted: callback,
  105666. processFailed: callback
  105667. },
  105668. format: format
  105669. });
  105670. buffersAnalystJobsService.getBuffersJob(id);
  105671. }
  105672. /**
  105673. * @function ProcessingService.prototype.addBuffersJob
  105674. * @description 缓冲区分析。
  105675. * @param {BuffersAnalystJobsParameter} params - 缓冲区分析请求参数类。
  105676. * @param {RequestCallback} callback - 回调函数。
  105677. * @param {number} seconds - 获取创建成功结果的时间间隔。
  105678. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105679. */
  105680. }, {
  105681. key: "addBuffersJob",
  105682. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  105683. var me = this,
  105684. format = me._processFormat(resultFormat);
  105685. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  105686. proxy: me.options.proxy,
  105687. withCredentials: me.options.withCredentials,
  105688. crossOrigin: me.options.crossOrigin,
  105689. headers: me.options.headers,
  105690. eventListeners: {
  105691. scope: me,
  105692. processCompleted: callback,
  105693. processFailed: callback,
  105694. processRunning: function processRunning(job) {
  105695. me.buffersJobs[job.id] = job.state;
  105696. }
  105697. },
  105698. format: format
  105699. });
  105700. buffersAnalystJobsService.addBuffersJob(params, seconds);
  105701. }
  105702. /**
  105703. * @function ProcessingService.prototype.getBuffersJobState
  105704. * @description 获取缓冲区分析的状态。
  105705. * @param {string} id - 缓冲区分析的 ID。
  105706. * @returns {Object} 缓冲区分析的状态。
  105707. */
  105708. }, {
  105709. key: "getBuffersJobState",
  105710. value: function getBuffersJobState(id) {
  105711. return this.buffersJobs[id];
  105712. }
  105713. /**
  105714. * @function ProcessingService.prototype.getTopologyValidatorJobs
  105715. * @description 获取拓扑检查分析的列表。
  105716. * @param {RequestCallback} callback - 回调函数。
  105717. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105718. */
  105719. }, {
  105720. key: "getTopologyValidatorJobs",
  105721. value: function getTopologyValidatorJobs(callback, resultFormat) {
  105722. var me = this,
  105723. format = me._processFormat(resultFormat);
  105724. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  105725. proxy: me.options.proxy,
  105726. withCredentials: me.options.withCredentials,
  105727. crossOrigin: me.options.crossOrigin,
  105728. headers: me.options.headers,
  105729. eventListeners: {
  105730. scope: me,
  105731. processCompleted: callback,
  105732. processFailed: callback
  105733. },
  105734. format: format
  105735. });
  105736. topologyValidatorJobsService.getTopologyValidatorJobs();
  105737. }
  105738. /**
  105739. * @function ProcessingService.prototype.getTopologyValidatorJob
  105740. * @description 获取某个拓扑检查分析。
  105741. * @param {string} id - 空间分析的 ID。
  105742. * @param {RequestCallback} callback - 回调函数。
  105743. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105744. */
  105745. }, {
  105746. key: "getTopologyValidatorJob",
  105747. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  105748. var me = this,
  105749. format = me._processFormat(resultFormat);
  105750. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  105751. proxy: me.options.proxy,
  105752. withCredentials: me.options.withCredentials,
  105753. crossOrigin: me.options.crossOrigin,
  105754. headers: me.options.headers,
  105755. eventListeners: {
  105756. scope: me,
  105757. processCompleted: callback,
  105758. processFailed: callback
  105759. },
  105760. format: format
  105761. });
  105762. topologyValidatorJobsService.getTopologyValidatorJob(id);
  105763. }
  105764. /**
  105765. * @function ProcessingService.prototype.addTopologyValidatorJob
  105766. * @description 拓扑检查分析。
  105767. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析请求参数类。
  105768. * @param {RequestCallback} callback - 回调函数。
  105769. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105770. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105771. */
  105772. }, {
  105773. key: "addTopologyValidatorJob",
  105774. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  105775. var me = this,
  105776. format = me._processFormat(resultFormat);
  105777. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  105778. proxy: me.options.proxy,
  105779. withCredentials: me.options.withCredentials,
  105780. crossOrigin: me.options.crossOrigin,
  105781. headers: me.options.headers,
  105782. eventListeners: {
  105783. scope: me,
  105784. processCompleted: callback,
  105785. processFailed: callback,
  105786. processRunning: function processRunning(job) {
  105787. me.topologyValidatorJobs[job.id] = job.state;
  105788. }
  105789. },
  105790. format: format
  105791. });
  105792. topologyValidatorJobsService.addTopologyValidatorJob(params, seconds);
  105793. }
  105794. /**
  105795. * @function ProcessingService.prototype.getTopologyValidatorJobState
  105796. * @description 获取拓扑检查分析的状态。
  105797. * @param {string} id - 拓扑检查分析的 ID。
  105798. * @returns {Object} 拓扑检查分析的状态。
  105799. */
  105800. }, {
  105801. key: "getTopologyValidatorJobState",
  105802. value: function getTopologyValidatorJobState(id) {
  105803. return this.topologyValidatorJobs[id];
  105804. }
  105805. /**
  105806. * @function ProcessingService.prototype.getSummaryAttributesJobs
  105807. * @description 获取属性汇总分析的列表。
  105808. * @param {RequestCallback} callback - 回调函数。
  105809. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105810. */
  105811. }, {
  105812. key: "getSummaryAttributesJobs",
  105813. value: function getSummaryAttributesJobs(callback, resultFormat) {
  105814. var me = this,
  105815. format = me._processFormat(resultFormat);
  105816. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  105817. proxy: me.options.proxy,
  105818. withCredentials: me.options.withCredentials,
  105819. crossOrigin: me.options.crossOrigin,
  105820. headers: me.options.headers,
  105821. eventListeners: {
  105822. scope: me,
  105823. processCompleted: callback,
  105824. processFailed: callback
  105825. },
  105826. format: format
  105827. });
  105828. summaryAttributesJobsService.getSummaryAttributesJobs();
  105829. }
  105830. /**
  105831. * @function ProcessingService.prototype.getSummaryAttributesJob
  105832. * @description 获取某个属性汇总分析。
  105833. * @param {string} id - 空间分析的 ID。
  105834. * @param {RequestCallback} callback - 回调函数。
  105835. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105836. */
  105837. }, {
  105838. key: "getSummaryAttributesJob",
  105839. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  105840. var me = this,
  105841. format = me._processFormat(resultFormat);
  105842. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  105843. proxy: me.options.proxy,
  105844. withCredentials: me.options.withCredentials,
  105845. crossOrigin: me.options.crossOrigin,
  105846. headers: me.options.headers,
  105847. eventListeners: {
  105848. scope: me,
  105849. processCompleted: callback,
  105850. processFailed: callback
  105851. },
  105852. format: format
  105853. });
  105854. summaryAttributesJobsService.getSummaryAttributesJob(id);
  105855. }
  105856. /**
  105857. * @function ProcessingService.prototype.addSummaryAttributesJob
  105858. * @description 属性汇总分析。
  105859. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析参数类。
  105860. * @param {RequestCallback} callback - 回调函数。
  105861. * @param {number} [seconds=1000] - 获取创建成功结果的时间间隔。
  105862. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105863. */
  105864. }, {
  105865. key: "addSummaryAttributesJob",
  105866. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  105867. var me = this,
  105868. format = me._processFormat(resultFormat);
  105869. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  105870. proxy: me.options.proxy,
  105871. withCredentials: me.options.withCredentials,
  105872. crossOrigin: me.options.crossOrigin,
  105873. headers: me.options.headers,
  105874. eventListeners: {
  105875. scope: me,
  105876. processCompleted: callback,
  105877. processFailed: callback,
  105878. processRunning: function processRunning(job) {
  105879. me.summaryAttributesJobs[job.id] = job.state;
  105880. }
  105881. },
  105882. format: format
  105883. });
  105884. summaryAttributesJobsService.addSummaryAttributesJob(params, seconds);
  105885. }
  105886. /**
  105887. * @function ProcessingService.prototype.getSummaryAttributesJobState
  105888. * @description 获取属性汇总分析的状态。
  105889. * @param {string} id - 属性汇总分析的 ID。
  105890. * @returns {Object} 属性汇总分析的状态
  105891. */
  105892. }, {
  105893. key: "getSummaryAttributesJobState",
  105894. value: function getSummaryAttributesJobState(id) {
  105895. return this.summaryAttributesJobs[id];
  105896. }
  105897. }, {
  105898. key: "_processFormat",
  105899. value: function _processFormat(resultFormat) {
  105900. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  105901. }
  105902. }]);
  105903. return ProcessingService;
  105904. }();
  105905. ;// CONCATENATED MODULE: ./src/leaflet/services/ProcessingService.js
  105906. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  105907. * This program are made available under the terms of the Apache License, Version 2.0
  105908. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  105909. /**
  105910. * @class ProcessingService
  105911. * @deprecatedclassinstance L.supermap.processingService
  105912. * @classdesc 分布式分析服务类。
  105913. * @category iServer ProcessingService
  105914. * @modulecategory Services
  105915. * @extends ServiceBase
  105916. * @example
  105917. * new ProcessingService(url)
  105918. * .getKernelDensityJobs(function(result){
  105919. * //doSomething
  105920. * })
  105921. * @param {string} url - 服务地址。
  105922. * @param {Object} options - 参数。
  105923. * @param {string} [options.proxy] - 服务代理地址。
  105924. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  105925. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  105926. * @param {Object} [options.headers] - 请求头。
  105927. * @usage
  105928. */
  105929. var ProcessingService_ProcessingService = ServiceBase.extend({
  105930. initialize: function initialize(url, options) {
  105931. options = options || {};
  105932. external_L_default().setOptions(this, options);
  105933. ServiceBase.prototype.initialize.call(this, url, options);
  105934. this.kernelDensityJobs = {};
  105935. this.summaryMeshJobs = {};
  105936. this.queryJobs = {};
  105937. this.summaryRegionJobs = {};
  105938. this.vectorClipJobs = {};
  105939. this.overlayGeoJobs = {};
  105940. this.buffersJobs = {};
  105941. this.topologyValidatorJobs = {};
  105942. this.summaryAttributesJobs = {};
  105943. this._processingService = new ProcessingService(url, options);
  105944. },
  105945. /**
  105946. * @function ProcessingService.prototype.getKernelDensityJobs
  105947. * @description 获取密度分析的列表。
  105948. * @param {RequestCallback} callback - 回调函数。
  105949. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105950. */
  105951. getKernelDensityJobs: function getKernelDensityJobs(callback, resultFormat) {
  105952. this._processingService.getKernelDensityJobs(callback, resultFormat);
  105953. },
  105954. /**
  105955. * @function ProcessingService.prototype.getKernelDensityJob
  105956. * @description 获取指定 ID 的密度分析。
  105957. * @param {string} id - 空间分析的 ID。
  105958. * @param {RequestCallback} callback - 回调函数。
  105959. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105960. */
  105961. getKernelDensityJob: function getKernelDensityJob(id, callback, resultFormat) {
  105962. this._processingService.getKernelDensityJob(id, callback, resultFormat);
  105963. },
  105964. /**
  105965. * @function ProcessingService.prototype.addKernelDensityJob
  105966. * @description 新建密度分析。
  105967. * @param {KernelDensityJobParameter} params - 密度分析任务参数类。
  105968. * @param {RequestCallback} callback - 回调函数。
  105969. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  105970. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105971. */
  105972. addKernelDensityJob: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  105973. var processParams = this._processParams(params);
  105974. this._processingService.addKernelDensityJob(processParams, callback, seconds, resultFormat);
  105975. },
  105976. /**
  105977. * @function ProcessingService.prototype.getKernelDensityJobState
  105978. * @description 获取密度分析的状态。
  105979. * @param {string} id - 密度分析 ID。
  105980. * @returns {Object} 密度分析的状态。
  105981. */
  105982. getKernelDensityJobState: function getKernelDensityJobState(id) {
  105983. return this._processingService.getKernelDensityJobState(id);
  105984. },
  105985. /**
  105986. * @function ProcessingService.prototype.getSummaryMeshJobs
  105987. * @description 获取点聚合分析的列表。
  105988. * @param {RequestCallback} callback - 回调函数。
  105989. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  105990. */
  105991. getSummaryMeshJobs: function getSummaryMeshJobs(callback, resultFormat) {
  105992. this._processingService.getSummaryMeshJobs(callback, resultFormat);
  105993. },
  105994. /**
  105995. * @function ProcessingService.prototype.getSummaryMeshJob
  105996. * @description 获取指定 ID 的点聚合分析。
  105997. * @param {string} id - 空间分析的 ID。
  105998. * @param {RequestCallback} callback - 回调函数。
  105999. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106000. */
  106001. getSummaryMeshJob: function getSummaryMeshJob(id, callback, resultFormat) {
  106002. this._processingService.getSummaryMeshJob(id, callback, resultFormat);
  106003. },
  106004. /**
  106005. * @function ProcessingService.prototype.addSummaryMeshJob
  106006. * @description 新建点聚合分析。
  106007. * @param {SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  106008. * @param {RequestCallback} callback - 回调函数。
  106009. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  106010. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106011. */
  106012. addSummaryMeshJob: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  106013. params = this._processParams(params);
  106014. this._processingService.addSummaryMeshJob(params, callback, seconds, resultFormat);
  106015. },
  106016. /**
  106017. * @function ProcessingService.prototype.getSummaryMeshJobState
  106018. * @description 获取点聚合分析的状态。
  106019. * @param {string} id - 点聚合分析的 ID。
  106020. * @returns {Object} 点聚合分析的状态。
  106021. */
  106022. getSummaryMeshJobState: function getSummaryMeshJobState(id) {
  106023. return this._processingService.getSummaryMeshJobState(id);
  106024. },
  106025. /**
  106026. * @function ProcessingService.prototype.getQueryJobs
  106027. * @description 获取单对象查询分析的列表。
  106028. * @param {RequestCallback} callback - 回调函数。
  106029. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106030. */
  106031. getQueryJobs: function getQueryJobs(callback, resultFormat) {
  106032. this._processingService.getQueryJobs(callback, resultFormat);
  106033. },
  106034. /**
  106035. * @function ProcessingService.prototype.getQueryJob
  106036. * @description 获取指定 ID 的单对象查询分析。
  106037. * @param {string} id - 空间分析的 ID。
  106038. * @param {RequestCallback} callback - 回调函数。
  106039. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106040. */
  106041. getQueryJob: function getQueryJob(id, callback, resultFormat) {
  106042. this._processingService.getQueryJob(id, callback, resultFormat);
  106043. },
  106044. /**
  106045. * @function ProcessingService.prototype.addQueryJob
  106046. * @description 新建单对象查询分析。
  106047. * @param {SingleObjectQueryJobsParameter} params - 单对象空间查询分析任务参数类。
  106048. * @param {RequestCallback} callback - 回调函数。
  106049. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  106050. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106051. */
  106052. addQueryJob: function addQueryJob(params, callback, seconds, resultFormat) {
  106053. params = this._processParams(params);
  106054. this._processingService.addQueryJob(params, callback, seconds, resultFormat);
  106055. },
  106056. /**
  106057. * @function ProcessingService.prototype.getQueryJobState
  106058. * @description 获取单对象查询分析的状态。
  106059. * @param {string} id - 单对象查询分析的 ID。
  106060. * @returns {Object} 单对象查询分析的状态。
  106061. */
  106062. getQueryJobState: function getQueryJobState(id) {
  106063. return this._processingService.getQueryJobState(id);
  106064. },
  106065. /**
  106066. * @function ProcessingService.prototype.getSummaryRegionJobs
  106067. * @description 获取区域汇总分析的列表。
  106068. * @param {RequestCallback} callback - 回调函数。
  106069. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106070. */
  106071. getSummaryRegionJobs: function getSummaryRegionJobs(callback, resultFormat) {
  106072. this._processingService.getSummaryRegionJobs(callback, resultFormat);
  106073. },
  106074. /**
  106075. * @function ProcessingService.prototype.getSummaryRegionJob
  106076. * @description 获取指定 ID 的区域汇总分析。
  106077. * @param {string} id - 区域汇总分析的 ID。
  106078. * @param {RequestCallback} callback - 回调函数。
  106079. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106080. */
  106081. getSummaryRegionJob: function getSummaryRegionJob(id, callback, resultFormat) {
  106082. this._processingService.getSummaryRegionJob(id, callback, resultFormat);
  106083. },
  106084. /**
  106085. * @function ProcessingService.prototype.addSummaryRegionJob
  106086. * @description 新建区域汇总分析。
  106087. * @param {SummaryRegionJobParameter} params - 区域汇总分析任务参数类。
  106088. * @param {RequestCallback} callback - 回调函数。
  106089. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  106090. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106091. */
  106092. addSummaryRegionJob: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  106093. params = this._processParams(params);
  106094. this._processingService.addSummaryRegionJob(params, callback, seconds, resultFormat);
  106095. },
  106096. /**
  106097. * @function ProcessingService.prototype.getSummaryRegionJobState
  106098. * @description 获取区域汇总分析的状态。
  106099. * @param {string} id - 区域汇总分析的 ID。
  106100. * @returns {Object} 区域汇总分析的状态。
  106101. */
  106102. getSummaryRegionJobState: function getSummaryRegionJobState(id) {
  106103. return this._processingService.getSummaryRegionJobState(id);
  106104. },
  106105. /**
  106106. * @function ProcessingService.prototype.getVectorClipJobs
  106107. * @description 获取矢量裁剪分析的列表。
  106108. * @param {RequestCallback} callback - 回调函数。
  106109. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106110. */
  106111. getVectorClipJobs: function getVectorClipJobs(callback, resultFormat) {
  106112. this._processingService.getVectorClipJobs(callback, resultFormat);
  106113. },
  106114. /**
  106115. * @function ProcessingService.prototype.getVectorClipJob
  106116. * @description 获取指定 ID 的矢量裁剪分析。
  106117. * @param {string} id - 空间分析的 ID。
  106118. * @param {RequestCallback} callback - 回调函数。
  106119. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106120. */
  106121. getVectorClipJob: function getVectorClipJob(id, callback, resultFormat) {
  106122. this._processingService.getVectorClipJob(id, callback, resultFormat);
  106123. },
  106124. /**
  106125. * @function ProcessingService.prototype.addVectorClipJob
  106126. * @description 新建矢量裁剪分析。
  106127. * @param {VectorClipJobsParameter} params - 矢量裁剪分析任务参数类。
  106128. * @param {RequestCallback} callback - 回调函数。
  106129. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  106130. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106131. */
  106132. addVectorClipJob: function addVectorClipJob(params, callback, seconds, resultFormat) {
  106133. params = this._processParams(params);
  106134. this._processingService.addVectorClipJob(params, callback, seconds, resultFormat);
  106135. },
  106136. /**
  106137. * @function ProcessingService.prototype.getVectorClipJobState
  106138. * @description 获取矢量裁剪分析的状态。
  106139. * @param {string} id - 矢量裁剪分析的 ID。
  106140. * @returns {Object} 矢量裁剪分析的状态。
  106141. */
  106142. getVectorClipJobState: function getVectorClipJobState(id) {
  106143. return this._processingService.getVectorClipJobState(id);
  106144. },
  106145. /**
  106146. * @function ProcessingService.prototype.getOverlayGeoJobs
  106147. * @description 获取叠加分析的列表。
  106148. * @param {RequestCallback} callback - 回调函数。
  106149. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106150. */
  106151. getOverlayGeoJobs: function getOverlayGeoJobs(callback, resultFormat) {
  106152. this._processingService.getOverlayGeoJobs(callback, resultFormat);
  106153. },
  106154. /**
  106155. * @function ProcessingService.prototype.getOverlayGeoJob
  106156. * @description 获取指定 ID 的叠加分析。
  106157. * @param {string} id - 空间分析的 ID。
  106158. * @param {RequestCallback} callback - 回调函数。
  106159. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106160. */
  106161. getOverlayGeoJob: function getOverlayGeoJob(id, callback, resultFormat) {
  106162. this._processingService.getOverlayGeoJob(id, callback, resultFormat);
  106163. },
  106164. /**
  106165. * @function ProcessingService.prototype.addOverlayGeoJob
  106166. * @description 新建叠加分析。
  106167. * @param {OverlayGeoJobParameter} params - 叠加分析任务参数类。
  106168. * @param {RequestCallback} callback - 回调函数。
  106169. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  106170. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106171. */
  106172. addOverlayGeoJob: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  106173. params = this._processParams(params);
  106174. this._processingService.addOverlayGeoJob(params, callback, seconds, resultFormat);
  106175. },
  106176. /**
  106177. * @function ProcessingService.prototype.getoverlayGeoJobState
  106178. * @description 获取叠加分析的状态。
  106179. * @param {string} id - 叠加分析的 ID。
  106180. * @returns {Object} 叠加分析的状态。
  106181. */
  106182. getoverlayGeoJobState: function getoverlayGeoJobState(id) {
  106183. return this._processingService.getoverlayGeoJobState(id);
  106184. },
  106185. /**
  106186. * @function ProcessingService.prototype.getBuffersJobs
  106187. * @description 获取缓冲区分析的列表。
  106188. * @param {RequestCallback} callback - 回调函数。
  106189. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106190. */
  106191. getBuffersJobs: function getBuffersJobs(callback, resultFormat) {
  106192. this._processingService.getBuffersJobs(callback, resultFormat);
  106193. },
  106194. /**
  106195. * @function ProcessingService.prototype.getBuffersJob
  106196. * @description 获取指定 ID 的缓冲区分析。
  106197. * @param {string} id - 空间分析的 ID。
  106198. * @param {RequestCallback} callback - 回调函数。
  106199. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106200. */
  106201. getBuffersJob: function getBuffersJob(id, callback, resultFormat) {
  106202. this._processingService.getBuffersJob(id, callback, resultFormat);
  106203. },
  106204. /**
  106205. * @function ProcessingService.prototype.addBuffersJob
  106206. * @description 新建缓冲区分析。
  106207. * @param {BuffersAnalystJobsParameter} params - 缓冲区分析任务参数类。
  106208. * @param {RequestCallback} callback - 回调函数。
  106209. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  106210. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106211. */
  106212. addBuffersJob: function addBuffersJob(params, callback, seconds, resultFormat) {
  106213. params = this._processParams(params);
  106214. this._processingService.addBuffersJob(params, callback, seconds, resultFormat);
  106215. },
  106216. /**
  106217. * @function ProcessingService.prototype.getBuffersJobState
  106218. * @description 获取缓冲区分析的状态。
  106219. * @param {string} id - 缓冲区分析的 ID。
  106220. * @returns {Object} 缓冲区分析的状态
  106221. */
  106222. getBuffersJobState: function getBuffersJobState(id) {
  106223. return this._processingService.getBuffersJobState(id);
  106224. },
  106225. /**
  106226. * @function ProcessingService.prototype.getTopologyValidatorJobs
  106227. * @description 获取拓扑检查分析的列表。
  106228. * @param {RequestCallback} callback - 回调函数。
  106229. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106230. */
  106231. getTopologyValidatorJobs: function getTopologyValidatorJobs(callback, resultFormat) {
  106232. this._processingService.getTopologyValidatorJobs(callback, resultFormat);
  106233. },
  106234. /**
  106235. * @function ProcessingService.prototype.getTopologyValidatorJob
  106236. * @description 获取指定 ID 的拓扑检查分析。
  106237. * @param {string} id - 空间分析的 ID。
  106238. * @param {RequestCallback} callback - 回调函数。
  106239. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106240. */
  106241. getTopologyValidatorJob: function getTopologyValidatorJob(id, callback, resultFormat) {
  106242. this._processingService.getTopologyValidatorJob(id, callback, resultFormat);
  106243. },
  106244. /**
  106245. * @function ProcessingService.prototype.addTopologyValidatorJob
  106246. * @description 新建拓扑检查分析。
  106247. * @param {TopologyValidatorJobsParameter} params - 拓扑检查分析任务参数类。
  106248. * @param {RequestCallback} callback - 回调函数。
  106249. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  106250. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106251. */
  106252. addTopologyValidatorJob: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  106253. params = this._processParams(params);
  106254. this._processingService.addTopologyValidatorJob(params, callback, seconds, resultFormat);
  106255. },
  106256. /**
  106257. * @function ProcessingService.prototype.getTopologyValidatorJobState
  106258. * @description 获取拓扑检查分析的状态。
  106259. * @param {string} id - 拓扑检查分析的 ID。
  106260. * @returns {Object} 拓扑检查分析的状态。
  106261. */
  106262. getTopologyValidatorJobState: function getTopologyValidatorJobState(id) {
  106263. return this._processingService.getTopologyValidatorJobState(id);
  106264. },
  106265. /**
  106266. * @function ProcessingService.prototype.getSummaryAttributesJobs
  106267. * @description 获取属性汇总分析的列表。
  106268. * @param {RequestCallback} callback - 回调函数。
  106269. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106270. */
  106271. getSummaryAttributesJobs: function getSummaryAttributesJobs(callback, resultFormat) {
  106272. this._processingService.getSummaryAttributesJobs(callback, resultFormat);
  106273. },
  106274. /**
  106275. * @function ProcessingService.prototype.getSummaryAttributesJob
  106276. * @description 获取指定 ID 的属性汇总分析。
  106277. * @param {string} id - 空间分析的 ID。
  106278. * @param {RequestCallback} callback - 回调函数。
  106279. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106280. */
  106281. getSummaryAttributesJob: function getSummaryAttributesJob(id, callback, resultFormat) {
  106282. this._processingService.getSummaryAttributesJob(id, callback, resultFormat);
  106283. },
  106284. /**
  106285. * @function ProcessingService.prototype.addSummaryAttributesJob
  106286. * @description 新建属性汇总分析。
  106287. * @param {SummaryAttributesJobsParameter} params - 属性汇总分析任务参数类。
  106288. * @param {RequestCallback} callback - 回调函数。
  106289. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  106290. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106291. */
  106292. addSummaryAttributesJob: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  106293. params = this._processParams(params);
  106294. this._processingService.addSummaryAttributesJob(params, callback, seconds, resultFormat);
  106295. },
  106296. /**
  106297. * @function ProcessingService.prototype.getSummaryAttributesJobState
  106298. * @description 获取属性汇总分析的状态。
  106299. * @param {string} id - 属性汇总分析的 ID。
  106300. * @returns {Object} 属性汇总分析的状态。
  106301. */
  106302. getSummaryAttributesJobState: function getSummaryAttributesJobState(id) {
  106303. return this._processingService.getSummaryAttributesJobState(id);
  106304. },
  106305. _processParams: function _processParams(params) {
  106306. if (!params) {
  106307. return {};
  106308. }
  106309. if (params.bounds) {
  106310. params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
  106311. }
  106312. if (params.query) {
  106313. params.query = CommontypesConversion.toSuperMapBounds(params.query);
  106314. }
  106315. if (params.geometryQuery) {
  106316. params.geometryQuery = CommontypesConversion.toProcessingParam(params.geometryQuery);
  106317. }
  106318. if (params.geometryClip) {
  106319. params.geometryClip = CommontypesConversion.toProcessingParam(params.geometryClip);
  106320. }
  106321. return params;
  106322. }
  106323. });
  106324. var processingService = function processingService(url, options) {
  106325. return new ProcessingService_ProcessingService(url, options);
  106326. };
  106327. ;// CONCATENATED MODULE: ./src/leaflet/services/QueryService.js
  106328. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  106329. * This program are made available under the terms of the Apache License, Version 2.0
  106330. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  106331. /**
  106332. * @class QueryService
  106333. * @deprecatedclassinstance L.supermap.queryService
  106334. * @classdesc 地图查询服务类。
  106335. * @category iServer Map QueryResults
  106336. * @modulecategory Services
  106337. * @extends {ServiceBase}
  106338. * @param {string} url - 服务地址。
  106339. * @param {Object} options - 参数。
  106340. * @param {string} [options.proxy] - 服务代理地址。
  106341. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  106342. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  106343. * @param {Object} [options.headers] - 请求头。
  106344. * @example
  106345. * new QueryService(url).queryByBounds(param,function(result){
  106346. * //doSomething
  106347. * })
  106348. * @usage
  106349. */
  106350. var QueryService_QueryService = ServiceBase.extend({
  106351. initialize: function initialize(url, options) {
  106352. ServiceBase.prototype.initialize.call(this, url, options);
  106353. this._queryService = new QueryService(url, options);
  106354. },
  106355. /**
  106356. * @function QueryService.prototype.queryByBounds
  106357. * @description bounds 查询地图服务。
  106358. * @param {QueryByBoundsParameters} params - Bounds 查询参数类。
  106359. * @param {RequestCallback} callback - 回调函数。
  106360. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106361. */
  106362. queryByBounds: function queryByBounds(params, callback, resultFormat) {
  106363. params = this._processParams(params);
  106364. this._queryService.queryByBounds(params, callback, resultFormat);
  106365. },
  106366. /**
  106367. * @function QueryService.prototype.queryByDistance
  106368. * @description 地图距离查询服务。
  106369. * @param {QueryByDistanceParameters} params - Distance 查询参数类。
  106370. * @param {RequestCallback} callback - 回调函数。
  106371. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106372. */
  106373. queryByDistance: function queryByDistance(params, callback, resultFormat) {
  106374. params = this._processParams(params);
  106375. this._queryService.queryByDistance(params, callback, resultFormat);
  106376. },
  106377. /**
  106378. * @function QueryService.prototype.queryBySQL
  106379. * @description 地图 SQL 查询服务。
  106380. * @param {QueryBySQLParameters} params - SQL 查询参数类。
  106381. * @param {RequestCallback} callback - 回调函数。
  106382. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106383. */
  106384. queryBySQL: function queryBySQL(params, callback, resultFormat) {
  106385. params = this._processParams(params);
  106386. this._queryService.queryBySQL(params, callback, resultFormat);
  106387. },
  106388. /**
  106389. * @function QueryService.prototype.queryByGeometry
  106390. * @description 地图几何查询服务。
  106391. * @param {QueryByGeometryParameters} params - Geometry 查询相关参数类。
  106392. * @param {RequestCallback} callback - 回调函数。
  106393. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106394. */
  106395. queryByGeometry: function queryByGeometry(params, callback, resultFormat) {
  106396. params = this._processParams(params);
  106397. this._queryService.queryByGeometry(params, callback, resultFormat);
  106398. },
  106399. _processParams: function _processParams(params) {
  106400. if (!params) {
  106401. return {};
  106402. }
  106403. params.returnContent = params.returnContent == null ? true : params.returnContent;
  106404. if (params.queryParams && !external_L_default().Util.isArray(params.queryParams)) {
  106405. params.queryParams = [params.queryParams];
  106406. }
  106407. if (params.bounds) {
  106408. params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
  106409. }
  106410. if (params.geometry) {
  106411. if (params.geometry instanceof (external_L_default()).Point) {
  106412. params.geometry = new Point(params.geometry.x, params.geometry.y);
  106413. } else {
  106414. params.geometry = Util_toSuperMapGeometry(params.geometry);
  106415. }
  106416. }
  106417. return params;
  106418. }
  106419. });
  106420. var queryService = function queryService(url, options) {
  106421. return new QueryService_QueryService(url, options);
  106422. };
  106423. ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystService.js
  106424. function SpatialAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  106425. 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); } }
  106426. 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; }
  106427. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  106428. * This program are made available under the terms of the Apache License, Version 2.0
  106429. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  106430. /**
  106431. * @class SpatialAnalystService
  106432. * @extends {ServiceBase}
  106433. * @category iServer SpatialAnalyst
  106434. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  106435. * @example
  106436. * new SpatialAnalystService(url).bufferAnalysis(params,function(result){
  106437. * //doSomething
  106438. * })
  106439. * @param {string} url - 服务地址。
  106440. * @param {Object} options - 参数。
  106441. * @param {string} [options.proxy] - 服务代理地址。
  106442. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  106443. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  106444. * @param {Object} [options.headers] - 请求头。
  106445. * @usage
  106446. */
  106447. var SpatialAnalystService = /*#__PURE__*/function () {
  106448. function SpatialAnalystService(url, options) {
  106449. SpatialAnalystService_classCallCheck(this, SpatialAnalystService);
  106450. this.url = url;
  106451. this.options = options || {};
  106452. }
  106453. /**
  106454. * @function SpatialAnalystService.prototype.getAreaSolarRadiationResult
  106455. * @description 地区太阳辐射。
  106456. * @param {AreaSolarRadiationParameters} params - 地区太阳辐射参数类。
  106457. * @param {RequestCallback} callback 回调函数。
  106458. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106459. */
  106460. SpatialAnalystService_createClass(SpatialAnalystService, [{
  106461. key: "getAreaSolarRadiationResult",
  106462. value: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  106463. var me = this;
  106464. var areaSolarRadiationService = new AreaSolarRadiationService(me.url, {
  106465. proxy: me.options.proxy,
  106466. withCredentials: me.options.withCredentials,
  106467. crossOrigin: me.options.crossOrigin,
  106468. headers: me.options.headers,
  106469. eventListeners: {
  106470. scope: me,
  106471. processCompleted: callback,
  106472. processFailed: callback
  106473. },
  106474. format: me._processFormat(resultFormat)
  106475. });
  106476. areaSolarRadiationService.processAsync(params);
  106477. }
  106478. /**
  106479. * @function SpatialAnalystService.prototype.bufferAnalysis
  106480. * @description 缓冲区分析。
  106481. * @param {DatasetBufferAnalystParameters} params - 数据集缓冲区分析参数类。
  106482. * @param {RequestCallback} callback 回调函数。
  106483. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106484. */
  106485. }, {
  106486. key: "bufferAnalysis",
  106487. value: function bufferAnalysis(params, callback, resultFormat) {
  106488. var me = this;
  106489. var bufferAnalystService = new BufferAnalystService(me.url, {
  106490. proxy: me.options.proxy,
  106491. withCredentials: me.options.withCredentials,
  106492. crossOrigin: me.options.crossOrigin,
  106493. headers: me.options.headers,
  106494. eventListeners: {
  106495. scope: me,
  106496. processCompleted: callback,
  106497. processFailed: callback
  106498. },
  106499. format: me._processFormat(resultFormat)
  106500. });
  106501. bufferAnalystService.processAsync(params);
  106502. }
  106503. /**
  106504. * @function SpatialAnalystService.prototype.densityAnalysis
  106505. * @description 点密度分析。
  106506. * @param {DensityKernelAnalystParameters} params - 核密度分析参数类。
  106507. * @param {RequestCallback} callback 回调函数。
  106508. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106509. */
  106510. }, {
  106511. key: "densityAnalysis",
  106512. value: function densityAnalysis(params, callback, resultFormat) {
  106513. var me = this;
  106514. var densityAnalystService = new DensityAnalystService(me.url, {
  106515. proxy: me.options.proxy,
  106516. withCredentials: me.options.withCredentials,
  106517. crossOrigin: me.options.crossOrigin,
  106518. headers: me.options.headers,
  106519. eventListeners: {
  106520. scope: me,
  106521. processCompleted: callback,
  106522. processFailed: callback
  106523. },
  106524. format: me._processFormat(resultFormat)
  106525. });
  106526. densityAnalystService.processAsync(params);
  106527. }
  106528. /**
  106529. * @function SpatialAnalystService.prototype.generateSpatialData
  106530. * @description 动态分段分析。
  106531. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  106532. * @param {RequestCallback} callback 回调函数。
  106533. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106534. */
  106535. }, {
  106536. key: "generateSpatialData",
  106537. value: function generateSpatialData(params, callback, resultFormat) {
  106538. var me = this;
  106539. var generateSpatialDataService = new GenerateSpatialDataService(me.url, {
  106540. proxy: me.options.proxy,
  106541. withCredentials: me.options.withCredentials,
  106542. crossOrigin: me.options.crossOrigin,
  106543. headers: me.options.headers,
  106544. eventListeners: {
  106545. scope: me,
  106546. processCompleted: callback,
  106547. processFailed: callback
  106548. },
  106549. format: me._processFormat(resultFormat)
  106550. });
  106551. generateSpatialDataService.processAsync(params);
  106552. }
  106553. /**
  106554. * @function SpatialAnalystService.prototype.geoRelationAnalysis
  106555. * @description 空间关系分析。
  106556. * @param {GeoRelationAnalystParameters} params - 空间关系分析服务参数类。
  106557. * @param {RequestCallback} callback 回调函数。
  106558. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106559. */
  106560. }, {
  106561. key: "geoRelationAnalysis",
  106562. value: function geoRelationAnalysis(params, callback, resultFormat) {
  106563. var me = this;
  106564. var geoRelationAnalystService = new GeoRelationAnalystService(me.url, {
  106565. proxy: me.options.proxy,
  106566. withCredentials: me.options.withCredentials,
  106567. crossOrigin: me.options.crossOrigin,
  106568. headers: me.options.headers,
  106569. eventListeners: {
  106570. scope: me,
  106571. processCompleted: callback,
  106572. processFailed: callback
  106573. },
  106574. format: me._processFormat(resultFormat)
  106575. });
  106576. geoRelationAnalystService.processAsync(params);
  106577. }
  106578. /**
  106579. * @function SpatialAnalystService.prototype.interpolationAnalysis
  106580. * @description 插值分析。
  106581. * @param {InterpolationRBFAnalystParameters|InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationKrigingAnalystParameters} params - 样条插值分析参数类。
  106582. * @param {RequestCallback} callback 回调函数。
  106583. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106584. */
  106585. }, {
  106586. key: "interpolationAnalysis",
  106587. value: function interpolationAnalysis(params, callback, resultFormat) {
  106588. var me = this;
  106589. var interpolationAnalystService = new InterpolationAnalystService(me.url, {
  106590. proxy: me.options.proxy,
  106591. withCredentials: me.options.withCredentials,
  106592. crossOrigin: me.options.crossOrigin,
  106593. headers: me.options.headers,
  106594. eventListeners: {
  106595. scope: me,
  106596. processCompleted: callback,
  106597. processFailed: callback
  106598. },
  106599. format: me._processFormat(resultFormat)
  106600. });
  106601. interpolationAnalystService.processAsync(params);
  106602. }
  106603. /**
  106604. * @function SpatialAnalystService.prototype.mathExpressionAnalysis
  106605. * @description 栅格代数运算。
  106606. * @param {MathExpressionAnalysisParameters} params - 栅格代数运算参数类。
  106607. * @param {RequestCallback} callback 回调函数。
  106608. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106609. */
  106610. }, {
  106611. key: "mathExpressionAnalysis",
  106612. value: function mathExpressionAnalysis(params, callback, resultFormat) {
  106613. var me = this;
  106614. var mathExpressionAnalysisService = new MathExpressionAnalysisService(me.url, {
  106615. proxy: me.options.proxy,
  106616. withCredentials: me.options.withCredentials,
  106617. crossOrigin: me.options.crossOrigin,
  106618. headers: me.options.headers,
  106619. eventListeners: {
  106620. scope: me,
  106621. processCompleted: callback,
  106622. processFailed: callback
  106623. },
  106624. format: me._processFormat(resultFormat)
  106625. });
  106626. mathExpressionAnalysisService.processAsync(params);
  106627. }
  106628. /**
  106629. * @function SpatialAnalystService.prototype.overlayAnalysis
  106630. * @description 叠加分析。
  106631. * @param {DatasetOverlayAnalystParameters|GeometryOverlayAnalystParameters} params - 数据集叠加分析参数类或几何对象叠加分析参数类。
  106632. * @param {RequestCallback} callback 回调函数。
  106633. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106634. */
  106635. }, {
  106636. key: "overlayAnalysis",
  106637. value: function overlayAnalysis(params, callback, resultFormat) {
  106638. var me = this;
  106639. var overlayAnalystService = new OverlayAnalystService(me.url, {
  106640. proxy: me.options.proxy,
  106641. withCredentials: me.options.withCredentials,
  106642. crossOrigin: me.options.crossOrigin,
  106643. headers: me.options.headers,
  106644. eventListeners: {
  106645. scope: me,
  106646. processCompleted: callback,
  106647. processFailed: callback
  106648. },
  106649. format: me._processFormat(resultFormat)
  106650. });
  106651. overlayAnalystService.processAsync(params);
  106652. }
  106653. /**
  106654. * @function SpatialAnalystService.prototype.routeCalculateMeasure
  106655. * @description 路由测量计算。
  106656. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  106657. * @param {RequestCallback} callback 回调函数。
  106658. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106659. */
  106660. }, {
  106661. key: "routeCalculateMeasure",
  106662. value: function routeCalculateMeasure(params, callback, resultFormat) {
  106663. var me = this;
  106664. var routeCalculateMeasureService = new RouteCalculateMeasureService(me.url, {
  106665. proxy: me.options.proxy,
  106666. withCredentials: me.options.withCredentials,
  106667. crossOrigin: me.options.crossOrigin,
  106668. headers: me.options.headers,
  106669. eventListeners: {
  106670. scope: me,
  106671. processCompleted: callback,
  106672. processFailed: callback
  106673. },
  106674. format: me._processFormat(resultFormat)
  106675. });
  106676. routeCalculateMeasureService.processAsync(params);
  106677. }
  106678. /**
  106679. * @function SpatialAnalystService.prototype.routeLocate
  106680. * @description 路由定位。
  106681. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  106682. * @param {RequestCallback} callback 回调函数。
  106683. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106684. */
  106685. }, {
  106686. key: "routeLocate",
  106687. value: function routeLocate(params, callback, resultFormat) {
  106688. var me = this;
  106689. var routeLocatorService = new RouteLocatorService(me.url, {
  106690. proxy: me.options.proxy,
  106691. withCredentials: me.options.withCredentials,
  106692. crossOrigin: me.options.crossOrigin,
  106693. headers: me.options.headers,
  106694. eventListeners: {
  106695. scope: me,
  106696. processCompleted: callback,
  106697. processFailed: callback
  106698. },
  106699. format: me._processFormat(resultFormat)
  106700. });
  106701. routeLocatorService.processAsync(params);
  106702. }
  106703. /**
  106704. * @function SpatialAnalystService.prototype.surfaceAnalysis
  106705. * @description 表面分析。
  106706. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  106707. * @param {RequestCallback} callback 回调函数。
  106708. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106709. */
  106710. }, {
  106711. key: "surfaceAnalysis",
  106712. value: function surfaceAnalysis(params, callback, resultFormat) {
  106713. var me = this;
  106714. var surfaceAnalystService = new SurfaceAnalystService(me.url, {
  106715. proxy: me.options.proxy,
  106716. withCredentials: me.options.withCredentials,
  106717. crossOrigin: me.options.crossOrigin,
  106718. headers: me.options.headers,
  106719. eventListeners: {
  106720. scope: me,
  106721. processCompleted: callback,
  106722. processFailed: callback
  106723. },
  106724. format: me._processFormat(resultFormat)
  106725. });
  106726. surfaceAnalystService.processAsync(params);
  106727. }
  106728. /**
  106729. * @function SpatialAnalystService.prototype.terrainCurvatureCalculate
  106730. * @description 地形曲率计算。
  106731. * @param {TerrainCurvatureCalculationParameters} params - 地形曲率计算参数类。
  106732. * @param {RequestCallback} callback 回调函数。
  106733. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106734. */
  106735. }, {
  106736. key: "terrainCurvatureCalculate",
  106737. value: function terrainCurvatureCalculate(params, callback, resultFormat) {
  106738. var me = this;
  106739. var terrainCurvatureCalculationService = new TerrainCurvatureCalculationService(me.url, {
  106740. proxy: me.options.proxy,
  106741. withCredentials: me.options.withCredentials,
  106742. crossOrigin: me.options.crossOrigin,
  106743. headers: me.options.headers,
  106744. eventListeners: {
  106745. scope: me,
  106746. processCompleted: callback,
  106747. processFailed: callback
  106748. },
  106749. format: me._processFormat(resultFormat)
  106750. });
  106751. terrainCurvatureCalculationService.processAsync(params);
  106752. }
  106753. /**
  106754. * @function SpatialAnalystService.prototype.thiessenAnalysis
  106755. * @description 泰森多边形分析。
  106756. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} params - 数据集泰森多边形分析参数类。
  106757. * @param {RequestCallback} callback 回调函数。
  106758. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106759. */
  106760. }, {
  106761. key: "thiessenAnalysis",
  106762. value: function thiessenAnalysis(params, callback, resultFormat) {
  106763. var me = this;
  106764. var thiessenAnalystService = new ThiessenAnalystService(me.url, {
  106765. proxy: me.options.proxy,
  106766. withCredentials: me.options.withCredentials,
  106767. crossOrigin: me.options.crossOrigin,
  106768. headers: me.options.headers,
  106769. eventListeners: {
  106770. scope: me,
  106771. processCompleted: callback,
  106772. processFailed: callback
  106773. },
  106774. format: me._processFormat(resultFormat)
  106775. });
  106776. thiessenAnalystService.processAsync(params);
  106777. }
  106778. /**
  106779. * @function SpatialAnalystService.prototype.geometrybatchAnalysis
  106780. * @description 批量空间分析。
  106781. * @param {Array.<Object>} params - 批量分析参数对象数组。
  106782. * @param {Array.<Object>} params.analystName - 空间分析方法的名称。包括:</br>
  106783. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"。
  106784. * @param {Object} params.param - 空间分析类型对应的请求参数,包括:</br>
  106785. * {@link GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  106786. * {@link GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  106787. * {@link InterpolationAnalystParameters} 插值分析参数类。</br>
  106788. * {@link SurfaceAnalystParameters} 表面分析参数类。</br>
  106789. * @param {RequestCallback} callback - 回调函数。
  106790. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  106791. */
  106792. }, {
  106793. key: "geometrybatchAnalysis",
  106794. value: function geometrybatchAnalysis(params, callback, resultFormat) {
  106795. var me = this;
  106796. var geometryBatchAnalystService = new GeometryBatchAnalystService(me.url, {
  106797. eventListeners: {
  106798. scope: me,
  106799. processCompleted: callback,
  106800. processFailed: callback
  106801. },
  106802. format: me._processFormat(resultFormat)
  106803. });
  106804. //处理批量分析中各个分类类型的参数:
  106805. var analystParameters = [];
  106806. for (var i = 0; i < params.length; i++) {
  106807. var tempParameter = params[i];
  106808. analystParameters.push({
  106809. analystName: tempParameter.analystName,
  106810. param: tempParameter.param
  106811. });
  106812. }
  106813. geometryBatchAnalystService.processAsync(analystParameters);
  106814. }
  106815. }, {
  106816. key: "_processFormat",
  106817. value: function _processFormat(resultFormat) {
  106818. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  106819. }
  106820. }]);
  106821. return SpatialAnalystService;
  106822. }();
  106823. ;// CONCATENATED MODULE: ./src/leaflet/services/SpatialAnalystService.js
  106824. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  106825. * This program are made available under the terms of the Apache License, Version 2.0
  106826. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  106827. /**
  106828. * @class SpatialAnalystService
  106829. * @deprecatedclassinstance L.supermap.spatialAnalystService
  106830. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  106831. * @category iServer SpatialAnalyst
  106832. * @modulecategory Services
  106833. * @example
  106834. * new SpatialAnalystService(url)
  106835. * .bufferAnalysis(params,function(result){
  106836. * //doSomething
  106837. * })
  106838. * @param {string} url - 服务地址。
  106839. * @param {Object} options - 参数。
  106840. * @param {string} [options.proxy] - 服务代理地址。
  106841. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  106842. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  106843. * @param {Object} [options.headers] - 请求头。
  106844. * @extends {ServiceBase}
  106845. * @usage
  106846. */
  106847. var SpatialAnalystService_SpatialAnalystService = ServiceBase.extend({
  106848. initialize: function initialize(url, options) {
  106849. ServiceBase.prototype.initialize.call(this, url, options);
  106850. this._spatialAnalystService = new SpatialAnalystService(url, options);
  106851. },
  106852. /**
  106853. * @function SpatialAnalystService.prototype.getAreaSolarRadiationResult
  106854. * @description 地区太阳辐射。
  106855. * @param {AreaSolarRadiationParameters} params - 地区太阳辐射参数类。
  106856. * @param {RequestCallback} callback - 回调函数。
  106857. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106858. */
  106859. getAreaSolarRadiationResult: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  106860. this._spatialAnalystService.getAreaSolarRadiationResult(params, callback, resultFormat);
  106861. },
  106862. /**
  106863. * @function SpatialAnalystService.prototype.bufferAnalysis
  106864. * @description 缓冲区分析。
  106865. * @param {DatasetBufferAnalystParameters} params - 数据集缓冲区分析参数类。
  106866. * @param {RequestCallback} callback - 回调函数。
  106867. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106868. */
  106869. bufferAnalysis: function bufferAnalysis(params, callback, resultFormat) {
  106870. params = this._processParams(params);
  106871. this._spatialAnalystService.bufferAnalysis(params, callback, resultFormat);
  106872. },
  106873. /**
  106874. * @function SpatialAnalystService.prototype.densityAnalysis
  106875. * @description 点密度分析。
  106876. * @param {DensityKernelAnalystParameters} params - 核密度分析参数类。
  106877. * @param {RequestCallback} callback - 回调函数。
  106878. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106879. */
  106880. densityAnalysis: function densityAnalysis(params, callback, resultFormat) {
  106881. params = this._processParams(params);
  106882. this._spatialAnalystService.densityAnalysis(params, callback, resultFormat);
  106883. },
  106884. /**
  106885. * @function SpatialAnalystService.prototype.generateSpatialData
  106886. * @description 动态分段分析。
  106887. * @param {GenerateSpatialDataParameters} params - 动态分段操作参数类。
  106888. * @param {RequestCallback} callback - 回调函数。
  106889. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106890. */
  106891. generateSpatialData: function generateSpatialData(params, callback, resultFormat) {
  106892. this._spatialAnalystService.generateSpatialData(params, callback, resultFormat);
  106893. },
  106894. /**
  106895. * @function SpatialAnalystService.prototype.geoRelationAnalysis
  106896. * @description 空间关系分析。
  106897. * @param {GeoRelationAnalystParameters} params - 空间关系分析服务参数类。
  106898. * @param {RequestCallback} callback - 回调函数。
  106899. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106900. */
  106901. geoRelationAnalysis: function geoRelationAnalysis(params, callback, resultFormat) {
  106902. params = this._processParams(params);
  106903. this._spatialAnalystService.geoRelationAnalysis(params, callback, resultFormat);
  106904. },
  106905. /**
  106906. * @function SpatialAnalystService.prototype.interpolationAnalysis
  106907. * @description 插值分析。
  106908. * @param {InterpolationDensityAnalystParameters|InterpolationIDWAnalystParameters|InterpolationRBFAnalystParameters|InterpolationKrigingAnalystParameters} params - 样条插值(径向基函数插值法)分析参数类。
  106909. * @param {RequestCallback} callback - 回调函数。
  106910. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106911. */
  106912. interpolationAnalysis: function interpolationAnalysis(params, callback, resultFormat) {
  106913. params = this._processParams(params);
  106914. this._spatialAnalystService.interpolationAnalysis(params, callback, resultFormat);
  106915. },
  106916. /**
  106917. * @function SpatialAnalystService.prototype.mathExpressionAnalysis
  106918. * @description 栅格代数运算。
  106919. * @param {MathExpressionAnalysisParameters} params - 栅格代数运算参数类。
  106920. * @param {RequestCallback} callback - 回调函数。
  106921. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106922. */
  106923. mathExpressionAnalysis: function mathExpressionAnalysis(params, callback, resultFormat) {
  106924. params = this._processParams(params);
  106925. this._spatialAnalystService.mathExpressionAnalysis(params, callback, resultFormat);
  106926. },
  106927. /**
  106928. * @function SpatialAnalystService.prototype.overlayAnalysis
  106929. * @description 叠加分析。
  106930. * @param {DatasetOverlayAnalystParameters|GeometryOverlayAnalystParameters} params - 数据集叠加分析参数类。|| 几何对象叠加分析参数类。
  106931. * @param {RequestCallback} callback - 回调函数。
  106932. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106933. */
  106934. overlayAnalysis: function overlayAnalysis(params, callback, resultFormat) {
  106935. params = this._processParams(params);
  106936. this._spatialAnalystService.overlayAnalysis(params, callback, resultFormat);
  106937. },
  106938. /**
  106939. * @function SpatialAnalystService.prototype.routeCalculateMeasure
  106940. * @description 路由测量计算。
  106941. * @param {RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  106942. * @param {RequestCallback} callback - 回调函数。
  106943. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106944. */
  106945. routeCalculateMeasure: function routeCalculateMeasure(params, callback, resultFormat) {
  106946. params = this._processParams(params);
  106947. this._spatialAnalystService.routeCalculateMeasure(params, callback, resultFormat);
  106948. },
  106949. /**
  106950. * @function SpatialAnalystService.prototype.routeLocate
  106951. * @description 路由定位。
  106952. * @param {RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  106953. * @param {RequestCallback} callback - 回调函数。
  106954. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106955. */
  106956. routeLocate: function routeLocate(params, callback, resultFormat) {
  106957. params = this._processParams(params);
  106958. this._spatialAnalystService.routeLocate(params, callback, resultFormat);
  106959. },
  106960. /**
  106961. * @function SpatialAnalystService.prototype.surfaceAnalysis
  106962. * @description 表面分析。
  106963. * @param {SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  106964. * @param {RequestCallback} callback - 回调函数。
  106965. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106966. */
  106967. surfaceAnalysis: function surfaceAnalysis(params, callback, resultFormat) {
  106968. params = this._processParams(params);
  106969. this._spatialAnalystService.surfaceAnalysis(params, callback, resultFormat);
  106970. },
  106971. /**
  106972. * @function SpatialAnalystService.prototype.terrainCurvatureCalculate
  106973. * @description 地形曲率计算。
  106974. * @param {TerrainCurvatureCalculationParameters} params - 地形曲率计算参数类。
  106975. * @param {RequestCallback} callback - 回调函数。
  106976. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106977. */
  106978. terrainCurvatureCalculate: function terrainCurvatureCalculate(params, callback, resultFormat) {
  106979. this._spatialAnalystService.terrainCurvatureCalculate(params, callback, resultFormat);
  106980. },
  106981. /**
  106982. * @function SpatialAnalystService.prototype.thiessenAnalysis
  106983. * @description 泰森多边形分析。
  106984. * @param {DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters} params - 数据集泰森多边形分析参数类。
  106985. * @param {RequestCallback} callback - 回调函数。
  106986. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  106987. */
  106988. thiessenAnalysis: function thiessenAnalysis(params, callback, resultFormat) {
  106989. params = this._processParams(params);
  106990. this._spatialAnalystService.thiessenAnalysis(params, callback, resultFormat);
  106991. },
  106992. /**
  106993. * @function SpatialAnalystService.prototype.geometrybatchAnalysis
  106994. * @description 批量空间分析。
  106995. * @param {Array.<Object>} params -批量分析参数对象数组;包括:</br>
  106996. * @param {string} params.analystName - 空间分析方法的名称。包括:</br>
  106997. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"
  106998. * @param {Object} param - 空间分析类型对应的请求参数,包括:</br>
  106999. * {@link GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  107000. * {@link GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  107001. * {@link InterpolationAnalystParameters} 插值分析参数类。</br>
  107002. * {@link SurfaceAnalystParameters} 表面分析参数类。</br>
  107003. * @param {RequestCallback} callback - 回调函数。
  107004. * @param {DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回结果类型。
  107005. */
  107006. geometrybatchAnalysis: function geometrybatchAnalysis(params, callback, resultFormat) {
  107007. for (var i = 0; i < params.length; i++) {
  107008. params[i].param = this._processParams(params[i].param);
  107009. }
  107010. this._spatialAnalystService.geometrybatchAnalysis(params, callback, resultFormat);
  107011. },
  107012. _processParams: function _processParams(params) {
  107013. if (!params) {
  107014. return {};
  107015. }
  107016. if (params.bounds) {
  107017. params.bounds = CommontypesConversion.toSuperMapBounds(params.bounds);
  107018. }
  107019. if (params.inputPoints) {
  107020. for (var i = 0; i < params.inputPoints.length; i++) {
  107021. var inputPoint = params.inputPoints[i];
  107022. if (external_L_default().Util.isArray(inputPoint)) {
  107023. params.inputPoints[i] = {
  107024. x: inputPoint[0],
  107025. y: inputPoint[1],
  107026. tag: inputPoint[2]
  107027. };
  107028. }
  107029. }
  107030. }
  107031. if (params.points) {
  107032. for (var _i2 = 0; _i2 < params.points.length; _i2++) {
  107033. var point = params.points[_i2];
  107034. if (external_L_default().Util.isArray(point)) {
  107035. params.points[_i2] = {
  107036. x: point[0],
  107037. y: point[1]
  107038. };
  107039. } else if (point instanceof (external_L_default()).LatLng) {
  107040. params.points[_i2] = {
  107041. x: point.lng,
  107042. y: point.lat
  107043. };
  107044. } else {
  107045. params.points[_i2] = {
  107046. x: point.x,
  107047. y: point.y
  107048. };
  107049. }
  107050. }
  107051. }
  107052. if (params.point) {
  107053. if (external_L_default().Util.isArray(params.point)) {
  107054. params.point = {
  107055. x: params.point[0],
  107056. y: params.point[1]
  107057. };
  107058. } else if (params.point instanceof (external_L_default()).LatLng) {
  107059. params.point = {
  107060. x: params.point.lng,
  107061. y: params.point.lat
  107062. };
  107063. } else {
  107064. params.point = {
  107065. x: params.point.x,
  107066. y: params.point.y
  107067. };
  107068. }
  107069. }
  107070. if (params.extractRegion) {
  107071. params.extractRegion = Util_toSuperMapGeometry(params.extractRegion);
  107072. }
  107073. if (params.extractParameter && params.extractParameter.clipRegion) {
  107074. params.extractParameter.clipRegion = Util_toSuperMapGeometry(params.extractParameter.clipRegion);
  107075. }
  107076. if (params.clipParam && params.clipParam.clipRegion) {
  107077. params.clipParam.clipRegion = Util_toSuperMapGeometry(params.clipParam.clipRegion);
  107078. }
  107079. //支持格式:Vector Layers; GeoJson
  107080. if (params.sourceGeometry) {
  107081. var SRID = null;
  107082. if (params.sourceGeometrySRID) {
  107083. SRID = params.sourceGeometrySRID;
  107084. }
  107085. params.sourceGeometry = Util_toSuperMapGeometry(params.sourceGeometry);
  107086. if (SRID) {
  107087. params.sourceGeometry.SRID = SRID;
  107088. }
  107089. delete params.sourceGeometry.sourceGeometrySRID;
  107090. }
  107091. if (params.operateGeometry) {
  107092. params.operateGeometry = Util_toSuperMapGeometry(params.operateGeometry);
  107093. }
  107094. //支持传入多个几何要素进行叠加分析:
  107095. if (params.sourceGeometries) {
  107096. var sourceGeometries = [];
  107097. for (var k = 0; k < params.sourceGeometries.length; k++) {
  107098. sourceGeometries.push(Util_toSuperMapGeometry(params.sourceGeometries[k]));
  107099. }
  107100. params.sourceGeometries = sourceGeometries;
  107101. }
  107102. //支持传入多个几何要素进行叠加分析:
  107103. if (params.operateGeometries) {
  107104. var operateGeometries = [];
  107105. for (var j = 0; j < params.operateGeometries.length; j++) {
  107106. operateGeometries.push(Util_toSuperMapGeometry(params.operateGeometries[j]));
  107107. }
  107108. params.operateGeometries = operateGeometries;
  107109. }
  107110. if (params.sourceRoute) {
  107111. if (params.sourceRoute instanceof (external_L_default()).Polyline) {
  107112. var target = {};
  107113. target.type = 'LINEM';
  107114. target.parts = [params.sourceRoute.getLatLngs().length];
  107115. target.points = [];
  107116. for (var _i4 = 0; _i4 < params.sourceRoute.getLatLngs().length; _i4++) {
  107117. var _point = params.sourceRoute.getLatLngs()[_i4];
  107118. target.points = target.points.concat({
  107119. x: _point.lng,
  107120. y: _point.lat,
  107121. measure: _point.alt
  107122. });
  107123. }
  107124. params.sourceRoute = target;
  107125. }
  107126. }
  107127. if (params.operateRegions && external_L_default().Util.isArray(params.operateRegions)) {
  107128. params.operateRegions.map(function (geometry, key) {
  107129. params.operateRegions[key] = Util_toSuperMapGeometry(geometry);
  107130. return params.operateRegions[key];
  107131. });
  107132. }
  107133. // if (params.sourceRoute && params.sourceRoute.components && L.Util.isArray(params.sourceRoute.components)) {
  107134. // params.sourceRoute.components.map(function (geometry, key) {
  107135. // params.sourceRoute.components[key] = Util.toSuperMapGeometry(geometry);
  107136. // });
  107137. // }
  107138. return params;
  107139. },
  107140. _processFormat: function _processFormat(resultFormat) {
  107141. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  107142. }
  107143. });
  107144. var spatialAnalystService = function spatialAnalystService(url, options) {
  107145. return new SpatialAnalystService_SpatialAnalystService(url, options);
  107146. };
  107147. ;// CONCATENATED MODULE: ./src/leaflet/services/ThemeService.js
  107148. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107149. * This program are made available under the terms of the Apache License, Version 2.0
  107150. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107151. /**
  107152. * @class ThemeService
  107153. * @deprecatedclassinstance L.supermap.themeService
  107154. * @classdesc 专题图服务类。
  107155. * @category iServer Map Theme
  107156. * @modulecategory Services
  107157. * @extends {ServiceBase}
  107158. * @example
  107159. * new ThemeService(url,{
  107160. * projection:projection
  107161. * }).getThemeInfo(params,function(result){
  107162. * //doSomething
  107163. * });
  107164. * @param {string} url - 服务地址。
  107165. * @param {Object} options - 参数。
  107166. * @param {string} [options.proxy] - 服务代理地址。
  107167. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107168. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107169. * @param {Object} [options.headers] - 请求头。
  107170. * @usage
  107171. */
  107172. var ThemeService_ThemeService = ServiceBase.extend({
  107173. initialize: function initialize(url, options) {
  107174. ServiceBase.prototype.initialize.call(this, url, options);
  107175. this._themeService = new ThemeService(this.url, {
  107176. proxy: this.options.proxy,
  107177. withCredentials: this.options.withCredentials,
  107178. crossOrigin: this.options.crossOrigin,
  107179. headers: this.options.headers
  107180. });
  107181. },
  107182. /**
  107183. * @function ThemeService.prototype.getThemeInfo
  107184. * @description 获取专题图信息。
  107185. * @param {ThemeParameters} params - 专题图参数类。
  107186. * @param {RequestCallback} callback - 回调函数。
  107187. */
  107188. getThemeInfo: function getThemeInfo(params, callback) {
  107189. this._themeService.processAsync(params, callback);
  107190. }
  107191. });
  107192. var themeService = function themeService(url, options) {
  107193. return new ThemeService_ThemeService(url, options);
  107194. };
  107195. ;// CONCATENATED MODULE: ./src/common/iServer/TrafficTransferAnalystService.js
  107196. function TrafficTransferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  107197. 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); } }
  107198. 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; }
  107199. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107200. * This program are made available under the terms of the Apache License, Version 2.0
  107201. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107202. /**
  107203. * @class TrafficTransferAnalystService
  107204. * @extends {ServiceBase}
  107205. * @category iServer TrafficTransferAnalyst
  107206. * @classdesc 交通换乘分析服务类。
  107207. * @example
  107208. * new TrafficTransferAnalystService(url).queryStop(params,function(result){
  107209. * //doSomething
  107210. * })
  107211. * @param {string} url - 服务地址。
  107212. * @param {Object} options - 参数。
  107213. * @param {string} [options.proxy] - 服务代理地址。
  107214. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107215. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107216. * @param {Object} [options.headers] - 请求头。
  107217. * @usage
  107218. */
  107219. var TrafficTransferAnalystService = /*#__PURE__*/function () {
  107220. function TrafficTransferAnalystService(url, options) {
  107221. TrafficTransferAnalystService_classCallCheck(this, TrafficTransferAnalystService);
  107222. this.url = url;
  107223. this.options = options || {};
  107224. }
  107225. /**
  107226. * @function TrafficTransferAnalystService.prototype.queryStop
  107227. * @description 站点查询服务。
  107228. * @param {StopQueryParameters} params - 查询相关参数类。
  107229. * @param {RequestCallback} callback - 回调函数。
  107230. */
  107231. TrafficTransferAnalystService_createClass(TrafficTransferAnalystService, [{
  107232. key: "queryStop",
  107233. value: function queryStop(params, callback) {
  107234. var me = this;
  107235. var stopQueryService = new StopQueryService(me.url, {
  107236. proxy: me.options.proxy,
  107237. withCredentials: me.options.withCredentials,
  107238. crossOrigin: me.options.crossOrigin,
  107239. headers: me.options.headers,
  107240. eventListeners: {
  107241. scope: me,
  107242. processCompleted: callback,
  107243. processFailed: callback
  107244. }
  107245. });
  107246. stopQueryService.processAsync(params);
  107247. }
  107248. /**
  107249. * @function TrafficTransferAnalystService.prototype.analysisTransferPath
  107250. * @description 交通换乘线路查询服务。
  107251. * @param {TransferPathParameters} params - 查询相关参数类。
  107252. * @param {RequestCallback} callback - 回调函数。
  107253. */
  107254. }, {
  107255. key: "analysisTransferPath",
  107256. value: function analysisTransferPath(params, callback) {
  107257. var me = this;
  107258. var transferPathService = new TransferPathService(me.url, {
  107259. proxy: me.options.proxy,
  107260. withCredentials: me.options.withCredentials,
  107261. crossOrigin: me.options.crossOrigin,
  107262. headers: me.options.headers,
  107263. eventListeners: {
  107264. scope: me,
  107265. processCompleted: callback,
  107266. processFailed: callback
  107267. }
  107268. });
  107269. transferPathService.processAsync(params);
  107270. }
  107271. /**
  107272. * @function TrafficTransferAnalystService.prototype.analysisTransferSolution
  107273. * @description 交通换乘方案查询服务。
  107274. * @param {TransferSolutionParameters} params - 查询相关参数类。
  107275. * @param {RequestCallback} callback - 回调函数。
  107276. */
  107277. }, {
  107278. key: "analysisTransferSolution",
  107279. value: function analysisTransferSolution(params, callback) {
  107280. var me = this;
  107281. var transferSolutionService = new TransferSolutionService(me.url, {
  107282. proxy: me.options.proxy,
  107283. withCredentials: me.options.withCredentials,
  107284. crossOrigin: me.options.crossOrigin,
  107285. headers: me.options.headers,
  107286. eventListeners: {
  107287. scope: me,
  107288. processCompleted: callback,
  107289. processFailed: callback
  107290. }
  107291. });
  107292. transferSolutionService.processAsync(params);
  107293. }
  107294. }]);
  107295. return TrafficTransferAnalystService;
  107296. }();
  107297. ;// CONCATENATED MODULE: ./src/leaflet/services/TrafficTransferAnalystService.js
  107298. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107299. * This program are made available under the terms of the Apache License, Version 2.0
  107300. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107301. /**
  107302. * @class TrafficTransferAnalystService
  107303. * @deprecatedclassinstance L.supermap.trafficTransferAnalystService
  107304. * @classdesc 交通换乘分析服务类。
  107305. * @category iServer TrafficTransferAnalyst
  107306. * @modulecategory Services
  107307. * @example
  107308. * new TrafficTransferAnalystService(url).queryStop(params,function(result){
  107309. * //doSomething
  107310. * })
  107311. * @extends {ServiceBase}
  107312. * @param {string} url - 服务地址。
  107313. * @param {Object} options - 参数。
  107314. * @param {string} [options.proxy] - 服务代理地址。
  107315. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107316. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107317. * @param {Object} [options.headers] - 请求头。
  107318. * @usage
  107319. */
  107320. var TrafficTransferAnalystService_TrafficTransferAnalystService = ServiceBase.extend({
  107321. initialize: function initialize(url, options) {
  107322. ServiceBase.prototype.initialize.call(this, url, options);
  107323. this._commonTrafficTransferAnalystService = new TrafficTransferAnalystService(url, options);
  107324. },
  107325. /**
  107326. * @function TrafficTransferAnalystService.prototype.queryStop
  107327. * @description 站点查询服务。
  107328. * @param {StopQueryParameters} params - 站点查询参数类。
  107329. * @param {RequestCallback} callback - 回调函数。
  107330. */
  107331. queryStop: function queryStop(params, callback) {
  107332. this._commonTrafficTransferAnalystService.queryStop(params, callback);
  107333. },
  107334. /**
  107335. * @function TrafficTransferAnalystService.prototype.analysisTransferPath
  107336. * @description 交通换乘线路查询服务。
  107337. * @param {TransferPathParameters} params - 交通换乘线路查询参数类。
  107338. * @param {RequestCallback} callback - 回调函数。
  107339. */
  107340. analysisTransferPath: function analysisTransferPath(params, callback) {
  107341. params = this._processParams(params);
  107342. this._commonTrafficTransferAnalystService.analysisTransferPath(params, callback);
  107343. },
  107344. /**
  107345. * @function TrafficTransferAnalystService.prototype.analysisTransferSolution
  107346. * @description 交通换乘方案查询服务。
  107347. * @param {TransferSolutionParameters} params - 交通换乘方案查询参数类。
  107348. * @param {RequestCallback} callback - 回调函数。
  107349. */
  107350. analysisTransferSolution: function analysisTransferSolution(params, callback) {
  107351. params = this._processParams(params);
  107352. this._commonTrafficTransferAnalystService.analysisTransferSolution(params, callback);
  107353. },
  107354. _processParams: function _processParams(params) {
  107355. if (!params) {
  107356. return {};
  107357. }
  107358. if (params.points && external_L_default().Util.isArray(params.points)) {
  107359. params.points.map(function (point, key) {
  107360. params.points[key] = point instanceof (external_L_default()).LatLng ? {
  107361. x: point.lng,
  107362. y: point.lat
  107363. } : point;
  107364. return params.points[key];
  107365. });
  107366. }
  107367. return params;
  107368. }
  107369. });
  107370. var trafficTransferAnalystService = function trafficTransferAnalystService(url, options) {
  107371. return new TrafficTransferAnalystService_TrafficTransferAnalystService(url, options);
  107372. };
  107373. ;// CONCATENATED MODULE: ./src/leaflet/services/WebPrintingJobService.js
  107374. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107375. * This program are made available under the terms of the Apache License, Version 2.0
  107376. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107377. /**
  107378. * @class WebPrintingJobService
  107379. * @deprecatedclassinstance L.supermap.webPrintingJobService
  107380. * @classdesc Web 打印服务类。
  107381. * 提供:创建 Web 打印任务,获取 Web 打印任务内容,获取 Web 打印输出文档流,获取 Web 打印服务的布局模板信息。
  107382. * @category iServer WebPrintingJob
  107383. * @modulecategory Services
  107384. * @example
  107385. * new WebPrintingJobService(url)
  107386. * .createWebPrintingJob(param,function(result){
  107387. * //doSomething
  107388. * })
  107389. * @extends {ServiceBase}
  107390. * @version 10.1.0
  107391. * @param {string} url - 服务地址。
  107392. * @param {Object} options - 参数。
  107393. * @param {string} [options.proxy] - 服务代理地址。
  107394. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107395. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107396. * @param {Object} [options.headers] - 请求头。
  107397. * @usage
  107398. */
  107399. var WebPrintingJobService = ServiceBase.extend({
  107400. initialize: function initialize(url, options) {
  107401. ServiceBase.prototype.initialize.call(this, url, options);
  107402. this._webPrintingService = new WebPrintingService(this.url, {
  107403. proxy: this.options.proxy,
  107404. withCredentials: this.options.withCredentials,
  107405. crossOrigin: this.options.crossOrigin,
  107406. headers: this.options.headers
  107407. });
  107408. },
  107409. /**
  107410. * @function WebPrintingJobService.prototype.createWebPrintingJob
  107411. * @description 创建 Web 打印任务。
  107412. * @param {WebPrintingJobParameters} params - Web 打印参数类。
  107413. * @param {RequestCallback} callback - 回调函数。
  107414. */
  107415. createWebPrintingJob: function createWebPrintingJob(params, callback) {
  107416. if (!params) {
  107417. return;
  107418. }
  107419. this._webPrintingService.createWebPrintingJob(this._processParams(params), callback);
  107420. },
  107421. /**
  107422. * @function WebPrintingJobService.prototype.getPrintingJob
  107423. * @description 获取 Web 打印输出文档任务。
  107424. * @param {string} jobId - Web 打印输入文档任务 ID。
  107425. * @param {RequestCallback} callback - 回调函数。
  107426. */
  107427. getPrintingJob: function getPrintingJob(jobId, callback) {
  107428. this._webPrintingService.getPrintingJob(jobId, callback);
  107429. },
  107430. /**
  107431. * @function WebPrintingJobService.prototype.getPrintingJobResult
  107432. * @description 获取 Web 打印任务的输出文档。
  107433. * @param {string} jobId - Web 打印输入文档任务 ID。
  107434. * @param {RequestCallback} callback - 回调函数。
  107435. */
  107436. getPrintingJobResult: function getPrintingJobResult(jobId, callback) {
  107437. this._webPrintingService.getPrintingJobResult(jobId, callback);
  107438. },
  107439. /**
  107440. * @function WebPrintingJobService.prototype.getLayoutTemplates
  107441. * @description 查询 Web 打印服务所有可用的模板信息。
  107442. * @param {RequestCallback} callback - 回调函数。
  107443. */
  107444. getLayoutTemplates: function getLayoutTemplates(callback) {
  107445. this._webPrintingService.getLayoutTemplates(callback);
  107446. },
  107447. _processParams: function _processParams(params) {
  107448. if (params.layoutOptions && params.layoutOptions.littleMapOptions) {
  107449. params.layoutOptions.littleMapOptions.center = this._toPointObject(params.layoutOptions.littleMapOptions.center);
  107450. }
  107451. if (params.exportOptions) {
  107452. params.exportOptions.center = this._toPointObject(params.exportOptions.center);
  107453. }
  107454. return params;
  107455. },
  107456. _toPointObject: function _toPointObject(point) {
  107457. if (external_L_default().Util.isArray(point)) {
  107458. return {
  107459. x: point[0],
  107460. y: point[1]
  107461. };
  107462. } else if (point instanceof Point || point instanceof (external_L_default()).Point) {
  107463. return {
  107464. x: point.x,
  107465. y: point.y
  107466. };
  107467. } else if (point instanceof (external_L_default()).LatLng) {
  107468. return {
  107469. x: point.lng,
  107470. y: point.lat
  107471. };
  107472. }
  107473. return point;
  107474. }
  107475. });
  107476. var webPrintingJobService = function webPrintingJobService(url, options) {
  107477. return new WebPrintingJobService(url, options);
  107478. };
  107479. ;// CONCATENATED MODULE: ./src/leaflet/services/ImageService.js
  107480. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107481. * This program are made available under the terms of the Apache License, Version 2.0
  107482. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107483. /**
  107484. * @class ImageService
  107485. * @deprecatedclassinstance L.supermap.imageService
  107486. * @version 10.2.0
  107487. * @constructs ImageService
  107488. * @classdesc 影像服务类。
  107489. * @category iServer Image
  107490. * @modulecategory Services
  107491. * @extends {ServiceBase}
  107492. * @example
  107493. * new ImageService(url,options)
  107494. * .getCollections(function(result){
  107495. * //doSomething
  107496. * })
  107497. * @param {string} url - 服务地址。
  107498. * @param {Object} options - 参数。
  107499. * @param {string} [options.proxy] - 服务代理地址。
  107500. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107501. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107502. * @param {Object} [options.headers] - 请求头。
  107503. * @usage
  107504. */
  107505. var ImageService_ImageService = ServiceBase.extend({
  107506. initialize: function initialize(url, options) {
  107507. ServiceBase.prototype.initialize.call(this, url, options);
  107508. this._imageService = new ImageService(this.url, {
  107509. proxy: this.options.proxy,
  107510. withCredentials: this.options.withCredentials,
  107511. crossOrigin: this.options.crossOrigin,
  107512. headers: this.options.headers
  107513. });
  107514. },
  107515. /**
  107516. * @function ImageService.prototype.getCollections
  107517. * @description 返回影像集合列表(Collections)。
  107518. * @param {RequestCallback} callback - 回调函数。
  107519. */
  107520. getCollections: function getCollections(callback) {
  107521. this._imageService.getCollections(callback);
  107522. },
  107523. /**
  107524. * @function ImageService.prototype.getCollectionByID
  107525. * @description ID值等于`collectionId`参数值的影像集合(Collection)。ID值用于在服务中唯一标识该影像集合。
  107526. * @param {string} collectionId 影像集合( Collection )的 ID ,在一个影像服务中唯一标识影像集合。
  107527. * @param {RequestCallback} callback - 回调函数。
  107528. */
  107529. getCollectionByID: function getCollectionByID(collectionId, callback) {
  107530. this._imageService.getCollectionByID(collectionId, callback);
  107531. },
  107532. /**
  107533. * @function ImageService.prototype.search
  107534. * @description 查询与过滤条件匹配的影像数据。
  107535. * @param {ImageSearchParameter} [itemSearch] 查询参数。
  107536. * @param {RequestCallback} callback - 回调函数。
  107537. */
  107538. search: function search(itemSearch, callback) {
  107539. this._imageService.search(itemSearch, callback);
  107540. }
  107541. });
  107542. var imageService = function imageService(url, options) {
  107543. return new ImageService_ImageService(url, options);
  107544. };
  107545. ;// CONCATENATED MODULE: ./src/leaflet/services/ImageCollectionService.js
  107546. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107547. * This program are made available under the terms of the Apache License, Version 2.0
  107548. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107549. /**
  107550. * @class ImageCollectionService
  107551. * @deprecatedclassinstance L.supermap.imageCollectionService
  107552. * @version 10.2.0
  107553. * @constructs ImageCollectionService
  107554. * @classdesc 影像集合服务类。
  107555. * @category iServer Image
  107556. * @modulecategory Services
  107557. * @extends {ServiceBase}
  107558. * @example
  107559. * new ImageCollectionService(url,options)
  107560. * .getLegend(queryParams, function(result){
  107561. * //doSomething
  107562. * })
  107563. * @param {string} url - 服务地址。
  107564. * @param {Object} options - 参数。
  107565. * @param {string} options.collectionId 影像集合(Collection)的ID,在一个影像服务中唯一标识影像集合。
  107566. * @param {string} [options.proxy] - 服务代理地址。
  107567. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  107568. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  107569. * @param {Object} [options.headers] - 请求头。
  107570. * @usage
  107571. */
  107572. var ImageCollectionService_ImageCollectionService = ServiceBase.extend({
  107573. initialize: function initialize(url, options) {
  107574. ServiceBase.prototype.initialize.call(this, url, options);
  107575. this._imageCollectionService = new ImageCollectionService(this.url, {
  107576. collectionId: this.options.collectionId,
  107577. proxy: this.options.proxy,
  107578. withCredentials: this.options.withCredentials,
  107579. crossOrigin: this.options.crossOrigin,
  107580. headers: this.options.headers
  107581. });
  107582. },
  107583. /**
  107584. * @function ImageCollectionService.prototype.getLegend
  107585. * @param {Object} queryParams query 参数。
  107586. * @param {ImageRenderingRule} [queryParams.renderingRule] 指定影像显示的风格,包含拉伸显示方式、颜色表、波段组合以及应用栅格函数进行快速处理等。默认使用发布服务时所配置的风格。
  107587. * @param {RequestCallback} callback - 回调函数。
  107588. */
  107589. getLegend: function getLegend(queryParams, callback) {
  107590. this._imageCollectionService.getLegend(queryParams, callback);
  107591. },
  107592. /**
  107593. * @function ImageCollectionService.prototype.getStatistics
  107594. * @description 返回当前影像集合的统计信息。包括文件数量,文件大小等信息。
  107595. * @param {RequestCallback} callback - 回调函数。
  107596. */
  107597. getStatistics: function getStatistics(callback) {
  107598. this._imageCollectionService.getStatistics(callback);
  107599. },
  107600. /**
  107601. * @function ImageCollectionService.prototype.getTileInfo
  107602. * @description 返回影像集合所提供的服务瓦片的信息,包括:每层瓦片的分辨率,比例尺等信息,方便前端进行图层叠加。
  107603. * @param {RequestCallback} callback - 回调函数。
  107604. */
  107605. getTileInfo: function getTileInfo(callback) {
  107606. this._imageCollectionService.getTileInfo(callback);
  107607. },
  107608. /**
  107609. * @function ImageCollectionService.prototype.deleteItemByID
  107610. * @description 删除影像集合中指定ID (`featureId`)的Item对象,即从影像集合中删除指定的影像。
  107611. * @param {string} featureId Feature 的本地标识符。
  107612. * @param {RequestCallback} callback - 回调函数。
  107613. */
  107614. deleteItemByID: function deleteItemByID(featureId, callback) {
  107615. this._imageCollectionService.deleteItemByID(featureId, callback);
  107616. },
  107617. /**
  107618. * @function ImageCollectionService.prototype.getItemByID
  107619. * @description 返回影像集合中指定ID (`featureId`)的Item对象,即返回影像集合中指定的影像。
  107620. * @param {string} featureId Feature 的本地标识符。
  107621. * @param {RequestCallback} callback - 回调函数。
  107622. */
  107623. getItemByID: function getItemByID(featureId, callback) {
  107624. this._imageCollectionService.getItemByID(featureId, callback);
  107625. }
  107626. });
  107627. var imageCollectionService = function imageCollectionService(url, options) {
  107628. return new ImageCollectionService_ImageCollectionService(url, options);
  107629. };
  107630. ;// CONCATENATED MODULE: ./src/leaflet/services/index.js
  107631. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107632. * This program are made available under the terms of the Apache License, Version 2.0
  107633. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107634. ;// CONCATENATED MODULE: ./src/leaflet/components/ComponentsViewBase.js
  107635. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107636. * This program are made available under the terms of the Apache License, Version 2.0
  107637. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107638. /**
  107639. * @class ComponentsViewBase
  107640. * @aliasclass Components.ComponentsViewBase
  107641. * @deprecatedclassinstance L.supermap.components.componentsViewBase
  107642. * @classdesc Lealfet 组件基类。
  107643. * @category Components Common
  107644. * @version 9.1.1
  107645. * @param {Object} options - 参数。
  107646. * @param {string} [options.position='topright'] - 组件在地图中显示的位置( 'topleft'|'topright'|'bottomleft'|'bottomright' )。
  107647. * @param {function} [options.style] - 默认图层样式。返回类型:点样式( maker|circleMaker);线和面样式( L.path )。
  107648. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗。
  107649. * @extends {L.Control}
  107650. * @usage
  107651. */
  107652. var ComponentsViewBase = external_L_default().Control.extend({
  107653. options: {
  107654. //控件位置 继承自leaflet control
  107655. position: 'topright',
  107656. //默认样式,以支持组件设置图层基本样式
  107657. style: function style(feature, latLng) {
  107658. if (latLng /*&& feature instanceof L.latLng || feature.geometry.type.toLowerCase() === "point"*/) {
  107659. return external_L_default().circleMarker(latLng, {
  107660. fillColor: 'blue',
  107661. weight: 1,
  107662. opacity: 1,
  107663. color: 'blue',
  107664. fillOpacity: 0.6
  107665. });
  107666. } else {
  107667. return {
  107668. fillColor: 'blue',
  107669. weight: 1,
  107670. opacity: 1,
  107671. color: 'blue',
  107672. fillOpacity: 0.6
  107673. };
  107674. }
  107675. },
  107676. onEachFeature: null
  107677. },
  107678. initialize: function initialize(options) {
  107679. external_L_default().setOptions(this, options);
  107680. //组件事件处理对象://todo 确认一些公开或私有的成员变量
  107681. this._event = new (external_L_default()).Evented();
  107682. //组件根 dom 元素:
  107683. this.rootContainer = null;
  107684. //图层参数,主要配置组件返回数据图层的样式和事件等
  107685. },
  107686. /**
  107687. * @function ComponentsViewBase.prototype.onAdd
  107688. * @description 向地图添加组件。
  107689. */
  107690. onAdd: function onAdd(map) {
  107691. //子类实现此方法
  107692. this.map = map;
  107693. this.rootContainer = this._initView();
  107694. return this.rootContainer;
  107695. },
  107696. /**
  107697. * @function ComponentsViewBase.prototype.on
  107698. * @description 事件绑定。
  107699. * @param {string} eventType - 监听的事件类型。
  107700. * @param {function} callback - 监听事件的回调函数。
  107701. */
  107702. on: function on(eventType, callback) {
  107703. this._event.on(eventType, callback);
  107704. },
  107705. /**
  107706. * @function ComponentsViewBase.prototype.off
  107707. * @description 事件关闭。
  107708. * @param {string} eventType - 监听的事件名。
  107709. * @param {function} callback - 监听事件的回调函数。
  107710. */
  107711. off: function off(eventType, callback) {
  107712. if (callback) {
  107713. this._event.off(eventType, callback);
  107714. return;
  107715. }
  107716. this._event.off(eventType);
  107717. },
  107718. /**
  107719. * @function ComponentsViewBase.prototype._initView
  107720. * @description 初始化组件 UI。
  107721. * @private
  107722. */
  107723. _initView: function _initView() {
  107724. //子类实现此方法
  107725. },
  107726. /**
  107727. * @function ComponentsViewBase.prototype._preventMapEvent
  107728. * @description 阻止 map 默认事件。
  107729. * @private
  107730. */
  107731. _preventMapEvent: function _preventMapEvent(div, map) {
  107732. if (!div || !map) {
  107733. return;
  107734. }
  107735. div.addEventListener('mouseover', function () {
  107736. map.dragging.disable();
  107737. map.scrollWheelZoom.disable();
  107738. map.doubleClickZoom.disable();
  107739. });
  107740. div.addEventListener('mouseout', function () {
  107741. map.dragging.enable();
  107742. map.scrollWheelZoom.enable();
  107743. map.doubleClickZoom.enable();
  107744. });
  107745. }
  107746. });
  107747. var componentsViewBase = function componentsViewBase(options) {
  107748. return new ComponentsViewBase(options);
  107749. };
  107750. ;// CONCATENATED MODULE: ./src/leaflet/components/openfile/OpenFileViewModel.js
  107751. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107752. * This program are made available under the terms of the Apache License, Version 2.0
  107753. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107754. /**
  107755. * @class OpenFileViewModel
  107756. * @aliasclass Components.OpenFileViewModel
  107757. * @deprecatedclassinstance L.supermap.components.openFileViewModel
  107758. * @classdesc 打开本地文件组件功能类,目前只支持 WGS84 经纬度坐标。
  107759. * @version 9.1.1
  107760. * @category Components OpenFile
  107761. * @param {L.Map} map - Leaflet Map 对象。
  107762. * @fires OpenFileViewModel#filesizeexceed
  107763. * @fires OpenFileViewModel#errorfileformat
  107764. * @fires OpenFileViewModel#openfilesucceeded
  107765. * @fires OpenFileViewModel#openfilefailed
  107766. * @extends {L.Evented}
  107767. * @usage
  107768. */
  107769. var OpenFileViewModel = external_L_default().Evented.extend({
  107770. initialize: function initialize() {
  107771. this.fileModel = new FileModel();
  107772. },
  107773. /**
  107774. * @function OpenFileViewModel.prototype.readFile
  107775. * @description 打开文件并加载到地图。
  107776. * @param {Object} fileEventObject - 本地文件对象。
  107777. */
  107778. readFile: function readFile(fileEventObject) {
  107779. var inputDom = fileEventObject.target;
  107780. var file = inputDom.files[0];
  107781. //文件大小限制
  107782. if (file.size > this.fileModel.FileConfig.fileMaxSize) {
  107783. // document.alert("File supports up to 10M.");
  107784. /**
  107785. * @event OpenFileViewModel#filesizeexceed
  107786. * @description 超出文件大小限制后触发。
  107787. * @property {string} messageType - 警告类型。
  107788. * @property {string} message - 警告内容。
  107789. */
  107790. this.fire("filesizeexceed", {
  107791. messageType: "warring",
  107792. message: Lang.i18n('msg_fileSizeExceeded')
  107793. });
  107794. return false;
  107795. }
  107796. var filePath = inputDom.value;
  107797. var fileName = file.name;
  107798. var fileType = ComponentsUtil.getFileType(fileName);
  107799. //文件格式不支持
  107800. if (!fileType) {
  107801. // document.alert("Unsupported data type.");
  107802. /**
  107803. * @event OpenFileViewModel#errorfileformat
  107804. * @description 文件格式不支持时触发。
  107805. * @property {string} messageType - 警告类型。
  107806. * @property {string} message - 警告内容。
  107807. */
  107808. this.fire("errorfileformat", {
  107809. messageType: "failure",
  107810. message: Lang.i18n('msg_fileTypeUnsupported')
  107811. });
  107812. return false;
  107813. }
  107814. //文件类型限制
  107815. if (fileName !== "") {
  107816. //给control 一份数据
  107817. //todo MVVM模式 应该是数据变化触发数据变化的事件
  107818. this.fileModel.set("loadFileObject", {
  107819. file: file,
  107820. filePath: filePath,
  107821. fileName: fileName,
  107822. fileType: fileType
  107823. });
  107824. //响应选中文件添加到地图
  107825. this._readData();
  107826. }
  107827. },
  107828. /**
  107829. * @function OpenFileViewModel.prototype._readData
  107830. * @description 数据文件中的数据。
  107831. * @private
  107832. */
  107833. _readData: function _readData() {
  107834. var _this = this;
  107835. //todo 需要测试另外两个
  107836. var me = this;
  107837. var type = this.fileModel.loadFileObject.fileType;
  107838. FileReaderUtil.readFile(type, {
  107839. file: this.fileModel.loadFileObject.file,
  107840. path: this.fileModel.loadFileObject.filePath
  107841. }, function (data) {
  107842. //将数据统一转换为 geoJson 格式加载到底图
  107843. FileReaderUtil.processDataToGeoJson(type, data, function (geojson) {
  107844. if (geojson) {
  107845. /**
  107846. * @event OpenFileViewModel#openfilesucceeded
  107847. * @description 打开文件成功。
  107848. * @property {GeoJSONObject} result - GeoJSON 格式数据。
  107849. * @property {string} layerName - 图层名。
  107850. */
  107851. _this.fire("openfilesucceeded", {
  107852. result: geojson,
  107853. layerName: _this.fileModel.loadFileObject.fileName.split('.')[0]
  107854. });
  107855. }
  107856. }, function (e) {
  107857. me.fire("openfilefailed", {
  107858. messageType: "failure",
  107859. message: e
  107860. });
  107861. }, _this);
  107862. }, function () {
  107863. /**
  107864. * @event OpenFileViewModel#openfilefailed
  107865. * @description 打开文件失败。
  107866. * @property {string} messageType - 警告类型。
  107867. * @property {string} message - 警告内容。
  107868. */
  107869. me.fire("openfilefailed", {
  107870. messageType: "failure",
  107871. message: Lang.i18n('msg_openFileFail')
  107872. });
  107873. }, this);
  107874. }
  107875. });
  107876. var openFileViewModel = function openFileViewModel(options) {
  107877. return new OpenFileViewModel(options);
  107878. };
  107879. ;// CONCATENATED MODULE: ./src/leaflet/components/openfile/OpenFileView.js
  107880. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  107881. * This program are made available under the terms of the Apache License, Version 2.0
  107882. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  107883. /**
  107884. * @class OpenFileView
  107885. * @aliasclass Components.OpenFileView
  107886. * @deprecatedclassinstance L.supermap.components.openFile
  107887. * @classdesc 打开文件组件类。用于打开本地数据文件并加载到地图,目前支持打开.csv|.xls|.xlsx|.geojson|.json 格式,只支持 WGS84 经纬度坐标。
  107888. * @version 9.1.1
  107889. * @modulecategory Components
  107890. * @param {Object} options - 参数。
  107891. * @param {string} [options.position='topright'] - 组件在地图中显示的位置( 'topleft'|'topright'|'bottomleft'|'bottomright' )。
  107892. * @param {function} [options.style] - 默认图层样式。返回类型:点样式( maker|circleMaker);线和面样式( L.path )。
  107893. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗。
  107894. * @fires OpenFileView#openfilesucceeded
  107895. * @fires OpenFileView#openfilefailed
  107896. * @extends {ComponentsViewBase}
  107897. * @category Components OpenFile
  107898. * @usage
  107899. */
  107900. var OpenFileView = ComponentsViewBase.extend({
  107901. options: {
  107902. //绑定的底图图层
  107903. layer: null
  107904. },
  107905. initialize: function initialize(options) {
  107906. ComponentsViewBase.prototype.initialize.apply(this, [options]);
  107907. //初始化 ViewModel:
  107908. this.viewModel = new OpenFileViewModel();
  107909. },
  107910. /**
  107911. * @function OpenFileView.prototype.setViewStyle
  107912. * @description 设置组件样式。
  107913. * @param {string} styleName - CSS 样式名称。
  107914. * @param {string} value - CSS 样式值。
  107915. */
  107916. setViewStyle: function setViewStyle(styleName, value) {
  107917. this.rootContainer.style[styleName] = value;
  107918. },
  107919. /**
  107920. * @function OpenFileView.prototype._initView
  107921. * @description 创建打开文件组件。
  107922. * @returns {HTMLElement}
  107923. * @private
  107924. * @override
  107925. */
  107926. _initView: function _initView() {
  107927. var _this = this;
  107928. //初始化 view
  107929. var uploadContent = external_L_default().DomUtil.create('div', 'component-openfile');
  107930. uploadContent.id = 'openFile';
  107931. this.fileSelect = external_L_default().DomUtil.create('div', '', uploadContent);
  107932. this.label = external_L_default().DomUtil.create('label', 'component-openfile__span--select', this.fileSelect);
  107933. this.label.htmlFor = "input_file";
  107934. external_L_default().DomUtil.create('div', 'supermapol-icons-upload', this.label);
  107935. var fileSpan = external_L_default().DomUtil.create('span', 'component-openfile__span', this.label);
  107936. fileSpan.appendChild(document.createTextNode(Lang.i18n('text_chooseFile')));
  107937. this.fileInput = external_L_default().DomUtil.create('input', 'component-openfile__input', this.fileSelect);
  107938. this.fileInput.id = "input_file";
  107939. this.fileInput.type = "file";
  107940. this.fileInput.accept = ".json,.geojson,.csv,.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel";
  107941. this.fileInput.onchange = function (fileEventObject) {
  107942. _this.messageBox.closeView();
  107943. _this.viewModel.readFile(fileEventObject);
  107944. };
  107945. //增加提示框:
  107946. this.messageBox = new MessageBox();
  107947. //添加监听
  107948. this.viewModel.on("filesizeexceed", function (e) {
  107949. _this.messageBox.showView(e.message, e.messageType);
  107950. });
  107951. this.viewModel.on("errorfileformat", function (e) {
  107952. _this.messageBox.showView(e.message, e.messageType);
  107953. });
  107954. this.viewModel.on("openfilefailed", function (e) {
  107955. _this.messageBox.showView(e.message, e.messageType);
  107956. /**
  107957. * @event OpenFileView#openfilefailed
  107958. * @description 打开文件失败。
  107959. * @property {Object} e - 事件对象。
  107960. */
  107961. _this._event.fire("openfilefailed", e);
  107962. });
  107963. this.viewModel.on("readdatafail", function (e) {
  107964. _this.messageBox.showView(e.message, e.messageType);
  107965. });
  107966. this.viewModel.on("openfilesucceeded", function (e) {
  107967. /**
  107968. * @event OpenFileView#openfilesucceeded
  107969. * @description 打开文件成功。
  107970. * @property {Object} e - 事件对象。
  107971. */
  107972. _this._event.fire("openfilesucceeded", e);
  107973. });
  107974. // 阻止 map 默认事件
  107975. this._preventMapEvent(uploadContent, this.map);
  107976. return uploadContent;
  107977. }
  107978. });
  107979. var openFileView = function openFileView(options) {
  107980. return new OpenFileView(options);
  107981. };
  107982. ;// CONCATENATED MODULE: ./src/leaflet/components/search/CityConfig.js
  107983. var config = {
  107984. HOT: {
  107985. HOT: ["北京市", "上海市", "广州市", "深圳市", "南京市", "杭州市", "天津市", "重庆市", "成都市", "青岛市", "苏州市", "无锡市", "常州市", "温州市", "武汉市", "长沙市", "南昌市", "三亚市", "合肥市", "石家庄市"]
  107986. },
  107987. AB: {
  107988. A: ["阿拉善盟", "鞍山市", "安庆市", "安阳市", "阿坝藏族羌族自治州", "安顺市", "阿里地区", "安康市", "阿克苏地区", "阿勒泰地区", "阿拉尔市"],
  107989. B: ["北京市", "保定市", "包头市", "巴彦淖尔市", "本溪市", "白山市", "白城市", "蚌埠市", "亳州市", "滨州市", "北海市", "百色市", "白沙黎族自治县", "保亭黎族苗族自治县", "巴中市", "毕节地区", "保山市", "宝鸡市", "白银市", "博尔塔拉蒙古自治州", "巴音郭楞蒙古自治州", "北区"]
  107990. },
  107991. CD: {
  107992. C: ["重庆市", "成都市", "常州市", "长沙市", "承德市", "沧州市", "长治市", "赤峰市", "朝阳市", "长春市", "滁州市", "巢湖市", "池州市", "常德市", "郴州市", "潮州市", "崇左市", "澄迈县", "昌江黎族自治县", "楚雄彝族自治州", "昌都地区", "昌吉回族自治州"],
  107993. D: ["大同市", "大连市", "丹东市", "大庆市", "大兴安岭地区", "东营市", "德州市", "东莞市", "儋州市", "东方市", "定安县", "德阳市", "达州市", "大理白族自治州", "德宏傣族景颇族自治州", "迪庆藏族自治州", "定西市", "东区", "大埔区", "大堂区"]
  107994. },
  107995. EFG: {
  107996. E: ["鄂尔多斯市", "鄂州市", "恩施土家族苗族自治州"],
  107997. F: ["抚顺市", "阜新市", "阜阳市", "福州市", "抚州市", "佛山市", "防城港市"],
  107998. G: ["广州市", "赣州市", "桂林市", "贵港市", "广元市", "广安市", "贵阳市", "固原市", "高雄市", "高雄县", "甘南藏族自治州", "甘孜藏族自治州"]
  107999. },
  108000. H: {
  108001. H: ["杭州市", "合肥市", "邯郸市", "衡水市", "呼和浩特市", "呼伦贝尔市", "葫芦岛市", "哈尔滨市", "鹤岗市", "黑河市", "淮安市", "湖州市", "淮南市", "淮北市", "黄山市", "菏泽市", "鹤壁市", "黄石市", "黄冈市", "衡阳市", "怀化市", "惠州市", "河源市", "贺州市", "河池市", "海口市", "红河哈尼族彝族自治州", "汉中市", "海东地区", "海北藏族自治州", "黄南藏族自治州", "海南藏族自治州", "果洛藏族自治州", "海西蒙古族藏族自治州", "哈密地区", "和田地区", "花莲县", "黄大仙区", "花地玛堂区"]
  108002. },
  108003. J: {
  108004. J: ["晋城市", "晋中市", "锦州市", "吉林市", "鸡西市", "佳木斯市", "嘉兴市", "金华市", "景德镇市", "九江市", "吉安市", "济南市", "济宁市", "焦作市", "济源市", "荆门市", "荆州市", "江门市", "湛江市", "揭阳市", "嘉峪关市", "金昌市", "酒泉市", "基隆市", "嘉义市", "嘉义县", "九龙城区", "嘉模堂区"]
  108005. },
  108006. KL: {
  108007. K: ["开封市", "昆明市", "克拉玛依市", "克孜勒苏柯尔克孜自治州", "喀什地区"],
  108008. L: ["廊坊市", "临汾市", "吕梁市", "辽阳市", "辽源市", "连云港市", "丽水市", "六安市", "龙岩市", "莱芜市", "临沂市", "聊城市", "洛阳市", "漯河市", "娄底市", "柳州市", "来宾市", "临高县", "乐东黎族自治县", "陵水黎族自治县", "泸州市", "乐山市", "凉山彝族自治州", "六盘水市", "丽江市", "临沧市", "拉萨市", "林芝地区", "兰州市", "陇南市", "临夏回族自治州"]
  108009. },
  108010. MNP: {
  108011. M: ["牡丹江市", "马鞍山市", "茂名市", "梅州市", "绵阳市", "眉山市", "苗栗县"],
  108012. N: ["南京市", "南昌市", "南通市", "宁波市", "南平市", "宁德市", "南阳市", "南宁市", "南沙群岛", "内江市", "南充市", "怒江傈傈族自治州", "那曲地区", "南投县"],
  108013. P: ["盘锦市", "莆田市", "萍乡市", "平顶山市", "濮阳市", "攀枝花市", "平凉市", "屏东县", "澎湖县"]
  108014. },
  108015. QR: {
  108016. Q: ["青岛市", "秦皇岛市", "齐齐哈尔市", "黔西南布依族苗族自治州", "七台河市", "衢州市", "泉州市", "潜江市", "清远市", "钦州市", "琼海市", "曲靖市", "庆阳市", "荃湾区", "黔东南苗族侗族自治州", "黔南布依族苗族自治州", "琼中黎族苗族自治县"],
  108017. R: ["日照市", "日喀则地区"]
  108018. },
  108019. S: {
  108020. S: ["上海市", "深圳市", "苏州市", "石家庄市", "三亚市", "朔州市", "沈阳市", "四平市", "松原市", "双鸭山市", "绥化市", "宿迁市", "绍兴市", "宿州市", "三明市", "上饶市", "三门峡市", "商丘市", "十堰市", "随州市", "邵阳市", "韶关市", "汕头市", "汕尾市", "三亚市", "遂宁市", "思茅市", "山南地区", "商洛市", "石嘴山市", "石河子市", "深水埗区", "沙田区", "神农架林区", "圣安多尼堂区", "圣方济各堂区"]
  108021. },
  108022. T: {
  108023. T: ["天津市", "唐山市", "太原市", "通辽市", "铁岭市", "通化市", "泰州市", "台州市", "铜陵市", "泰安市", "天门市", "屯昌县", "铜仁地区", "铜川市", "天水市", "吐鲁番地区", "塔城地区", "图木舒克市", "台北市", "台中市", "台南市", "台北县", "桃园县", "台中县", "台南县", "台东县", "屯门区"]
  108024. },
  108025. W: {
  108026. W: ["无锡市", "温州市", "武汉市", "乌海市", "乌兰察布市", "芜湖市", "潍坊市", "威海市", "梧州市", "五指山市", "文昌市", "万宁市", "文山壮族苗族自治州", "渭南市", "武威市", "吴忠市", "乌鲁木齐市", "五家渠市", "湾仔区", "望德堂区"]
  108027. },
  108028. X: {
  108029. X: ["邢台市", "忻州市", "兴安盟", "徐州市", "宣城市", "厦门市", "新余市", "新乡市", "许昌市", "信阳市", "襄樊市", "孝感市", "咸宁市", "仙桃市", "湘潭市", "西安市", "咸阳市", "西宁市", "新竹市", "新竹县", "西贡区", "锡林郭勒盟", "西沙群岛", "湘西土家族苗族自治州", "西双版纳傣族自治州"]
  108030. },
  108031. Y: {
  108032. Y: ["阳泉市", "运城市", "营口市", "延边朝鲜族自治州", "伊春市", "盐城市", "扬州市", "鹰潭市", "宜春市", "烟台市", "宜昌市", "岳阳市", "益阳市", "永州市", "阳江市", "云浮市", "玉林市", "宜宾市", "雅安市", "玉溪市", "延安市", "榆林市", "玉树藏族自治州", "银川市", "伊犁哈萨克自治州", "宜兰县", "云林县", "油尖旺区", "元朗区"]
  108033. },
  108034. Z: {
  108035. Z: ["郑州市", "张家口市", "镇江市", "舟山市", "漳州市", "淄博市", "枣庄市", "周口市", "驻马店市", "株洲市", "张家界市", "珠海市", "肇庆市", "中山市", "自贡市", "资阳市", "遵义市", "昭通市", "张掖市", "中卫市", "彰化县", "中西区", "中沙群岛的岛礁及其海域"]
  108036. }
  108037. };
  108038. ;// CONCATENATED MODULE: ./src/leaflet/components/commonmodels/GeoJsonLayersModel.js
  108039. function GeoJsonLayersModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  108040. function GeoJsonLayersModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  108041. function GeoJsonLayersModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJsonLayersModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJsonLayersModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  108042. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  108043. * This program are made available under the terms of the Apache License, Version 2.0
  108044. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  108045. /**
  108046. * @class GeoJsonLayersDataModel
  108047. * @aliasclass Components.GeoJsonLayersDataModel
  108048. * @deprecatedclassinstance L.supermap.components.GeoJsonLayersDataModel
  108049. * @description 多图层数据模型。
  108050. * @category Components Common
  108051. * @private
  108052. * @param {Array.<Object>} layers - 图层数组。
  108053. * @param {GeoJSONLayerWithName} layers.layerObject - 含有 layerName 与 GeoJSON 图层的对象。
  108054. * @fires GeoJsonLayersDataModel#newlayeradded
  108055. * @usage
  108056. */
  108057. // todo 看看如何完善
  108058. var GeoJsonLayersDataModel = /*#__PURE__*/function () {
  108059. function GeoJsonLayersDataModel(layers) {
  108060. GeoJsonLayersModel_classCallCheck(this, GeoJsonLayersDataModel);
  108061. this.layers = [];
  108062. if (layers && layers.length > 0) {
  108063. this.addLayers(layers);
  108064. }
  108065. this.currentLayerDataModel = null;
  108066. }
  108067. GeoJsonLayersModel_createClass(GeoJsonLayersDataModel, [{
  108068. key: "addLayers",
  108069. value: function addLayers(layers, success, failed, context) {
  108070. for (var i = 0; i < layers.length; i++) {
  108071. var layerName = layers[i].layerName;
  108072. if (layers[i].layer instanceof (external_L_default()).GeoJSON) {
  108073. var geoJsonLayerDataModel = new GeoJsonLayerDataModel(layers[i].layer);
  108074. //赋给 GeoJsonLayersDataModel 对象 layerName 属性,每个图层名对应一个 layerDataModel 对象
  108075. this.layers[layerName] = geoJsonLayerDataModel;
  108076. success && success.call(context, {
  108077. layerName: layerName,
  108078. layer: geoJsonLayerDataModel
  108079. });
  108080. } else {
  108081. failed && failed.call(context, "");
  108082. }
  108083. }
  108084. }
  108085. /**
  108086. * @function GeoJsonLayersDataModel.prototype.setCurrentLayerDataModel
  108087. * @description 设置当前选中的图层。
  108088. * @param {string} layerName - 选中的图层名称。
  108089. */
  108090. }, {
  108091. key: "setCurrentLayerDataModel",
  108092. value: function setCurrentLayerDataModel(layerName) {
  108093. if (this.layers[layerName]) {
  108094. this.currentLayerDataModel = this.layers[layerName];
  108095. }
  108096. }
  108097. }]);
  108098. return GeoJsonLayersDataModel;
  108099. }();
  108100. /**
  108101. * @class GeoJsonLayerDataModel
  108102. * @classdesc 图层数据模型,可用于图层要素数据、属性管理等。
  108103. * @category Components Common
  108104. * @param {L.GeoJSON} layer - GeoJSON 图层。
  108105. * 注:leaflet 没有 feature 的概念
  108106. * @usage
  108107. */
  108108. var GeoJsonLayerDataModel = /*#__PURE__*/function () {
  108109. function GeoJsonLayerDataModel(layer) {
  108110. GeoJsonLayersModel_classCallCheck(this, GeoJsonLayerDataModel);
  108111. //图层对象
  108112. this.layer = layer;
  108113. //要素图层数组
  108114. this.features = layer.getLayers();
  108115. //图层属性字段
  108116. this.attributeNames = [];
  108117. //这里一个图层默认共用一套属性字段
  108118. if (this.features[0].feature.properties) {
  108119. for (var field in this.features[0].feature.properties) {
  108120. this.attributeNames.push(field);
  108121. }
  108122. }
  108123. //指定图层操作属性字段
  108124. this.operatingAttributeNames = [];
  108125. //图层属性对象
  108126. this.attributes = {};
  108127. }
  108128. /**
  108129. * @function GeoJsonLayerDataModel.prototype.setOperatingAttributeNames
  108130. * @description 指定操作字段。
  108131. * @param {Array.<string>} operatingAttr - 查询属性字段数组,该数组为 this.attributeNames 的子集。
  108132. */
  108133. GeoJsonLayersModel_createClass(GeoJsonLayerDataModel, [{
  108134. key: "setOperatingAttributeNames",
  108135. value: function setOperatingAttributeNames(operatingAttr) {
  108136. this.operatingAttributeNames = operatingAttr;
  108137. }
  108138. /**
  108139. * @function GeoJsonLayerDataModel.prototype.getAllAttributeNames
  108140. * @description 获取图层所有属性名称。
  108141. * @returns {Array.<string>} 返回图层所有属性名称。
  108142. */
  108143. }, {
  108144. key: "getAllAttributeNames",
  108145. value: function getAllAttributeNames() {
  108146. return this.attributeNames;
  108147. }
  108148. /**
  108149. * @function GeoJsonLayerDataModel.prototype.getAttributeNamesByType
  108150. * @description 获取指定类型的图层属性字段。
  108151. * @param {string} [type] - 类型参数。默认返回所有字段,可选 'Num'。
  108152. * @returns {Array.<string>} 返回指定类型的图层属性字段。
  108153. */
  108154. }, {
  108155. key: "getAttributeNamesByType",
  108156. value: function getAttributeNamesByType(type) {
  108157. //图层属性字段
  108158. if (this.features[0].feature.properties) {
  108159. var properties = this.features[0].feature.properties;
  108160. var attributeNames = [];
  108161. if (type === 'Num') {
  108162. for (var field in properties) {
  108163. if (!isNaN(properties[field])) {
  108164. attributeNames.push(field);
  108165. }
  108166. }
  108167. } else {
  108168. attributeNames = this.attributeNames;
  108169. }
  108170. return attributeNames;
  108171. }
  108172. }
  108173. /**
  108174. * @function GeoJsonLayerDataModel.prototype.getAllFeatures
  108175. * @description 获取图层所有要素。
  108176. * @returns {Array.<Object>} 返回图层所有要素。
  108177. */
  108178. }, {
  108179. key: "getAllFeatures",
  108180. value: function getAllFeatures() {
  108181. return this.features;
  108182. }
  108183. /**
  108184. * @function GeoJsonLayerDataModel.prototype.getAttributeValueByAttributeName
  108185. * @description 获取属性值。
  108186. * @param {string} attributeName - 属性名称。
  108187. * @returns {Object} 返回属性值对象。
  108188. */
  108189. }, {
  108190. key: "getAttributeValueByAttributeName",
  108191. value: function getAttributeValueByAttributeName(attributeName) {
  108192. //如果图层属性对象中已存在该属性,则直接返回
  108193. if (this.attributes[attributeName]) {
  108194. return this.attributes[attributeName];
  108195. }
  108196. //若图层属性对象还未存储该属性,则遍历每个feature 读取其属性值,并存储到图层属性对象中
  108197. this.attributes[attributeName] = [];
  108198. for (var i = 0; i < this.features.length; i++) {
  108199. this.attributes[attributeName].push([this.features[i].feature.properties[attributeName]]);
  108200. }
  108201. return this.attributes[attributeName];
  108202. }
  108203. //getAttributeValueByAttributeName(feature,attributeName)
  108204. //getAllFeatures()
  108205. //todo getFeatureByID()
  108206. //getFeaturesByKeywords(keyword,searchAttributeNames)
  108207. //getAllAttributeValues(attributeName) ??
  108208. //getAllAttributeNames()
  108209. /**
  108210. * @function GeoJsonLayerDataModel.prototype.getFeaturesByKeyWord
  108211. * @description 查询要素对象。
  108212. * @param {string} keyWord - 查询关键字。
  108213. * @returns {Array.<Object>} 返回要素对象数组。
  108214. */
  108215. }, {
  108216. key: "getFeaturesByKeyWord",
  108217. value: function getFeaturesByKeyWord(keyWord) {
  108218. var features = [],
  108219. keyReg = new RegExp(keyWord.toLowerCase());
  108220. var self = this;
  108221. this.features.forEach(function (feature) {
  108222. if (!feature.feature.properties) {
  108223. return null;
  108224. }
  108225. var fAttr = feature.feature.properties;
  108226. var operatingAttributeNames;
  108227. //若设置了过滤字段,则按过滤字段查询
  108228. if (self.operatingAttributeNames.length > 0) {
  108229. operatingAttributeNames = self.operatingAttributeNames;
  108230. } else {
  108231. //若未设置了过滤字段,则按图层字段查询
  108232. operatingAttributeNames = self.attributeNames;
  108233. }
  108234. //遍历要素,查询符合条件的要素
  108235. for (var i = 0, len = operatingAttributeNames.length; i < len; i++) {
  108236. if (fAttr[operatingAttributeNames[i]] && keyReg.test(fAttr[operatingAttributeNames[i]].toString().toLowerCase())) {
  108237. var filterAttributeName = operatingAttributeNames[i];
  108238. var filterAttributeValue = fAttr[operatingAttributeNames[i]];
  108239. //将查询出的属性字段及属性值赋给 feature 并返回
  108240. feature.filterAttribute = {
  108241. filterAttributeName: filterAttributeName,
  108242. filterAttributeValue: filterAttributeValue
  108243. };
  108244. features.push(feature);
  108245. break;
  108246. }
  108247. }
  108248. });
  108249. return features;
  108250. }
  108251. }]);
  108252. return GeoJsonLayerDataModel;
  108253. }();
  108254. ;// CONCATENATED MODULE: ./src/leaflet/components/search/SearchViewModel.js
  108255. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  108256. * This program are made available under the terms of the Apache License, Version 2.0
  108257. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  108258. /**
  108259. * @class SearchViewModel
  108260. * @aliasclass Components.SearchViewModel
  108261. * @deprecatedclassinstance L.supermap.components.searchViewModel
  108262. * @classdesc 图层查询组件功能类。
  108263. * @version 9.1.1
  108264. * @category Components Search
  108265. * @param {L.Map} map - Leaflet Map 对象。
  108266. * @param {Object} options - 参数。
  108267. * @param {Object} [options.cityGeoCodingConfig] - 城市地址匹配服务配置,包括:{addressUrl:"",key:""},默认为 online 本地搜索服务。
  108268. * @fires SearchViewModel#newlayeradded
  108269. * @fires SearchViewModel#searchlayersucceeded
  108270. * @fires SearchViewModel#searchfailed
  108271. * @fires SearchViewModel#geocodesucceeded
  108272. * @extends {L.Evented}
  108273. * @usage
  108274. */
  108275. var SearchViewModel = external_L_default().Evented.extend({
  108276. options: {
  108277. cityGeoCodingConfig: {
  108278. addressUrl: "https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos",
  108279. key: "fvV2osxwuZWlY0wJb8FEb2i5"
  108280. }
  108281. },
  108282. initialize: function initialize(map, options) {
  108283. if (map) {
  108284. /**
  108285. * @member {L.Map} SearchViewModel.prototype.map
  108286. * @description 当前组件所在的地图。
  108287. */
  108288. this.map = map;
  108289. } else {
  108290. return new Error("Cannot find map, fileModel.map cannot be null.");
  108291. }
  108292. external_L_default().Util.setOptions(this, options);
  108293. //初始化Model
  108294. this.dataModel = new GeoJsonLayersDataModel();
  108295. //初始话地址匹配服务
  108296. this.geoCodeParam = {
  108297. keyWords: '北京市',
  108298. city: "北京市",
  108299. pageSize: this.options.pageSize,
  108300. pageNum: this.options.pageNum
  108301. };
  108302. //查询缓存
  108303. this.searchCache = {};
  108304. },
  108305. /**
  108306. * @function SearchViewModel.prototype.search
  108307. * @description 查询。
  108308. * @param {string} keyWords - 查询的关键字。
  108309. * @param {string} [searchLayerName] - 执行的查询类型,支执行矢量图层属性查询,当为 "geocode" 则执行地址匹配。
  108310. */
  108311. search: function search(keyWord, searchLayerName) {
  108312. if (!searchLayerName) {
  108313. this.searchFromCityLocalSearchService(keyWord);
  108314. } else {
  108315. this.searchFromLayer(keyWord, searchLayerName);
  108316. }
  108317. },
  108318. /**
  108319. * @function SearchViewModel.prototype.searchFromLayer
  108320. * @description 图层属性查询。
  108321. * @param {string} searchLayerName - 查询的图层名。
  108322. * @param {string} keyWord - 图层属性搜索关键字。
  108323. */
  108324. searchFromLayer: function searchFromLayer(keyWord, searchLayerName) {
  108325. if (this.dataModel.layers[searchLayerName]) {
  108326. var resultFeatures = this.dataModel.layers[searchLayerName].getFeaturesByKeyWord(keyWord);
  108327. if (resultFeatures && resultFeatures.length > 0) {
  108328. /**
  108329. * @event SearchViewModel#searchlayersucceeded
  108330. * @description 图层属性查询成功后触发。
  108331. * @property {Object} result - 图层数据。
  108332. */
  108333. this.fire("searchlayersucceeded", {
  108334. result: resultFeatures
  108335. });
  108336. } else {
  108337. /**
  108338. * @event SearchViewModel#searchfailed
  108339. * @description 图层属性查询失败后触发。
  108340. * @property {string} searchType - 图层属性查询状态。
  108341. */
  108342. this.fire("searchfailed", {
  108343. searchType: "searchLayersField"
  108344. });
  108345. }
  108346. }
  108347. },
  108348. /**
  108349. * @function SearchViewModel.prototype.searchFromCityLocalSearchService
  108350. * @description 城市地址匹配查询。
  108351. * @param {string} keyWords - 城市地址匹配查询关键字。
  108352. */
  108353. searchFromCityLocalSearchService: function searchFromCityLocalSearchService(keyWords) {
  108354. //todo 是否保留缓存?请求过的数据保留一份缓存?
  108355. if (this.searchCache[keyWords]) {
  108356. /**
  108357. * @event SearchViewModel#geocodesucceeded
  108358. * @description 城市地址匹配成功后触发。
  108359. * @property {Object} result - 城市匹配成功后返回的数据。
  108360. */
  108361. this.fire("geocodesucceeded", {
  108362. result: this.searchCache[keyWords]
  108363. });
  108364. } else {
  108365. this.geoCodeParam.keyWords = keyWords || this.geoCodeParam.city;
  108366. var self = this;
  108367. var url = this._getSearchUrl(this.geoCodeParam);
  108368. FetchRequest.get(url).then(function (response) {
  108369. return response.json();
  108370. }).then(function (geocodingResult) {
  108371. if (geocodingResult.error || geocodingResult.poiInfos.length === 0) {
  108372. self.fire("searchfailed", {
  108373. searchType: "searchGeocodeField"
  108374. });
  108375. return;
  108376. }
  108377. if (geocodingResult.poiInfos) {
  108378. var geoJsonResult = self._dataToGeoJson(geocodingResult.poiInfos, self.geoCodeParam);
  108379. self.fire("geocodesucceeded", {
  108380. result: geoJsonResult
  108381. });
  108382. }
  108383. });
  108384. }
  108385. },
  108386. /**
  108387. * @function SearchViewModel.prototype.addSearchLayers
  108388. * @description 添加新的可查询图层。
  108389. * @param {Array.<L.GeoJSON>} layers - 新添加的图层对象。
  108390. */
  108391. addSearchLayers: function addSearchLayers(layers) {
  108392. var _this = this;
  108393. this.dataModel.addLayers(layers, function (e) {
  108394. /**
  108395. * @event SearchViewModel#newlayeradded
  108396. * @description 添加查询图层事件。
  108397. * @property {Object} result - 事件返回的新的查询图层对象。
  108398. * @property {string} layerName - 事件返回的新的查询图层对象名。
  108399. */
  108400. _this.fire("newlayeradded", {
  108401. layerName: e.layerName
  108402. });
  108403. }, null, this);
  108404. },
  108405. /**
  108406. * @function SearchViewModel.prototype.panToLayer
  108407. * @description 缩放到指定图层。
  108408. * @param {string} layerName - 指定缩放的图层名。
  108409. */
  108410. panToLayer: function panToLayer(layerName) {
  108411. if (this.dataModel.layers[layerName]) {
  108412. this.map.flyToBounds(this.dataModel.layers[layerName].layer.getBounds());
  108413. }
  108414. },
  108415. /**
  108416. * @function SearchViewModel.prototype.panToCity
  108417. * @description 缩放到指定城市。
  108418. * @param {string} city - 指定缩放的城市名。
  108419. */
  108420. panToCity: function panToCity(city) {
  108421. this.geoCodeParam.keyWords = city;
  108422. this.geoCodeParam.city = city;
  108423. var self = this;
  108424. var url = this._getSearchUrl(this.geoCodeParam);
  108425. FetchRequest.get(url).then(function (response) {
  108426. return response.json();
  108427. }).then(function (geocodingResult) {
  108428. if (geocodingResult.poiInfos.length > 0) {
  108429. //缩放至城市
  108430. var center = external_L_default().latLng(geocodingResult.poiInfos[0].location.y, geocodingResult.poiInfos[0].location.x);
  108431. self.map.setView(center, 8);
  108432. } else {
  108433. self.fire("searchfailed", {
  108434. searchType: "cityGeocodeField"
  108435. });
  108436. }
  108437. });
  108438. },
  108439. /**
  108440. * @description 将地址匹配返回的数据转为 GeoJSON 格式数据。
  108441. * @param data
  108442. * @private
  108443. */
  108444. _dataToGeoJson: function _dataToGeoJson(data, geoCodeParam) {
  108445. var features = [];
  108446. for (var i = 0; i < data.length; i++) {
  108447. var feature = {
  108448. type: "Feature",
  108449. geometry: {
  108450. type: "Point",
  108451. coordinates: [data[i].location.x, data[i].location.y]
  108452. },
  108453. properties: {
  108454. name: data[i].name || geoCodeParam.keyWords,
  108455. address: data[i].formatedAddress || data[i].address
  108456. }
  108457. };
  108458. features.push(feature);
  108459. }
  108460. return features;
  108461. },
  108462. /**
  108463. * @function SearchViewModel.prototype._getSearchUrl
  108464. * @description 获取地理编码查询地址。
  108465. * @param {Object} geoCodeParam - 地理编码查询参数。
  108466. * @private
  108467. */
  108468. _getSearchUrl: function _getSearchUrl(geoCodeParam) {
  108469. var url = this.options.cityGeoCodingConfig.addressUrl + ".json?keywords=".concat(geoCodeParam.keyWords, "&city=").concat(geoCodeParam.city, "&pageSize=").concat(geoCodeParam.pageSize, "&pageNum=").concat(geoCodeParam.pageNum, "&key=").concat(this.options.cityGeoCodingConfig.key);
  108470. return url;
  108471. }
  108472. });
  108473. var searchViewModel = function searchViewModel(options) {
  108474. return new SearchViewModel(options);
  108475. };
  108476. ;// CONCATENATED MODULE: ./src/leaflet/components/search/SearchView.js
  108477. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  108478. * This program are made available under the terms of the Apache License, Version 2.0
  108479. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  108480. /**
  108481. * @class SearchView
  108482. * @aliasclass Components.Search
  108483. * @deprecatedclassinstance L.supermap.components.search
  108484. * @classdesc 图层查询组件类。
  108485. * @category Components Search
  108486. * @modulecategory Components
  108487. * @version 9.1.1
  108488. * @param {Object} options - 参数。
  108489. * @param {Object|Array.<string>} [options.cityConfig] - 城市地址匹配配置,默认为全国城市,与 options.cityGeoCodingConfig 支持匹配的服务对应;
  108490. * 配置两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或 ["成都市","北京市"],用户可根据自己的项目需求进行配置。
  108491. * @param {Object} [options.cityGeoCodingConfig] - 城市地址匹配服务配置,包括:{addressUrl:"",key:""} 默认为 online 地址匹配服务,与 options.cityConfig 对应。
  108492. * @param {boolean} [options.isGeoCoding=true] - 是否支持城市地址匹配功能。
  108493. * @param {number} [options.pageSize=10] - 地址匹配查询返回记录结果数,最大设置为 20。
  108494. * @param {number} [options.pageNum=1] - 地址匹配查询分页页码,默认 1 代表第一页。
  108495. * @param {number} [options.perPageDataNum=8] - 每页显示个数,最大值为 8。
  108496. * @param {string} [options.position='topright'] - 组件在地图中显示的位置( 'topleft'|'topright'|'bottomleft'|'bottomright' )。
  108497. * @param {function} [options.style] - 默认图层样式。点样式( maker|circleMaker);线和面样式( L.path )。
  108498. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗。
  108499. * @extends {ComponentsViewBase}
  108500. * @fires SearchView#searchlayersucceeded
  108501. * @fires SearchView#searchfailed
  108502. * @fires SearchView#geocodesucceeded
  108503. * @usage
  108504. */
  108505. var SearchView = ComponentsViewBase.extend({
  108506. options: {
  108507. cityConfig: config,
  108508. cityGeoCodingConfig: {
  108509. addressUrl: "https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos",
  108510. key: "fvV2osxwuZWlY0wJb8FEb2i5"
  108511. },
  108512. isGeoCoding: true,
  108513. pageSize: 10,
  108514. pageNum: 1,
  108515. perPageDataNum: 8
  108516. },
  108517. initialize: function initialize(options) {
  108518. ComponentsViewBase.prototype.initialize.apply(this, [options]);
  108519. //当前选中查询的图层名:
  108520. this.currentSearchLayerName = "";
  108521. this.isSearchLayer = false;
  108522. this.perPageDataNum = this.options.perPageDataNum;
  108523. },
  108524. /*------以下是一些接口-----*/
  108525. /**
  108526. * @function SearchView.prototype.onAdd
  108527. * @description 向底图添加组件。
  108528. * @private
  108529. * @override
  108530. */
  108531. onAdd: function onAdd(map) {
  108532. //初始化组件业务逻辑执行对象 viewModel
  108533. this.viewModel = new SearchViewModel(map, this.options);
  108534. return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
  108535. },
  108536. /**
  108537. * @function SearchView.prototype.addSearchLayer
  108538. * @description 添加可查询的图层。
  108539. * @param {Array.<L.GeoJSON>|L.GeoJSON} layers - 可查询的图层。
  108540. */
  108541. addSearchLayer: function addSearchLayer(layers) {
  108542. //将可查询图层数据传入vm处理
  108543. this.viewModel.addSearchLayers(layers);
  108544. },
  108545. /*----------以下是创建 dom 元素的方法---------*/
  108546. /**
  108547. * @function SearchView.prototype._initView
  108548. * @description 创建地址匹配或图层要素查询组件。
  108549. * @override
  108550. * @returns {HTMLElement}
  108551. * @private
  108552. */
  108553. _initView: function _initView() {
  108554. var _this = this;
  108555. // self 便于 this 对象的使用
  108556. var self = this;
  108557. var div = document.createElement("div");
  108558. div.setAttribute("class", "component-search-container");
  108559. //外框
  108560. var poiContainer = document.createElement("div");
  108561. poiContainer.setAttribute("class", "component-search");
  108562. //主体
  108563. //---------下拉框:
  108564. var poiSettings = document.createElement("div");
  108565. poiSettings.setAttribute("class", "component-search__settings");
  108566. //下拉框
  108567. var poiSearchName = document.createElement("div");
  108568. //由View 维护,进行交互操作
  108569. poiSearchName.setAttribute("class", "component-search__settings__name");
  108570. //poiSettings.innerHTML 通过下拉框选项改变
  108571. poiSettings.appendChild(poiSearchName);
  108572. //下拉标记
  108573. var triangleIcon = document.createElement("span");
  108574. triangleIcon.setAttribute("class", "supermapol-icons-solid-down-triangle");
  108575. poiSettings.appendChild(triangleIcon);
  108576. //城市地址匹配页面, 以及图层查询页面
  108577. //城市地址匹配页面:
  108578. var citySelect = null;
  108579. if (this.options.isGeoCoding) {
  108580. var cityTabsPageObj = new CityTabsPage({
  108581. config: this.options.cityConfig
  108582. });
  108583. citySelect = cityTabsPageObj.getElement();
  108584. //点选城市名,修改显示,并执行定位城市查询【城市列表列表点击事件】
  108585. cityTabsPageObj.content.onclick = function (e) {
  108586. if (e.target.nodeName === "SPAN" && e.target.innerText) {
  108587. _this.viewModel.panToCity(e.target.innerHTML);
  108588. _this.messageBox.closeView();
  108589. poiSearchName.removeChild(poiSearchName.firstChild);
  108590. poiSearchName.insertBefore(document.createTextNode(e.target.innerHTML), poiSearchName.firstChild);
  108591. _this.isSearchLayer = false;
  108592. }
  108593. };
  108594. //支持城市地址匹配,则初始化显示配置的第一个城市名:
  108595. poiSearchName.appendChild(document.createTextNode(cityTabsPageObj.content.getElementsByTagName("span")[0].innerText));
  108596. }
  108597. //图层查询页面:写法是为了为了代码可读性
  108598. var layersSelect = function () {
  108599. var layersSelect = document.createElement("div");
  108600. layersSelect.setAttribute("class", "component-search__layers");
  108601. var layersContent = document.createElement("div");
  108602. layersContent.setAttribute("class", "component-search-layers-content");
  108603. layersSelect.appendChild(layersContent);
  108604. //header todo 两个选项的功能暂没用到,先关闭,后续用到再打开
  108605. var layersHeader = document.createElement("div");
  108606. layersHeader.setAttribute("class", "component-search__layers__header");
  108607. //加载搜索条件
  108608. var loadBtn = document.createElement("div");
  108609. loadBtn.setAttribute("class", "load-btn");
  108610. layersHeader.appendChild(loadBtn);
  108611. var loadIcon = document.createElement("span");
  108612. loadIcon.setAttribute("class", "supermapol-icons-poi-load");
  108613. loadBtn.appendChild(loadIcon);
  108614. var loadBtnText = document.createElement("span");
  108615. loadBtnText.appendChild(document.createTextNode(Lang.i18n("text_loadSearchCriteria")));
  108616. loadBtn.appendChild(loadBtnText);
  108617. //保存搜索条件
  108618. var saveBtn = document.createElement("div");
  108619. saveBtn.setAttribute("class", "save-btn");
  108620. layersHeader.appendChild(saveBtn);
  108621. var icon = document.createElement("span");
  108622. icon.setAttribute("class", "supermapol-icons-poi-save");
  108623. saveBtn.appendChild(icon);
  108624. var saveBtnText = document.createElement("span");
  108625. saveBtnText.appendChild(document.createTextNode(Lang.i18n("text_saveSearchCriteria")));
  108626. saveBtn.appendChild(saveBtnText);
  108627. //body
  108628. var layerSelectOptions = document.createElement("div");
  108629. layerSelectOptions.setAttribute("class", "component-search__layers__body");
  108630. //选中查询图层监听
  108631. //选择查询图层【图层列表点击事件】
  108632. layerSelectOptions.onclick = function (e) {
  108633. //先进行清除操作
  108634. self.clearSearchResult();
  108635. var selectLayerOption = null;
  108636. if (e.target.classList[0] === "component-search__layers__itme__singleselect") {
  108637. selectLayerOption = e.target;
  108638. } else if (e.target.classList[0] === "component-single-default-img" || e.target.classList[0] === "single-label") {
  108639. selectLayerOption = e.target.parentNode;
  108640. } else {
  108641. return;
  108642. }
  108643. if (document.getElementsByClassName("component-single-checked-img").length > 0) {
  108644. document.getElementsByClassName("component-single-checked-img")[0].setAttribute("class", "component-single-default-img");
  108645. }
  108646. selectLayerOption.firstChild.setAttribute("class", "component-single-checked-img");
  108647. self.currentSearchLayerName = selectLayerOption.lastChild.innerText;
  108648. self.isSearchLayer = true;
  108649. poiSearchName.removeChild(poiSearchName.firstChild);
  108650. poiSearchName.insertBefore(document.createTextNode(self.currentSearchLayerName), poiSearchName.firstChild);
  108651. self.viewModel.panToLayer(self.currentSearchLayerName);
  108652. self.messageBox.closeView();
  108653. };
  108654. layersContent.appendChild(layerSelectOptions);
  108655. //读取当前图层数据,并展现
  108656. //只有调用添加查询图层接口才能添加图层选项
  108657. return layersSelect;
  108658. }();
  108659. //配置开启 城市匹配功能则添加
  108660. var navTabs = [];
  108661. if (citySelect) {
  108662. navTabs.push({
  108663. title: Lang.i18n("title_searchCity"),
  108664. content: citySelect
  108665. });
  108666. }
  108667. navTabs.push({
  108668. title: Lang.i18n("title_searchLayer"),
  108669. content: layersSelect
  108670. });
  108671. var navTabsPageObject = new NavTabsPage({
  108672. tabs: navTabs
  108673. });
  108674. var navTabsPage = navTabsPageObject.getElement();
  108675. navTabsPageObject.closeView();
  108676. poiContainer.appendChild(navTabsPage);
  108677. poiSettings.onclick = function () {
  108678. if (navTabsPage.hidden) {
  108679. navTabsPageObject.showView();
  108680. } else {
  108681. navTabsPageObject.closeView();
  108682. }
  108683. };
  108684. poiContainer.appendChild(poiSettings);
  108685. //初始时,下拉框若没赋值显示信息,则再次赋值:
  108686. if (!poiSearchName.innerText) {
  108687. poiSearchName.appendChild(document.createTextNode(Lang.i18n("text_label_chooseSearchLayers")));
  108688. }
  108689. //---------下拉框 END
  108690. //---------搜索输入框:
  108691. var poiInputContainer = document.createElement("div");
  108692. poiInputContainer.setAttribute("class", "component-search__input");
  108693. var poiInput = document.createElement("input");
  108694. poiInput.type = "text";
  108695. poiInput.placeholder = Lang.i18n("text_label_searchTips");
  108696. poiInputContainer.appendChild(poiInput);
  108697. //由View 维护,进行交互操作
  108698. this.poiInput = poiInput;
  108699. //清除输入内容按钮:
  108700. var poiInputClose = document.createElement("span");
  108701. poiInputClose.setAttribute("class", "supermapol-icons-close");
  108702. poiInputClose.hidden = true;
  108703. poiInputContainer.appendChild(poiInputClose);
  108704. poiContainer.appendChild(poiInputContainer);
  108705. //---------搜索输入框 END
  108706. //--------搜索按钮:
  108707. var searchBtn = document.createElement("div");
  108708. searchBtn.setAttribute("class", "component-search-icon supermapol-icons-search");
  108709. //查询结果页面
  108710. var resultDomObj = new PaginationContainer();
  108711. this._resultDomObj = resultDomObj;
  108712. //查询要素或匹配要素【搜索按钮点击事件】
  108713. searchBtn.onclick = function () {
  108714. //若是遮挡结果显示,则关闭
  108715. resultDomObj.closeView();
  108716. _this.clearSearchResult();
  108717. _this.messageBox.closeView();
  108718. navTabsPageObject.closeView();
  108719. var keyWord = _this.poiInput.value.trim();
  108720. if (keyWord === "") {
  108721. _this.messageBox.showView(Lang.i18n('msg_searchKeywords'));
  108722. return;
  108723. }
  108724. if (_this.isSearchLayer) {
  108725. _this.viewModel.search(keyWord, _this.currentSearchLayerName);
  108726. } else {
  108727. _this.viewModel.search(keyWord);
  108728. }
  108729. };
  108730. //【输入框输入内容回车事件】
  108731. poiInput.onkeypress = function (e) {
  108732. //.which属性判断按下的是哪个键,回车键的键位序号为13
  108733. if (e.which == 13) {
  108734. //手动触发 searchBtn 得点击事件,执行查询操作
  108735. var evt = document.createEvent("HTMLEvents");
  108736. evt.initEvent("click", false, true);
  108737. searchBtn.dispatchEvent(evt);
  108738. }
  108739. };
  108740. poiContainer.appendChild(searchBtn);
  108741. //--------搜索按钮 END
  108742. var resultContainer = function createResultPage() {
  108743. var resultContainer = resultDomObj.getElement();
  108744. resultContainer.style.position = "absolute";
  108745. resultContainer.style.top = "44px";
  108746. resultContainer.style.right = "0";
  108747. //先关闭结果界面,当有数据时再打开
  108748. resultDomObj.closeView();
  108749. //【结果列表点击事件】,以支持联动map上对应要素:
  108750. resultDomObj.content.onclick = function (e) {
  108751. var selectFeatureOption = null;
  108752. if (e.target.parentNode.className === "component-search-result-info") {
  108753. selectFeatureOption = e.target.parentNode.parentNode;
  108754. } else if (e.target.parentNode.className === "component-search__resultitme") {
  108755. selectFeatureOption = e.target.parentNode;
  108756. } else if (e.target.className === "component-search__resultitme") {
  108757. selectFeatureOption = e.target;
  108758. } else {
  108759. return;
  108760. }
  108761. //修改
  108762. if (document.getElementsByClassName("component-search__resultitme-selected").length > 0) {
  108763. document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected");
  108764. }
  108765. selectFeatureOption.firstChild.classList.add("component-search__resultitme-selected");
  108766. var filter = selectFeatureOption.children[1].firstChild.innerText;
  108767. //联动地图上要素响应
  108768. self._linkageFeature(filter);
  108769. };
  108770. return resultContainer;
  108771. }();
  108772. poiContainer.appendChild(resultContainer);
  108773. //清除输入框内容【输入框删除按钮点击事件】
  108774. poiInputClose.onclick = function (e) {
  108775. _this.clearSearchResult();
  108776. poiInput.value = "";
  108777. e.target.hidden = true;
  108778. resultDomObj.closeView();
  108779. };
  108780. //【输入框输入内容事件】
  108781. poiInput.oninput = function () {
  108782. poiInputClose.hidden = false;
  108783. };
  108784. //添加提示框
  108785. this.messageBox = new MessageBox();
  108786. //绑定 VM 的监听
  108787. this._addViewModelListener();
  108788. div.appendChild(poiContainer);
  108789. //阻止 map 默认事件
  108790. this._preventMapEvent(div, this.map);
  108791. return div;
  108792. },
  108793. /**
  108794. * @function SearchView.prototype._createSearchLayerItem
  108795. * @description 创建查询图层选项。
  108796. * @private
  108797. */
  108798. _createSearchLayerItem: function _createSearchLayerItem(layerName) {
  108799. var layerOption = document.createElement("div");
  108800. layerOption.setAttribute("class", "component-search__layers__itme");
  108801. // 创建圆形单选框
  108802. var singleSelect = document.createElement("div");
  108803. singleSelect.setAttribute("class", "component-search__layers__itme__singleselect");
  108804. var singleIcon = document.createElement("div");
  108805. singleIcon.setAttribute("class", "component-single-default-img");
  108806. singleSelect.appendChild(singleIcon);
  108807. var singleLabel = document.createElement("span");
  108808. singleLabel.setAttribute("class", "single-label");
  108809. singleLabel.innerHTML = layerName;
  108810. singleSelect.appendChild(singleLabel);
  108811. layerOption.appendChild(singleSelect);
  108812. //attributes-select todo 暂不支持该功能
  108813. // const attributesSelect = (new ComponentSelect(layer.layer.attributeNames)).getElement();
  108814. //选择查询的字段 todo 限制图层查找属性功能待属性选择框优化后完善
  108815. /*attributesSelect.onchange = (e) => {
  108816. this.searchAttributes = e.target.value;
  108817. };*/
  108818. // layerOption.appendChild(attributesSelect);
  108819. document.getElementsByClassName("component-search__layers__body")[0].appendChild(layerOption);
  108820. },
  108821. /**
  108822. * @function SearchView.prototype._createResultItem
  108823. * @description 创建查询结果列表。
  108824. * @private
  108825. */
  108826. _createResultItem: function _createResultItem(featureType, properties) {
  108827. var item = document.createElement("div");
  108828. item.setAttribute("class", "component-search__resultitme");
  108829. var icon = document.createElement("div");
  108830. if (featureType === "Point" || featureType === "MultiPoint") {
  108831. icon.setAttribute("class", "supermapol-icons-marker-layer component-search-result-icon");
  108832. } else if (featureType === "LineString" || featureType === "MultiLineString ") {
  108833. icon.setAttribute("class", "supermapol-icons-line-layer component-search-result-icon");
  108834. } else if (featureType === "Polygon" || featureType === "MultiPolygon") {
  108835. icon.setAttribute("class", "supermapol-icons-polygon-layer component-search-result-icon");
  108836. } else {
  108837. icon.setAttribute("class", "supermapol-icons-point-layer component-search-result-icon");
  108838. }
  108839. item.appendChild(icon);
  108840. var info = document.createElement("div");
  108841. info.setAttribute("class", "component-search-result-info");
  108842. var info1 = document.createElement("div");
  108843. info.appendChild(info1);
  108844. var info2 = document.createElement("div");
  108845. //分地址匹配和图层搜索的两种数据展现形式:
  108846. if (properties.name) {
  108847. info1.innerHTML = properties.name;
  108848. info2.innerHTML = properties.address;
  108849. info.appendChild(info2);
  108850. } else {
  108851. info1.innerHTML = properties.filterAttributeName + ": " + properties.filterAttributeValue;
  108852. }
  108853. item.appendChild(info);
  108854. //暂时删除复选框UI
  108855. var check = document.createElement("div");
  108856. check.setAttribute("class", "component-checkbox component-checkbox-default-img");
  108857. // item.appendChild(check);
  108858. return item;
  108859. },
  108860. /*----------对 VM 的一些事件监听 ----------*/
  108861. /**
  108862. * @function SearchView.prototype._addViewModelListener
  108863. * @description 绑定对 VM 的事件监听。
  108864. * @private
  108865. */
  108866. _addViewModelListener: function _addViewModelListener() {
  108867. var _this2 = this;
  108868. //----可查询图层变化监听
  108869. this.viewModel.on("searchlayerschanged", function (layers) {
  108870. for (var i = 0; i < layers.length; i++) {
  108871. _this2._createSearchLayerItem(layers[i]);
  108872. }
  108873. });
  108874. //----可查询图层变化监听
  108875. this.viewModel.on("newlayeradded", function (e) {
  108876. _this2._createSearchLayerItem(e.layerName);
  108877. });
  108878. //----图层查询结果监听
  108879. this.viewModel.on("searchlayersucceeded", function (e) {
  108880. var data = e.result;
  108881. _this2.clearSearchResult();
  108882. _this2.searchResultLayer = external_L_default().featureGroup(data, {
  108883. pointToLayer: _this2.options.style,
  108884. style: _this2.options.style
  108885. }).bindPopup(function (layer) {
  108886. if (layer.feature.properties) {
  108887. return new AttributesPopContainer({
  108888. attributes: layer.feature.properties
  108889. }).getElement();
  108890. }
  108891. }).addTo(_this2.map);
  108892. _this2.searchResultLayer.eachLayer(function (layer) {
  108893. _this2.options.onEachFeature ? _this2.options.onEachFeature(layer.toGeoJSON(), layer) : _this2._featureOnclickEvent.bind(_this2)(layer.toGeoJSON(), layer);
  108894. });
  108895. _this2.searchLayersData = data;
  108896. //查询结果列表:
  108897. _this2._prepareResultData(data);
  108898. /**
  108899. * @event SearchView#searchlayersucceeded
  108900. * @description 图层查询成功后触发。
  108901. * @property {Object} result - 事件返回的 GeoJSON 格式数据对象。
  108902. */
  108903. _this2._event.fire("searchlayersucceeded", {
  108904. result: _this2.searchResultLayer.toGeoJSON()
  108905. });
  108906. });
  108907. //----地址匹配服务监听
  108908. this.viewModel.on("geocodesucceeded", function (e) {
  108909. var data = e.result;
  108910. //先清空当前有的地址匹配图层
  108911. _this2.clearSearchResult();
  108912. _this2.searchResultLayer = external_L_default().geoJSON(data, {
  108913. pointToLayer: _this2.options.style,
  108914. style: _this2.options.style,
  108915. onEachFeature: _this2.options.onEachFeature || _this2._featureOnclickEvent.bind(_this2)
  108916. }).bindPopup(function (layer) {
  108917. if (layer.feature.properties) {
  108918. return new AttributesPopContainer({
  108919. attributes: layer.feature.properties
  108920. }).getElement();
  108921. }
  108922. }).addTo(_this2.map);
  108923. _this2.searchLayersData = data;
  108924. //查询结果列表:
  108925. _this2._prepareResultData(data);
  108926. /**
  108927. * @event SearchView#geocodesucceeded
  108928. * @description 地址匹配服务成功后触发。
  108929. * @property {Object} result - 事件返回的 GeoJSON 格式数据对象。
  108930. */
  108931. _this2._event.fire("geocodesucceeded", {
  108932. result: data
  108933. });
  108934. });
  108935. //----地址匹配或图层查询失败监听
  108936. this.viewModel.on("searchfailed", function (e) {
  108937. var message = "";
  108938. if (e.searchType === "searchGeocodeField") {
  108939. message = Lang.i18n("msg_searchGeocodeField");
  108940. } else if (e.searchType === "cityGeocodeField") {
  108941. message = Lang.i18n("msg_cityGeocodeField");
  108942. } else {
  108943. message = Lang.i18n("msg_getFeatureField");
  108944. }
  108945. _this2.messageBox.showView(message);
  108946. /**
  108947. * @event SearchView#searchfailed
  108948. * @description 图层属性查询失败后触发。
  108949. * @property {string} message - 失败原因。
  108950. */
  108951. _this2._event.fire("searchfailed", {
  108952. message: message
  108953. });
  108954. });
  108955. },
  108956. /*-------以下是一些辅助性功能函数 -------*/
  108957. /**
  108958. * @function SearchView.prototype._prepareResultData
  108959. * @description 展示数据。
  108960. * @param {Array.<Feature>} data - 图层查询或地址匹配返回的要素数据数组。
  108961. * @private
  108962. */
  108963. _prepareResultData: function _prepareResultData(data) {
  108964. this.currentResult = data;
  108965. //向下取舍,这只页码
  108966. var pageCounts = Math.ceil(data.length / this.perPageDataNum);
  108967. this._resultDomObj.setPageLink(pageCounts);
  108968. //初始结果页面内容:
  108969. this._createResultListByPageNum(1, data);
  108970. this._resultDomObj.showView();
  108971. //给页面模板设置联动事件
  108972. this._resultDomObj.setLinkageEvent(_linkageEvent);
  108973. var self = this;
  108974. function _linkageEvent(page) {
  108975. self._createResultListByPageNum(page, self.currentResult);
  108976. }
  108977. },
  108978. /**
  108979. * @function SearchView.prototype._createResultListByPageNum
  108980. * @description 填充内容。
  108981. * @param {number} page - 页数。
  108982. * @param {Array.<Feature>} data - 图层查询或地址匹配返回的要素数据数组。
  108983. * @private
  108984. */
  108985. _createResultListByPageNum: function _createResultListByPageNum(page, data) {
  108986. var start = 0,
  108987. end;
  108988. if (page === 1 && data.length < this.perPageDataNum) {
  108989. //data数据不满8个时:
  108990. end = data.length - 1;
  108991. } else if (page * this.perPageDataNum > data.length) {
  108992. //最后一页且数据不满8个时
  108993. start = this.perPageDataNum * (page - 1);
  108994. end = data.length - 1;
  108995. } else {
  108996. //中间页面的情况
  108997. start = this.perPageDataNum * (page - 1);
  108998. end = page * this.perPageDataNum - 1;
  108999. }
  109000. var content = document.createElement("div");
  109001. for (var i = start; i <= end; i++) {
  109002. var properties = void 0,
  109003. featureType = "Point";
  109004. if (data[i].filterAttribute) {
  109005. featureType = data[i].feature.geometry.type;
  109006. properties = data[i].filterAttribute;
  109007. } else {
  109008. properties = data[i].properties;
  109009. }
  109010. content.appendChild(this._createResultItem(featureType, properties));
  109011. }
  109012. this._resultDomObj.setContent(content);
  109013. this._resultDomObj.showView();
  109014. //查询完成默认选中第一个结果:
  109015. content.firstChild.getElementsByClassName("component-search-result-icon")[0].classList.add("component-search__resultitme-selected");
  109016. var filter = content.firstChild.getElementsByClassName("component-search-result-info")[0].firstChild.innerText;
  109017. !this._selectMarkerFeature && this._linkageFeature(filter);
  109018. },
  109019. /**
  109020. * @function SearchView.prototype._flyToBounds
  109021. * @param {L.Bounds} bounds - 当前图层范围。
  109022. * @description 移动到该范围。
  109023. * @private
  109024. */
  109025. _flyToBounds: function _flyToBounds(bounds) {
  109026. var sw = bounds.getSouthWest();
  109027. var ne = bounds.getNorthEast();
  109028. if (sw.lat === ne.lat && sw.lng === ne.lng) {
  109029. this.map.flyTo(sw);
  109030. } else {
  109031. // this.map.fitBounds(this.searchResultLayer.getBounds());
  109032. this.map.fitBounds(bounds);
  109033. }
  109034. },
  109035. /**
  109036. * @function SearchView.prototype._linkageFeature
  109037. * @description 点击结果列表联动地图上要素响应。
  109038. * @private
  109039. */
  109040. _linkageFeature: function _linkageFeature(filter) {
  109041. var _this3 = this;
  109042. var filterValue = "";
  109043. if (this.isSearchLayer) {
  109044. filterValue = filter.split(":")[1].trim();
  109045. } else {
  109046. filterValue = filter;
  109047. }
  109048. this._selectFeature && this._selectFeature.addTo(this.map);
  109049. this.searchResultLayer.eachLayer(function (layer) {
  109050. // this._resetLayerStyleToDefault(layer);
  109051. if (!filterValue || layer.filterAttribute && layer.filterAttribute.filterAttributeValue === filterValue || layer.feature.properties && layer.feature.properties.name === filterValue) {
  109052. layer.remove();
  109053. _this3._setSelectedLayerStyle(layer);
  109054. /*layer.bindPopup(function () {
  109055. return (new AttributesPopContainer(layer.feature.properties)).getElement()
  109056. }, {closeOnClick: false}).openPopup().addTo(this.map);*/
  109057. //若这个图层只有一个点的话,则直接 flyTo 到点:
  109058. }
  109059. });
  109060. },
  109061. /**
  109062. * @function SearchView.prototype.clearSearchResult
  109063. * @description 清空查询结果。
  109064. */
  109065. clearSearchResult: function clearSearchResult() {
  109066. if (this.searchResultLayer) {
  109067. this.map.closePopup();
  109068. //若当前是查询图层的结果,则不删除图层,只修改样式
  109069. !this.isSearchLayer && this.map.removeLayer(this.searchResultLayer);
  109070. this._selectMarkerFeature && this.map.removeLayer(this._selectMarkerFeature);
  109071. this._selectFeaturethis && this.map.removeLayer(this._selectFeature);
  109072. this._selectMarkerFeature = null;
  109073. this._selectFeature = null;
  109074. this.searchResultLayer = null;
  109075. this.currentResult = null;
  109076. }
  109077. },
  109078. /**
  109079. * @function SearchView.prototype._featureOnclickEvent
  109080. * @description 要素点击事件
  109081. * @param {L.layer} layer - Leaflet Layer 对象。
  109082. * @private
  109083. */
  109084. _featureOnclickEvent: function _featureOnclickEvent(feature, layer) {
  109085. var _this4 = this;
  109086. layer.on('click', function () {
  109087. var pageEles1 = document.getElementsByClassName('component-pagination__link')[0];
  109088. _this4._resultDomObj._changePageEvent({
  109089. target: pageEles1.children[0].children[0]
  109090. });
  109091. _this4._selectFeature && _this4._selectFeature.addTo(_this4.map);
  109092. layer.remove();
  109093. var page, dataIndex;
  109094. for (var i = 0; i < _this4.searchLayersData.length; i++) {
  109095. var item = _this4.searchLayersData[i];
  109096. if (item.properties && item.properties.name === feature.properties.name || item.filterAttribute && item.filterAttribute.filterAttributeName + ": " + item.filterAttribute.filterAttributeValue === layer.filterAttribute.filterAttributeName + ": " + layer.filterAttribute.filterAttributeValue) {
  109097. dataIndex = i % _this4.perPageDataNum;
  109098. page = parseInt(i / _this4.perPageDataNum) + 1;
  109099. break;
  109100. }
  109101. }
  109102. if (page > 1) {
  109103. for (var _i2 = 1; _i2 < page; _i2++) {
  109104. var pageEles = void 0;
  109105. pageEles = document.getElementsByClassName('component-pagination__link')[0];
  109106. _this4._resultDomObj._changePageEvent({
  109107. target: pageEles.children[pageEles.children.length - 2].children[0]
  109108. });
  109109. }
  109110. }
  109111. var pageList = document.getElementsByClassName('component-search-result-info');
  109112. var target = pageList[dataIndex].children[0];
  109113. if (target.innerHTML === feature.properties.name || target.innerHTML === layer.filterAttribute.filterAttributeName + ": " + layer.filterAttribute.filterAttributeValue) {
  109114. var selectFeatureOption = pageList[dataIndex].parentNode;
  109115. //修改
  109116. if (document.getElementsByClassName("component-search__resultitme-selected").length > 0) {
  109117. document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected");
  109118. }
  109119. selectFeatureOption.firstChild.classList.add("component-search__resultitme-selected");
  109120. _this4._setSelectedLayerStyle(layer);
  109121. }
  109122. }, this);
  109123. },
  109124. /**
  109125. * @function SearchView.prototype._setSelectedLayerStyle
  109126. * @description 设置图层选中样式。
  109127. * @param {L.layer} layer - Leaflet Layer 对象。
  109128. * @private
  109129. */
  109130. _setSelectedLayerStyle: function _setSelectedLayerStyle(layer) {
  109131. this._selectMarkerFeature && this._selectMarkerFeature.remove();
  109132. this._selectMarkerFeature = null;
  109133. this._selectFeature = layer;
  109134. //circleMarker 需要变成 marker 的样式:
  109135. this._selectMarkerFeature = external_L_default().geoJSON(layer.toGeoJSON(), {
  109136. //点选中样式, todo marker 显示位置需要调整
  109137. pointToLayer: function pointToLayer(geoJsonPoint, latlng) {
  109138. return external_L_default().marker(latlng, {
  109139. icon: external_L_default().divIcon({
  109140. className: 'component-select-marker-icon',
  109141. iconAnchor: [15, 0]
  109142. })
  109143. });
  109144. },
  109145. //线和面选中样式:
  109146. style: {
  109147. fillColor: 'red',
  109148. weight: 1,
  109149. opacity: 1,
  109150. color: 'red',
  109151. fillOpacity: 0.2
  109152. }
  109153. }).addTo(this.map);
  109154. this._selectMarkerFeature.bindPopup(function () {
  109155. return new AttributesPopContainer({
  109156. attributes: layer.feature.properties
  109157. }).getElement();
  109158. }, {
  109159. closeOnClick: false
  109160. }).openPopup().addTo(this.map);
  109161. this._flyToBounds(this.searchResultLayer.getBounds());
  109162. var center;
  109163. if (layer.getLatLng) {
  109164. center = layer.getLatLng();
  109165. } else if (layer.getCenter) {
  109166. center = layer.getCenter();
  109167. }
  109168. this.map.setView(center);
  109169. }
  109170. });
  109171. var searchView = function searchView(options) {
  109172. return new SearchView(options);
  109173. };
  109174. ;// CONCATENATED MODULE: ./src/leaflet/components/dataflow/DataFlowViewModel.js
  109175. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  109176. * This program are made available under the terms of the Apache License, Version 2.0
  109177. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  109178. /**
  109179. * @class DataFlowViewModel
  109180. * @aliasclass Components.DataFlowViewModel
  109181. * @deprecatedclassinstance L.supermap.components.dataFlowViewModel
  109182. * @classdesc 数据流组件功能类。
  109183. * @version 9.1.1
  109184. * @category Components DataFlow
  109185. * @param {L.Map} map - Leaflet Map 对象。
  109186. * @param {Object} [dataFlowLayerOptions] - 数据流服务返回数据数据展示样式,默认采用 ViewModel 默认样式。
  109187. * @param {Object} options - 参数。
  109188. * @param {function} [options.style] - 定义点、线、面要素样式。参数为{@link L.Path-option}。</br>
  109189. `function (feature) {
  109190. return {
  109191. fillColor: "red",
  109192. fillOpacity: 1,
  109193. radius: 6,
  109194. weight: 0
  109195. };
  109196. }`
  109197. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗,默认对新创建的图层不执行任何操作。
  109198. * @fires DataFlowViewModel#dataflowservicesubscribed
  109199. * @fires DataFlowViewModel#subscribesucceeded
  109200. * @fires DataFlowViewModel#subscribefailed
  109201. * @fires DataFlowViewModel#dataupdated
  109202. * @extends {L.Evented}
  109203. * @usage
  109204. */
  109205. var DataFlowViewModel = external_L_default().Evented.extend({
  109206. options: {
  109207. _defaultLayerOptions: {
  109208. //style 返回 marker样式或者 L.path 样式
  109209. style: null,
  109210. onEachFeature: function onEachFeature(feature, layer) {
  109211. var content = "属性信息如下:<br>";
  109212. for (var key in feature.properties) {
  109213. content += key + ": " + feature.properties[key] + "<br>";
  109214. }
  109215. layer.bindPopup(content);
  109216. }
  109217. }
  109218. },
  109219. initialize: function initialize(map) {
  109220. var dataFlowLayerOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  109221. if (map) {
  109222. /**
  109223. * @member {L.Map} DataFlowViewModel.prototype.map
  109224. * @description Leaflet Map 对象。
  109225. */
  109226. this.map = map;
  109227. } else {
  109228. return new Error("Cannot find map, fileModel.map cannot be null.");
  109229. }
  109230. //合并用户的 dataFlowLayerOptions
  109231. external_L_default().Util.extend(this.options._defaultLayerOptions, dataFlowLayerOptions);
  109232. //点样式也存储在style里
  109233. this.options._defaultLayerOptions.pointToLayer = this.options._defaultLayerOptions.style;
  109234. /**
  109235. * @member {boolean} [DataFlowViewModel.prototype.popupsStatus=true]
  109236. * @description 图层 popup 打开 "true" 或关闭 "false" 的状态。
  109237. */
  109238. this.popupsStatus = true;
  109239. /**
  109240. * @member {boolean} [DataFlowViewModel.prototype.dataFlowStatus=false]
  109241. * @description 数据流服务当前状态,订阅 "true" 或未订阅 "false" 的状态。
  109242. */
  109243. this.dataFlowStatus = false;
  109244. /**
  109245. * @member {string} [DataFlowViewModel.prototype.dataFlowUrl=""]
  109246. * @description 数据流地址。
  109247. */
  109248. this.dataFlowUrl = "";
  109249. /**
  109250. * @member {Array.<Object>} [DataFlowViewModel.prototype.currentFeatures]
  109251. * @description 当前订阅数据流返回的要素数组。
  109252. */
  109253. this.currentFeatures = [];
  109254. /**
  109255. * @member {DataFlowLayer} [DataFlowViewModel.prototype.dataFlowLayer=null]
  109256. * @description 当前 dataFlowLayer 图层对象。
  109257. */
  109258. this.dataFlowLayer = null;
  109259. },
  109260. /**
  109261. * @function DataFlowViewModel.prototype.subscribe
  109262. * @description 订阅数据流。
  109263. * @param {string} dataFlowUrl - 数据流服务地址。
  109264. */
  109265. subscribe: function subscribe(dataFlowUrl) {
  109266. var _this = this;
  109267. //若当前数据流服务没变,则不进行重新订阅 todo 或者没点击暂停
  109268. if (this.dataFlowUrl === dataFlowUrl) {
  109269. if (this.dataFlowStatus) {
  109270. /**
  109271. * @event DataFlowViewModel#dataflowservicesubscribed
  109272. * @description 数据流订阅成功后触发。
  109273. */
  109274. this.fire("dataflowservicesubscribed");
  109275. return;
  109276. }
  109277. } else {
  109278. this.dataFlowUrl = dataFlowUrl;
  109279. }
  109280. this.dataFlowStatus = true;
  109281. //移除已有图层
  109282. if (this.dataFlowLayer) {
  109283. this.dataFlowLayer.remove();
  109284. this.dataFlowLayer = null;
  109285. }
  109286. //创建DataFlowLayer,创建DataFlowLayer订阅iServer dataflow服务并将结果加载到地图上
  109287. var dataFlowLayer = new DataFlowLayer(dataFlowUrl, this.options._defaultLayerOptions);
  109288. dataFlowLayer.on('subscribesucceeded', function (result) {
  109289. /**
  109290. * @event DataFlowViewModel#subscribesucceeded
  109291. * @description 数据流订阅成功后触发。
  109292. * @property {Object} result - 返回的数据。
  109293. */
  109294. _this.fire("subscribesucceeded", {
  109295. result: result
  109296. });
  109297. });
  109298. dataFlowLayer.on('subscribefailed', function (result) {
  109299. /**
  109300. * @event DataFlowViewModel#subscribefailed
  109301. * @description 数据流订阅失败后触发。
  109302. * @property {Object} result - 返回的数据。
  109303. */
  109304. _this.fire("subscribefailed", {
  109305. result: result
  109306. });
  109307. });
  109308. dataFlowLayer.on('dataupdated', function (result) {
  109309. //派发出订阅返回的数据:
  109310. /**
  109311. * @event DataFlowViewModel#dataupdated
  109312. * @description 数据返回成功后触发。
  109313. * @property {Object} result - 返回的数据。
  109314. */
  109315. _this.fire("dataupdated", {
  109316. result: result
  109317. });
  109318. //若数据超出当前视图范围,则移动到数据所在视图范围:
  109319. var layerBounds = result.layer.getBounds(),
  109320. mapBounds = CommontypesConversion.toSuperMapBounds(_this.map.getBounds()),
  109321. layerBoundsSuperMap = CommontypesConversion.toSuperMapBounds(layerBounds);
  109322. if (!mapBounds.intersectsBounds(layerBoundsSuperMap)) {
  109323. if (layerBoundsSuperMap.left === layerBoundsSuperMap.right && layerBoundsSuperMap.top === layerBoundsSuperMap.bottom) {
  109324. _this.map.setView(layerBounds.getCenter());
  109325. } else {
  109326. _this.map.flyToBounds(layerBounds);
  109327. }
  109328. }
  109329. if (_this.popupsStatus) {
  109330. _this.openPopups();
  109331. }
  109332. });
  109333. dataFlowLayer.addTo(this.map);
  109334. this.dataFlowLayer = dataFlowLayer;
  109335. },
  109336. /**
  109337. * @function DataFlowViewModel.prototype.cancelSubscribe
  109338. * @description 取消订阅的数据流。
  109339. */
  109340. cancelSubscribe: function cancelSubscribe() {
  109341. if (this.dataFlowLayer) {
  109342. this.dataFlowStatus = false;
  109343. this.dataFlowLayer.dataService.unSubscribe();
  109344. this.dataFlowLayer.remove();
  109345. this.dataFlowLayer = null;
  109346. }
  109347. },
  109348. /**
  109349. * @function DataFlowViewModel.prototype.openPopups
  109350. * @description 打开图层要素弹窗。
  109351. */
  109352. openPopups: function openPopups() {
  109353. this.popupsStatus = true;
  109354. if (this.dataFlowLayer) {
  109355. var layers = this.dataFlowLayer.getLayers();
  109356. for (var i = 0; i < layers.length; i++) {
  109357. for (var j = 0; j < layers[i].getLayers().length; j++) {
  109358. layers[i].getLayers()[j].openPopup();
  109359. }
  109360. }
  109361. }
  109362. },
  109363. /**
  109364. * @function DataFlowViewModel.prototype.closePopups
  109365. * @description 关闭图层要素弹窗。
  109366. */
  109367. closePopups: function closePopups() {
  109368. this.popupsStatus = false;
  109369. if (this.dataFlowLayer) {
  109370. var layers = this.dataFlowLayer.getLayers();
  109371. for (var i = 0; i < layers.length; i++) {
  109372. for (var j = 0; j < layers[i].getLayers().length; j++) {
  109373. layers[i].getLayers()[j].closePopup();
  109374. }
  109375. }
  109376. }
  109377. }
  109378. });
  109379. var dataFlowViewModel = function dataFlowViewModel(options) {
  109380. return new DataFlowViewModel(options);
  109381. };
  109382. ;// CONCATENATED MODULE: ./src/leaflet/components/dataflow/DataFlowView.js
  109383. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  109384. * This program are made available under the terms of the Apache License, Version 2.0
  109385. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  109386. /**
  109387. * @class DataFlowView
  109388. * @aliasclass Components.DataFlowView
  109389. * @deprecatedclassinstance L.supermap.components.dataFlow
  109390. * @classdesc 数据流组件类。
  109391. * @version 9.1.1
  109392. * @category Components DataFlow
  109393. * @modulecategory Components
  109394. * @param {Object} options - 参数。
  109395. * @param {string} [options.position='topright'] - 组件在地图中显示的位置( 'topleft'|'topright'|'bottomleft'|'bottomright' )。
  109396. * @param {function} [options.style] - 默认图层样式。返回类型:点样式( maker|circleMaker);线和面样式( L.path )。<br>
  109397. `function (feature) {
  109398. return {
  109399. fillColor: "red",
  109400. fillOpacity: 1,
  109401. radius: 6,
  109402. weight: 0
  109403. };
  109404. }`
  109405. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗。
  109406. * @fires DataFlowView#dataupdated
  109407. * @extends {ComponentsViewBase}
  109408. * @usage
  109409. */
  109410. var DataFlowView = ComponentsViewBase.extend({
  109411. initialize: function initialize(options) {
  109412. ComponentsViewBase.prototype.initialize.apply(this, [options]);
  109413. },
  109414. /**
  109415. * @function DataFlowView.prototype.onAdd
  109416. * @description 给地图添加组件。
  109417. * @override
  109418. * @private
  109419. */
  109420. onAdd: function onAdd(map) {
  109421. //为了避免空对象为复写默认配置的现象,先判断参数是否为空
  109422. var options = {};
  109423. if (this.options.style) {
  109424. options.style = this.options.style;
  109425. }
  109426. if (this.options.onEachFeature) {
  109427. options.style = this.options.onEachFeature;
  109428. }
  109429. this.viewModel = new DataFlowViewModel(map, options);
  109430. return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
  109431. },
  109432. /**
  109433. * @function DataFlowView.prototype._initView
  109434. * @description 创建数据组件,用于打开本地文件。
  109435. * @returns {HTMLElement}
  109436. * @private
  109437. * @override
  109438. */
  109439. _initView: function _initView() {
  109440. var _this = this;
  109441. var containerObj = new CommonContainer({
  109442. title: Lang.i18n("title_dataFlowService")
  109443. });
  109444. var container = containerObj.getElement();
  109445. var componentContent = containerObj.getContentElement();
  109446. componentContent.style.padding = "10px 18px";
  109447. var dataFlowContainer1 = document.createElement("div");
  109448. dataFlowContainer1.setAttribute("class", "component-dataflow__container");
  109449. //输入框
  109450. var dataFlowInputContainer = document.createElement("div");
  109451. dataFlowInputContainer.setAttribute("class", "component-input-default");
  109452. var dataFlowInput = document.createElement("input");
  109453. dataFlowInput.setAttribute("class", "component-input-default");
  109454. dataFlowInput.type = "text";
  109455. dataFlowInput.placeholder = Lang.i18n('text_input_value_inputDataFlowUrl');
  109456. dataFlowInput.title = Lang.i18n('text_input_value_inputDataFlowUrl');
  109457. dataFlowInputContainer.appendChild(dataFlowInput);
  109458. //删除输入值按钮:
  109459. var inputClearBtn = document.createElement("span");
  109460. inputClearBtn.setAttribute("class", "supermapol-icons-close");
  109461. inputClearBtn.hidden = true;
  109462. //---清除输入值【清除按钮点击事件】
  109463. inputClearBtn.onclick = function (e) {
  109464. dataFlowInput.value = "";
  109465. e.target.hidden = true;
  109466. };
  109467. //---输入框值改变,打开清除按钮【输入框内容改变事件】
  109468. dataFlowInput.oninput = function () {
  109469. inputClearBtn.hidden = false;
  109470. };
  109471. dataFlowInputContainer.appendChild(inputClearBtn);
  109472. dataFlowContainer1.appendChild(dataFlowInputContainer);
  109473. componentContent.appendChild(dataFlowContainer1);
  109474. //复选框条件
  109475. var dataFlowContainer2 = document.createElement("div");
  109476. dataFlowContainer2.setAttribute("class", "component-dataflow__container");
  109477. var checkboxContainer = document.createElement("div");
  109478. checkboxContainer.setAttribute("class", "component-checkbox-container");
  109479. var attributesCheckbox = document.createElement("div");
  109480. attributesCheckbox.setAttribute("class", "component-checkbox-default component-checkbox-selected-img");
  109481. attributesCheckbox.checked = true;
  109482. checkboxContainer.appendChild(attributesCheckbox);
  109483. var checkboxLabel = document.createElement("div");
  109484. checkboxLabel.setAttribute("class", "component-label component-label-selected");
  109485. checkboxLabel.innerHTML = Lang.i18n('text_displayFeaturesInfo');
  109486. checkboxContainer.appendChild(checkboxLabel);
  109487. //----是否显示属性框【属性框复选框点击事件】
  109488. attributesCheckbox.onclick = function (e) {
  109489. e.target.checked = !e.target.checked;
  109490. if (e.target.checked) {
  109491. checkboxLabel.setAttribute("class", "component-label component-label-selected");
  109492. e.target.setAttribute("class", "component-checkbox-default component-checkbox-selected-img");
  109493. _this.viewModel.openPopups();
  109494. } else {
  109495. checkboxLabel.setAttribute("class", "component-label");
  109496. e.target.setAttribute("class", "component-checkbox-default component-checkbox-default-img");
  109497. _this.viewModel.closePopups();
  109498. }
  109499. };
  109500. dataFlowContainer2.appendChild(checkboxContainer);
  109501. componentContent.appendChild(dataFlowContainer2);
  109502. //订阅按钮,取消按钮:
  109503. var dataFlowContainer3 = document.createElement("div");
  109504. dataFlowContainer3.setAttribute("class", "component-dataflow__container component-init-center");
  109505. var subscribe = document.createElement("button");
  109506. subscribe.setAttribute("class", "component-button-default");
  109507. subscribe.innerHTML = Lang.i18n('text_subscribe');
  109508. //----订阅服务【订阅按钮点击事件】
  109509. subscribe.onclick = function () {
  109510. var urlDataFlow = dataFlowInput.value;
  109511. if (urlDataFlow === "") {
  109512. _this.messageBox.showView(Lang.i18n('msg_inputDataFlowUrlFirst'));
  109513. return;
  109514. }
  109515. _this.viewModel.subscribe(urlDataFlow);
  109516. };
  109517. dataFlowContainer3.appendChild(subscribe);
  109518. var cancelSubscribe = document.createElement("button");
  109519. cancelSubscribe.setAttribute("class", "component-button-default");
  109520. cancelSubscribe.innerHTML = Lang.i18n('text_cancelSubscribe');
  109521. //----取消订阅服务【取消订阅按钮点击事件】
  109522. cancelSubscribe.onclick = function () {
  109523. _this.viewModel.cancelSubscribe();
  109524. };
  109525. dataFlowContainer3.appendChild(cancelSubscribe);
  109526. componentContent.appendChild(dataFlowContainer3);
  109527. //增加提示框:
  109528. this.messageBox = new MessageBox();
  109529. this.viewModel.on("dataflowservicesubscribed", function () {
  109530. _this.messageBox.showView(Lang.i18n("msg_dataflowservicesubscribed"));
  109531. });
  109532. this.viewModel.on("subscribesucceeded", function () {
  109533. _this.messageBox.showView(Lang.i18n("msg_subscribesucceeded"));
  109534. });
  109535. /**
  109536. * @event DataFlowView#dataupdated
  109537. * @description 数据流服务成功返回数据后触发。
  109538. * @property {Object} result - 事件返回的数据对象。
  109539. */
  109540. this.viewModel.on("dataupdated", function (result) {
  109541. _this.messageBox.closeView();
  109542. _this._event.fire("dataupdated", result);
  109543. });
  109544. //关闭在控件上触发地图的事件响应:
  109545. //阻止 map 默认事件
  109546. this._preventMapEvent(container, this.map);
  109547. return container;
  109548. }
  109549. });
  109550. var dataFlowView = function dataFlowView(options) {
  109551. return new DataFlowView(options);
  109552. };
  109553. ;// CONCATENATED MODULE: ./src/leaflet/components/commonmodels/GeoJSONLayerWithName.js
  109554. function GeoJSONLayerWithName_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  109555. function GeoJSONLayerWithName_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJSONLayerWithName_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJSONLayerWithName_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  109556. function GeoJSONLayerWithName_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  109557. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  109558. * This program are made available under the terms of the Apache License, Version 2.0
  109559. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  109560. /**
  109561. * @class GeoJSONLayerWithName
  109562. * @aliasclass Components.GeoJSONLayerWithName
  109563. * @deprecatedclassinstance L.supermap.components.geoJSONLayerWithName
  109564. * @classdesc 含有 layerName 与 GeoJSON 图层的对象。
  109565. * @param {Object} layerObject - 图层对象。
  109566. * @param {string} layerName - 图层名称。
  109567. * @param {L.GeoJSON} layer - 图层。
  109568. * @category Components Common
  109569. * @usage
  109570. */
  109571. var GeoJSONLayerWithName = /*#__PURE__*/GeoJSONLayerWithName_createClass(function GeoJSONLayerWithName(layerName, layer) {
  109572. GeoJSONLayerWithName_classCallCheck(this, GeoJSONLayerWithName);
  109573. this.layerName = layerName;
  109574. this.layer = layer;
  109575. });
  109576. var geoJSONLayerWithName = function geoJSONLayerWithName(layerName, layer) {
  109577. return new GeoJSONLayerWithName(layerName, layer);
  109578. };
  109579. ;// CONCATENATED MODULE: ./src/leaflet/components/clientcomputation/ClientComputationViewModel.js
  109580. function ClientComputationViewModel_typeof(obj) { "@babel/helpers - typeof"; return ClientComputationViewModel_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; }, ClientComputationViewModel_typeof(obj); }
  109581. function ClientComputationViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  109582. function ClientComputationViewModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  109583. function ClientComputationViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClientComputationViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClientComputationViewModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  109584. function ClientComputationViewModel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new 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) ClientComputationViewModel_setPrototypeOf(subClass, superClass); }
  109585. function ClientComputationViewModel_setPrototypeOf(o, p) { ClientComputationViewModel_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ClientComputationViewModel_setPrototypeOf(o, p); }
  109586. function ClientComputationViewModel_createSuper(Derived) { var hasNativeReflectConstruct = ClientComputationViewModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ClientComputationViewModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ClientComputationViewModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ClientComputationViewModel_possibleConstructorReturn(this, result); }; }
  109587. function ClientComputationViewModel_possibleConstructorReturn(self, call) { if (call && (ClientComputationViewModel_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 ClientComputationViewModel_assertThisInitialized(self); }
  109588. function ClientComputationViewModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  109589. function ClientComputationViewModel_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; } }
  109590. function ClientComputationViewModel_getPrototypeOf(o) { ClientComputationViewModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ClientComputationViewModel_getPrototypeOf(o); }
  109591. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  109592. * This program are made available under the terms of the Apache License, Version 2.0
  109593. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  109594. /**
  109595. * @class ClientComputationViewModel
  109596. * @aliasclass Components.ClientComputationViewModel
  109597. * @deprecatedclassinstance L.supermap.components.clientComputationViewModel
  109598. * @classdesc 客户端计算组件功能类。
  109599. * @version 9.1.1
  109600. * @category Components ClientComputation
  109601. * @param {string} workerUrl - worker 地址,原始位置为 dist/leaflet/workers/TurfWorker.js。
  109602. * @fires ClientComputationViewModel#analysisfailed
  109603. * @fires ClientComputationViewModel#analysissucceeded
  109604. * @fires ClientComputationViewModel#layerloaded
  109605. * @fires ClientComputationViewModel#layersremoved
  109606. * @extends {L.Evented}
  109607. * @usage
  109608. */
  109609. var ClientComputationViewModel = /*#__PURE__*/function (_L$Evented) {
  109610. ClientComputationViewModel_inherits(ClientComputationViewModel, _L$Evented);
  109611. var _super = ClientComputationViewModel_createSuper(ClientComputationViewModel);
  109612. function ClientComputationViewModel() {
  109613. ClientComputationViewModel_classCallCheck(this, ClientComputationViewModel);
  109614. return _super.apply(this, arguments);
  109615. }
  109616. ClientComputationViewModel_createClass(ClientComputationViewModel, [{
  109617. key: "initialize",
  109618. value: function initialize(workerUrl) {
  109619. this.workerUrl = workerUrl;
  109620. this.turfLayers = [];
  109621. }
  109622. /**
  109623. * @function ClientComputationViewModel.prototype.getLayersData
  109624. * @description 获取填充到 view 的数据。
  109625. * @param {Array.<L.GeoJSON>} layersArr - 图层数组。
  109626. * @returns {Object} layers 数据。
  109627. */
  109628. }, {
  109629. key: "getLayersData",
  109630. value: function getLayersData(layersArr) {
  109631. var result = {};
  109632. var pointData = {},
  109633. lineData = {},
  109634. polygonData = {};
  109635. for (var i = 0; i < layersArr; i++) {
  109636. layersArr[i] = new GeoJSONLayerWithName(layersArr[i].layerName, layersArr[i].layer);
  109637. }
  109638. this.geoJsonLayersDataModel = new GeoJsonLayersDataModel(layersArr);
  109639. // 把 layersArr 转成 key = layername 对象,方便获取 fields 时遍历
  109640. var dataObj = [];
  109641. for (var _i2 = 0; _i2 < layersArr.length; _i2++) {
  109642. dataObj[layersArr[_i2].layerName] = {
  109643. fields: layersArr[_i2].fields,
  109644. layer: layersArr[_i2].layer.toGeoJSON()
  109645. };
  109646. }
  109647. for (var key in this.geoJsonLayersDataModel.layers) {
  109648. var fields = void 0;
  109649. if (dataObj[key].fields) {
  109650. fields = dataObj[key].fields;
  109651. } else {
  109652. fields = this.geoJsonLayersDataModel.layers[key].getAttributeNamesByType("Num");
  109653. }
  109654. var fieldsValue = [];
  109655. for (var _i4 = 0; _i4 < fields.length; _i4++) {
  109656. fieldsValue[fields[_i4]] = this.geoJsonLayersDataModel.layers[key].getAttributeValueByAttributeName(fields[_i4]);
  109657. // 去空 & 去重 & 转 number
  109658. var arr = fieldsValue[fields[_i4]];
  109659. for (var j = 0; j < arr.length; j++) {
  109660. if (arr[j] == "" || typeof arr[j] == "undefined") {
  109661. arr.splice(j, 1);
  109662. j = j - 1;
  109663. }
  109664. arr[j] = parseFloat(arr[j]);
  109665. }
  109666. fieldsValue[fields[_i4]] = Array.from(new Set(arr.sort(function (a, b) {
  109667. return a - b;
  109668. })));
  109669. }
  109670. var obj = {
  109671. layerName: key,
  109672. fields: fields,
  109673. fieldsValue: fieldsValue,
  109674. features: dataObj[key].layer
  109675. };
  109676. var layersType = dataObj[key].layer.features[0].geometry.type;
  109677. if (layersType === "Point") {
  109678. pointData[key] = obj;
  109679. } else if (layersType === "LineString") {
  109680. lineData[key] = obj;
  109681. } else if (layersType === "Polygon") {
  109682. polygonData[key] = obj;
  109683. }
  109684. }
  109685. result['point'] = pointData;
  109686. result['lineString'] = lineData;
  109687. result['polygon'] = polygonData;
  109688. return result;
  109689. }
  109690. /**
  109691. * @function ClientComputationViewModel.prototype.analysis
  109692. * @description 客户端计算。
  109693. * @param {Object} params - 客户端计算参数。
  109694. * @param {L.Map} map - Leaflet Map 对象。
  109695. */
  109696. }, {
  109697. key: "analysis",
  109698. value: function analysis(params, map) {
  109699. this.geoJsonLayersDataModel.setCurrentLayerDataModel(params.analysisLayers);
  109700. this.worker = new Worker(this.workerUrl);
  109701. var resultData = this.geoJsonLayersDataModel.currentLayerDataModel.layer.toGeoJSON();
  109702. if (params.analysisMethod === "isolines") {
  109703. var fieldsValue = params.analysisFieldsValue.split(",");
  109704. var pointGrid = resultData;
  109705. for (var j = 0; j < fieldsValue.length; j++) {
  109706. fieldsValue[j] = parseFloat(fieldsValue[j]);
  109707. }
  109708. var me = this;
  109709. var analysisParams = {
  109710. "pointGrid": pointGrid,
  109711. "analysisMethod": params.analysisMethod,
  109712. "breaks": fieldsValue,
  109713. "zProperty": params.analysisFields,
  109714. "analysisCellSize": params.analysisCellSize,
  109715. "options": {
  109716. gridType: "point",
  109717. property: params.analysisFields,
  109718. weight: Number(params.analysisBreaks)
  109719. }
  109720. };
  109721. this.worker.postMessage(analysisParams);
  109722. this.worker.onmessage = function (e) {
  109723. if (e.data.features.length === 0) {
  109724. /**
  109725. * @event ClientComputationViewModel#analysisfailed
  109726. * @description 事件分析失败后触发,返回结果为空。
  109727. */
  109728. me.fire('analysisfailed');
  109729. } else {
  109730. /**
  109731. * @event ClientComputationViewModel#analysissucceeded
  109732. * @description 事件分析成功后触发。
  109733. * @property {Object} data - 分析成功后的数据。
  109734. */
  109735. me.fire('analysissucceeded', {
  109736. 'data': e.data
  109737. });
  109738. var turfLayer = external_L_default().geoJSON(e.data, {
  109739. style: {
  109740. color: '#1060C2',
  109741. weight: 3
  109742. },
  109743. onEachFeature: function onEachFeature(feature, layer) {
  109744. if (feature.properties) {
  109745. layer.bindPopup(new AttributesPopContainer(feature.properties).getElement());
  109746. }
  109747. layer.on({
  109748. 'mouseover': function mouseover() {
  109749. layer.setStyle({
  109750. color: "#ffffff",
  109751. weight: 5
  109752. });
  109753. },
  109754. 'mouseout': function mouseout() {
  109755. layer.setStyle({
  109756. color: '#1060C2',
  109757. weight: 3
  109758. });
  109759. },
  109760. "click": function click() {
  109761. layer.setStyle({
  109762. color: "#ffffff",
  109763. weight: 5
  109764. });
  109765. }
  109766. });
  109767. }
  109768. }).addTo(map);
  109769. me.turfLayers.push(turfLayer);
  109770. /**
  109771. * @event ClientComputationViewModel#layerloaded
  109772. * @description 结果图层加载完成后触发。
  109773. * @property {L.GeoJSON} layer - 加载完成后的结果图层。
  109774. * @property {string} name - 加载完成后的结果图层名称。
  109775. */
  109776. me.fire('layerloaded', {
  109777. "layer": turfLayer,
  109778. "name": params.resultLayersName
  109779. });
  109780. me.worker.terminate();
  109781. }
  109782. };
  109783. } else if (params.analysisMethod === "buffer") {
  109784. var _me = this;
  109785. var _analysisParams = {
  109786. "analysisMethod": "buffer",
  109787. "radius": params.radius,
  109788. "unit": params.unit,
  109789. "isSave": params.isSaveStatus,
  109790. "isUnion": params.isUnion,
  109791. 'geoJson': resultData
  109792. };
  109793. this.worker.postMessage(_analysisParams);
  109794. this.worker.onmessage = function (e) {
  109795. var turfLayer = external_L_default().geoJSON(e.data, {
  109796. style: {
  109797. color: "#ffffff",
  109798. fillColor: '#1060C2',
  109799. fillOpacity: .5,
  109800. weight: 1.5
  109801. },
  109802. onEachFeature: function onEachFeature(feature, layer) {
  109803. if (feature.properties) {
  109804. layer.bindPopup(new AttributesPopContainer(feature.properties).getElement());
  109805. }
  109806. layer.on({
  109807. 'mouseover': function mouseover() {
  109808. layer.setStyle({
  109809. color: "#ffffff",
  109810. fillColor: "rgb(46,40,79)",
  109811. fillOpacity: .5,
  109812. weight: 5
  109813. });
  109814. },
  109815. 'mouseout': function mouseout() {
  109816. layer.setStyle({
  109817. color: "#ffffff",
  109818. fillColor: '#1060C2',
  109819. fillOpacity: .5,
  109820. weight: 1.5
  109821. });
  109822. },
  109823. "click": function click() {
  109824. layer.setStyle({
  109825. color: "#ffffff",
  109826. fillColor: "rgb(46,40,79)",
  109827. fillOpacity: .5,
  109828. weight: 2
  109829. });
  109830. }
  109831. });
  109832. }
  109833. }).addTo(map);
  109834. _me.turfLayers.push(turfLayer);
  109835. _me.fire('layerloaded', {
  109836. "layer": turfLayer,
  109837. "name": params.resultLayersName
  109838. });
  109839. _me.worker.terminate();
  109840. };
  109841. }
  109842. }
  109843. /**
  109844. * @function ClientComputationViewModel.prototype.clearLayers
  109845. * @description 清空分析图层。
  109846. */
  109847. }, {
  109848. key: "clearLayers",
  109849. value: function clearLayers() {
  109850. for (var i in this.turfLayers) {
  109851. this.turfLayers[i].clearLayers();
  109852. }
  109853. /**
  109854. * @event ClientComputationViewModel#layersremoved
  109855. * @description 图层删除之后触发。
  109856. * @property {Array.<L.GeoJSON>} layer - 需要删除的图层数组。
  109857. */
  109858. this.fire('layersremoved', {
  109859. layers: this.turfLayers
  109860. });
  109861. }
  109862. /**
  109863. * @function ClientComputationViewModel.prototype.cancelAnalysis
  109864. * @description 取消分析。
  109865. */
  109866. }, {
  109867. key: "cancelAnalysis",
  109868. value: function cancelAnalysis() {
  109869. this.worker.terminate();
  109870. }
  109871. }]);
  109872. return ClientComputationViewModel;
  109873. }((external_L_default()).Evented);
  109874. var clientComputationViewModel = function clientComputationViewModel(options) {
  109875. return new ClientComputationViewModel(options);
  109876. };
  109877. ;// CONCATENATED MODULE: ./src/leaflet/components/clientcomputation/ClientComputationView.js
  109878. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  109879. * This program are made available under the terms of the Apache License, Version 2.0
  109880. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  109881. /**
  109882. * @class ClientComputationView
  109883. * @aliasclass Components.ClientComputationView
  109884. * @deprecatedclassinstance L.supermap.components.clientComputation
  109885. * @classdesc 叠加图层的客户端计算类。
  109886. * @version 9.1.1
  109887. * @modulecategory Components
  109888. * @param {string} workerUrl - worker 地址,原始位置为 dist/leaflet/workers/TurfWorker.js。
  109889. * @param {Object} options - 参数。
  109890. * @param {string} [options.position='topright'] - 组件在地图中显示的位置( 'topleft'|'topright'|'bottomleft'|'bottomright' )。
  109891. * @param {function} [options.style] - 默认图层样式。返回类型:点样式( maker|circleMaker);线和面样式( L.path )。
  109892. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗。
  109893. * @fires ClientComputationView#analysissucceeded
  109894. * @fires ClientComputationView#analysisfailed
  109895. * @fires ClientComputationView#layersremoved
  109896. * @category Components ClientComputation
  109897. * @extends {ComponentsViewBase}
  109898. * @usage
  109899. */
  109900. var ClientComputationView = ComponentsViewBase.extend({
  109901. initialize: function initialize(workerUrl, options) {
  109902. if (!workerUrl) {
  109903. throw new Error('workerUrl is required');
  109904. }
  109905. this.workerUrl = workerUrl;
  109906. ComponentsViewBase.prototype.initialize.apply(this, [options]);
  109907. },
  109908. /**
  109909. * @function ClientComputationView.prototype.onAdd
  109910. * @description 添加控件。
  109911. * @private
  109912. * @override
  109913. */
  109914. onAdd: function onAdd(map) {
  109915. this.map = map;
  109916. return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
  109917. },
  109918. /**
  109919. * @function ClientComputationView.prototype.addLayer
  109920. * @description 添加叠加图层。
  109921. */
  109922. addLayer: function addLayer(layer) {
  109923. this.layers = this.layers || [];
  109924. this.layers.push(layer);
  109925. var fillData = this.viewModel.getLayersData(this.layers);
  109926. this.fillDataToView(fillData);
  109927. },
  109928. /**
  109929. * @function ClientComputationView.prototype.fillDataToView
  109930. * @private
  109931. * @description 填充数据到 view。
  109932. * @param {Object} fillData - 待填充的数据。
  109933. */
  109934. fillDataToView: function fillDataToView(fillData) {
  109935. if (!fillData) {
  109936. return;
  109937. }
  109938. this.fillData = fillData;
  109939. var analysisMethod = document.getElementById('dropDownTop').getAttribute('data-value');
  109940. var currentFillData = {};
  109941. switch (analysisMethod) {
  109942. case 'isolines':
  109943. currentFillData = fillData['point'];
  109944. break;
  109945. case 'buffer':
  109946. currentFillData = fillData['point'];
  109947. break;
  109948. }
  109949. if (JSON.stringify(currentFillData) == '{}') {
  109950. return;
  109951. }
  109952. // 填充分析图层下拉框
  109953. var layserArr = [];
  109954. for (var layerName in currentFillData) {
  109955. layserArr.push(layerName);
  109956. }
  109957. var layersSelect = document.getElementById('layersSelect');
  109958. var layerSelectName = document.getElementById('layerSelectName');
  109959. // 清空 layersSelect;
  109960. layersSelect.innerHTML = '';
  109961. layerSelectName.title = layserArr[0];
  109962. layerSelectName.innerHTML = layserArr[0];
  109963. this._createOptions(layersSelect, layserArr);
  109964. // 设置 layer select option 点击事件
  109965. this.layerSelectObj.optionClickEvent(layersSelect, layerSelectName, this.layersSelectOnchange);
  109966. // 当前选中图层数据
  109967. var currentData = currentFillData[layerSelectName.title];
  109968. var fieldsArr = currentData.fields;
  109969. var textAreaData = currentData.fieldsValue;
  109970. // 设置当前数据
  109971. this.currentData = currentData;
  109972. this.currentFillData = currentFillData;
  109973. // 填充字段下拉框
  109974. var fieldsSelect = document.getElementById('fieldsSelect');
  109975. // 清空 fieldsSelect
  109976. fieldsSelect.innerHTML = '';
  109977. var fieldsSelectNameDiv = document.getElementById('fieldsSelectName');
  109978. fieldsSelectNameDiv.innerHTML = fieldsArr[0];
  109979. fieldsSelectNameDiv.title = fieldsArr[0];
  109980. this._createOptions(fieldsSelect, fieldsArr);
  109981. this.fieldsSelectObj.optionClickEvent(fieldsSelect, fieldsSelectNameDiv, this.fieldsSelectOnchange);
  109982. // 当前选中字段
  109983. var fieldsSelectName = fieldsSelectNameDiv.title;
  109984. // 通过当前选中字段 填充 TextArea 初始值
  109985. var getValueTextArea = document.getElementById('getValueTextArea');
  109986. getValueTextArea.value = textAreaData[fieldsSelectName].toString().replace(/,/g, ",\r\n");
  109987. getValueTextArea.setAttribute('data-value', textAreaData[fieldsSelectName]);
  109988. // 结果图层
  109989. var resultLayersName = document.getElementById('resultLayersName');
  109990. var analysisType = document.getElementById('dropDownTop').getAttribute('data-value');
  109991. switch (analysisType) {
  109992. case 'isolines':
  109993. resultLayersName.value = Lang.i18n('text_label_isolines') + layerSelectName.title;
  109994. break;
  109995. case 'buffer':
  109996. resultLayersName.value = Lang.i18n('text_label_buffer') + layerSelectName.title;
  109997. break;
  109998. }
  109999. },
  110000. /**
  110001. * @function ClientComputationView.prototype._initView
  110002. * @description 创建客户端计算组件。
  110003. * @returns {HTMLElement}
  110004. * @private
  110005. */
  110006. _initView: function _initView() {
  110007. var _this = this;
  110008. //初始化 ViewModel
  110009. this.workerUrl && (this.viewModel = new ClientComputationViewModel(this.workerUrl));
  110010. //初始化 view
  110011. // Container
  110012. var container = new CommonContainer({
  110013. title: Lang.i18n('title_clientComputing')
  110014. }).getElement();
  110015. container.classList.add('component-analysis');
  110016. container.children[0].style.fontSize = '12px';
  110017. var analysisOptionsArr = [{
  110018. 'title': Lang.i18n('text_isoline'),
  110019. 'dataValue': 'isolines',
  110020. 'remark': Lang.i18n('text_extractDiscreteValue'),
  110021. 'icon': {
  110022. 'className': 'component-analyst-isoline-img'
  110023. }
  110024. }, {
  110025. 'title': Lang.i18n('text_buffer'),
  110026. 'dataValue': 'buffer',
  110027. 'remark': Lang.i18n('text_specifyTheDistance'),
  110028. 'icon': {
  110029. 'className': 'component-analyst-buffer-img'
  110030. }
  110031. }];
  110032. var componentContentContainer = container.children[1];
  110033. componentContentContainer.classList.add('component-content--scroll');
  110034. componentContentContainer.classList.add('component-content--analysis');
  110035. // 下拉框
  110036. var dropDownBox = new DropDownBox(analysisOptionsArr).getElement();
  110037. componentContentContainer.appendChild(dropDownBox);
  110038. var dropDownTopContainer = dropDownBox.children[0].children[0];
  110039. var dropDownItems = dropDownBox.children[0].children[2].children[0];
  110040. dropDownTopContainer.children[0].id = 'dropDownTop';
  110041. // analysisContainer
  110042. var analysisTypeContainer = external_L_default().DomUtil.create('div', 'component-analysis__container', componentContentContainer);
  110043. // 分析图层
  110044. var analysisLayer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisLayer', analysisTypeContainer);
  110045. var layerSelectControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', analysisLayer);
  110046. layerSelectControl.id = 'layerSelectControl';
  110047. var layerOptions = {
  110048. 'optionsArr': [''],
  110049. 'labelName': Lang.i18n('text_label_analysisLayer')
  110050. };
  110051. var layerSelectObj = new Select(layerOptions);
  110052. var layerSelectTool = layerSelectObj.getElement();
  110053. this.layerSelectObj = layerSelectObj;
  110054. layerSelectControl.appendChild(layerSelectTool);
  110055. // 图层选中div
  110056. var layerSelectName = layerSelectTool.children[1].children[0];
  110057. layerSelectName.id = 'layerSelectName';
  110058. // 图层下拉框select
  110059. var layersSelect = layerSelectTool.children[1].children[2].children[0].children[0];
  110060. layersSelect.id = 'layersSelect';
  110061. // ISOLINE
  110062. // 提取字段
  110063. var div = external_L_default().DomUtil.create('div', 'component-analysis__container__analysistype', analysisTypeContainer);
  110064. var isolineDiv = external_L_default().DomUtil.create('div', 'component-clientcomputation__isoline', div);
  110065. var fieldsOptions = {
  110066. 'optionsArr': [''],
  110067. 'labelName': Lang.i18n('text_label_extractField'),
  110068. 'optionsClickCb': this.fieldsSelectOnchange
  110069. };
  110070. var fieldsSelectControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', isolineDiv);
  110071. var fieldsSelectObj = new Select(fieldsOptions);
  110072. var fieldsSelectTool = fieldsSelectObj.getElement();
  110073. this.fieldsSelectObj = fieldsSelectObj;
  110074. var fieldsSelectName = fieldsSelectTool.children[1].children[0];
  110075. fieldsSelectName.id = 'fieldsSelectName';
  110076. var fieldsSelect = fieldsSelectTool.children[1].children[2].children[0].children[0];
  110077. fieldsSelect.id = 'fieldsSelect';
  110078. fieldsSelectControl.appendChild(fieldsSelectTool);
  110079. // 提取值
  110080. var textareaContainer = external_L_default().DomUtil.create('div', 'component-analysis__container', isolineDiv);
  110081. var textareaSpan = external_L_default().DomUtil.create('span', 'component-textarea__name', textareaContainer);
  110082. textareaSpan.innerHTML = Lang.i18n('text_label_extractedValue');
  110083. var textareaControl = external_L_default().DomUtil.create('div', 'component-textarea', textareaContainer);
  110084. textareaControl.id = 'getValueText';
  110085. var scrollarea = external_L_default().DomUtil.create('div', '', textareaControl);
  110086. var scrollareaContent = external_L_default().DomUtil.create('div', 'component-scrollarea-content', scrollarea);
  110087. scrollareaContent.setAttribute('tabindex', '1');
  110088. var getValueTextArea = external_L_default().DomUtil.create('textarea', 'component-textarea__content', scrollareaContent);
  110089. getValueTextArea.id = 'getValueTextArea';
  110090. getValueTextArea.setAttribute('rows', '20');
  110091. // 距离衰减
  110092. var breaksDiv = external_L_default().DomUtil.create('div', '', isolineDiv);
  110093. var breaksSpan = external_L_default().DomUtil.create('span', '', breaksDiv);
  110094. breaksSpan.innerHTML = Lang.i18n('text_label_distanceAttenuation');
  110095. var breaks = external_L_default().DomUtil.create('input', '', breaksDiv);
  110096. breaks.value = '3';
  110097. // 栅格大小
  110098. var cellSizeDiv = external_L_default().DomUtil.create('div', '', isolineDiv);
  110099. var cellSizeSpan = external_L_default().DomUtil.create('span', '', cellSizeDiv);
  110100. cellSizeSpan.innerHTML = Lang.i18n('text_label_gridSize');
  110101. var cellSize = external_L_default().DomUtil.create('input', '', cellSizeDiv);
  110102. cellSize.value = '30';
  110103. // BUFFER
  110104. // 缓冲半径
  110105. var bufferDiv = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer hidden', div);
  110106. var bufferRadius = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--radius', bufferDiv);
  110107. var bufferRadiusSpan = external_L_default().DomUtil.create('span', '', bufferRadius);
  110108. bufferRadiusSpan.innerHTML = Lang.i18n('text_label_bufferRadius');
  110109. var bufferRadiusDiv = external_L_default().DomUtil.create('div', '', bufferRadius);
  110110. var bufferRadiusInput = external_L_default().DomUtil.create('input', 'buffer-radius-input', bufferRadiusDiv);
  110111. bufferRadiusInput.id = 'bufferRadiusInput';
  110112. bufferRadiusInput.value = '10';
  110113. bufferRadiusInput.setAttribute('placeholder', Lang.i18n('text_label_defaultkilometers'));
  110114. var bufferUnit = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--unit', bufferRadiusDiv);
  110115. bufferUnit.id = 'bufferUnit';
  110116. // 半径单位选择下拉框
  110117. var bufferUnitOptions = {
  110118. 'optionsArr': [Lang.i18n('text_option_kilometer')],
  110119. 'labelName': Lang.i18n('text_label_unit')
  110120. };
  110121. var bufferUnitSelectTool = new Select(bufferUnitOptions).getElement();
  110122. var bufferUnitSelectName = bufferUnitSelectTool.children[1].children[0];
  110123. bufferUnitSelectName.id = 'bufferUnitSelectName';
  110124. var bufferUnitSelect = bufferUnitSelectTool.children[1].children[2].children[0].children[0];
  110125. bufferUnitSelect.id = 'bufferUnitSelect';
  110126. bufferUnitSelectTool.children[0].style.display = 'none';
  110127. bufferUnit.appendChild(bufferUnitSelectTool);
  110128. // 保留原对象字段属性
  110129. var saveFieldDiv = external_L_default().DomUtil.create('div', '', bufferRadius);
  110130. var saveAttrsContainer = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--issaveattrs', saveFieldDiv);
  110131. saveAttrsContainer.id = 'saveAttrsContainer';
  110132. var saveAttrsCheckbox = external_L_default().DomUtil.create('div', 'checkbox checkbox-fault', saveAttrsContainer);
  110133. saveAttrsCheckbox.id = 'saveAttrsCheckbox';
  110134. var saveAttrsLabel = external_L_default().DomUtil.create('div', 'lable', saveAttrsContainer);
  110135. saveAttrsLabel.id = 'saveAttrsLabel';
  110136. saveAttrsLabel.innerHTML = Lang.i18n('text_retainOriginal');
  110137. // 合并缓冲区
  110138. var isUnionContainer = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--isunion', saveFieldDiv);
  110139. isUnionContainer.id = 'isUnionContainer';
  110140. var isUnionCheckbox = external_L_default().DomUtil.create('div', 'checkbox checkbox-fault', isUnionContainer);
  110141. isUnionCheckbox.id = 'isUnionCheckbox';
  110142. var isUnionLabel = external_L_default().DomUtil.create('div', 'lable', isUnionContainer);
  110143. isUnionLabel.innerHTML = Lang.i18n('text_mergeBuffer');
  110144. isUnionLabel.id = 'isUnionLabel';
  110145. // 结果图层
  110146. var resultLayerDiv = external_L_default().DomUtil.create('div', 'component-analysis__container__resultLayersName', analysisTypeContainer);
  110147. var resultLayerSpan = external_L_default().DomUtil.create('span', '', resultLayerDiv);
  110148. resultLayerSpan.innerHTML = Lang.i18n('text_label_resultLayerName');
  110149. var resultLayersName = external_L_default().DomUtil.create('input', '', resultLayerDiv);
  110150. resultLayersName.id = 'resultLayersName';
  110151. // 分析按钮
  110152. var runBtnContainer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisbtn', analysisTypeContainer);
  110153. var runBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn', runBtnContainer);
  110154. var analysisBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis', runBtn);
  110155. analysisBtn.innerHTML = Lang.i18n('btn_analyze');
  110156. var analysingContainer = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysing-container hidden', runBtn);
  110157. var analysisingBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysising', analysingContainer);
  110158. var svgContainer = external_L_default().DomUtil.create('div', 'component-analysis__svg-container', analysisingBtn);
  110159. svgContainer.id = 'analyse_background';
  110160. svgContainer.innerHTML = "<svg class=\"component-analysis__svg-rotate\" width=\"16px\" height=\"16px\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"ring\" fill=\"#FFF\" transform=\"translate(8,8)\" d=\"M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z\"></path>\n <circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"#38ADF5\"></circle>\n <rect class=\"svg-top\" x=\"8\" y=\"0\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n <rect class=\"svg-left\" x=\"0\" y=\"8\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n </svg>";
  110161. external_L_default().DomUtil.create('span', '', analysisingBtn).innerHTML = Lang.i18n('btn_analyzing');
  110162. var analysisCancelBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--cancel', analysingContainer);
  110163. analysisCancelBtn.innerHTML = Lang.i18n('btn_cancelAnalysis');
  110164. var deleteLayersBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers', runBtn);
  110165. deleteLayersBtn.innerHTML = Lang.i18n('btn_emptyTheAnalysisLayer');
  110166. var _loop = function _loop(i) {
  110167. // 点击何种分析类型 判断使用图层数据
  110168. dropDownItems.children[i].onclick = function () {
  110169. dropDownTopContainer.innerHTML = dropDownItems.children[i].outerHTML;
  110170. dropDownTopContainer.children[0].id = 'dropDownTop';
  110171. var layersSelect = document.getElementById('layersSelect');
  110172. var layerSelectName = document.getElementById('layerSelectName');
  110173. var analysisMethod = dropDownItems.children[i].getAttribute('data-value');
  110174. var currentFillData = {};
  110175. switch (analysisMethod) {
  110176. case 'buffer':
  110177. isolineDiv.classList.add('hidden');
  110178. bufferDiv.classList.remove('hidden');
  110179. componentContentContainer.style.height = '422px';
  110180. resultLayersName.value = Lang.i18n('text_label_buffer') + layerSelectName.title;
  110181. currentFillData = _this.fillData['point'];
  110182. break;
  110183. case 'isolines':
  110184. isolineDiv.classList.remove('hidden');
  110185. bufferDiv.classList.add('hidden');
  110186. componentContentContainer.style.height = '712px';
  110187. resultLayersName.value = Lang.i18n('text_label_isolines') + layerSelectName.title;
  110188. currentFillData = _this.fillData['point'];
  110189. break;
  110190. }
  110191. // 清空 layersSelect;
  110192. // 清空 layersSelect;
  110193. if (_this.currentFillData === currentFillData) {
  110194. return;
  110195. }
  110196. layersSelect.innerHTML = '';
  110197. if (JSON.stringify(currentFillData) == '{}') {
  110198. resultLayersName.value = '';
  110199. layerSelectName.title = '';
  110200. layerSelectName.innerHTML = '';
  110201. return;
  110202. }
  110203. var layserArr = [];
  110204. for (var layerName in currentFillData) {
  110205. layserArr.push(layerName);
  110206. }
  110207. layerSelectName.title = layserArr[0];
  110208. layerSelectName.innerHTML = layserArr[0];
  110209. _this._createOptions(layersSelect, layserArr);
  110210. // 设置 layer select option 点击事件
  110211. _this.layerSelectObj.optionClickEvent(layersSelect, layerSelectName, _this.layersSelectOnchange);
  110212. if (analysisMethod === 'buffer') {
  110213. resultLayersName.value = Lang.i18n('text_label_buffer') + layserArr[0];
  110214. } else if (analysisMethod === 'isolines') {
  110215. resultLayersName.value = Lang.i18n('text_label_isolines') + layserArr[0];
  110216. }
  110217. // 当前选中图层数据
  110218. _this.currentData = currentFillData[layerSelectName.title];
  110219. _this.currentFillData = currentFillData;
  110220. };
  110221. };
  110222. for (var i = 0; i < dropDownItems.children.length; i++) {
  110223. _loop(i);
  110224. }
  110225. // 字段下拉框 onchange 事件
  110226. this.fieldsSelectOnchange = fieldsSelectOnchange.bind(this);
  110227. function fieldsSelectOnchange(option) {
  110228. if (this.currentData) {
  110229. var displayData = this.currentData;
  110230. var _fieldsSelectName = option.title;
  110231. getValueTextArea.value = displayData.fieldsValue[_fieldsSelectName].toString().replace(/,/g, ",\r\n");
  110232. getValueTextArea.setAttribute('data-value', displayData.fieldsValue[_fieldsSelectName]);
  110233. }
  110234. }
  110235. // 选中图层实时改变事件
  110236. this.layersSelectOnchange = layersSelectOnchange.bind(this);
  110237. function layersSelectOnchange(option) {
  110238. if (this.currentData) {
  110239. var _layerSelectName = option.title;
  110240. var displayData = this.currentFillData[_layerSelectName];
  110241. this.currentData = displayData;
  110242. fieldsSelect.innerHTML = '';
  110243. this._createOptions(fieldsSelect, displayData.fields);
  110244. var fieldsSelectNameDiv = document.getElementById('fieldsSelectName');
  110245. var field = displayData.fields[0];
  110246. fieldsSelectNameDiv.title = field;
  110247. fieldsSelectNameDiv.innerHTML = field;
  110248. var _fieldsSelectName2 = field;
  110249. this.fieldsSelectObj.optionClickEvent(fieldsSelect, fieldsSelectNameDiv, this.fieldsSelectOnchange);
  110250. getValueTextArea.value = displayData.fieldsValue[_fieldsSelectName2].toString().replace(/,/g, ",\r\n");
  110251. getValueTextArea.setAttribute('data-value', displayData.fieldsValue[_fieldsSelectName2]);
  110252. var analysisMethod = document.getElementById('dropDownTop').getAttribute('data-value');
  110253. switch (analysisMethod) {
  110254. case 'buffer':
  110255. resultLayersName.value = Lang.i18n('text_label_buffer') + _layerSelectName;
  110256. break;
  110257. case 'isolines':
  110258. resultLayersName.value = Lang.i18n('text_label_isolines') + _layerSelectName;
  110259. break;
  110260. }
  110261. }
  110262. }
  110263. //复选框事件
  110264. var isSaveStatus = true;
  110265. //合并缓冲区
  110266. //合并缓冲区,默认不选中,即为false
  110267. var isUnion = false;
  110268. //选中select
  110269. saveAttrsLabel.classList.add("selected");
  110270. saveAttrsCheckbox.classList.add("checkbox-active");
  110271. saveAttrsContainer.onclick = function () {
  110272. if (isSaveStatus) {
  110273. //将当前状态和样式->不选中的样式和状态
  110274. saveAttrsCheckbox.classList.add("checkbox-fault");
  110275. saveAttrsCheckbox.classList.remove("checkbox-active");
  110276. saveAttrsLabel.classList.remove("selected");
  110277. isSaveStatus = false;
  110278. } else {
  110279. //将当前样式和状态改为选中
  110280. saveAttrsCheckbox.classList.add("checkbox-active");
  110281. saveAttrsCheckbox.classList.remove("checkbox-fault");
  110282. saveAttrsLabel.classList.add("selected");
  110283. isSaveStatus = true;
  110284. //如果当前状态为选中的状态,则将上一个复选框的样式和状态由选中-不选中
  110285. if (isUnion) {
  110286. //移除dom样式和复选框的状态改变
  110287. isUnionCheckbox.classList.add("checkbox-fault");
  110288. isUnionCheckbox.classList.remove("checkbox-active");
  110289. isUnion = false;
  110290. }
  110291. }
  110292. };
  110293. isUnionContainer.onclick = function () {
  110294. if (isUnion) {
  110295. //将选中状态 由选中->不选中,修改其样式和状态
  110296. isUnionCheckbox.classList.add("checkbox-fault");
  110297. isUnionCheckbox.classList.remove("checkbox-active");
  110298. isUnionLabel.classList.remove("selected");
  110299. isUnion = false;
  110300. } else {
  110301. //将状态由不选中->选中,修改其样式和状态
  110302. isUnionCheckbox.classList.add("checkbox-active");
  110303. isUnionCheckbox.classList.remove("checkbox-fault");
  110304. isUnionLabel.classList.add("selected");
  110305. isUnion = true;
  110306. //如果当前状态为选中的,将上一个复选框改为不选中的状态
  110307. if (isSaveStatus) {
  110308. //修改当前样式和状态
  110309. saveAttrsCheckbox.classList.add("checkbox-fault");
  110310. saveAttrsCheckbox.classList.remove("checkbox-active");
  110311. isSaveStatus = false;
  110312. }
  110313. }
  110314. };
  110315. // 提示框
  110316. this.messageBox = new MessageBox();
  110317. // 分析按钮点击事件
  110318. analysisBtn.onclick = function () {
  110319. analysingContainer.style.display = 'block';
  110320. analysisBtn.style.display = 'none';
  110321. var dropDownTop = document.getElementById('dropDownTop');
  110322. var analysisMethod = dropDownTop.getAttribute('data-value');
  110323. var params;
  110324. switch (analysisMethod) {
  110325. case 'isolines':
  110326. params = getIsolinesAnalysisParams();
  110327. break;
  110328. case 'buffer':
  110329. params = getBufferAnalysisParams();
  110330. break;
  110331. }
  110332. _this.viewModel.analysis(params, _this.map);
  110333. _this.viewModel.on('layerloaded', function (e) {
  110334. analysingContainer.style.display = 'none';
  110335. analysisBtn.style.display = 'block';
  110336. /**
  110337. * @event ClientComputationView#analysissucceeded
  110338. * @description 分析完成之后触发。
  110339. * @property {L.GeoJSON} layer - 加载完成后的结果图层。
  110340. * @property {string} name - 加载完成后的结果图层名称。
  110341. */
  110342. _this._event.fire('analysissucceeded', {
  110343. "layer": e.layer,
  110344. "name": e.name
  110345. });
  110346. });
  110347. // 若分析的结果为空
  110348. _this.viewModel.on('analysisfailed', function () {
  110349. analysingContainer.style.display = 'none';
  110350. analysisBtn.style.display = 'block';
  110351. _this.messageBox.showView(Lang.i18n('msg_resultIsEmpty'), "failure");
  110352. /**
  110353. * @event ClientComputationView#analysisfailed
  110354. * @description 分析失败之后触发。
  110355. */
  110356. _this._event.fire('analysisfailed');
  110357. });
  110358. };
  110359. // 取消按钮点击事件
  110360. analysisCancelBtn.onclick = function () {
  110361. analysingContainer.style.display = 'none';
  110362. analysisBtn.style.display = 'block';
  110363. _this.viewModel.cancelAnalysis();
  110364. };
  110365. // 删除按钮点击事件
  110366. deleteLayersBtn.onclick = function () {
  110367. /**
  110368. * @event ClientComputationView#layersremoved
  110369. * @description 结果图层删除后触发。
  110370. * @property {Array.<L.GeoJSON>} layers - 被删除的结果图层。
  110371. */
  110372. _this.viewModel.on('layersremoved', function (e) {
  110373. _this._event.fire('layersremoved', {
  110374. 'layers': e.layers
  110375. });
  110376. });
  110377. _this.viewModel.clearLayers();
  110378. };
  110379. // 获取分析数据
  110380. function getIsolinesAnalysisParams() {
  110381. var dropDownTop = document.getElementById('dropDownTop');
  110382. var analysisMethod = dropDownTop.getAttribute('data-value');
  110383. var resultLayersName = document.getElementById('resultLayersName').value;
  110384. var analysisLayers = layerSelectName.title;
  110385. var analysisFields = fieldsSelectName.title;
  110386. var analysisFieldsValue = getValueTextArea.value.replace(/[\r\n]/g, "").split(',').toString();
  110387. var analysisBreaks = breaks.value;
  110388. var analysisCellSize = cellSize.value;
  110389. var param = {
  110390. 'analysisMethod': analysisMethod,
  110391. 'analysisLayers': analysisLayers,
  110392. 'analysisFields': analysisFields,
  110393. 'analysisFieldsValue': analysisFieldsValue,
  110394. 'analysisBreaks': analysisBreaks,
  110395. 'analysisCellSize': analysisCellSize,
  110396. 'resultLayersName': resultLayersName
  110397. };
  110398. return param;
  110399. }
  110400. function getBufferAnalysisParams() {
  110401. var dropDownTop = document.getElementById('dropDownTop');
  110402. var resultLayersName = document.getElementById('resultLayersName').value;
  110403. var analysisLayers = layerSelectName.title;
  110404. var analysisMethod = dropDownTop.getAttribute('data-value');
  110405. var radius = bufferRadiusInput.value;
  110406. var unit = bufferUnitSelectName.title;
  110407. var param = {
  110408. 'analysisMethod': analysisMethod,
  110409. 'analysisLayers': analysisLayers,
  110410. 'radius': radius,
  110411. 'unit': unit,
  110412. 'resultLayersName': resultLayersName,
  110413. 'isSaveStatus': isSaveStatus,
  110414. 'isUnion': isUnion
  110415. };
  110416. return param;
  110417. }
  110418. // 阻止 map 默认事件
  110419. this._preventMapEvent(container, this.map);
  110420. return container;
  110421. },
  110422. /**
  110423. * @function ClientComputationView.prototype._createOptions
  110424. * @description 创建 select 下拉框的 options。
  110425. * @private
  110426. */
  110427. _createOptions: function _createOptions(container, optionsArr) {
  110428. for (var i in optionsArr) {
  110429. var option = document.createElement('div');
  110430. var optData = optionsArr[i];
  110431. option.className = 'component-selecttool__option';
  110432. option.title = optData;
  110433. option.innerHTML = optData;
  110434. option.setAttribute('data-value', optData);
  110435. container.appendChild(option);
  110436. }
  110437. }
  110438. });
  110439. var clientComputationView = function clientComputationView(options) {
  110440. return new ClientComputationView(options);
  110441. };
  110442. ;// CONCATENATED MODULE: ./src/leaflet/components/clientcomputation/ClientComputationLayer.js
  110443. function ClientComputationLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  110444. function ClientComputationLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClientComputationLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClientComputationLayer_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  110445. function ClientComputationLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  110446. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  110447. * This program are made available under the terms of the Apache License, Version 2.0
  110448. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  110449. /**
  110450. * @class ClientComputationLayer
  110451. * @aliasclass Components.ClientComputationLayer
  110452. * @deprecatedclassinstance L.supermap.components.clientComputationLayer
  110453. * @classdesc 客户端计算图层对象。
  110454. * @version 9.1.1
  110455. * @param {Object} layerObject - 图层对象。
  110456. * @param {string} layerObject.layerName - 图层名称。
  110457. * @param {L.GeoJSON} layerObject.layer - 图层。
  110458. * @param {Array.<string>} [layerObject.fields] - 字段数组。
  110459. * @category Components ClientComputation
  110460. * @usage
  110461. */
  110462. var ClientComputationLayer = /*#__PURE__*/ClientComputationLayer_createClass(function ClientComputationLayer(layerObject) {
  110463. ClientComputationLayer_classCallCheck(this, ClientComputationLayer);
  110464. this.layerName = layerObject.layerName;
  110465. this.layer = layerObject.layer;
  110466. this.fields = layerObject.fields || null;
  110467. });
  110468. var clientComputationLayer = function clientComputationLayer(layerObject) {
  110469. return new ClientComputationLayer(layerObject);
  110470. };
  110471. ;// CONCATENATED MODULE: ./src/leaflet/components/distributedanalysis/DistributedAnalysisModel.js
  110472. function DistributedAnalysisModel_typeof(obj) { "@babel/helpers - typeof"; return DistributedAnalysisModel_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; }, DistributedAnalysisModel_typeof(obj); }
  110473. function DistributedAnalysisModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  110474. function DistributedAnalysisModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  110475. function DistributedAnalysisModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) DistributedAnalysisModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) DistributedAnalysisModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  110476. function DistributedAnalysisModel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new 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) DistributedAnalysisModel_setPrototypeOf(subClass, superClass); }
  110477. function DistributedAnalysisModel_setPrototypeOf(o, p) { DistributedAnalysisModel_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DistributedAnalysisModel_setPrototypeOf(o, p); }
  110478. function DistributedAnalysisModel_createSuper(Derived) { var hasNativeReflectConstruct = DistributedAnalysisModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DistributedAnalysisModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DistributedAnalysisModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DistributedAnalysisModel_possibleConstructorReturn(this, result); }; }
  110479. function DistributedAnalysisModel_possibleConstructorReturn(self, call) { if (call && (DistributedAnalysisModel_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 DistributedAnalysisModel_assertThisInitialized(self); }
  110480. function DistributedAnalysisModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  110481. function DistributedAnalysisModel_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; } }
  110482. function DistributedAnalysisModel_getPrototypeOf(o) { DistributedAnalysisModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DistributedAnalysisModel_getPrototypeOf(o); }
  110483. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  110484. * This program are made available under the terms of the Apache License, Version 2.0
  110485. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  110486. /**
  110487. * @class DistributedAnalysisModel
  110488. * @aliasclass Components.DistributedAnalysisModel
  110489. * @deprecatedclassinstance L.supermap.components.DistributedAnalysisModel
  110490. * @classdesc 分布式分析组件数据模型。
  110491. * @private
  110492. * @category Components DistributedAnalysis
  110493. * @param {string} processingUrl - 分布式分析地址。
  110494. * @fires DistributedAnalysisModel#datasetsloaded
  110495. * @fires DistributedAnalysisModel#datasetinfoloaded
  110496. * @extends {L.Evented}
  110497. */
  110498. var DistributedAnalysisModel = /*#__PURE__*/function (_L$Evented) {
  110499. DistributedAnalysisModel_inherits(DistributedAnalysisModel, _L$Evented);
  110500. var _super = DistributedAnalysisModel_createSuper(DistributedAnalysisModel);
  110501. function DistributedAnalysisModel() {
  110502. DistributedAnalysisModel_classCallCheck(this, DistributedAnalysisModel);
  110503. return _super.apply(this, arguments);
  110504. }
  110505. DistributedAnalysisModel_createClass(DistributedAnalysisModel, [{
  110506. key: "initialize",
  110507. value: function initialize(processingUrl) {
  110508. this.processingUrl = processingUrl;
  110509. }
  110510. /**
  110511. * @function DistributedAnalysisModel.prototype.getDatasetsName
  110512. * @description 获取所有可进行分布式分析的数据集名称。
  110513. * @param {string} url - 服务地址。
  110514. */
  110515. }, {
  110516. key: "getDatasetsName",
  110517. value: function getDatasetsName() {
  110518. var url = this.processingUrl;
  110519. this.dataset = [];
  110520. this.dataset['datasetNames'] = [];
  110521. this.dataset['childUrl'] = [];
  110522. var host = 'http://' + url.split('/')[2];
  110523. var sharefileUrl = host + '/iserver/services/datacatalog/rest/datacatalog/sharefile.json';
  110524. var datasetsUrl = host + '/iserver/services/datacatalog/rest/datacatalog/relationship/datasets.json';
  110525. var me = this;
  110526. FetchRequest.get(sharefileUrl).then(function (response) {
  110527. return response.json();
  110528. }).then(function (result) {
  110529. me.dataset['datasetNames'] = me.dataset['datasetNames'].concat(result.datasetNames);
  110530. me.dataset['childUrl'] = me.dataset['childUrl'].concat(result.childUriList);
  110531. var _me = me;
  110532. FetchRequest.get(datasetsUrl).then(function (response) {
  110533. return response.json();
  110534. }).then(function (result) {
  110535. _me.dataset['datasetNames'] = _me.dataset['datasetNames'].concat(result.datasetNames);
  110536. _me.dataset['childUrl'] = _me.dataset['childUrl'].concat(result.childUriList);
  110537. var datasetHash = [];
  110538. for (var i in _me.dataset['datasetNames']) {
  110539. datasetHash[_me.dataset.datasetNames[i]] = _me.dataset.childUrl[i];
  110540. }
  110541. /**
  110542. * @event DistributedAnalysisModel#datasetsloaded
  110543. * @description 数据集获取完成之后触发。
  110544. * @property {Object} result - 数据集数据。
  110545. * @property {Array.<string>} result.dataset - 数据集名称数组。
  110546. * @property {Object} result.datasetHash - 数据集名称数组与数据集 URL 一一对应的对象。
  110547. */
  110548. _me.fire('datasetsloaded', {
  110549. 'result': {
  110550. 'dataset': _me.dataset,
  110551. 'datasetHash': datasetHash
  110552. }
  110553. });
  110554. });
  110555. });
  110556. }
  110557. /**
  110558. * @function DistributedAnalysisModel.prototype.getDatasetInfo
  110559. * @description 获取数据集类型和字段。
  110560. * @param {string} datasetUrl - 数据集资源地址。
  110561. */
  110562. }, {
  110563. key: "getDatasetInfo",
  110564. value: function getDatasetInfo(datasetUrl) {
  110565. var type;
  110566. var me = this;
  110567. FetchRequest.get(datasetUrl).then(function (response) {
  110568. return response.json();
  110569. }).then(function (data) {
  110570. var datasetInfo = data.datasetInfo;
  110571. if (datasetInfo.datasetType === 'LINE' || datasetInfo.type === 'LINE') {
  110572. type = 'LINE';
  110573. } else if (datasetInfo.datasetType === 'POINT' || datasetInfo.type === 'POINT' || datasetInfo.type === 'CSV') {
  110574. type = 'POINT';
  110575. } else if (datasetInfo.datasetType === 'REGION' || datasetInfo.type === 'REGION') {
  110576. type = 'REGION';
  110577. }
  110578. var fields = [];
  110579. var fieldInfos = datasetInfo.fieldInfos || datasetInfo.fieldInfo || null;
  110580. if (fieldInfos) {
  110581. for (var i in fieldInfos) {
  110582. fields.push(fieldInfos[i].name);
  110583. }
  110584. /**
  110585. * @event DistributedAnalysisModel#datasetinfoloaded
  110586. * @description 数据集查询完成之后触发。
  110587. * @property {Object} result - 数据集数据。
  110588. * @property {string} result.type - 数据集类型。
  110589. * @property {Array.<string>} result.fields - 数据集字段。
  110590. */
  110591. me.fire('datasetinfoloaded', {
  110592. 'result': {
  110593. 'type': type,
  110594. 'fields': fields
  110595. }
  110596. });
  110597. } else {
  110598. var fieldsUrl = data.childUriList[0].replace('//fields', '/fields');
  110599. FetchRequest.get(fieldsUrl).then(function (response) {
  110600. return response.json();
  110601. }).then(function (data) {
  110602. var fieldNames = data.fieldNames;
  110603. var fields = [];
  110604. for (var _i2 in fieldNames) {
  110605. fields.push(fieldNames[_i2]);
  110606. }
  110607. me.fire('datasetinfoloaded', {
  110608. 'result': {
  110609. 'type': type,
  110610. 'fields': fields
  110611. }
  110612. });
  110613. });
  110614. }
  110615. });
  110616. }
  110617. }]);
  110618. return DistributedAnalysisModel;
  110619. }((external_L_default()).Evented);
  110620. ;// CONCATENATED MODULE: ./src/leaflet/components/distributedanalysis/DistributedAnalysisViewModel.js
  110621. function DistributedAnalysisViewModel_typeof(obj) { "@babel/helpers - typeof"; return DistributedAnalysisViewModel_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; }, DistributedAnalysisViewModel_typeof(obj); }
  110622. function DistributedAnalysisViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  110623. function DistributedAnalysisViewModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  110624. function DistributedAnalysisViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) DistributedAnalysisViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) DistributedAnalysisViewModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  110625. function DistributedAnalysisViewModel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new 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) DistributedAnalysisViewModel_setPrototypeOf(subClass, superClass); }
  110626. function DistributedAnalysisViewModel_setPrototypeOf(o, p) { DistributedAnalysisViewModel_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DistributedAnalysisViewModel_setPrototypeOf(o, p); }
  110627. function DistributedAnalysisViewModel_createSuper(Derived) { var hasNativeReflectConstruct = DistributedAnalysisViewModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DistributedAnalysisViewModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DistributedAnalysisViewModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DistributedAnalysisViewModel_possibleConstructorReturn(this, result); }; }
  110628. function DistributedAnalysisViewModel_possibleConstructorReturn(self, call) { if (call && (DistributedAnalysisViewModel_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 DistributedAnalysisViewModel_assertThisInitialized(self); }
  110629. function DistributedAnalysisViewModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  110630. function DistributedAnalysisViewModel_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; } }
  110631. function DistributedAnalysisViewModel_getPrototypeOf(o) { DistributedAnalysisViewModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DistributedAnalysisViewModel_getPrototypeOf(o); }
  110632. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  110633. * This program are made available under the terms of the Apache License, Version 2.0
  110634. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  110635. /**
  110636. * @class DistributedAnalysisViewModel
  110637. * @aliasclass Components.DistributedAnalysisViewModel
  110638. * @deprecatedclassinstance L.supermap.components.distributedAnalysisViewModel
  110639. * @classdesc 分布式分析组件功能类。
  110640. * @version 9.1.1
  110641. * @category Components DistributedAnalysis
  110642. * @param {string} processingUrl - 分布式分析地址。
  110643. * @fires DistributedAnalysisViewModel#datasetsloaded
  110644. * @fires DistributedAnalysisViewModel#datasetinfoloaded
  110645. * @fires DistributedAnalysisViewModel#analysisfailed
  110646. * @fires DistributedAnalysisViewModel#analysissucceeded
  110647. * @fires DistributedAnalysisViewModel#layerloaded
  110648. * @fires DistributedAnalysisViewModel#layersremoved
  110649. * @extends {L.Evented}
  110650. * @usage
  110651. */
  110652. var DistributedAnalysisViewModel = /*#__PURE__*/function (_L$Evented) {
  110653. DistributedAnalysisViewModel_inherits(DistributedAnalysisViewModel, _L$Evented);
  110654. var _super = DistributedAnalysisViewModel_createSuper(DistributedAnalysisViewModel);
  110655. function DistributedAnalysisViewModel() {
  110656. DistributedAnalysisViewModel_classCallCheck(this, DistributedAnalysisViewModel);
  110657. return _super.apply(this, arguments);
  110658. }
  110659. DistributedAnalysisViewModel_createClass(DistributedAnalysisViewModel, [{
  110660. key: "initialize",
  110661. value: function initialize(processingUrl) {
  110662. this.processingUrl = processingUrl;
  110663. }
  110664. /**
  110665. * @function DistributedAnalysisViewModel.prototype.getDatasetsName
  110666. * @description 获取所有数据集名称。
  110667. * @param {string} url - 服务地址。
  110668. */
  110669. }, {
  110670. key: "getDatasetsName",
  110671. value: function getDatasetsName() {
  110672. var processingUrl = this.processingUrl;
  110673. this.resultLayers = [];
  110674. this.datasetNames = [];
  110675. this.distributedAnalysisModel = new DistributedAnalysisModel(processingUrl);
  110676. this.distributedAnalysisModel.getDatasetsName();
  110677. var me = this;
  110678. this.distributedAnalysisModel.on('datasetsloaded', function (e) {
  110679. /**
  110680. * @event DistributedAnalysisViewModel#datasetsloaded
  110681. * @description 数据集获取完成之后触发。
  110682. * @property {Object} result - 数据集数据。
  110683. */
  110684. me.fire('datasetsloaded', {
  110685. 'result': e.result
  110686. });
  110687. });
  110688. }
  110689. /**
  110690. * @function DistributedAnalysisViewModel.prototype.getDatasetInfo
  110691. * @description 获取数据集类型和字段。
  110692. * @param {string} datasetUrl - 数据集资源地址。
  110693. */
  110694. }, {
  110695. key: "getDatasetInfo",
  110696. value: function getDatasetInfo(datasetUrl) {
  110697. // 判断数据集类型
  110698. this.distributedAnalysisModel.getDatasetInfo(datasetUrl);
  110699. var me = this;
  110700. this.distributedAnalysisModel.on('datasetinfoloaded', function (e) {
  110701. var type = e.result.type;
  110702. var fields = e.result.fields;
  110703. /**
  110704. * @event DistributedAnalysisViewModel#datasetinfoloaded
  110705. * @description 数据集类型与字段获取完成之后触发。
  110706. * @property {Object} result - 数据集数据。
  110707. * @property {string} result.type - 数据集类型。
  110708. * @property {Array.<string>} result.fields - 数据集所含有的字段。
  110709. */
  110710. me.fire('datasetinfoloaded', {
  110711. 'result': {
  110712. 'type': type,
  110713. 'fields': fields
  110714. }
  110715. });
  110716. });
  110717. }
  110718. /**
  110719. * @function DistributedAnalysisViewModel.prototype.analysis
  110720. * @description 分布式分析。
  110721. * @param {Object.<KernelDensityJobParameter|string>} params - 参数。
  110722. * @param {KernelDensityJobParameter} params.analysisParam - 密度分析任务参数类。
  110723. * @param {string} [params.resultLayerName] - 结果图层名称。
  110724. * @param {L.Map} map - Leaflet Map 对象。
  110725. */
  110726. }, {
  110727. key: "analysis",
  110728. value: function analysis(params, map) {
  110729. var processingService = new ProcessingService_ProcessingService(this.processingUrl);
  110730. if (params.analysisParam instanceof KernelDensityJobParameter) {
  110731. var kernelDensityJobParameter = params.analysisParam;
  110732. var me = this;
  110733. processingService.addKernelDensityJob(kernelDensityJobParameter, function (serviceResult) {
  110734. if (serviceResult.error) {
  110735. /**
  110736. * @event DistributedAnalysisViewModel#analysisfailed
  110737. * @description 分析失败后触发。
  110738. */
  110739. me.fire('analysisfailed', {
  110740. 'error': serviceResult.error
  110741. });
  110742. return;
  110743. }
  110744. serviceResult.result.setting.serviceInfo.targetServiceInfos.map(function (info) {
  110745. if (info.serviceType === 'RESTMAP') {
  110746. FetchRequest.get(info.serviceAddress + '/maps').then(function (response) {
  110747. return response.json();
  110748. }).then(function (result) {
  110749. var mapUrl = result[0].path;
  110750. /**
  110751. * @event DistributedAnalysisViewModel#analysissucceeded
  110752. * @description 分析成功后服务器返回的数据。
  110753. */
  110754. me.fire('analysissucceed', {
  110755. 'result': result
  110756. });
  110757. var layer = tiledMapLayer(mapUrl, {
  110758. noWrap: true,
  110759. transparent: true
  110760. });
  110761. me.resultLayers.push(layer);
  110762. layer.addTo(map);
  110763. /**
  110764. * @event DistributedAnalysisViewModel#layerloaded
  110765. * @description 分析结果图层加载完成后触发。
  110766. * @property {L.GeoJSON} layer - 结果图层。
  110767. * @property {string} name - 结果图层名称。
  110768. */
  110769. var date = new Date();
  110770. var resultLayerName = params.resultLayerName || date.getTime();
  110771. me.fire('layerloaded', {
  110772. 'layer': layer,
  110773. 'name': resultLayerName
  110774. });
  110775. });
  110776. }
  110777. return info;
  110778. });
  110779. });
  110780. }
  110781. }
  110782. /**
  110783. * @function DistributedAnalysisViewModel.prototype.clearLayers
  110784. * @description 清空分析图层。
  110785. */
  110786. }, {
  110787. key: "clearLayers",
  110788. value: function clearLayers() {
  110789. for (var i in this.resultLayers) {
  110790. this.resultLayers[i].remove();
  110791. }
  110792. /**
  110793. * @event DistributedAnalysisViewModel#layersremoved
  110794. * @description 图层删除后触发。
  110795. * @property {Array.<L.GeoJSON>} layers - 结果图层数组。
  110796. */
  110797. this.fire('layersremoved', {
  110798. 'layers': this.resultLayers
  110799. });
  110800. this.resultLayers = [];
  110801. }
  110802. }]);
  110803. return DistributedAnalysisViewModel;
  110804. }((external_L_default()).Evented);
  110805. var distributedAnalysisViewModel = function distributedAnalysisViewModel(options) {
  110806. return new DistributedAnalysisViewModel(options);
  110807. };
  110808. ;// CONCATENATED MODULE: ./src/leaflet/components/distributedanalysis/DistributedAnalysisView.js
  110809. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  110810. * This program are made available under the terms of the Apache License, Version 2.0
  110811. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  110812. /**
  110813. * @class DistributedAnalysisView
  110814. * @aliasclass Components.DistributedAnalysisView
  110815. * @deprecatedclassinstance L.supermap.components.distributedAnalysis
  110816. * @classdesc 分布式分析组件类。
  110817. * @version 9.1.1
  110818. * @modulecategory Components
  110819. * @param {string} processingUrl - 分布式分析服务地址。
  110820. * @param {Object} options - 参数。
  110821. * @param {string} [options.position='topright'] - 组件在地图中显示的位置( 'topleft'|'topright'|'bottomleft'|'bottomright' )。
  110822. * @param {function} [options.style] - 默认图层样式。返回类型:点样式( maker|circleMaker);线和面样式( L.path )。
  110823. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗。
  110824. * @fires DistributedAnalysisView#analysissucceeded
  110825. * @fires DistributedAnalysisView#analysisfailed
  110826. * @fires DistributedAnalysisView#layersremoved
  110827. * @extends {ComponentsViewBase}
  110828. * @category Components DistributedAnalysis
  110829. * @usage
  110830. */
  110831. var DistributedAnalysisView = ComponentsViewBase.extend({
  110832. initialize: function initialize(processingUrl, options) {
  110833. ComponentsViewBase.prototype.initialize.apply(this, [options]);
  110834. //初始化 ViewModel:
  110835. this.viewModel = new DistributedAnalysisViewModel(processingUrl);
  110836. },
  110837. /**
  110838. * @function DistributedAnalysisView.prototype.onAdd
  110839. * @description 添加控件。
  110840. * @private
  110841. * @override
  110842. */
  110843. onAdd: function onAdd(map) {
  110844. this._fillDataToView();
  110845. return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
  110846. },
  110847. /**
  110848. * @function DistributedAnalysisView.prototype._fillDataToView
  110849. * @description 添加数据。
  110850. * @private
  110851. */
  110852. _fillDataToView: function _fillDataToView() {
  110853. var _this = this;
  110854. // 获取数据集
  110855. this.viewModel.on('datasetsloaded', function (e) {
  110856. var datasetOptionsArr = e.result.dataset.datasetNames;
  110857. _this.datasetSelect.innerHTML = '';
  110858. _this._createOptions(_this.datasetSelect, datasetOptionsArr);
  110859. _this.datasetSelectObj.optionClickEvent(_this.datasetSelect, _this.datasetSelectName, _this.datasetSelectOnchange);
  110860. _this.dataHash = e.result.datasetHash;
  110861. });
  110862. this.viewModel.getDatasetsName();
  110863. },
  110864. /**
  110865. * @function DistributedAnalysisView.prototype._initView
  110866. * @description 创建分布式分析组件。
  110867. * @returns {HTMLElement}
  110868. * @private
  110869. * @override
  110870. */
  110871. _initView: function _initView() {
  110872. var _this2 = this;
  110873. // 组件 container
  110874. var container = new CommonContainer({
  110875. title: Lang.i18n('title_distributedAnalysis')
  110876. }).getElement();
  110877. container.classList.add('component-analysis');
  110878. container.children[0].style.fontSize = '12px';
  110879. // 组件内容 container
  110880. var componentContentContainer = external_L_default().DomUtil.create('div', 'component-content component-content--scroll component-content--analysis', container);
  110881. // 分析方式下拉框
  110882. var analysisOptionsArr = [{
  110883. 'title': Lang.i18n('text_densityAnalysis'),
  110884. 'dataValue': 'density',
  110885. 'remark': Lang.i18n('text_CalculateTheValuePerUnitArea'),
  110886. 'icon': {
  110887. 'className': 'component-analyst-density-img'
  110888. }
  110889. }];
  110890. var dropDownBox = new DropDownBox(analysisOptionsArr).getElement();
  110891. componentContentContainer.appendChild(dropDownBox);
  110892. // 选中的 dropDownItem
  110893. var dropDownTop = dropDownBox.children[0].children[0].children[0];
  110894. // 各分析参数 container
  110895. var analysisTypeContainer = external_L_default().DomUtil.create('div', 'component-analysis__container', componentContentContainer);
  110896. var analysisType = external_L_default().DomUtil.create('div', 'analysistype', analysisTypeContainer);
  110897. var analysisLayer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisLayer', analysisType);
  110898. // 数据集下拉框
  110899. var datasetSelectControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', analysisLayer);
  110900. var datasetOptions = {
  110901. 'optionsArr': [Lang.i18n('text_option_selectDataset')],
  110902. 'labelName': Lang.i18n('text_label_dataset'),
  110903. "optionsClickCb": datasetSelectOnchange.bind(this)
  110904. };
  110905. var datasetSelectObj = new Select(datasetOptions);
  110906. var datasetSelectTool = datasetSelectObj.getElement();
  110907. this.datasetSelectObj = datasetSelectObj;
  110908. datasetSelectControl.appendChild(datasetSelectTool);
  110909. // 选中的 dataset
  110910. var datasetSelectName = datasetSelectTool.children[1].children[0];
  110911. this.datasetSelectName = datasetSelectName;
  110912. // dataset select container
  110913. var datasetSelect = datasetSelectTool.children[1].children[2].children[0].children[0];
  110914. datasetSelect.children[0].style.display = 'none';
  110915. this.datasetSelect = datasetSelect;
  110916. // 分析方法下拉框 & 网格面类型下拉框
  110917. var analyseIDW = external_L_default().DomUtil.create('div', 'component-analysis__idw', analysisLayer);
  110918. var analysisOptions = [{
  110919. 'optionsArr': [Lang.i18n('text_option_simplePointDensityAnalysis'), Lang.i18n('text_option_nuclearDensityAnalysis')],
  110920. 'labelName': Lang.i18n('text_label_analyticalMethod')
  110921. // 'optionsClickCb': analysisMethodSelectOnchange.bind(this)
  110922. }, {
  110923. 'optionsArr': [Lang.i18n('text_option_quadrilateral'), Lang.i18n('text_option_hexagon')],
  110924. 'labelName': Lang.i18n('text_label_meshType')
  110925. }];
  110926. // 分析参数 select control
  110927. var analysisSelectControl = external_L_default().DomUtil.create('div', 'component-analysis__idw__selecttool', analyseIDW);
  110928. for (var i in analysisOptions) {
  110929. var selectTool = new Select(analysisOptions[i]).getElement();
  110930. analysisSelectControl.appendChild(selectTool);
  110931. }
  110932. // 权重选择下拉框
  110933. var weightFieldsSelectOptions = {
  110934. 'optionsArr': [Lang.i18n('text_option_notSet')],
  110935. 'labelName': Lang.i18n('text_label_weightField')
  110936. };
  110937. var weightFieldsSelectObj = new Select(weightFieldsSelectOptions);
  110938. var weightFieldsSelectTool = weightFieldsSelectObj.getElement();
  110939. analysisSelectControl.appendChild(weightFieldsSelectTool);
  110940. this.weightFieldsSelectObj = weightFieldsSelectObj;
  110941. // 分析方法选中值 & option attr设置
  110942. var analysisMethodSelectName = analysisSelectControl.children[0].children[1].children[0];
  110943. analysisMethodSelectName.setAttribute('data-value', '0');
  110944. var analysisMethodSelect = analysisSelectControl.children[0].children[1].children[2].children[0].children[0];
  110945. var analysisMethodDV = ['0', '1'];
  110946. this._setEleAtribute(analysisMethodDV, 'data-value', analysisMethodSelect.children);
  110947. // 网格面类型选中值 & option attr设置
  110948. var gridTypeSelectName = analysisSelectControl.children[1].children[1].children[0];
  110949. gridTypeSelectName.setAttribute('data-value', '0');
  110950. var gridTypeSelect = analysisSelectControl.children[1].children[1].children[2].children[0].children[0];
  110951. var gridTypeDV = ['0', '1'];
  110952. this._setEleAtribute(gridTypeDV, 'data-value', gridTypeSelect.children);
  110953. // 权重值选中值
  110954. var weightFieldsSelectName = analysisSelectControl.children[2].children[1].children[0];
  110955. var weightFieldsSelect = analysisSelectControl.children[2].children[1].children[2].children[0].children[0];
  110956. // 分析范围 & 网格大小 & 搜索半径 & 面积单位
  110957. // 分析范围
  110958. var inputOptions = [{
  110959. 'spanName': Lang.i18n('text_label_queryRange'),
  110960. 'value': ''
  110961. }];
  110962. for (var _i2 in inputOptions) {
  110963. this._creatInputBox(inputOptions[_i2], analysisSelectControl);
  110964. }
  110965. var queryRangeInput = analysisSelectControl.children[3].children[1];
  110966. queryRangeInput.setAttribute('placeholder', Lang.i18n('text_label_queryRangeTips'));
  110967. queryRangeInput.title = Lang.i18n('text_label_queryRangeTips');
  110968. // 网格大小
  110969. var gridSizeUnitSelectOptions = {
  110970. 'optionsArr': ['Meter', 'Kilometer', 'Yard', 'Foot', 'Mile']
  110971. };
  110972. var gridSizeOptions = {
  110973. 'labelName': Lang.i18n('text_label_gridSizeInMeters'),
  110974. 'selectOptions': gridSizeUnitSelectOptions
  110975. };
  110976. var gridSizeContainer = this._creatUnitSelectBox(gridSizeOptions, analysisSelectControl);
  110977. var gridSizeInput = gridSizeContainer.children[1].children[0];
  110978. gridSizeInput.value = '1000';
  110979. var gridSizeUnitSelectName = gridSizeContainer.children[1].children[1].children[0].children[0].children[0];
  110980. // 搜索半径
  110981. var searchRadiusUnitSelectOptions = {
  110982. 'optionsArr': ['Meter', 'Kilometer', 'Yard', 'Foot', 'Mile']
  110983. };
  110984. var searchRadiusOptions = {
  110985. 'labelName': Lang.i18n('text_label_searchRadius'),
  110986. 'selectOptions': searchRadiusUnitSelectOptions
  110987. };
  110988. var searchRadiusContainer = this._creatUnitSelectBox(searchRadiusOptions, analysisSelectControl);
  110989. var searchRadiusInput = searchRadiusContainer.children[1].children[0];
  110990. searchRadiusInput.value = '300';
  110991. var searchRadiusSelectName = searchRadiusContainer.children[1].children[1].children[0].children[0].children[0];
  110992. // 面积单位
  110993. var areaUnitSelectOptions = {
  110994. 'labelName': Lang.i18n('text_label_areaUnit'),
  110995. 'optionsArr': ['SquareMile', 'SquareMeter', 'Hectare', 'Acre', 'SquareFoot', 'SquareYard']
  110996. };
  110997. var areaUnitSelectTool = new Select(areaUnitSelectOptions).getElement();
  110998. analysisSelectControl.appendChild(areaUnitSelectTool);
  110999. var areaUnitSelectName = areaUnitSelectTool.children[1].children[0];
  111000. // 专题图分段
  111001. var rangeContent = external_L_default().DomUtil.create('div', 'range-content', analysisType);
  111002. var rangeContentOptions = {
  111003. 'optionsArr': [Lang.i18n('text_option_notSet'), Lang.i18n('text_option_equidistantSegmentation'), Lang.i18n('text_option_logarithm'), Lang.i18n('text_option_equalCountingSegment'), Lang.i18n('text_option_squareRootSegmentation')],
  111004. 'labelName': Lang.i18n('text_label_thematicMapSegmentationMode'),
  111005. "optionsClickCb": themeModelSelectOnchange
  111006. };
  111007. rangeContent.appendChild(new Select(rangeContentOptions).getElement());
  111008. var themeModelSelectName = rangeContent.children[0].children[1].children[0];
  111009. themeModelSelectName.setAttribute('data-value', 'NOTSET');
  111010. var themeModelSelect = rangeContent.children[0].children[1].children[2].children[0].children[0];
  111011. var themeModelDataValue = ['NOTSET', 'EQUALINTERVAL', 'LOGARITHM', 'QUANTILE', 'SQUAREROOT'];
  111012. this._setEleAtribute(themeModelDataValue, 'data-value', themeModelSelect.children);
  111013. var rangeContentParamInput = this._creatInputBox({
  111014. 'spanName': Lang.i18n('text_label_thematicMapSegmentationParameters'),
  111015. 'value': '20'
  111016. }, rangeContent);
  111017. rangeContentParamInput.classList.add('hidden');
  111018. var rangeContentModelSelectTool = new Select({
  111019. 'optionsArr': [Lang.i18n('text_option_greenOrangePurpleGradient'), Lang.i18n('text_option_greenOrangeRedGradient'), Lang.i18n('text_option_rainbowGradient'), Lang.i18n('text_option_spectralGradient'), Lang.i18n('text_option_terrainGradient')],
  111020. 'labelName': Lang.i18n('text_label_thematicMapColorGradientMode')
  111021. }).getElement();
  111022. rangeContent.appendChild(rangeContentModelSelectTool);
  111023. rangeContentModelSelectTool.classList.add('hidden');
  111024. var rangeContentModelSelect = rangeContentModelSelectTool.children[1].children[2].children[0].children[0];
  111025. var rangeContentModelSelectName = rangeContentModelSelectTool.children[1].children[0];
  111026. rangeContentModelSelectName.setAttribute('data-value', 'GREENORANGEVIOLET');
  111027. var rangeContentModelDV = ['GREENORANGEVIOLET', 'GREENORANGERED', 'RAINBOW', 'SPECTRUM', 'TERRAIN'];
  111028. this._setEleAtribute(rangeContentModelDV, 'data-value', rangeContentModelSelect.children);
  111029. // 专题图分段模式下拉框 onchange 事件
  111030. function themeModelSelectOnchange(option) {
  111031. if (option.getAttribute('data-value') !== 'NOTSET') {
  111032. rangeContentParamInput.classList.remove('hidden');
  111033. rangeContentModelSelectTool.classList.remove('hidden');
  111034. } else {
  111035. rangeContentParamInput.classList.add('hidden');
  111036. rangeContentModelSelectTool.classList.add('hidden');
  111037. }
  111038. }
  111039. // 结果图层
  111040. var resultLayerContainer = external_L_default().DomUtil.create('div', '', analysisType);
  111041. var resultLayerSpan = external_L_default().DomUtil.create('span', '', resultLayerContainer);
  111042. resultLayerSpan.innerHTML = Lang.i18n('text_label_resultLayerName');
  111043. var resultLayerInput = external_L_default().DomUtil.create('input', 'component-distributeanalysis__input', resultLayerContainer);
  111044. // 分析 & 分析中 & 取消 按钮
  111045. var runBtnContainer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisbtn', analysisTypeContainer);
  111046. var runBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn', runBtnContainer);
  111047. var analysisBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis', runBtn);
  111048. analysisBtn.innerHTML = Lang.i18n('btn_analyze');
  111049. var analysingContainer = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysing-container hidden', runBtn);
  111050. var analysisingBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysising', analysingContainer);
  111051. analysisingBtn.style.width = '200px';
  111052. var svgContainer = external_L_default().DomUtil.create('div', 'component-analysis__svg-container', analysisingBtn);
  111053. svgContainer.innerHTML = "<svg class=\"component-analysis__svg-rotate\" width=\"16px\" height=\"16px\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"ring\" fill=\"#FFF\" transform=\"translate(8,8)\" d=\"M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z\"></path>\n <circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"#38ADF5\"></circle>\n <rect class=\"svg-top\" x=\"8\" y=\"0\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n <rect class=\"svg-left\" x=\"0\" y=\"8\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n </svg>";
  111054. external_L_default().DomUtil.create('span', '', analysisingBtn).innerHTML = Lang.i18n('btn_analyzing');
  111055. // 删除按钮
  111056. var deleteLayersBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers', runBtn);
  111057. deleteLayersBtn.id = 'deleteLayersBtn';
  111058. deleteLayersBtn.innerHTML = Lang.i18n('btn_emptyTheAnalysisLayer');
  111059. // 交互
  111060. // 弹框
  111061. this.messageBox = new MessageBox();
  111062. // 数据集下拉框 onchange 事件
  111063. this.datasetSelectOnchange = datasetSelectOnchange.bind(this);
  111064. function datasetSelectOnchange(option) {
  111065. this.messageBox.closeView();
  111066. if (this.dataHash) {
  111067. weightFieldsSelect.innerHTML = '';
  111068. // 获取当前选中数据集类型
  111069. var datasetUrl = this.dataHash[option.title];
  111070. // 判断当前选中数据集是否支持该选中分析类,并填充分析权重字段
  111071. var _me = this;
  111072. this.viewModel.on('datasetinfoloaded', function (e) {
  111073. weightFieldsSelectName.title = Lang.i18n('text_option_notSet');
  111074. weightFieldsSelectName.innerHTML = Lang.i18n('text_option_notSet');
  111075. weightFieldsSelect.innerHTML = '';
  111076. var analyseType = dropDownTop.getAttribute('data-value');
  111077. var type = e.result.type;
  111078. var fields = e.result.fields;
  111079. if (analyseType === 'density') {
  111080. if (type === 'REGION' || type === 'LINE') {
  111081. _me.messageBox.showView(Lang.i18n('msg_datasetOrMethodUnsupport'), "failure");
  111082. } else {
  111083. _me.messageBox.closeView();
  111084. _me._createOptions(weightFieldsSelect, fields);
  111085. _me.weightFieldsSelectObj.optionClickEvent(weightFieldsSelect, weightFieldsSelectName);
  111086. }
  111087. }
  111088. });
  111089. this.viewModel.getDatasetInfo(datasetUrl);
  111090. }
  111091. }
  111092. // 分析按钮点击事件
  111093. analysisBtn.onclick = function () {
  111094. _this2.messageBox.closeView();
  111095. var params = getAnalysisParam();
  111096. if (datasetSelectName.title === Lang.i18n('text_option_selectDataset')) {
  111097. _this2.messageBox.showView(Lang.i18n('msg_selectDataset'), "failure");
  111098. } else if (weightFieldsSelectName.title === Lang.i18n('text_option_notSet')) {
  111099. _this2.messageBox.showView(Lang.i18n('msg_setTheWeightField'), "failure");
  111100. } else {
  111101. _this2.messageBox.closeView();
  111102. analysingContainer.style.display = 'block';
  111103. analysisBtn.style.display = 'none';
  111104. _this2.viewModel.on('layerloaded', function (e) {
  111105. analysingContainer.style.display = 'none';
  111106. analysisBtn.style.display = 'block';
  111107. /**
  111108. * @event DistributedAnalysisView#analysissucceeded
  111109. * @description 分析完成后触发。
  111110. * @property {L.GeoJSON} layer - 结果图层。
  111111. * @property {string} name - 结果图层名称。
  111112. */
  111113. _this2._event.fire('analysissucceeded', {
  111114. 'layer': e.layer,
  111115. 'name': e.name
  111116. });
  111117. });
  111118. _this2.viewModel.on('analysisfailed', function (e) {
  111119. _this2.messageBox.showView(Lang.i18n('msg_theFieldNotSupportAnalysis'), "failure");
  111120. analysingContainer.style.display = 'none';
  111121. analysisBtn.style.display = 'block';
  111122. /**
  111123. * @event DistributedAnalysisView#analysisfailed
  111124. * @description 分析失败后触发。
  111125. * @property {string} error - 服务器返回的错误。
  111126. */
  111127. _this2._event.fire('analysisfailed', {
  111128. 'error': e.error
  111129. });
  111130. });
  111131. _this2.viewModel.analysis(params, _this2.map);
  111132. }
  111133. };
  111134. // 删除按钮点击事件
  111135. deleteLayersBtn.onclick = function () {
  111136. /**
  111137. * @event DistributedAnalysisView#layersremoved
  111138. * @description 结果图层删除后触发。
  111139. * @property {Array.<L.GeoJSON>} layers - 被删除的结果图层。
  111140. */
  111141. _this2.viewModel.on('layersremoved', function (e) {
  111142. _this2._event.fire('layersremoved', {
  111143. 'layers': e.layers
  111144. });
  111145. });
  111146. _this2.viewModel.clearLayers();
  111147. };
  111148. // 获取分析参数
  111149. function getAnalysisParam() {
  111150. var analysisType = dropDownTop.getAttribute('data-value');
  111151. var analysisMethod = analysisMethodSelectName.getAttribute('data-value');
  111152. var gridType = gridTypeSelectName.getAttribute('data-value');
  111153. var queryRange = queryRangeInput.value;
  111154. var gridSizeUnit = gridSizeUnitSelectName.title;
  111155. var searchRadiusUnit = searchRadiusSelectName.title;
  111156. var areaUnit = areaUnitSelectName.title;
  111157. var colorGradientType = rangeContentModelSelectName.getAttribute('data-value');
  111158. var themeModel = themeModelSelectName.getAttribute('data-value');
  111159. var date = new Date();
  111160. var resultLayerName = resultLayerInput.value || date.getTime();
  111161. var mappingParameter;
  111162. if (themeModel === 'NOTSET') {
  111163. mappingParameter = '';
  111164. } else {
  111165. mappingParameter = {
  111166. 'rangeMode': themeModel,
  111167. 'rangeCount': rangeContentParamInput.value,
  111168. 'colorGradientType': colorGradientType
  111169. };
  111170. }
  111171. var analysisParam;
  111172. if (analysisType === 'density') {
  111173. analysisParam = new KernelDensityJobParameter({
  111174. 'datasetName': datasetSelectName.title,
  111175. 'method': analysisMethod,
  111176. 'meshType': gridType,
  111177. 'resolution': gridSizeInput.value,
  111178. 'fields': weightFieldsSelectName.title,
  111179. 'radius': searchRadiusInput.value,
  111180. 'meshSizeUnit': gridSizeUnit,
  111181. 'radiusUnit': searchRadiusUnit,
  111182. 'areaUnit': areaUnit,
  111183. 'query': queryRange,
  111184. 'mappingParameters': new MappingParameters({
  111185. 'rangeMode': mappingParameter.rangeMode,
  111186. 'rangeCount': mappingParameter.rangeCount,
  111187. 'colorGradientType': mappingParameter.colorGradientType
  111188. })
  111189. });
  111190. }
  111191. var params = {
  111192. 'analysisParam': analysisParam,
  111193. 'resultLayerName': resultLayerName
  111194. };
  111195. return params;
  111196. }
  111197. //阻止 map 默认事件
  111198. this._preventMapEvent(container, this.map);
  111199. return container;
  111200. },
  111201. /**
  111202. * @function DistributedAnalysisView.prototype._createOptions
  111203. * @description 创建下拉框。
  111204. * @private
  111205. */
  111206. _createOptions: function _createOptions(container, optionsArr) {
  111207. for (var i in optionsArr) {
  111208. var option = document.createElement('div');
  111209. option.className = 'component-selecttool__option';
  111210. option.title = optionsArr[i];
  111211. option.innerHTML = optionsArr[i];
  111212. option.setAttribute('data-value', optionsArr[i]);
  111213. container.appendChild(option);
  111214. }
  111215. },
  111216. /**
  111217. * @function DistributedAnalysisView.prototype._creatInputBox
  111218. * @description 创建输入框。
  111219. * @private
  111220. */
  111221. _creatInputBox: function _creatInputBox(inputOptions, parentEle) {
  111222. var div = external_L_default().DomUtil.create('div', '', parentEle);
  111223. var span = external_L_default().DomUtil.create('span', '', div);
  111224. span.innerHTML = inputOptions.spanName;
  111225. var input = external_L_default().DomUtil.create('input', '', div);
  111226. input.value = inputOptions.value;
  111227. input.className = 'component-distributeanalysis__input';
  111228. return div;
  111229. },
  111230. /**
  111231. * @function DistributedAnalysisView.prototype._creatUnitSelectBox
  111232. * @description 创建选择框。
  111233. * @private
  111234. */
  111235. _creatUnitSelectBox: function _creatUnitSelectBox(options, parentEle) {
  111236. var unitSelectBoxContainer = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--radius', parentEle);
  111237. var unitSelectSpan = external_L_default().DomUtil.create('span', '', unitSelectBoxContainer);
  111238. unitSelectSpan.innerHTML = options.labelName;
  111239. var unitSelectInputContainer = external_L_default().DomUtil.create('div', '', unitSelectBoxContainer);
  111240. external_L_default().DomUtil.create('input', 'buffer-radius-input', unitSelectInputContainer);
  111241. var unitSelectUnitContainer = external_L_default().DomUtil.create('div', 'component-clientcomputation__buffer--unit', unitSelectInputContainer);
  111242. var unitSelectOptions = options.selectOptions;
  111243. var unitSelectTool = new Select(unitSelectOptions).getElement();
  111244. unitSelectUnitContainer.appendChild(unitSelectTool);
  111245. return unitSelectBoxContainer;
  111246. },
  111247. /**
  111248. * @function DistributedAnalysisView.prototype._setEleAtribute
  111249. * @description 设置元素的属性名和属性值。
  111250. * @private
  111251. */
  111252. _setEleAtribute: function _setEleAtribute(daraValueArr, attributeName, eleArr) {
  111253. for (var i = 0; i < eleArr.length; i++) {
  111254. eleArr[i].setAttribute(attributeName, daraValueArr[i]);
  111255. }
  111256. }
  111257. });
  111258. var distributedAnalysisView = function distributedAnalysisView(options) {
  111259. return new DistributedAnalysisView(options);
  111260. };
  111261. ;// CONCATENATED MODULE: ./src/leaflet/components/dataservicequery/DataServiceQueryViewModel.js
  111262. function DataServiceQueryViewModel_typeof(obj) { "@babel/helpers - typeof"; return DataServiceQueryViewModel_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; }, DataServiceQueryViewModel_typeof(obj); }
  111263. function DataServiceQueryViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  111264. function DataServiceQueryViewModel_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  111265. function DataServiceQueryViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataServiceQueryViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataServiceQueryViewModel_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  111266. function DataServiceQueryViewModel_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new 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) DataServiceQueryViewModel_setPrototypeOf(subClass, superClass); }
  111267. function DataServiceQueryViewModel_setPrototypeOf(o, p) { DataServiceQueryViewModel_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataServiceQueryViewModel_setPrototypeOf(o, p); }
  111268. function DataServiceQueryViewModel_createSuper(Derived) { var hasNativeReflectConstruct = DataServiceQueryViewModel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DataServiceQueryViewModel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DataServiceQueryViewModel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DataServiceQueryViewModel_possibleConstructorReturn(this, result); }; }
  111269. function DataServiceQueryViewModel_possibleConstructorReturn(self, call) { if (call && (DataServiceQueryViewModel_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 DataServiceQueryViewModel_assertThisInitialized(self); }
  111270. function DataServiceQueryViewModel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  111271. function DataServiceQueryViewModel_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; } }
  111272. function DataServiceQueryViewModel_getPrototypeOf(o) { DataServiceQueryViewModel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataServiceQueryViewModel_getPrototypeOf(o); }
  111273. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  111274. * This program are made available under the terms of the Apache License, Version 2.0
  111275. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  111276. /**
  111277. * @class DataServiceQueryViewModel
  111278. * @aliasclass Components.DataServiceQueryViewModel
  111279. * @deprecatedclassinstance L.supermap.components.dataServiceQueryViewModel
  111280. * @classdesc 数据服务查询组件功能类。
  111281. * @version 9.1.1
  111282. * @category Components DataServiceQuery
  111283. * @param {string} dataserviceUrl - 数据服务地址。
  111284. * @fires DataServiceQueryViewModel#getfeaturessucceeded
  111285. * @fires DataServiceQueryViewModel#getfeaturesfailed
  111286. * @extends {L.Evented}
  111287. * @usage
  111288. */
  111289. var DataServiceQueryViewModel = /*#__PURE__*/function (_L$Evented) {
  111290. DataServiceQueryViewModel_inherits(DataServiceQueryViewModel, _L$Evented);
  111291. var _super = DataServiceQueryViewModel_createSuper(DataServiceQueryViewModel);
  111292. function DataServiceQueryViewModel() {
  111293. DataServiceQueryViewModel_classCallCheck(this, DataServiceQueryViewModel);
  111294. return _super.apply(this, arguments);
  111295. }
  111296. DataServiceQueryViewModel_createClass(DataServiceQueryViewModel, [{
  111297. key: "initialize",
  111298. value: function initialize(dataserviceUrl) {
  111299. this.dataserviceUrl = dataserviceUrl;
  111300. this.resultLayers = [];
  111301. }
  111302. /**
  111303. * @function DataServiceQueryViewModel.prototype.getFeatures
  111304. * @description 获取 features。
  111305. * @param {(GetFeaturesByIDsParameters|GetFeaturesByBufferParameters|GetFeaturesByBoundsParameters|GetFeaturesBySQLParameters|GetFeaturesByGeometryParameters)} queryParam - 查询参数。
  111306. * @param {L.Map} map - Leaflet Map 对象。
  111307. */
  111308. }, {
  111309. key: "getFeatures",
  111310. value: function getFeatures(queryParam, map) {
  111311. var dataserviceUrl = this.dataserviceUrl;
  111312. var me = this;
  111313. var featureService = FeatureService_featureService(dataserviceUrl);
  111314. if (queryParam instanceof GetFeaturesByIDsParameters) {
  111315. featureService.getFeaturesByIDs(queryParam, function (serviceResult) {
  111316. me._getQureyResult(serviceResult, map);
  111317. });
  111318. } else if (queryParam instanceof GetFeaturesBySQLParameters) {
  111319. featureService.getFeaturesBySQL(queryParam, function (serviceResult) {
  111320. me._getQureyResult(serviceResult, map);
  111321. });
  111322. } else if (queryParam instanceof GetFeaturesByBoundsParameters) {
  111323. featureService.getFeaturesByBounds(queryParam, function (serviceResult) {
  111324. me._getQureyResult(serviceResult, map);
  111325. });
  111326. } else if (queryParam instanceof GetFeaturesByBufferParameters) {
  111327. featureService.getFeaturesByBuffer(queryParam, function (serviceResult) {
  111328. me._getQureyResult(serviceResult, map);
  111329. });
  111330. } else if (queryParam instanceof GetFeaturesByGeometryParameters) {
  111331. featureService.getFeaturesByGeometry(queryParam, function (serviceResult) {
  111332. me._getQureyResult(serviceResult, map);
  111333. });
  111334. }
  111335. }
  111336. /**
  111337. * @function DataServiceQueryViewModel.prototype._getQureyResult
  111338. * @description 获取查询结果。
  111339. * @private
  111340. * @param {Object} serviceResult - 返回查询结果。
  111341. * @param {L.Map} map - Leaflet Map 对象。
  111342. */
  111343. }, {
  111344. key: "_getQureyResult",
  111345. value: function _getQureyResult(serviceResult, map) {
  111346. if (serviceResult.error) {
  111347. /**
  111348. * @event DataServiceQueryViewModel#getfeaturesfailed
  111349. * @description features 获取失败时触发。
  111350. * @property {string} error - 服务器返回的错误。
  111351. */
  111352. this.fire('getfeaturesfailed', {
  111353. 'error': serviceResult.error
  111354. });
  111355. return;
  111356. }
  111357. var resultLayer = external_L_default().geoJSON(serviceResult.result.features, {
  111358. onEachFeature: function onEachFeature(feature, layer) {
  111359. layer.bindPopup("ID: " + feature.properties.SMID);
  111360. },
  111361. pointToLayer: function pointToLayer(geoJsonPoint, latLng) {
  111362. return external_L_default().circleMarker(latLng, {
  111363. radius: 6
  111364. });
  111365. }
  111366. }).addTo(map);
  111367. this.resultLayers.push(resultLayer);
  111368. /**
  111369. * @event DataServiceQueryViewModel#getfeaturessucceeded
  111370. * @description features 获取成功时触发。
  111371. * @property {Object} result - 服务器返回的结果。
  111372. */
  111373. this.fire('getfeaturessucceeded', {
  111374. 'result': serviceResult.result.features
  111375. });
  111376. }
  111377. /**
  111378. * @function DataServiceQueryViewModel.prototype.clearLayers
  111379. * @description 清除所有结果图层。
  111380. */
  111381. }, {
  111382. key: "clearLayers",
  111383. value: function clearLayers() {
  111384. for (var i in this.resultLayers) {
  111385. this.resultLayers[i].remove();
  111386. }
  111387. this.resultLayers = [];
  111388. }
  111389. }]);
  111390. return DataServiceQueryViewModel;
  111391. }((external_L_default()).Evented);
  111392. var dataServiceQueryViewModel = function dataServiceQueryViewModel(dataserviceUrl) {
  111393. return new dataServiceQueryViewModel(dataserviceUrl);
  111394. };
  111395. ;// CONCATENATED MODULE: ./src/leaflet/components/dataservicequery/DataServiceQueryView.js
  111396. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  111397. * This program are made available under the terms of the Apache License, Version 2.0
  111398. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  111399. /**
  111400. * @class DataServiceQueryView
  111401. * @aliasclass Components.DataServiceQueryView
  111402. * @deprecatedclassinstance L.supermap.components.dataServiceQuery
  111403. * @classdesc 数据服务查询组件类。
  111404. * @version 9.1.1
  111405. * @modulecategory Components
  111406. * @param {string} dataServiceUrl - 数据服务地址。
  111407. * @param {(Array.<string>|string)} dataSetNames - 配置查询方式和查询的数据集数组。格式:" 数据源名:数据集名 ",例:"World: Countries"。
  111408. * @param {Object} options - 参数。
  111409. * @param {(Array.<GetFeatureMode>|GetFeatureMode)} [options.getFeatureMode] - 查询方式。
  111410. * @param {string} [options.position='topright'] - 组件在地图中显示的位置( 'topleft'|'topright'|'bottomleft'|'bottomright' )。
  111411. * @param {function} [options.style] - 默认图层样式。返回类型:点样式( maker|circleMaker);线和面样式( L.path )。
  111412. * @param {function} [options.onEachFeature] - 给该元素绑定事件和弹窗。
  111413. * @fires DataServiceQueryView#getfeaturessucceeded
  111414. * @fires DataServiceQueryView#getfeaturesfailed
  111415. * @category Components DataServiceQuery
  111416. * @extends {ComponentsViewBase}
  111417. * @usage
  111418. */
  111419. var DataServiceQueryView = ComponentsViewBase.extend({
  111420. initialize: function initialize(dataServiceUrl, dataSetNames, options) {
  111421. ComponentsViewBase.prototype.initialize.apply(this, [options]);
  111422. this.dataServiceUrl = dataServiceUrl;
  111423. if (!dataSetNames || dataSetNames.length === 0) {
  111424. throw new Error('Please configure the dataset of the query!');
  111425. }
  111426. if (dataSetNames instanceof Array) {
  111427. this.dataSetNames = dataSetNames;
  111428. } else {
  111429. this.dataSetNames = dataSetNames.split(" ");
  111430. }
  111431. },
  111432. /**
  111433. * @function DataServiceQueryView.prototype.onAdd
  111434. * @description 添加控件。
  111435. * @private
  111436. * @override
  111437. */
  111438. onAdd: function onAdd(map) {
  111439. return ComponentsViewBase.prototype.onAdd.apply(this, [map]);
  111440. },
  111441. /**
  111442. * @function DataServiceQueryView.prototype.onRemove
  111443. * @description 移除控件。
  111444. * @private
  111445. */
  111446. onRemove: function onRemove() {
  111447. this.map.off('pm:create');
  111448. },
  111449. /**
  111450. * @function DataServiceQueryView.prototype.setDataSetNames
  111451. * @description 设置查询的数据集名称。
  111452. * @param {(Array.<string>|string)} dataSetNames - 配置查询方式和查询的数据集数组。格式:" 数据源名:数据集名 ",例:"World: Countries";
  111453. */
  111454. setDataSetNames: function setDataSetNames(dataSetNames) {
  111455. if (dataSetNames instanceof Array) {
  111456. this.dataSetNames = dataSetNames;
  111457. } else {
  111458. this.dataSetNames = dataSetNames.split(" ");
  111459. }
  111460. },
  111461. /**
  111462. * @function DataServiceQueryView.prototype.setGetFeatureMode
  111463. * @description 设置查询方式。
  111464. * @param {(Array.<GetFeatureMode>|GetFeatureMode)} getFeatureMode - 查询方式。
  111465. */
  111466. setGetFeatureMode: function setGetFeatureMode(getFeatureMode) {
  111467. this.getFeatureMode = getFeatureMode;
  111468. this._getFeatureModeOnchange(this.getFeatureMode);
  111469. },
  111470. /**
  111471. * @function DataServiceQueryView.prototype.setDataServiceUrl
  111472. * @description 设置查询的数据服务地址。
  111473. * @param {string} dataServiceUrl - 数据服务地址。
  111474. */
  111475. setDataServiceUrl: function setDataServiceUrl(dataServiceUrl) {
  111476. this.dataServiceUrl = dataServiceUrl;
  111477. this.viewModel = new DataServiceQueryViewModel(this.dataServiceUrl);
  111478. },
  111479. /**
  111480. * @function DataServiceQueryView.prototype._getFeatureModeOnchange
  111481. * @private
  111482. * @description 改变查询方式时改变 UI。
  111483. * @param {string} getFeatureMode - 查询方式。
  111484. */
  111485. _getFeatureModeOnchange: function _getFeatureModeOnchange(getFeatureMode) {
  111486. var queryModelOptionsArr;
  111487. if (!getFeatureMode || JSON.stringify(getFeatureMode) == '{}') {
  111488. queryModelOptionsArr = ['ID', 'SQL', 'BOUNDS', 'BUFFER', 'SPATIAL'];
  111489. } else {
  111490. queryModelOptionsArr = getFeatureMode;
  111491. }
  111492. var queryModelControl = document.getElementById('queryModelControl');
  111493. queryModelControl.innerHTML = '';
  111494. this.creatQueryModeSelect(queryModelOptionsArr, queryModelControl);
  111495. },
  111496. /**
  111497. * @function DataServiceQueryView.prototype._initView
  111498. * @description 创建数据服务查询组件。
  111499. * @returns {HTMLElement}
  111500. * @private
  111501. */
  111502. _initView: function _initView() {
  111503. var _this = this;
  111504. // 初始化 ViewModel:
  111505. this.viewModel = new DataServiceQueryViewModel(this.dataServiceUrl);
  111506. this.messageBox = new MessageBox();
  111507. // 组件 container
  111508. var container = new CommonContainer({
  111509. title: Lang.i18n('title_dataServiceQuery')
  111510. }).getElement();
  111511. container.classList.add('component-servicequery__container');
  111512. container.children[0].classList.add('component-servicequery__title');
  111513. var componentContentContainer = container.children[1];
  111514. componentContentContainer.classList.add('component-content--scroll');
  111515. componentContentContainer.classList.add('data-services');
  111516. // 组件内容 container
  111517. var analyusisTypeContainer = external_L_default().DomUtil.create('div', 'component-analysis__container', componentContentContainer);
  111518. var analysisType = external_L_default().DomUtil.create('div', 'component-servicequery__analysistype', analyusisTypeContainer);
  111519. var analysisLayer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisLayer', analysisType);
  111520. var queryModelOptionsArr,
  111521. getFeatureModeArr = this.options.getFeatureMode;
  111522. // 获取查询模式
  111523. if (!getFeatureModeArr || JSON.stringify(getFeatureModeArr) == '{}') {
  111524. queryModelOptionsArr = ['ID', 'SQL', 'BOUNDS', 'BUFFER', 'SPATIAL'];
  111525. } else {
  111526. queryModelOptionsArr = getFeatureModeArr;
  111527. }
  111528. // 查询模式
  111529. var queryModelContainer = external_L_default().DomUtil.create('div', '', analysisLayer);
  111530. queryModelContainer.id = 'queryModelContainer';
  111531. var queryModelControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', queryModelContainer);
  111532. queryModelControl.id = 'queryModelControl';
  111533. this.creatQueryModeSelect = creatQueryModeSelect.bind(this);
  111534. this.queryModeltOnchange = queryModeltOnchange.bind(this);
  111535. this.creatQueryModeSelect(queryModelOptionsArr, queryModelControl);
  111536. // 要素 ID 数组
  111537. var featuresIdArrContainer = external_L_default().DomUtil.create('div', 'component-analysis__container component-textarea--dataservice__container', analysisLayer);
  111538. var textareaSpan = external_L_default().DomUtil.create('span', 'textarea-name', featuresIdArrContainer);
  111539. textareaSpan.innerHTML = Lang.i18n('text_label_IDArrayOfFeatures');
  111540. var textareaControl = external_L_default().DomUtil.create('div', 'component-textarea component-textarea--dataservice', featuresIdArrContainer);
  111541. textareaControl.id = 'getfeaturesIdArr';
  111542. var scrollarea = external_L_default().DomUtil.create('div', 'scrollarea', textareaControl);
  111543. var scrollareaContent = external_L_default().DomUtil.create('div', 'component-scrollarea-content', scrollarea);
  111544. scrollareaContent.setAttribute('tabindex', '1');
  111545. var getValueTextArea = external_L_default().DomUtil.create('textarea', 'component-textarea__content', scrollareaContent);
  111546. getValueTextArea.value = '[1,2,3]';
  111547. getValueTextArea.id = 'getValueTextArea';
  111548. // SQL 最多可返回的要素数量
  111549. var maxFeaturesContainer = external_L_default().DomUtil.create('div', 'component-servicequery__maxfeatures-container hidden', analysisLayer);
  111550. var maxFeaturesOtions = {
  111551. 'spanName': Lang.i18n('text_label_maxFeatures'),
  111552. 'value': '1000'
  111553. };
  111554. var maxFeaturesInputBox = this._creatInputBox(maxFeaturesOtions, maxFeaturesContainer);
  111555. var maxFeaturesInput = maxFeaturesInputBox.children[1];
  111556. maxFeaturesInput.classList.add('max-features-input');
  111557. // Buffer 缓冲区距离
  111558. var bufferDistanceContainer = external_L_default().DomUtil.create('div', 'component-servicequery__distance-container hidden', analysisLayer);
  111559. var bufferDistanceOtions = {
  111560. 'spanName': Lang.i18n('text_label_bufferDistance'),
  111561. 'value': '10'
  111562. };
  111563. var bufferDistanceInputBox = this._creatInputBox(bufferDistanceOtions, bufferDistanceContainer);
  111564. var bufferDistanceInput = bufferDistanceInputBox.children[1];
  111565. // Bounds 查询范围;
  111566. var queryRangeContainer = external_L_default().DomUtil.create('div', 'component-analysis__container component-textarea--dataservice__container hidden', analysisLayer);
  111567. var queryRangetextareaSpan = external_L_default().DomUtil.create('span', 'textarea-name', queryRangeContainer);
  111568. var queryRangeMainContent = external_L_default().DomUtil.create('div', '', queryRangeContainer);
  111569. var queryRangeIconContainer = external_L_default().DomUtil.create('div', 'component-servicequery__rangeicon-container', queryRangeMainContent);
  111570. queryRangetextareaSpan.innerHTML = Lang.i18n('text_label_queryRange1');
  111571. var queryRangeRecIcon = external_L_default().DomUtil.create('div', 'component-servicequery__rangeicon supermapol-icons-polygon-layer bounds', queryRangeIconContainer);
  111572. var queryRangeLineIcon = external_L_default().DomUtil.create('div', 'component-servicequery__rangeicon supermapol-icons-line-layer hidden', queryRangeIconContainer);
  111573. var queryRangePointIcon = external_L_default().DomUtil.create('div', 'component-servicequery__rangeicon supermapol-icons-point-layer hidden', queryRangeIconContainer);
  111574. var queryRangetextareaControl = external_L_default().DomUtil.create('div', 'component-textarea component-textarea--rangequery', queryRangeMainContent);
  111575. queryRangetextareaControl.id = 'getfeaturesIdArr';
  111576. var queryRangescrollarea = external_L_default().DomUtil.create('div', '', queryRangetextareaControl);
  111577. var queryRangescrollareaContent = external_L_default().DomUtil.create('div', 'component-scrollarea-content', queryRangescrollarea);
  111578. queryRangescrollareaContent.setAttribute('tabindex', '1');
  111579. var queryRangeTextArea = external_L_default().DomUtil.create('textarea', 'component-textarea__content component-textarea--rangequery__content', queryRangescrollareaContent);
  111580. queryRangeTextArea.value = '{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}';
  111581. // geometry 空间查询模式
  111582. var spatialQueryModeContainer = external_L_default().DomUtil.create('div', 'component-servicequery__spatialquerymode-container hidden', analysisLayer);
  111583. var spatialQueryModeOptions = {
  111584. 'optionsArr': ['CONTAIN', 'CROSS', 'DISJOINT', 'IDENTITY', 'INTERSECT', 'NONE', 'OVERLAP', 'TOUCH', 'WITHIN'],
  111585. 'labelName': Lang.i18n('text_label_spatialQueryMode')
  111586. };
  111587. var spatialQueryModeControl = external_L_default().DomUtil.create('div', 'component-analysis__selecttool', spatialQueryModeContainer);
  111588. var spatialQueryModeSelectTool = new Select(spatialQueryModeOptions).getElement();
  111589. spatialQueryModeSelectTool.children[1].classList.add('dataservice-select');
  111590. spatialQueryModeControl.appendChild(spatialQueryModeSelectTool);
  111591. var spatialQueryModeSelectName = spatialQueryModeSelectTool.children[1].children[0];
  111592. spatialQueryModeSelectName.id = 'spatialQueryModeSelectName';
  111593. var spatialQueryModeSelectContent = spatialQueryModeSelectTool.children[1].children[2];
  111594. spatialQueryModeSelectContent.classList.add('component-servicequery__spatialquerymode__selectcontent');
  111595. // 分析按钮
  111596. var runBtnContainer = external_L_default().DomUtil.create('div', 'component-analysis__container__analysisbtn', analysisLayer);
  111597. var runBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn', runBtnContainer);
  111598. var analysisBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis', runBtn);
  111599. analysisBtn.innerHTML = Lang.i18n('btn_query');
  111600. var analysingContainer = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysing-container hidden', runBtn);
  111601. var analysisingBtn = external_L_default().DomUtil.create('div', 'component-analysis__analysisbtn--analysising component-servicequery__querybtn--querying', analysingContainer);
  111602. var svgContainer = external_L_default().DomUtil.create('div', 'component-analysis__svg-container', analysisingBtn);
  111603. svgContainer.innerHTML = "<svg class=\"component-analysis__svg-rotate\" width=\"16px\" height=\"16px\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path id=\"ring\" fill=\"#FFF\" transform=\"translate(8,8)\" d=\"M 0 0 v -8 A 8 8 0 1 1 -8.00 0 z\"></path>\n <circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"#38ADF5\"></circle>\n <rect class=\"svg-top\" x=\"8\" y=\"0\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n <rect class=\"svg-left\" x=\"0\" y=\"8\" rx=\"2\" ry=\"2\" width=\"2\" height=\"2\" style=\"fill: rgb(255, 255, 255); stroke-width: 0;\"></rect>\n </svg>";
  111604. external_L_default().DomUtil.create('span', '', analysisingBtn).innerHTML = Lang.i18n('btn_querying');
  111605. // 删除按钮
  111606. var deleteLayersBtn = external_L_default().DomUtil.create('button', 'component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers', runBtn);
  111607. deleteLayersBtn.innerHTML = Lang.i18n('btn_emptyTheRresultLayer');
  111608. // 设置当前显示参数
  111609. queryModeltOnchange(queryModelOptionsArr[0]);
  111610. // 分析按钮点击事件
  111611. var me = this;
  111612. analysisBtn.onclick = function () {
  111613. _this.messageBox.closeView();
  111614. analysingContainer.style.display = 'block';
  111615. analysisBtn.style.display = 'none';
  111616. var queryParams = getQueryParams();
  111617. _this.viewModel.on('getfeaturessucceeded', function (e) {
  111618. analysingContainer.style.display = 'none';
  111619. analysisBtn.style.display = 'block';
  111620. if (e.result.features.length === 0) {
  111621. _this.messageBox.showView(Lang.i18n('msg_dataReturnedIsEmpty'), "success");
  111622. }
  111623. /**
  111624. * @event DataServiceQueryView#getfeaturessucceeded
  111625. * @description features 获取成功时触发。
  111626. * @property {Object} result - 服务器返回的结果。
  111627. */
  111628. _this._event.fire('getfeaturessucceeded', {
  111629. 'result': e.result
  111630. });
  111631. });
  111632. _this.viewModel.on('getfeaturesfailed', function (e) {
  111633. analysingContainer.style.display = 'none';
  111634. analysisBtn.style.display = 'block';
  111635. _this.messageBox.showView(e.error.errorMsg, "failure");
  111636. /**
  111637. * @event DataServiceQueryView#getfeaturesfailed
  111638. * @description features 获取失败时触发。
  111639. * @property {string} error - 服务器返回的错误。
  111640. */
  111641. _this._event.fire('getfeaturesfailed', {
  111642. 'error': e.error
  111643. });
  111644. });
  111645. _this.viewModel.getFeatures(queryParams, _this.map);
  111646. };
  111647. var bounds, resultLayer;
  111648. // 矩形 & 多边形绘制
  111649. queryRangeRecIcon.onclick = function (e) {
  111650. var queryModelSelectName = document.getElementById('queryModelSelectName');
  111651. var getFeatureMode = queryModelSelectName.title;
  111652. if (resultLayer) {
  111653. resultLayer.remove();
  111654. }
  111655. // 矩形
  111656. if (getFeatureMode === 'BOUNDS') {
  111657. _this.map.pm.enableDraw('Rectangle');
  111658. // 多边形
  111659. } else {
  111660. _this.map.pm.enableDraw('Poly');
  111661. }
  111662. e.stopPropagation();
  111663. e.preventDefault();
  111664. };
  111665. // 线绘制
  111666. queryRangeLineIcon.onclick = function (e) {
  111667. if (resultLayer) {
  111668. resultLayer.remove();
  111669. }
  111670. _this.map.pm.enableDraw('Line');
  111671. e.stopPropagation();
  111672. e.preventDefault();
  111673. };
  111674. // 点绘制
  111675. queryRangePointIcon.onclick = function (e) {
  111676. if (resultLayer) {
  111677. resultLayer.remove();
  111678. }
  111679. _this.map.pm.enableDraw('Marker');
  111680. e.stopPropagation();
  111681. e.preventDefault();
  111682. };
  111683. this.map.on('pm:create', function (e) {
  111684. if (e.shape === 'Rectangle') {
  111685. resultLayer = e.layer;
  111686. var boundsT = resultLayer.getBounds();
  111687. bounds = external_L_default().bounds([boundsT._southWest.lng, boundsT._southWest.lat], [boundsT._northEast.lng, boundsT._northEast.lat]);
  111688. var geo = {
  111689. 'leftBottom': {
  111690. 'x': boundsT._southWest.lng,
  111691. 'y': boundsT._southWest.lat
  111692. },
  111693. 'rightTop': {
  111694. 'x': boundsT._northEast.lng,
  111695. 'y': boundsT._northEast.lat
  111696. }
  111697. };
  111698. queryRangeTextArea.value = JSON.stringify(geo);
  111699. }
  111700. if (e.shape === 'Marker') {
  111701. resultLayer = e.layer;
  111702. queryRangeTextArea.value = JSON.stringify(e.layer.toGeoJSON());
  111703. _this.map.pm.disableDraw("Marker");
  111704. }
  111705. if (e.shape === 'Line') {
  111706. resultLayer = e.layer;
  111707. queryRangeTextArea.value = JSON.stringify(e.layer.toGeoJSON());
  111708. }
  111709. if (e.shape === 'Polygon') {
  111710. resultLayer = e.layer;
  111711. queryRangeTextArea.value = JSON.stringify(e.layer.toGeoJSON());
  111712. }
  111713. });
  111714. // 删除按钮点击事件
  111715. deleteLayersBtn.onclick = function () {
  111716. _this.viewModel.clearLayers();
  111717. };
  111718. function creatQueryModeSelect(queryModelOptionsArr, queryModelControl) {
  111719. // 查询模式
  111720. var queryModelSelectName;
  111721. if (queryModelOptionsArr instanceof Array && queryModelOptionsArr.length > 1) {
  111722. var queryModelOptions = {
  111723. 'optionsArr': queryModelOptionsArr,
  111724. 'labelName': Lang.i18n('text_label_queryMode'),
  111725. 'optionsClickCb': this.queryModeltOnchange
  111726. };
  111727. var queryModelSelectTool = new Select(queryModelOptions).getElement();
  111728. queryModelControl.appendChild(queryModelSelectTool);
  111729. queryModelSelectName = queryModelSelectTool.children[1].children[0];
  111730. queryModelSelectTool.children[1].classList.add('dataservice-select');
  111731. var queryModelSelect = queryModelSelectTool.children[1];
  111732. queryModelSelect.classList.add('dataservice-select');
  111733. queryModelSelect.classList.add('querymodel-select');
  111734. } else {
  111735. var span = external_L_default().DomUtil.create('span', '', queryModelContainer);
  111736. span.innerHTML = Lang.i18n('text_label_queryMode');
  111737. queryModelSelectName = external_L_default().DomUtil.create('div', 'component-servicequery__querymode-selectname', queryModelContainer);
  111738. var text = external_L_default().DomUtil.create('span', '', queryModelSelectName);
  111739. if (queryModelOptionsArr instanceof Array) {
  111740. text.innerHTML = queryModelOptionsArr[0];
  111741. } else {
  111742. text.innerHTML = queryModelOptionsArr;
  111743. }
  111744. queryModelSelectName.title = text.innerHTML;
  111745. this.queryModeltOnchange(queryModelSelectName);
  111746. }
  111747. queryModelSelectName.id = 'queryModelSelectName';
  111748. return queryModelSelectName;
  111749. }
  111750. // 查询模式下拉框 onchange 事件
  111751. function queryModeltOnchange(option) {
  111752. // 获取当前选中查询模式
  111753. var queryModelSelectName;
  111754. if (option.title) {
  111755. queryModelSelectName = option.title;
  111756. } else {
  111757. queryModelSelectName = option;
  111758. }
  111759. // 控制部分查询参数元素隐藏和显示
  111760. maxFeaturesContainer.classList.add('hidden');
  111761. queryRangeContainer.classList.add('hidden');
  111762. bufferDistanceContainer.classList.add('hidden');
  111763. queryRangeLineIcon.classList.add('hidden');
  111764. queryRangePointIcon.classList.add('hidden');
  111765. queryRangeRecIcon.classList.remove('bounds');
  111766. spatialQueryModeContainer.classList.add('hidden');
  111767. textareaSpan.innerHTML = Lang.i18n('text_label_featureFilter');
  111768. getValueTextArea.value = 'SMID<10';
  111769. if (queryModelSelectName === 'BUFFER' || queryModelSelectName === 'SPATIAL') {
  111770. queryRangeContainer.classList.remove('hidden');
  111771. queryRangetextareaSpan.innerHTML = Lang.i18n('text_label_geometricObject');
  111772. queryRangeTextArea.value = '{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[84.90234375,40.25390625]}}';
  111773. queryRangeLineIcon.classList.remove('hidden');
  111774. queryRangePointIcon.classList.remove('hidden');
  111775. }
  111776. switch (queryModelSelectName) {
  111777. case 'ID':
  111778. textareaSpan.innerHTML = Lang.i18n('text_label_IDArrayOfFeatures');
  111779. getValueTextArea.value = '[1,2,3]';
  111780. break;
  111781. case 'SQL':
  111782. maxFeaturesContainer.classList.remove('hidden');
  111783. break;
  111784. case 'BOUNDS':
  111785. queryRangeContainer.classList.remove('hidden');
  111786. queryRangetextareaSpan.innerHTML = Lang.i18n('text_label_queryRange');
  111787. queryRangeTextArea.value = '{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}';
  111788. queryRangeRecIcon.classList.add('bounds');
  111789. break;
  111790. case 'BUFFER':
  111791. bufferDistanceContainer.classList.remove('hidden');
  111792. break;
  111793. case 'SPATIAL':
  111794. spatialQueryModeContainer.classList.remove('hidden');
  111795. break;
  111796. }
  111797. }
  111798. // 获取查询参数
  111799. function getQueryParams() {
  111800. // 数据集数组
  111801. var datasetArr = me.dataSetNames;
  111802. var queryModelSelectName = document.getElementById('queryModelSelectName');
  111803. var getFeatureMode = queryModelSelectName.title;
  111804. // 过滤条件
  111805. var attributeFilter = getValueTextArea.value;
  111806. var queryParam;
  111807. if (getFeatureMode === 'ID') {
  111808. var value = getValueTextArea.value;
  111809. var ids = value.substring(1, value.length - 1).split(',');
  111810. queryParam = new GetFeaturesByIDsParameters({
  111811. IDs: ids,
  111812. datasetNames: datasetArr
  111813. });
  111814. } else if (getFeatureMode === 'SQL') {
  111815. var maxFeatures = maxFeaturesInput.value;
  111816. queryParam = new GetFeaturesBySQLParameters({
  111817. queryParameter: {
  111818. attributeFilter: attributeFilter
  111819. },
  111820. datasetNames: datasetArr,
  111821. maxFeatures: maxFeatures
  111822. });
  111823. } else if (getFeatureMode === 'BOUNDS') {
  111824. if (!bounds) {
  111825. var _value = JSON.parse(queryRangeTextArea.value);
  111826. bounds = external_L_default().bounds([_value.leftBottom.x, _value.leftBottom.y], [_value.rightTop.x, _value.rightTop.y]);
  111827. }
  111828. queryParam = new GetFeaturesByBoundsParameters({
  111829. attributeFilter: attributeFilter,
  111830. datasetNames: datasetArr,
  111831. bounds: bounds
  111832. });
  111833. } else if (getFeatureMode === 'BUFFER') {
  111834. var bufferDistance = bufferDistanceInput.value;
  111835. var defaultGeometryValue = JSON.parse(queryRangeTextArea.value);
  111836. var geometryLayer = resultLayer || defaultGeometryValue;
  111837. queryParam = new GetFeaturesByBufferParameters({
  111838. attributeFilter: attributeFilter,
  111839. datasetNames: datasetArr,
  111840. bufferDistance: bufferDistance,
  111841. geometry: geometryLayer
  111842. });
  111843. } else if (getFeatureMode === 'SPATIAL') {
  111844. var spatialQueryMode = spatialQueryModeSelectName.title;
  111845. var _defaultGeometryValue = JSON.parse(queryRangeTextArea.value);
  111846. var _geometryLayer = resultLayer || _defaultGeometryValue;
  111847. queryParam = new GetFeaturesByGeometryParameters({
  111848. attributeFilter: attributeFilter,
  111849. datasetNames: datasetArr,
  111850. spatialQueryMode: spatialQueryMode,
  111851. geometry: _geometryLayer
  111852. });
  111853. }
  111854. return queryParam;
  111855. }
  111856. //阻止 map 默认事件
  111857. this._preventMapEvent(container, this.map);
  111858. return container;
  111859. },
  111860. /**
  111861. * @function DataServiceQueryView.prototype._creatInputBox
  111862. * @description 创建含有 span 的 input 框。
  111863. * @private
  111864. */
  111865. _creatInputBox: function _creatInputBox(inputOptions, parentEle) {
  111866. var div = external_L_default().DomUtil.create('div', '', parentEle);
  111867. var span = external_L_default().DomUtil.create('span', '', div);
  111868. span.innerHTML = inputOptions.spanName;
  111869. var input = external_L_default().DomUtil.create('input', '', div);
  111870. input.value = inputOptions.value;
  111871. // input.className = 'distributeInput'
  111872. return div;
  111873. }
  111874. });
  111875. var dataServiceQueryView = function dataServiceQueryView(dataServiceUrl, dataSetNames, options) {
  111876. return new DataServiceQueryView(dataServiceUrl, dataSetNames, options);
  111877. };
  111878. ;// CONCATENATED MODULE: ./src/leaflet/components/index.js
  111879. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  111880. * This program are made available under the terms of the Apache License, Version 2.0
  111881. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  111882. ;// CONCATENATED MODULE: ./src/leaflet/index.js
  111883. /* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.
  111884. * This program are made available under the terms of the Apache License, Version 2.0
  111885. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  111886. ;// CONCATENATED MODULE: ./src/leaflet/namespace.js
  111887. function leaflet_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; }
  111888. function leaflet_namespace_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? leaflet_namespace_ownKeys(Object(source), !0).forEach(function (key) { leaflet_namespace_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : leaflet_namespace_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  111889. function leaflet_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; }
  111890. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  111891. * This program are made available under the terms of the Apache License, Version 2.0
  111892. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  111893. // 注:命名空间重复,内容会被覆盖
  111894. // 例如SuperMap.Components=>L.supermap.Componets,再写L.supermap.Componets = {}, SuprMap的Components就不会挂在L.supermap上了
  111895. // L.supermap.d3Layer是在别的地方挂上的
  111896. (external_L_default()).supermap = leaflet_namespace_objectSpread(leaflet_namespace_objectSpread({}, SuperMap), {}, {
  111897. Components: leaflet_namespace_objectSpread({}, SuperMap.Components)
  111898. }, (external_L_default()).supermap);
  111899. (external_L_default()).supermap.components = (external_L_default()).supermap.components || {};
  111900. (external_L_default()).supermap.Components = (external_L_default()).supermap.Components || {};
  111901. (external_L_default()).supermap.control = (external_L_default()).supermap.control || {};
  111902. (external_L_default()).supermap.Util = {};
  111903. // ./core
  111904. // L.Util.supermap_callbacks = coreUtil.supermap_callbacks;
  111905. (external_L_default()).Util.toGeoJSON = toGeoJSON;
  111906. (external_L_default()).supermap.Util.toGeoJSON = toGeoJSON;
  111907. (external_L_default()).Util.toSuperMapGeometry = Util_toSuperMapGeometry;
  111908. (external_L_default()).supermap.Util.toSuperMapGeometry = Util_toSuperMapGeometry;
  111909. (external_L_default()).Util.resolutionToScale = resolutionToScale;
  111910. (external_L_default()).supermap.Util.resolutionToScale = resolutionToScale;
  111911. (external_L_default()).Util.scaleToResolution = Util_scaleToResolution;
  111912. (external_L_default()).supermap.Util.scaleToResolution = Util_scaleToResolution;
  111913. (external_L_default()).Util.getMeterPerMapUnit = Util_getMeterPerMapUnit;
  111914. (external_L_default()).supermap.Util.getMeterPerMapUnit = Util_getMeterPerMapUnit;
  111915. (external_L_default()).Util.GetResolutionFromScaleDpi = getResolutionFromScaleDpi;
  111916. (external_L_default()).supermap.Util.getResolutionFromScaleDpi = getResolutionFromScaleDpi;
  111917. (external_L_default()).supermap.Util.GetResolutionFromScaleDpi = getResolutionFromScaleDpi;
  111918. (external_L_default()).Util.NormalizeScale = normalizeScale;
  111919. (external_L_default()).supermap.Util.normalizeScale = normalizeScale;
  111920. (external_L_default()).supermap.Util.NormalizeScale = normalizeScale;
  111921. (external_L_default()).Util.transform = transform;
  111922. (external_L_default()).supermap.Util.transform = transform;
  111923. // L.Proj4Leaflet
  111924. (external_L_default()).Proj = (external_L_default()).Proj || {};
  111925. (external_L_default()).supermap.Proj = (external_L_default()).supermap.Proj || {};
  111926. (external_L_default()).Proj.CRS = crs;
  111927. (external_L_default()).supermap.Proj.crs = crs;
  111928. (external_L_default()).supermap.Proj.CRS = CRS;
  111929. // core/NonEarthCRS
  111930. (external_L_default()).Projection = {};
  111931. (external_L_default()).supermap.Projection = (external_L_default()).supermap.Projection || {};
  111932. (external_L_default()).Projection.NonProjection = nonProjection;
  111933. (external_L_default()).supermap.Projection.nonProjection = nonProjection;
  111934. (external_L_default()).supermap.Projection.NonProjection = NonProjection;
  111935. (external_L_default()).supermap.CRS = (external_L_default()).supermap.CRS || {};
  111936. (external_L_default()).CRS.NonEarthCRS = nonEarthCRS;
  111937. (external_L_default()).supermap.CRS.NonEarthCRS = NonEarthCRS;
  111938. (external_L_default()).supermap.CRS.nonEarthCRS = nonEarthCRS;
  111939. // core/ExtendsCRS
  111940. (external_L_default()).CRS.BaiduCRS = BaiduCRS;
  111941. (external_L_default()).supermap.CRS.BaiduCRS = BaiduCRS;
  111942. (external_L_default()).CRS.TianDiTu_WGS84CRS = TianDiTu_WGS84CRS;
  111943. (external_L_default()).supermap.CRS.TianDiTu_WGS84CRS = TianDiTu_WGS84CRS;
  111944. (external_L_default()).CRS.TianDiTu_MercatorCRS = TianDiTu_MercatorCRS;
  111945. (external_L_default()).supermap.CRS.TianDiTu_MercatorCRS = TianDiTu_MercatorCRS;
  111946. (external_L_default()).CRS.TianDiTu_Mercator = TianDiTu_MercatorCRS;
  111947. (external_L_default()).supermap.CRS.TianDiTu_Mercator = TianDiTu_MercatorCRS;
  111948. (external_L_default()).CRS.TianDiTu_WGS84 = TianDiTu_WGS84CRS;
  111949. (external_L_default()).supermap.CRS.TianDiTu_WGS84 = TianDiTu_WGS84CRS;
  111950. (external_L_default()).CRS.Baidu = BaiduCRS;
  111951. (external_L_default()).supermap.CRS.Baidu = BaiduCRS;
  111952. (external_L_default()).supermap.CommontypesConversion = CommontypesConversion;
  111953. // components
  111954. (external_L_default()).supermap.components.clientComputationLayer = clientComputationLayer;
  111955. (external_L_default()).supermap.Components.ClientComputationLayer = ClientComputationLayer;
  111956. (external_L_default()).supermap.components.clientComputation = clientComputationView;
  111957. (external_L_default()).supermap.Components.ClientComputation = ClientComputationView;
  111958. (external_L_default()).supermap.components.clientComputationViewModel = clientComputationViewModel;
  111959. (external_L_default()).supermap.Components.ClientComputationViewModel = ClientComputationViewModel;
  111960. (external_L_default()).supermap.components.geoJSONLayerWithName = geoJSONLayerWithName;
  111961. (external_L_default()).supermap.Components.GeoJSONLayerWithName = GeoJSONLayerWithName;
  111962. (external_L_default()).supermap.components.GeoJsonLayersDataModel = GeoJsonLayersDataModel;
  111963. (external_L_default()).supermap.Components.GeoJsonLayersDataModel = GeoJsonLayersDataModel;
  111964. (external_L_default()).supermap.components.dataFlow = dataFlowView;
  111965. (external_L_default()).supermap.Components.DataFlow = DataFlowView;
  111966. (external_L_default()).supermap.components.dataFlowViewModel = dataFlowViewModel;
  111967. (external_L_default()).supermap.Components.DataFlowViewModel = DataFlowViewModel;
  111968. (external_L_default()).supermap.components.dataServiceQuery = dataServiceQueryView;
  111969. (external_L_default()).supermap.Components.DataServiceQuery = DataServiceQueryView;
  111970. (external_L_default()).supermap.components.dataServiceQueryViewModel = dataServiceQueryViewModel;
  111971. (external_L_default()).supermap.Components.DataServiceQueryViewModel = DataServiceQueryViewModel;
  111972. (external_L_default()).supermap.components.DistributedAnalysisModel = DistributedAnalysisModel;
  111973. (external_L_default()).supermap.Components.DistributedAnalysisModel = DistributedAnalysisModel;
  111974. (external_L_default()).supermap.components.distributedAnalysis = distributedAnalysisView;
  111975. (external_L_default()).supermap.Components.DistributedAnalysis = DistributedAnalysisView;
  111976. (external_L_default()).supermap.components.distributedAnalysisViewModel = distributedAnalysisViewModel;
  111977. (external_L_default()).supermap.Components.DistributedAnalysisViewModel = DistributedAnalysisViewModel;
  111978. (external_L_default()).supermap.components.openFile = openFileView;
  111979. (external_L_default()).supermap.Components.OpenFile = OpenFileView;
  111980. (external_L_default()).supermap.components.openFileViewModel = openFileViewModel;
  111981. (external_L_default()).supermap.Components.OpenFileViewModel = OpenFileViewModel;
  111982. (external_L_default()).supermap.components.search = searchView;
  111983. (external_L_default()).supermap.Components.Search = SearchView;
  111984. (external_L_default()).supermap.components.searchViewModel = searchViewModel;
  111985. (external_L_default()).supermap.Components.SearchViewModel = SearchViewModel;
  111986. (external_L_default()).supermap.components.componentsViewBase = componentsViewBase;
  111987. (external_L_default()).supermap.Components.ComponentsViewBase = ComponentsViewBase;
  111988. // control
  111989. (external_L_default()).supermap.control.changeTileVersion = changeTileVersion;
  111990. (external_L_default()).supermap.control.ChangeTileVersion = ChangeTileVersion;
  111991. (external_L_default()).supermap.control.logo = logo;
  111992. (external_L_default()).supermap.control.Logo = Logo;
  111993. // mapping
  111994. (external_L_default()).supermap.baiduTileLayer = baiduTileLayer;
  111995. (external_L_default()).supermap.BaiduTileLayer = BaiduTileLayer;
  111996. (external_L_default()).supermap.cloudTileLayer = cloudTileLayer;
  111997. (external_L_default()).supermap.CloudTileLayer = CloudTileLayer;
  111998. (external_L_default()).supermap.imageMapLayer = imageMapLayer;
  111999. (external_L_default()).supermap.ImageMapLayer = ImageMapLayer;
  112000. (external_L_default()).supermap.imageTileLayer = imageTileLayer;
  112001. (external_L_default()).supermap.ImageTileLayer = ImageTileLayer;
  112002. (external_L_default()).supermap.tiandituTileLayer = tiandituTileLayer;
  112003. (external_L_default()).supermap.TiandituTileLayer = TiandituTileLayer;
  112004. (external_L_default()).supermap.tiledMapLayer = tiledMapLayer;
  112005. (external_L_default()).supermap.TiledMapLayer = TiledMapLayer;
  112006. (external_L_default()).supermap.wmtsLayer = wmtsLayer;
  112007. (external_L_default()).supermap.WMTSLayer = WMTSLayer;
  112008. (external_L_default()).supermap.webmap = webMap;
  112009. (external_L_default()).supermap.WebMap = WebMap;
  112010. (external_L_default()).supermap.initMap = initMap;
  112011. (external_L_default()).supermap.crsFromMapJSON = crsFromMapJSON;
  112012. // overlay
  112013. (external_L_default()).supermap.CartoCSSToLeaflet = CartoCSSToLeaflet;
  112014. (external_L_default()).supermap.DefaultStyle = DefaultStyle;
  112015. (external_L_default()).supermap.CartoStyleMap = CartoStyleMap;
  112016. (external_L_default()).supermap.ServerStyleMap = ServerStyleMap;
  112017. (external_L_default()).supermap.CompOpMap = CompOpMap;
  112018. (external_L_default()).supermap.circleStyle = circleStyle;
  112019. (external_L_default()).supermap.CircleStyle = CircleStyle;
  112020. (external_L_default()).supermap.cloverStyle = cloverStyle;
  112021. (external_L_default()).supermap.CloverStyle = CloverStyle;
  112022. (external_L_default()).supermap.graphic = graphic;
  112023. (external_L_default()).supermap.Graphic = Graphic;
  112024. (external_L_default()).supermap.imageStyle = imageStyle;
  112025. (external_L_default()).supermap.ImageStyle = ImageStyle;
  112026. (external_L_default()).supermap.themeFeature = themeFeature;
  112027. (external_L_default()).supermap.ThemeFeature = ThemeFeature;
  112028. (external_L_default()).supermap.dataFlowLayer = dataFlowLayer;
  112029. (external_L_default()).supermap.DataFlowLayer = DataFlowLayer;
  112030. (external_L_default()).supermap.echartsLayer = echartsLayer;
  112031. (external_L_default()).supermap.EchartsLayer = EchartsLayer;
  112032. (external_L_default()).supermap.graphicLayer = graphicLayer;
  112033. (external_L_default()).supermap.GraphicLayer = GraphicLayer;
  112034. (external_L_default()).supermap.graphThemeLayer = graphThemeLayer;
  112035. (external_L_default()).supermap.GraphThemeLayer = GraphThemeLayer;
  112036. (external_L_default()).supermap.heatMapFeature = heatMapFeature;
  112037. (external_L_default()).supermap.HeatMapFeature = HeatMapFeature;
  112038. (external_L_default()).supermap.heatMapLayer = heatMapLayer;
  112039. (external_L_default()).supermap.HeatMapLayer = HeatMapLayer;
  112040. (external_L_default()).supermap.labelThemeLayer = labelThemeLayer;
  112041. (external_L_default()).supermap.LabelThemeLayer = LabelThemeLayer;
  112042. (external_L_default()).supermap.mapVLayer = mapVLayer;
  112043. (external_L_default()).supermap.MapVLayer = MapVLayer;
  112044. (external_L_default()).supermap.rangeThemeLayer = rangeThemeLayer;
  112045. (external_L_default()).supermap.RangeThemeLayer = RangeThemeLayer;
  112046. (external_L_default()).supermap.rankSymbolThemeLayer = rankSymbolThemeLayer;
  112047. (external_L_default()).supermap.RankSymbolThemeLayer = RankSymbolThemeLayer;
  112048. (external_L_default()).supermap.tiledVectorLayer = tiledVectorLayer;
  112049. (external_L_default()).supermap.TileVectorLayer = TiledVectorLayer;
  112050. (external_L_default()).supermap.TiledVectorLayer = TiledVectorLayer;
  112051. (external_L_default()).supermap.turfLayer = turfLayer;
  112052. (external_L_default()).supermap.TurfLayer = TurfLayer;
  112053. (external_L_default()).supermap.FGBLayer = FGBLayer;
  112054. (external_L_default()).supermap.FGBLayer = fgbLayer;
  112055. (external_L_default()).supermap.unicodeMarker = unicodeMarker;
  112056. (external_L_default()).supermap.UnicodeMarker = UnicodeMarker;
  112057. (external_L_default()).supermap.uniqueThemeLayer = uniqueThemeLayer;
  112058. (external_L_default()).supermap.UniqueThemeLayer = UniqueThemeLayer;
  112059. (external_L_default()).supermap.VectorTileFormat = VectorTileFormat;
  112060. (external_L_default()).supermap.addressMatchService = addressMatchService;
  112061. (external_L_default()).supermap.AddressMatchService = AddressMatchService_AddressMatchService;
  112062. (external_L_default()).supermap.chartService = chartService;
  112063. (external_L_default()).supermap.ChartService = ChartService_ChartService;
  112064. (external_L_default()).supermap.dataFlowService = dataFlowService;
  112065. (external_L_default()).supermap.DataFlowService = DataFlowService_DataFlowService;
  112066. (external_L_default()).supermap.datasetService = datasetService;
  112067. (external_L_default()).supermap.DatasetService = DatasetService_DatasetService;
  112068. (external_L_default()).supermap.datasourceService = datasourceService;
  112069. (external_L_default()).supermap.DatasourceService = DatasourceService_DatasourceService;
  112070. (external_L_default()).supermap.featureService = FeatureService_featureService;
  112071. (external_L_default()).supermap.FeatureService = FeatureService_FeatureService;
  112072. (external_L_default()).supermap.fieldService = fieldService;
  112073. (external_L_default()).supermap.FieldService = FieldService_FieldService;
  112074. (external_L_default()).supermap.geoprocessingService = geoprocessingService;
  112075. (external_L_default()).supermap.GeoprocessingService = GeoprocessingService_GeoprocessingService;
  112076. (external_L_default()).supermap.gridCellInfosService = gridCellInfosService;
  112077. (external_L_default()).supermap.GridCellInfosService = GridCellInfosService;
  112078. (external_L_default()).supermap.imageCollectionService = imageCollectionService;
  112079. (external_L_default()).supermap.ImageCollectionService = ImageCollectionService_ImageCollectionService;
  112080. (external_L_default()).supermap.imageService = imageService;
  112081. (external_L_default()).supermap.ImageService = ImageService_ImageService;
  112082. (external_L_default()).supermap.layerInfoService = layerInfoService;
  112083. (external_L_default()).supermap.LayerInfoService = LayerInfoService_LayerInfoService;
  112084. (external_L_default()).supermap.mapService = mapService;
  112085. (external_L_default()).supermap.MapService = MapService_MapService;
  112086. (external_L_default()).supermap.measureService = measureService;
  112087. (external_L_default()).supermap.MeasureService = MeasureService_MeasureService;
  112088. (external_L_default()).supermap.networkAnalyst3DService = networkAnalyst3DService;
  112089. (external_L_default()).supermap.NetworkAnalyst3DService = NetworkAnalyst3DService_NetworkAnalyst3DService;
  112090. (external_L_default()).supermap.networkAnalystService = networkAnalystService;
  112091. (external_L_default()).supermap.NetworkAnalystService = NetworkAnalystService_NetworkAnalystService;
  112092. (external_L_default()).supermap.processingService = processingService;
  112093. (external_L_default()).supermap.ProcessingService = ProcessingService_ProcessingService;
  112094. (external_L_default()).supermap.queryService = queryService;
  112095. (external_L_default()).supermap.QueryService = QueryService_QueryService;
  112096. (external_L_default()).supermap.ServiceBase = ServiceBase;
  112097. (external_L_default()).supermap.spatialAnalystService = spatialAnalystService;
  112098. (external_L_default()).supermap.SpatialAnalystService = SpatialAnalystService_SpatialAnalystService;
  112099. (external_L_default()).supermap.themeService = themeService;
  112100. (external_L_default()).supermap.ThemeService = ThemeService_ThemeService;
  112101. (external_L_default()).supermap.trafficTransferAnalystService = trafficTransferAnalystService;
  112102. (external_L_default()).supermap.TrafficTransferAnalystService = TrafficTransferAnalystService_TrafficTransferAnalystService;
  112103. (external_L_default()).supermap.webPrintingJobService = webPrintingJobService;
  112104. (external_L_default()).supermap.WebPrintingJobService = WebPrintingJobService;
  112105. (external_L_default()).supermap.KnowledgeGraphService = KnowledgeGraphService_KnowledgeGraphService;
  112106. (external_L_default()).supermap.GraphMap = GraphMap;
  112107. // 处理命名空间重名
  112108. (external_L_default()).supermap.CommonUtil = Util_Util;
  112109. /***/ }),
  112110. /***/ 1351:
  112111. /***/ (function(__unused_webpack_module, exports) {
  112112. "use strict";
  112113. var __webpack_unused_export__;
  112114. __webpack_unused_export__ = ({
  112115. value: true
  112116. });
  112117. /*! *****************************************************************************
  112118. Copyright (c) Microsoft Corporation.
  112119. Permission to use, copy, modify, and/or distribute this software for any
  112120. purpose with or without fee is hereby granted.
  112121. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  112122. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  112123. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  112124. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  112125. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  112126. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  112127. PERFORMANCE OF THIS SOFTWARE.
  112128. ***************************************************************************** */
  112129. /* global Reflect, Promise */
  112130. var _extendStatics = function extendStatics(d, b) {
  112131. _extendStatics = Object.setPrototypeOf || {
  112132. __proto__: []
  112133. } instanceof Array && function (d, b) {
  112134. d.__proto__ = b;
  112135. } || function (d, b) {
  112136. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  112137. };
  112138. return _extendStatics(d, b);
  112139. };
  112140. function __extends(d, b) {
  112141. _extendStatics(d, b);
  112142. function __() {
  112143. this.constructor = d;
  112144. }
  112145. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  112146. }
  112147. function __awaiter(thisArg, _arguments, P, generator) {
  112148. function adopt(value) {
  112149. return value instanceof P ? value : new P(function (resolve) {
  112150. resolve(value);
  112151. });
  112152. }
  112153. return new (P || (P = Promise))(function (resolve, reject) {
  112154. function fulfilled(value) {
  112155. try {
  112156. step(generator.next(value));
  112157. } catch (e) {
  112158. reject(e);
  112159. }
  112160. }
  112161. function rejected(value) {
  112162. try {
  112163. step(generator["throw"](value));
  112164. } catch (e) {
  112165. reject(e);
  112166. }
  112167. }
  112168. function step(result) {
  112169. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  112170. }
  112171. step((generator = generator.apply(thisArg, _arguments || [])).next());
  112172. });
  112173. }
  112174. function __generator(thisArg, body) {
  112175. var _ = {
  112176. label: 0,
  112177. sent: function sent() {
  112178. if (t[0] & 1) throw t[1];
  112179. return t[1];
  112180. },
  112181. trys: [],
  112182. ops: []
  112183. },
  112184. f,
  112185. y,
  112186. t,
  112187. g;
  112188. return g = {
  112189. next: verb(0),
  112190. "throw": verb(1),
  112191. "return": verb(2)
  112192. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  112193. return this;
  112194. }), g;
  112195. function verb(n) {
  112196. return function (v) {
  112197. return step([n, v]);
  112198. };
  112199. }
  112200. function step(op) {
  112201. if (f) throw new TypeError("Generator is already executing.");
  112202. while (_) try {
  112203. 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;
  112204. if (y = 0, t) op = [op[0] & 2, t.value];
  112205. switch (op[0]) {
  112206. case 0:
  112207. case 1:
  112208. t = op;
  112209. break;
  112210. case 4:
  112211. _.label++;
  112212. return {
  112213. value: op[1],
  112214. done: false
  112215. };
  112216. case 5:
  112217. _.label++;
  112218. y = op[1];
  112219. op = [0];
  112220. continue;
  112221. case 7:
  112222. op = _.ops.pop();
  112223. _.trys.pop();
  112224. continue;
  112225. default:
  112226. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  112227. _ = 0;
  112228. continue;
  112229. }
  112230. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  112231. _.label = op[1];
  112232. break;
  112233. }
  112234. if (op[0] === 6 && _.label < t[1]) {
  112235. _.label = t[1];
  112236. t = op;
  112237. break;
  112238. }
  112239. if (t && _.label < t[2]) {
  112240. _.label = t[2];
  112241. _.ops.push(op);
  112242. break;
  112243. }
  112244. if (t[2]) _.ops.pop();
  112245. _.trys.pop();
  112246. continue;
  112247. }
  112248. op = body.call(thisArg, _);
  112249. } catch (e) {
  112250. op = [6, e];
  112251. y = 0;
  112252. } finally {
  112253. f = t = 0;
  112254. }
  112255. if (op[0] & 5) throw op[1];
  112256. return {
  112257. value: op[0] ? op[1] : void 0,
  112258. done: true
  112259. };
  112260. }
  112261. }
  112262. function __values(o) {
  112263. var s = typeof Symbol === "function" && Symbol.iterator,
  112264. m = s && o[s],
  112265. i = 0;
  112266. if (m) return m.call(o);
  112267. if (o && typeof o.length === "number") return {
  112268. next: function next() {
  112269. if (o && i >= o.length) o = void 0;
  112270. return {
  112271. value: o && o[i++],
  112272. done: !o
  112273. };
  112274. }
  112275. };
  112276. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  112277. }
  112278. function __await(v) {
  112279. return this instanceof __await ? (this.v = v, this) : new __await(v);
  112280. }
  112281. function __asyncGenerator(thisArg, _arguments, generator) {
  112282. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  112283. var g = generator.apply(thisArg, _arguments || []),
  112284. i,
  112285. q = [];
  112286. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
  112287. return this;
  112288. }, i;
  112289. function verb(n) {
  112290. if (g[n]) i[n] = function (v) {
  112291. return new Promise(function (a, b) {
  112292. q.push([n, v, a, b]) > 1 || resume(n, v);
  112293. });
  112294. };
  112295. }
  112296. function resume(n, v) {
  112297. try {
  112298. step(g[n](v));
  112299. } catch (e) {
  112300. settle(q[0][3], e);
  112301. }
  112302. }
  112303. function step(r) {
  112304. r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
  112305. }
  112306. function fulfill(value) {
  112307. resume("next", value);
  112308. }
  112309. function reject(value) {
  112310. resume("throw", value);
  112311. }
  112312. function settle(f, v) {
  112313. if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
  112314. }
  112315. }
  112316. /** An error subclass which is thrown when there are too many pending push or next operations on a single repeater. */
  112317. var RepeaterOverflowError = /** @class */function (_super) {
  112318. __extends(RepeaterOverflowError, _super);
  112319. function RepeaterOverflowError(message) {
  112320. var _this = _super.call(this, message) || this;
  112321. Object.defineProperty(_this, "name", {
  112322. value: "RepeaterOverflowError",
  112323. enumerable: false
  112324. });
  112325. if (typeof Object.setPrototypeOf === "function") {
  112326. Object.setPrototypeOf(_this, _this.constructor.prototype);
  112327. } else {
  112328. _this.__proto__ = _this.constructor.prototype;
  112329. }
  112330. if (typeof Error.captureStackTrace === "function") {
  112331. Error.captureStackTrace(_this, _this.constructor);
  112332. }
  112333. return _this;
  112334. }
  112335. return RepeaterOverflowError;
  112336. }(Error);
  112337. /** A buffer which allows you to push a set amount of values to the repeater without pushes waiting or throwing errors. */
  112338. var FixedBuffer = /** @class */function () {
  112339. function FixedBuffer(capacity) {
  112340. if (capacity < 0) {
  112341. throw new RangeError("Capacity may not be less than 0");
  112342. }
  112343. this._c = capacity;
  112344. this._q = [];
  112345. }
  112346. Object.defineProperty(FixedBuffer.prototype, "empty", {
  112347. get: function get() {
  112348. return this._q.length === 0;
  112349. },
  112350. enumerable: false,
  112351. configurable: true
  112352. });
  112353. Object.defineProperty(FixedBuffer.prototype, "full", {
  112354. get: function get() {
  112355. return this._q.length >= this._c;
  112356. },
  112357. enumerable: false,
  112358. configurable: true
  112359. });
  112360. FixedBuffer.prototype.add = function (value) {
  112361. if (this.full) {
  112362. throw new Error("Buffer full");
  112363. } else {
  112364. this._q.push(value);
  112365. }
  112366. };
  112367. FixedBuffer.prototype.remove = function () {
  112368. if (this.empty) {
  112369. throw new Error("Buffer empty");
  112370. }
  112371. return this._q.shift();
  112372. };
  112373. return FixedBuffer;
  112374. }();
  112375. // TODO: Use a circular buffer here.
  112376. /** 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. */
  112377. var SlidingBuffer = /** @class */function () {
  112378. function SlidingBuffer(capacity) {
  112379. if (capacity < 1) {
  112380. throw new RangeError("Capacity may not be less than 1");
  112381. }
  112382. this._c = capacity;
  112383. this._q = [];
  112384. }
  112385. Object.defineProperty(SlidingBuffer.prototype, "empty", {
  112386. get: function get() {
  112387. return this._q.length === 0;
  112388. },
  112389. enumerable: false,
  112390. configurable: true
  112391. });
  112392. Object.defineProperty(SlidingBuffer.prototype, "full", {
  112393. get: function get() {
  112394. return false;
  112395. },
  112396. enumerable: false,
  112397. configurable: true
  112398. });
  112399. SlidingBuffer.prototype.add = function (value) {
  112400. while (this._q.length >= this._c) {
  112401. this._q.shift();
  112402. }
  112403. this._q.push(value);
  112404. };
  112405. SlidingBuffer.prototype.remove = function () {
  112406. if (this.empty) {
  112407. throw new Error("Buffer empty");
  112408. }
  112409. return this._q.shift();
  112410. };
  112411. return SlidingBuffer;
  112412. }();
  112413. /** 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. */
  112414. var DroppingBuffer = /** @class */function () {
  112415. function DroppingBuffer(capacity) {
  112416. if (capacity < 1) {
  112417. throw new RangeError("Capacity may not be less than 1");
  112418. }
  112419. this._c = capacity;
  112420. this._q = [];
  112421. }
  112422. Object.defineProperty(DroppingBuffer.prototype, "empty", {
  112423. get: function get() {
  112424. return this._q.length === 0;
  112425. },
  112426. enumerable: false,
  112427. configurable: true
  112428. });
  112429. Object.defineProperty(DroppingBuffer.prototype, "full", {
  112430. get: function get() {
  112431. return false;
  112432. },
  112433. enumerable: false,
  112434. configurable: true
  112435. });
  112436. DroppingBuffer.prototype.add = function (value) {
  112437. if (this._q.length < this._c) {
  112438. this._q.push(value);
  112439. }
  112440. };
  112441. DroppingBuffer.prototype.remove = function () {
  112442. if (this.empty) {
  112443. throw new Error("Buffer empty");
  112444. }
  112445. return this._q.shift();
  112446. };
  112447. return DroppingBuffer;
  112448. }();
  112449. /** Makes sure promise-likes don’t cause unhandled rejections. */
  112450. function swallow(value) {
  112451. if (value != null && typeof value.then === "function") {
  112452. value.then(NOOP, NOOP);
  112453. }
  112454. }
  112455. /*** REPEATER STATES ***/
  112456. /** The following is an enumeration of all possible repeater states. These states are ordered, and a repeater may only advance to higher states. */
  112457. /** The initial state of the repeater. */
  112458. var Initial = 0;
  112459. /** Repeaters advance to this state the first time the next method is called on the repeater. */
  112460. var Started = 1;
  112461. /** Repeaters advance to this state when the stop function is called. */
  112462. var Stopped = 2;
  112463. /** Repeaters advance to this state when there are no values left to be pulled from the repeater. */
  112464. var Done = 3;
  112465. /** Repeaters advance to this state if an error is thrown into the repeater. */
  112466. var Rejected = 4;
  112467. /** The maximum number of push or next operations which may exist on a single repeater. */
  112468. var MAX_QUEUE_LENGTH = 1024;
  112469. var NOOP = function NOOP() {};
  112470. /** A helper function used to mimic the behavior of async generators where the final iteration is consumed. */
  112471. function consumeExecution(r) {
  112472. var err = r.err;
  112473. var execution = Promise.resolve(r.execution).then(function (value) {
  112474. if (err != null) {
  112475. throw err;
  112476. }
  112477. return value;
  112478. });
  112479. r.err = undefined;
  112480. r.execution = execution.then(function () {
  112481. return undefined;
  112482. }, function () {
  112483. return undefined;
  112484. });
  112485. return r.pending === undefined ? execution : r.pending.then(function () {
  112486. return execution;
  112487. });
  112488. }
  112489. /** A helper function for building iterations from values. Promises are unwrapped, so that iterations never have their value property set to a promise. */
  112490. function createIteration(r, value) {
  112491. var done = r.state >= Done;
  112492. return Promise.resolve(value).then(function (value) {
  112493. if (!done && r.state >= Rejected) {
  112494. return consumeExecution(r).then(function (value) {
  112495. return {
  112496. value: value,
  112497. done: true
  112498. };
  112499. });
  112500. }
  112501. return {
  112502. value: value,
  112503. done: done
  112504. };
  112505. });
  112506. }
  112507. /**
  112508. * This function is bound and passed to the executor as the stop argument.
  112509. *
  112510. * Advances state to Stopped.
  112511. */
  112512. function stop(r, err) {
  112513. var e_1, _a;
  112514. if (r.state >= Stopped) {
  112515. return;
  112516. }
  112517. r.state = Stopped;
  112518. r.onnext();
  112519. r.onstop();
  112520. if (r.err == null) {
  112521. r.err = err;
  112522. }
  112523. if (r.pushes.length === 0 && (typeof r.buffer === "undefined" || r.buffer.empty)) {
  112524. finish(r);
  112525. } else {
  112526. try {
  112527. for (var _b = __values(r.pushes), _d = _b.next(); !_d.done; _d = _b.next()) {
  112528. var push_1 = _d.value;
  112529. push_1.resolve();
  112530. }
  112531. } catch (e_1_1) {
  112532. e_1 = {
  112533. error: e_1_1
  112534. };
  112535. } finally {
  112536. try {
  112537. if (_d && !_d.done && (_a = _b["return"])) _a.call(_b);
  112538. } finally {
  112539. if (e_1) throw e_1.error;
  112540. }
  112541. }
  112542. }
  112543. }
  112544. /**
  112545. * 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.
  112546. *
  112547. * Advances state to Done.
  112548. */
  112549. function finish(r) {
  112550. var e_2, _a;
  112551. if (r.state >= Done) {
  112552. return;
  112553. }
  112554. if (r.state < Stopped) {
  112555. stop(r);
  112556. }
  112557. r.state = Done;
  112558. r.buffer = undefined;
  112559. try {
  112560. for (var _b = __values(r.nexts), _d = _b.next(); !_d.done; _d = _b.next()) {
  112561. var next = _d.value;
  112562. var execution = r.pending === undefined ? consumeExecution(r) : r.pending.then(function () {
  112563. return consumeExecution(r);
  112564. });
  112565. next.resolve(createIteration(r, execution));
  112566. }
  112567. } catch (e_2_1) {
  112568. e_2 = {
  112569. error: e_2_1
  112570. };
  112571. } finally {
  112572. try {
  112573. if (_d && !_d.done && (_a = _b["return"])) _a.call(_b);
  112574. } finally {
  112575. if (e_2) throw e_2.error;
  112576. }
  112577. }
  112578. r.pushes = [];
  112579. r.nexts = [];
  112580. }
  112581. /**
  112582. * Called when a promise passed to push rejects, or when a push call is unhandled.
  112583. *
  112584. * Advances state to Rejected.
  112585. */
  112586. function reject(r) {
  112587. if (r.state >= Rejected) {
  112588. return;
  112589. }
  112590. if (r.state < Done) {
  112591. finish(r);
  112592. }
  112593. r.state = Rejected;
  112594. }
  112595. /** This function is bound and passed to the executor as the push argument. */
  112596. function push(r, value) {
  112597. swallow(value);
  112598. if (r.pushes.length >= MAX_QUEUE_LENGTH) {
  112599. throw new RepeaterOverflowError("No more than " + MAX_QUEUE_LENGTH + " pending calls to push are allowed on a single repeater.");
  112600. } else if (r.state >= Stopped) {
  112601. return Promise.resolve(undefined);
  112602. }
  112603. var valueP = r.pending === undefined ? Promise.resolve(value) : r.pending.then(function () {
  112604. return value;
  112605. });
  112606. valueP = valueP["catch"](function (err) {
  112607. if (r.state < Stopped) {
  112608. r.err = err;
  112609. }
  112610. reject(r);
  112611. return undefined; // void :(
  112612. });
  112613. var nextP;
  112614. if (r.nexts.length) {
  112615. var next_1 = r.nexts.shift();
  112616. next_1.resolve(createIteration(r, valueP));
  112617. if (r.nexts.length) {
  112618. nextP = Promise.resolve(r.nexts[0].value);
  112619. } else {
  112620. nextP = new Promise(function (resolve) {
  112621. return r.onnext = resolve;
  112622. });
  112623. }
  112624. } else if (typeof r.buffer !== "undefined" && !r.buffer.full) {
  112625. r.buffer.add(valueP);
  112626. nextP = Promise.resolve(undefined);
  112627. } else {
  112628. nextP = new Promise(function (resolve) {
  112629. return r.pushes.push({
  112630. resolve: resolve,
  112631. value: valueP
  112632. });
  112633. });
  112634. }
  112635. // 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.
  112636. // 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.
  112637. var floating = true;
  112638. var next = {};
  112639. var unhandled = nextP["catch"](function (err) {
  112640. if (floating) {
  112641. throw err;
  112642. }
  112643. return undefined; // void :(
  112644. });
  112645. next.then = function (onfulfilled, onrejected) {
  112646. floating = false;
  112647. return Promise.prototype.then.call(nextP, onfulfilled, onrejected);
  112648. };
  112649. next["catch"] = function (onrejected) {
  112650. floating = false;
  112651. return Promise.prototype["catch"].call(nextP, onrejected);
  112652. };
  112653. next["finally"] = nextP["finally"].bind(nextP);
  112654. r.pending = valueP.then(function () {
  112655. return unhandled;
  112656. })["catch"](function (err) {
  112657. r.err = err;
  112658. reject(r);
  112659. });
  112660. return next;
  112661. }
  112662. /**
  112663. * Creates the stop callable promise which is passed to the executor
  112664. */
  112665. function createStop(r) {
  112666. var stop1 = stop.bind(null, r);
  112667. var stopP = new Promise(function (resolve) {
  112668. return r.onstop = resolve;
  112669. });
  112670. stop1.then = stopP.then.bind(stopP);
  112671. stop1["catch"] = stopP["catch"].bind(stopP);
  112672. stop1["finally"] = stopP["finally"].bind(stopP);
  112673. return stop1;
  112674. }
  112675. /**
  112676. * Calls the executor passed into the constructor. This function is called the first time the next method is called on the repeater.
  112677. *
  112678. * Advances state to Started.
  112679. */
  112680. function execute(r) {
  112681. if (r.state >= Started) {
  112682. return;
  112683. }
  112684. r.state = Started;
  112685. var push1 = push.bind(null, r);
  112686. var stop1 = createStop(r);
  112687. r.execution = new Promise(function (resolve) {
  112688. return resolve(r.executor(push1, stop1));
  112689. });
  112690. // TODO: We should consider stopping all repeaters when the executor settles.
  112691. r.execution["catch"](function () {
  112692. return stop(r);
  112693. });
  112694. }
  112695. var records = new WeakMap();
  112696. // 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.
  112697. var Repeater = /** @class */function () {
  112698. function Repeater(executor, buffer) {
  112699. records.set(this, {
  112700. executor: executor,
  112701. buffer: buffer,
  112702. err: undefined,
  112703. state: Initial,
  112704. pushes: [],
  112705. nexts: [],
  112706. pending: undefined,
  112707. execution: undefined,
  112708. onnext: NOOP,
  112709. onstop: NOOP
  112710. });
  112711. }
  112712. Repeater.prototype.next = function (value) {
  112713. swallow(value);
  112714. var r = records.get(this);
  112715. if (r === undefined) {
  112716. throw new Error("WeakMap error");
  112717. }
  112718. if (r.nexts.length >= MAX_QUEUE_LENGTH) {
  112719. throw new RepeaterOverflowError("No more than " + MAX_QUEUE_LENGTH + " pending calls to next are allowed on a single repeater.");
  112720. }
  112721. if (r.state <= Initial) {
  112722. execute(r);
  112723. }
  112724. r.onnext(value);
  112725. if (typeof r.buffer !== "undefined" && !r.buffer.empty) {
  112726. var result = createIteration(r, r.buffer.remove());
  112727. if (r.pushes.length) {
  112728. var push_2 = r.pushes.shift();
  112729. r.buffer.add(push_2.value);
  112730. r.onnext = push_2.resolve;
  112731. }
  112732. return result;
  112733. } else if (r.pushes.length) {
  112734. var push_3 = r.pushes.shift();
  112735. r.onnext = push_3.resolve;
  112736. return createIteration(r, push_3.value);
  112737. } else if (r.state >= Stopped) {
  112738. finish(r);
  112739. return createIteration(r, consumeExecution(r));
  112740. }
  112741. return new Promise(function (resolve) {
  112742. return r.nexts.push({
  112743. resolve: resolve,
  112744. value: value
  112745. });
  112746. });
  112747. };
  112748. Repeater.prototype["return"] = function (value) {
  112749. swallow(value);
  112750. var r = records.get(this);
  112751. if (r === undefined) {
  112752. throw new Error("WeakMap error");
  112753. }
  112754. finish(r);
  112755. // We override the execution because return should always return the value passed in.
  112756. r.execution = Promise.resolve(r.execution).then(function () {
  112757. return value;
  112758. });
  112759. return createIteration(r, consumeExecution(r));
  112760. };
  112761. Repeater.prototype["throw"] = function (err) {
  112762. var r = records.get(this);
  112763. if (r === undefined) {
  112764. throw new Error("WeakMap error");
  112765. }
  112766. if (r.state <= Initial || r.state >= Stopped || typeof r.buffer !== "undefined" && !r.buffer.empty) {
  112767. finish(r);
  112768. // 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.
  112769. if (r.err == null) {
  112770. r.err = err;
  112771. }
  112772. return createIteration(r, consumeExecution(r));
  112773. }
  112774. return this.next(Promise.reject(err));
  112775. };
  112776. Repeater.prototype[Symbol.asyncIterator] = function () {
  112777. return this;
  112778. };
  112779. // TODO: Remove these static methods from the class.
  112780. Repeater.race = race;
  112781. Repeater.merge = merge;
  112782. Repeater.zip = zip;
  112783. Repeater.latest = latest;
  112784. return Repeater;
  112785. }();
  112786. /*** COMBINATOR FUNCTIONS ***/
  112787. // TODO: move these combinators to their own file.
  112788. function getIterators(values, options) {
  112789. var e_3, _a;
  112790. var iters = [];
  112791. var _loop_1 = function _loop_1(value) {
  112792. if (value != null && typeof value[Symbol.asyncIterator] === "function") {
  112793. iters.push(value[Symbol.asyncIterator]());
  112794. } else if (value != null && typeof value[Symbol.iterator] === "function") {
  112795. iters.push(value[Symbol.iterator]());
  112796. } else {
  112797. iters.push(function valueToAsyncIterator() {
  112798. return __asyncGenerator(this, arguments, function valueToAsyncIterator_1() {
  112799. return __generator(this, function (_a) {
  112800. switch (_a.label) {
  112801. case 0:
  112802. if (!options.yieldValues) return [3 /*break*/, 3];
  112803. return [4 /*yield*/, __await(value)];
  112804. case 1:
  112805. return [4 /*yield*/, _a.sent()];
  112806. case 2:
  112807. _a.sent();
  112808. _a.label = 3;
  112809. case 3:
  112810. if (!options.returnValues) return [3 /*break*/, 5];
  112811. return [4 /*yield*/, __await(value)];
  112812. case 4:
  112813. return [2 /*return*/, _a.sent()];
  112814. case 5:
  112815. return [2 /*return*/];
  112816. }
  112817. });
  112818. });
  112819. }());
  112820. }
  112821. };
  112822. try {
  112823. for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
  112824. var value = values_1_1.value;
  112825. _loop_1(value);
  112826. }
  112827. } catch (e_3_1) {
  112828. e_3 = {
  112829. error: e_3_1
  112830. };
  112831. } finally {
  112832. try {
  112833. if (values_1_1 && !values_1_1.done && (_a = values_1["return"])) _a.call(values_1);
  112834. } finally {
  112835. if (e_3) throw e_3.error;
  112836. }
  112837. }
  112838. return iters;
  112839. }
  112840. // 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.
  112841. function race(contenders) {
  112842. var _this = this;
  112843. var iters = getIterators(contenders, {
  112844. returnValues: true
  112845. });
  112846. return new Repeater(function (push, stop) {
  112847. return __awaiter(_this, void 0, void 0, function () {
  112848. var advance, stopped, finalIteration, iteration, i_1, _loop_2;
  112849. return __generator(this, function (_a) {
  112850. switch (_a.label) {
  112851. case 0:
  112852. if (!iters.length) {
  112853. stop();
  112854. return [2 /*return*/];
  112855. }
  112856. stopped = false;
  112857. stop.then(function () {
  112858. advance();
  112859. stopped = true;
  112860. });
  112861. _a.label = 1;
  112862. case 1:
  112863. _a.trys.push([1,, 5, 7]);
  112864. iteration = void 0;
  112865. i_1 = 0;
  112866. _loop_2 = function _loop_2() {
  112867. var j, iters_1, iters_1_1, iter;
  112868. var e_4, _a;
  112869. return __generator(this, function (_b) {
  112870. switch (_b.label) {
  112871. case 0:
  112872. j = i_1;
  112873. try {
  112874. 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()) {
  112875. iter = iters_1_1.value;
  112876. Promise.resolve(iter.next()).then(function (iteration) {
  112877. if (iteration.done) {
  112878. stop();
  112879. if (finalIteration === undefined) {
  112880. finalIteration = iteration;
  112881. }
  112882. } else if (i_1 === j) {
  112883. // This iterator has won, advance i and resolve the promise.
  112884. i_1++;
  112885. advance(iteration);
  112886. }
  112887. }, function (err) {
  112888. return stop(err);
  112889. });
  112890. }
  112891. } catch (e_4_1) {
  112892. e_4 = {
  112893. error: e_4_1
  112894. };
  112895. } finally {
  112896. try {
  112897. if (iters_1_1 && !iters_1_1.done && (_a = iters_1["return"])) _a.call(iters_1);
  112898. } finally {
  112899. if (e_4) throw e_4.error;
  112900. }
  112901. }
  112902. return [4 /*yield*/, new Promise(function (resolve) {
  112903. return advance = resolve;
  112904. })];
  112905. case 1:
  112906. iteration = _b.sent();
  112907. if (!(iteration !== undefined)) return [3 /*break*/, 3];
  112908. return [4 /*yield*/, push(iteration.value)];
  112909. case 2:
  112910. _b.sent();
  112911. _b.label = 3;
  112912. case 3:
  112913. return [2 /*return*/];
  112914. }
  112915. });
  112916. };
  112917. _a.label = 2;
  112918. case 2:
  112919. if (!!stopped) return [3 /*break*/, 4];
  112920. return [5 /*yield**/, _loop_2()];
  112921. case 3:
  112922. _a.sent();
  112923. return [3 /*break*/, 2];
  112924. case 4:
  112925. return [2 /*return*/, finalIteration && finalIteration.value];
  112926. case 5:
  112927. stop();
  112928. return [4 /*yield*/, Promise.race(iters.map(function (iter) {
  112929. return iter["return"] && iter["return"]();
  112930. }))];
  112931. case 6:
  112932. _a.sent();
  112933. return [7 /*endfinally*/];
  112934. case 7:
  112935. return [2 /*return*/];
  112936. }
  112937. });
  112938. });
  112939. });
  112940. }
  112941. function merge(contenders) {
  112942. var _this = this;
  112943. var iters = getIterators(contenders, {
  112944. yieldValues: true
  112945. });
  112946. return new Repeater(function (push, stop) {
  112947. return __awaiter(_this, void 0, void 0, function () {
  112948. var advances, stopped, finalIteration;
  112949. var _this = this;
  112950. return __generator(this, function (_a) {
  112951. switch (_a.label) {
  112952. case 0:
  112953. if (!iters.length) {
  112954. stop();
  112955. return [2 /*return*/];
  112956. }
  112957. advances = [];
  112958. stopped = false;
  112959. stop.then(function () {
  112960. var e_5, _a;
  112961. stopped = true;
  112962. try {
  112963. for (var advances_1 = __values(advances), advances_1_1 = advances_1.next(); !advances_1_1.done; advances_1_1 = advances_1.next()) {
  112964. var advance = advances_1_1.value;
  112965. advance();
  112966. }
  112967. } catch (e_5_1) {
  112968. e_5 = {
  112969. error: e_5_1
  112970. };
  112971. } finally {
  112972. try {
  112973. if (advances_1_1 && !advances_1_1.done && (_a = advances_1["return"])) _a.call(advances_1);
  112974. } finally {
  112975. if (e_5) throw e_5.error;
  112976. }
  112977. }
  112978. });
  112979. _a.label = 1;
  112980. case 1:
  112981. _a.trys.push([1,, 3, 4]);
  112982. return [4 /*yield*/, Promise.all(iters.map(function (iter, i) {
  112983. return __awaiter(_this, void 0, void 0, function () {
  112984. var iteration, _a;
  112985. return __generator(this, function (_b) {
  112986. switch (_b.label) {
  112987. case 0:
  112988. _b.trys.push([0,, 6, 9]);
  112989. _b.label = 1;
  112990. case 1:
  112991. if (!!stopped) return [3 /*break*/, 5];
  112992. Promise.resolve(iter.next()).then(function (iteration) {
  112993. return advances[i](iteration);
  112994. }, function (err) {
  112995. return stop(err);
  112996. });
  112997. return [4 /*yield*/, new Promise(function (resolve) {
  112998. advances[i] = resolve;
  112999. })];
  113000. case 2:
  113001. iteration = _b.sent();
  113002. if (!(iteration !== undefined)) return [3 /*break*/, 4];
  113003. if (iteration.done) {
  113004. finalIteration = iteration;
  113005. return [2 /*return*/];
  113006. }
  113007. return [4 /*yield*/, push(iteration.value)];
  113008. case 3:
  113009. _b.sent();
  113010. _b.label = 4;
  113011. case 4:
  113012. return [3 /*break*/, 1];
  113013. case 5:
  113014. return [3 /*break*/, 9];
  113015. case 6:
  113016. _a = iter["return"];
  113017. if (!_a) return [3 /*break*/, 8];
  113018. return [4 /*yield*/, iter["return"]()];
  113019. case 7:
  113020. _a = _b.sent();
  113021. _b.label = 8;
  113022. case 8:
  113023. return [7 /*endfinally*/];
  113024. case 9:
  113025. return [2 /*return*/];
  113026. }
  113027. });
  113028. });
  113029. }))];
  113030. case 2:
  113031. _a.sent();
  113032. return [2 /*return*/, finalIteration && finalIteration.value];
  113033. case 3:
  113034. stop();
  113035. return [7 /*endfinally*/];
  113036. case 4:
  113037. return [2 /*return*/];
  113038. }
  113039. });
  113040. });
  113041. });
  113042. }
  113043. function zip(contenders) {
  113044. var _this = this;
  113045. var iters = getIterators(contenders, {
  113046. returnValues: true
  113047. });
  113048. return new Repeater(function (push, stop) {
  113049. return __awaiter(_this, void 0, void 0, function () {
  113050. var advance, stopped, iterations, values;
  113051. return __generator(this, function (_a) {
  113052. switch (_a.label) {
  113053. case 0:
  113054. if (!iters.length) {
  113055. stop();
  113056. return [2 /*return*/, []];
  113057. }
  113058. stopped = false;
  113059. stop.then(function () {
  113060. advance();
  113061. stopped = true;
  113062. });
  113063. _a.label = 1;
  113064. case 1:
  113065. _a.trys.push([1,, 6, 8]);
  113066. _a.label = 2;
  113067. case 2:
  113068. if (!!stopped) return [3 /*break*/, 5];
  113069. Promise.all(iters.map(function (iter) {
  113070. return iter.next();
  113071. })).then(function (iterations) {
  113072. return advance(iterations);
  113073. }, function (err) {
  113074. return stop(err);
  113075. });
  113076. return [4 /*yield*/, new Promise(function (resolve) {
  113077. return advance = resolve;
  113078. })];
  113079. case 3:
  113080. iterations = _a.sent();
  113081. if (iterations === undefined) {
  113082. return [2 /*return*/];
  113083. }
  113084. values = iterations.map(function (iteration) {
  113085. return iteration.value;
  113086. });
  113087. if (iterations.some(function (iteration) {
  113088. return iteration.done;
  113089. })) {
  113090. return [2 /*return*/, values];
  113091. }
  113092. return [4 /*yield*/, push(values)];
  113093. case 4:
  113094. _a.sent();
  113095. return [3 /*break*/, 2];
  113096. case 5:
  113097. return [3 /*break*/, 8];
  113098. case 6:
  113099. stop();
  113100. return [4 /*yield*/, Promise.all(iters.map(function (iter) {
  113101. return iter["return"] && iter["return"]();
  113102. }))];
  113103. case 7:
  113104. _a.sent();
  113105. return [7 /*endfinally*/];
  113106. case 8:
  113107. return [2 /*return*/];
  113108. }
  113109. });
  113110. });
  113111. });
  113112. }
  113113. function latest(contenders) {
  113114. var _this = this;
  113115. var iters = getIterators(contenders, {
  113116. yieldValues: true,
  113117. returnValues: true
  113118. });
  113119. return new Repeater(function (push, stop) {
  113120. return __awaiter(_this, void 0, void 0, function () {
  113121. var advance, advances, stopped, iterations_1, values_2;
  113122. var _this = this;
  113123. return __generator(this, function (_a) {
  113124. switch (_a.label) {
  113125. case 0:
  113126. if (!iters.length) {
  113127. stop();
  113128. return [2 /*return*/, []];
  113129. }
  113130. advances = [];
  113131. stopped = false;
  113132. stop.then(function () {
  113133. var e_6, _a;
  113134. advance();
  113135. try {
  113136. for (var advances_2 = __values(advances), advances_2_1 = advances_2.next(); !advances_2_1.done; advances_2_1 = advances_2.next()) {
  113137. var advance1 = advances_2_1.value;
  113138. advance1();
  113139. }
  113140. } catch (e_6_1) {
  113141. e_6 = {
  113142. error: e_6_1
  113143. };
  113144. } finally {
  113145. try {
  113146. if (advances_2_1 && !advances_2_1.done && (_a = advances_2["return"])) _a.call(advances_2);
  113147. } finally {
  113148. if (e_6) throw e_6.error;
  113149. }
  113150. }
  113151. stopped = true;
  113152. });
  113153. _a.label = 1;
  113154. case 1:
  113155. _a.trys.push([1,, 5, 7]);
  113156. Promise.all(iters.map(function (iter) {
  113157. return iter.next();
  113158. })).then(function (iterations) {
  113159. return advance(iterations);
  113160. }, function (err) {
  113161. return stop(err);
  113162. });
  113163. return [4 /*yield*/, new Promise(function (resolve) {
  113164. return advance = resolve;
  113165. })];
  113166. case 2:
  113167. iterations_1 = _a.sent();
  113168. if (iterations_1 === undefined) {
  113169. return [2 /*return*/];
  113170. }
  113171. values_2 = iterations_1.map(function (iteration) {
  113172. return iteration.value;
  113173. });
  113174. if (iterations_1.every(function (iteration) {
  113175. return iteration.done;
  113176. })) {
  113177. return [2 /*return*/, values_2];
  113178. }
  113179. // We continuously yield and mutate the same values array so we shallow copy it each time it is pushed.
  113180. return [4 /*yield*/, push(values_2.slice())];
  113181. case 3:
  113182. // We continuously yield and mutate the same values array so we shallow copy it each time it is pushed.
  113183. _a.sent();
  113184. return [4 /*yield*/, Promise.all(iters.map(function (iter, i) {
  113185. return __awaiter(_this, void 0, void 0, function () {
  113186. var iteration;
  113187. return __generator(this, function (_a) {
  113188. switch (_a.label) {
  113189. case 0:
  113190. if (iterations_1[i].done) {
  113191. return [2 /*return*/, iterations_1[i].value];
  113192. }
  113193. _a.label = 1;
  113194. case 1:
  113195. if (!!stopped) return [3 /*break*/, 4];
  113196. Promise.resolve(iter.next()).then(function (iteration) {
  113197. return advances[i](iteration);
  113198. }, function (err) {
  113199. return stop(err);
  113200. });
  113201. return [4 /*yield*/, new Promise(function (resolve) {
  113202. return advances[i] = resolve;
  113203. })];
  113204. case 2:
  113205. iteration = _a.sent();
  113206. if (iteration === undefined) {
  113207. return [2 /*return*/, iterations_1[i].value];
  113208. } else if (iteration.done) {
  113209. return [2 /*return*/, iteration.value];
  113210. }
  113211. values_2[i] = iteration.value;
  113212. return [4 /*yield*/, push(values_2.slice())];
  113213. case 3:
  113214. _a.sent();
  113215. return [3 /*break*/, 1];
  113216. case 4:
  113217. return [2 /*return*/];
  113218. }
  113219. });
  113220. });
  113221. }))];
  113222. case 4:
  113223. return [2 /*return*/, _a.sent()];
  113224. case 5:
  113225. stop();
  113226. return [4 /*yield*/, Promise.all(iters.map(function (iter) {
  113227. return iter["return"] && iter["return"]();
  113228. }))];
  113229. case 6:
  113230. _a.sent();
  113231. return [7 /*endfinally*/];
  113232. case 7:
  113233. return [2 /*return*/];
  113234. }
  113235. });
  113236. });
  113237. });
  113238. }
  113239. __webpack_unused_export__ = DroppingBuffer;
  113240. __webpack_unused_export__ = FixedBuffer;
  113241. __webpack_unused_export__ = MAX_QUEUE_LENGTH;
  113242. exports.ZN = Repeater;
  113243. __webpack_unused_export__ = RepeaterOverflowError;
  113244. __webpack_unused_export__ = SlidingBuffer;
  113245. /***/ })
  113246. /******/ });
  113247. /************************************************************************/
  113248. /******/ // The module cache
  113249. /******/ var __webpack_module_cache__ = {};
  113250. /******/
  113251. /******/ // The require function
  113252. /******/ function __webpack_require__(moduleId) {
  113253. /******/ // Check if module is in cache
  113254. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  113255. /******/ if (cachedModule !== undefined) {
  113256. /******/ return cachedModule.exports;
  113257. /******/ }
  113258. /******/ // Create a new module (and put it into the cache)
  113259. /******/ var module = __webpack_module_cache__[moduleId] = {
  113260. /******/ id: moduleId,
  113261. /******/ loaded: false,
  113262. /******/ exports: {}
  113263. /******/ };
  113264. /******/
  113265. /******/ // Execute the module function
  113266. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  113267. /******/
  113268. /******/ // Flag the module as loaded
  113269. /******/ module.loaded = true;
  113270. /******/
  113271. /******/ // Return the exports of the module
  113272. /******/ return module.exports;
  113273. /******/ }
  113274. /******/
  113275. /************************************************************************/
  113276. /******/ /* webpack/runtime/compat get default export */
  113277. /******/ !function() {
  113278. /******/ // getDefaultExport function for compatibility with non-harmony modules
  113279. /******/ __webpack_require__.n = function(module) {
  113280. /******/ var getter = module && module.__esModule ?
  113281. /******/ function() { return module['default']; } :
  113282. /******/ function() { return module; };
  113283. /******/ __webpack_require__.d(getter, { a: getter });
  113284. /******/ return getter;
  113285. /******/ };
  113286. /******/ }();
  113287. /******/
  113288. /******/ /* webpack/runtime/define property getters */
  113289. /******/ !function() {
  113290. /******/ // define getter functions for harmony exports
  113291. /******/ __webpack_require__.d = function(exports, definition) {
  113292. /******/ for(var key in definition) {
  113293. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  113294. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  113295. /******/ }
  113296. /******/ }
  113297. /******/ };
  113298. /******/ }();
  113299. /******/
  113300. /******/ /* webpack/runtime/global */
  113301. /******/ !function() {
  113302. /******/ __webpack_require__.g = (function() {
  113303. /******/ if (typeof globalThis === 'object') return globalThis;
  113304. /******/ try {
  113305. /******/ return this || new Function('return this')();
  113306. /******/ } catch (e) {
  113307. /******/ if (typeof window === 'object') return window;
  113308. /******/ }
  113309. /******/ })();
  113310. /******/ }();
  113311. /******/
  113312. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  113313. /******/ !function() {
  113314. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  113315. /******/ }();
  113316. /******/
  113317. /******/ /* webpack/runtime/node module decorator */
  113318. /******/ !function() {
  113319. /******/ __webpack_require__.nmd = function(module) {
  113320. /******/ module.paths = [];
  113321. /******/ if (!module.children) module.children = [];
  113322. /******/ return module;
  113323. /******/ };
  113324. /******/ }();
  113325. /******/
  113326. /************************************************************************/
  113327. /******/
  113328. /******/ // startup
  113329. /******/ // Load entry module and return exports
  113330. /******/ // This entry module is referenced by other modules so it can't be inlined
  113331. /******/ __webpack_require__(3123);
  113332. /******/ __webpack_require__(5023);
  113333. /******/ __webpack_require__(5494);
  113334. /******/ var __webpack_exports__ = __webpack_require__(8975);
  113335. /******/
  113336. /******/ })()
  113337. ;